Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 782


Ignore:
Timestamp:
Jan 1, 2008, 2:00:08 PM (16 years ago)
Author:
rgrieder
Message:
  • removed warnings on msvc compiler
  • on msvc: loader is now built with orxonox, not as a separate library
Location:
code/branches/FICN
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/audio/_AudioObject.cc

    r560 r782  
    11/*
    2  *   ORXONOX - the hottest 3D action shooter ever to exist
    3  *
    4  *
    5  *   License notice:
    6  *
    7  *   This program is free software; you can redistribute it and/or
    8  *   modify it under the terms of the GNU General Public License
    9  *   as published by the Free Software Foundation; either version 2
    10  *   of the License, or (at your option) any later version.
    11  *
    12  *   This program is distributed in the hope that it will be useful,
    13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    15  *   GNU General Public License for more details.
    16  *
    17  *   You should have received a copy of the GNU General Public License
    18  *   along with this program; if not, write to the Free Software
    19  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    20  *
    21  *   Author:
    22  *      ...
    23  *   Co-authors:
    24  *      ...
    25  *
    26  */
     2*   ORXONOX - the hottest 3D action shooter ever to exist
     3*
     4*
     5*   License notice:
     6*
     7*   This program is free software; you can redistribute it and/or
     8*   modify it under the terms of the GNU General Public License
     9*   as published by the Free Software Foundation; either version 2
     10*   of the License, or (at your option) any later version.
     11*
     12*   This program is distributed in the hope that it will be useful,
     13*   but WITHOUT ANY WARRANTY; without even the implied warranty of
     14*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15*   GNU General Public License for more details.
     16*
     17*   You should have received a copy of the GNU General Public License
     18*   along with this program; if not, write to the Free Software
     19*   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     20*
     21*   Author:
     22*      ...
     23*   Co-authors:
     24*      ...
     25*
     26*/
    2727
    2828
    2929#include <iostream>
    3030#include <string>
     31
     32#include "core/Debug.h"
    3133#include "AudioObject.h"
    32 #include "../orxonox/core/Debug.h"
    3334
    3435namespace audio
    3536{
    36         AudioObject::AudioObject(std::string audioFile)
    37         {
    38                 audioFile_ = audioFile;
    39                 SourcePos[0]=0;
    40                 SourcePos[1]=0;
    41                 SourcePos[2]=0;
     37  AudioObject::AudioObject(std::string audioFile)
     38  {
     39    audioFile_ = audioFile;
     40    SourcePos[0]=0;
     41    SourcePos[1]=0;
     42    SourcePos[2]=0;
    4243
    43                 SourceVel[0]=0;
    44                 SourceVel[1]=0;
    45                 SourceVel[2]=0;
     44    SourceVel[0]=0;
     45    SourceVel[1]=0;
     46    SourceVel[2]=0;
    4647
    47                 ListenerPos[0]=0;
    48                 ListenerPos[1]=0;
    49                 ListenerPos[2]=0;
     48    ListenerPos[0]=0;
     49    ListenerPos[1]=0;
     50    ListenerPos[2]=0;
    5051
    51                 ListenerVel[0]=0;
    52                 ListenerVel[1]=0;
    53                 ListenerVel[2]=0;
     52    ListenerVel[0]=0;
     53    ListenerVel[1]=0;
     54    ListenerVel[2]=0;
    5455
    55                 ListenerOri[0]=0;
    56                 ListenerOri[1]=0;
    57                 ListenerOri[2]=-1;
    58                 ListenerOri[3]=0;
    59                 ListenerOri[4]=1;
    60                 ListenerOri[5]=0;
     56    ListenerOri[0]=0;
     57    ListenerOri[1]=0;
     58    ListenerOri[2]=-1;
     59    ListenerOri[3]=0;
     60    ListenerOri[4]=1;
     61    ListenerOri[5]=0;
    6162
    6263
    63                 // Initialize OpenAL and clear the error bit.
     64    // Initialize OpenAL and clear the error bit.
    6465
    65                 alutInit(NULL, 0);
    66                 alGetError();
     66    alutInit(NULL, 0);
     67    alGetError();
    6768
    68                 // Load the wav data.
     69    // Load the wav data.
    6970
    70                 if(LoadALData() == AL_FALSE)
    71                 {
    72                     printf("Error loading sound data.");
     71    if(LoadALData() == AL_FALSE)
     72    {
     73      printf("Error loading sound data.");
    7374
    74                 }
     75    }
    7576
    76                 SetListenerValues();
    77                 COUT(3) << "Info: Play sone ambient background sound";
    78         }
     77    SetListenerValues();
     78    COUT(3) << "Info: Play sone ambient background sound";
     79  }
    7980
    80         AudioObject::~AudioObject()
    81         {
    82                 KillALData();
    83         }
     81  AudioObject::~AudioObject()
     82  {
     83    KillALData();
     84  }
    8485
    85         ALboolean AudioObject::LoadALData()
    86         {
    87                 ALenum format;
    88                 ALsizei size;
    89                 ALvoid* data;
    90                 ALsizei freq;
    91                 ALboolean loop;
     86  ALboolean AudioObject::LoadALData()
     87  {
     88    ALenum format;
     89    ALsizei size;
     90    ALvoid* data;
     91    ALsizei freq;
     92    ALboolean loop;
    9293
    9394
    94                 alGenBuffers(1, &Buffer);
     95    alGenBuffers(1, &Buffer);
    9596
    96                 if(alGetError() != AL_NO_ERROR)
    97                         return AL_FALSE;
     97    if(alGetError() != AL_NO_ERROR)
     98      return AL_FALSE;
    9899
    99                 alutLoadWAVFile((ALbyte*)audioFile_.c_str(), &format, &data, &size, &freq, &loop);
    100                 alBufferData(Buffer, format, data, size, freq);
    101                 alutUnloadWAV(format, data, size, freq);
     100    alutLoadWAVFile((ALbyte*)audioFile_.c_str(), &format, &data, &size, &freq, &loop);
     101    alBufferData(Buffer, format, data, size, freq);
     102    alutUnloadWAV(format, data, size, freq);
    102103
    103                 alGenSources(1, &Source);
     104    alGenSources(1, &Source);
    104105
    105                 if(alGetError() != AL_NO_ERROR)
    106                         return AL_FALSE;
     106    if(alGetError() != AL_NO_ERROR)
     107      return AL_FALSE;
    107108
    108                 alSourcei (Source, AL_BUFFER,   Buffer   );
    109                 alSourcef (Source, AL_PITCH,    1.0      );
    110                 alSourcef (Source, AL_GAIN,     1.0      );
    111                 alSourcefv(Source, AL_POSITION, SourcePos);
    112                 alSourcefv(Source, AL_VELOCITY, SourceVel);
    113                 alSourcei (Source, AL_LOOPING,  loop     );
     109    alSourcei (Source, AL_BUFFER,   Buffer   );
     110    alSourcef (Source, AL_PITCH,    1.0      );
     111    alSourcef (Source, AL_GAIN,     1.0      );
     112    alSourcefv(Source, AL_POSITION, SourcePos);
     113    alSourcefv(Source, AL_VELOCITY, SourceVel);
     114    alSourcei (Source, AL_LOOPING,  loop     );
    114115
    115                 if(alGetError() == AL_NO_ERROR)
    116                         return AL_TRUE;
     116    if(alGetError() == AL_NO_ERROR)
     117      return AL_TRUE;
    117118
    118119
    119                 return AL_FALSE;
    120         }
     120    return AL_FALSE;
     121  }
    121122
    122         void AudioObject::SetListenerValues()
    123         {
    124                 alListenerfv(AL_POSITION,    ListenerPos);
    125                 alListenerfv(AL_VELOCITY,    ListenerVel);
    126                 alListenerfv(AL_ORIENTATION, ListenerOri);
    127         }
     123  void AudioObject::SetListenerValues()
     124  {
     125    alListenerfv(AL_POSITION,    ListenerPos);
     126    alListenerfv(AL_VELOCITY,    ListenerVel);
     127    alListenerfv(AL_ORIENTATION, ListenerOri);
     128  }
    128129
    129         void AudioObject::KillALData()
    130         {
    131                 alDeleteBuffers(1, &Buffer);
    132                 alDeleteSources(1, &Source);
    133                 alutExit();
    134         }
     130  void AudioObject::KillALData()
     131  {
     132    alDeleteBuffers(1, &Buffer);
     133    alDeleteSources(1, &Source);
     134    alutExit();
     135  }
    135136
    136         void AudioObject::play()
    137         {
    138                 alSourcePlay(Source);
     137  void AudioObject::play()
     138  {
     139    alSourcePlay(Source);
     140  }
    139141
    140         }
    141142}
    142 
  • code/branches/FICN/src/loader/LoaderPrereqs.h

    r682 r782  
    3636#include "orxonox/OrxonoxPlatform.h"
    3737
     38// Compile loader directly in orxonox executable, if on Visual Studio platform
     39#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC && defined(ORXONOX_SHARED_BUILD)
     40#  define LOADER_SHARED_BUILD
     41#endif
     42
    3843//-----------------------------------------------------------------------
    3944// Shared library settings
  • code/branches/FICN/src/network/GameStateClient.cc

    r777 r782  
    136136    }
    137137    // should be finished now
    138     GameState r = {b.id, dest_length, dp};
     138    // FIXME: is it true or false now? (struct has changed, producing warnings)
     139    GameState r = {b.id, dest_length, true, dp};
    139140    return r;
    140141  }
  • code/branches/FICN/src/network/GameStateManager.cc

    r777 r782  
    182182    }
    183183    // should be finished now
    184     GameState r = {b->id, dest_length, dp};
     184    // FIXME: is it true or false now? (struct has changed, producing warnings)
     185    GameState r = {b->id, dest_length, true, dp};
    185186    return r;
    186187  }
  • code/branches/FICN/src/orxonox/Orxonox.cc

    r768 r782  
    282282      COUT(3) << "Info: network framelistener added" << std::endl;
    283283    }
    284     catch(std::exception &e)
     284    catch(...)
    285285    {
    286286      COUT(1) << "Error: There was a problem initialising the server :(" << std::endl;
  • code/branches/FICN/src/orxonox/OrxonoxPlatform.h

    r768 r782  
    211211
    212212// disable: "conversion from 'double' to 'float', possible loss of data
    213 #   pragma warning (disable : 4244)
     213//#   pragma warning (disable : 4244)
    214214
    215215// disable: "conversion from 'size_t' to 'unsigned int', possible loss of data
    216 #   pragma warning (disable : 4267)
     216//#   pragma warning (disable : 4267)
    217217
    218218// disable: "truncation from 'double' to 'float'
     
    221221// disable: "<type> needs to have dll-interface to be used by clients'
    222222// Happens on STL member variables which are not public therefore is ok
    223 #   pragma warning (disable : 4251)
     223//#   pragma warning (disable : 4251)
    224224
    225225// disable: "non dll-interface class used as base for dll-interface class"
  • code/branches/FICN/src/orxonox/core/Language.cc

    r729 r782  
    245245            if (lineString.compare("") != 0)
    246246            {
    247                 unsigned int pos = (unsigned int)lineString.find('=');
     247                unsigned int pos = lineString.find('=');
    248248
    249249                // Check if the length is at least 3 and if there's an entry before and behind the =
     
    288288            if (lineString.compare("") != 0)
    289289            {
    290                 unsigned int pos = (unsigned int)lineString.find('=');
     290                unsigned int pos = lineString.find('=');
    291291
    292292                // Check if the length is at least 3 and if there's an entry before and behind the =
  • code/branches/FICN/src/orxonox/objects/Model.cc

    r742 r782  
    6969
    7070    void Model::registerAllVariables(){
    71       registerVar(&meshSrc_, (int)meshSrc_.length() + 1, network::STRING);
     71      registerVar(&meshSrc_, meshSrc_.length() + 1, network::STRING);
    7272    }
    7373}
  • code/branches/FICN/visual_studio/FICN.sln

    r770 r782  
    2626        EndProjectSection
    2727        ProjectSection(ProjectDependencies) = postProject
     28                {2240ECD7-2F48-4431-8E1B-25466A384CCC} = {2240ECD7-2F48-4431-8E1B-25466A384CCC}
     29                {271715F3-5B90-4110-A552-70C788084A86} = {271715F3-5B90-4110-A552-70C788084A86}
     30                {4733BD1A-E04C-458D-8BFB-5010250EA497} = {4733BD1A-E04C-458D-8BFB-5010250EA497}
    2831                {35575B59-E1AE-40E8-89C4-2862B5B09B68} = {35575B59-E1AE-40E8-89C4-2862B5B09B68}
    29                 {E283910F-F911-40FB-A09D-D025CA821912} = {E283910F-F911-40FB-A09D-D025CA821912}
    30                 {4733BD1A-E04C-458D-8BFB-5010250EA497} = {4733BD1A-E04C-458D-8BFB-5010250EA497}
    31                 {271715F3-5B90-4110-A552-70C788084A86} = {271715F3-5B90-4110-A552-70C788084A86}
    32                 {2240ECD7-2F48-4431-8E1B-25466A384CCC} = {2240ECD7-2F48-4431-8E1B-25466A384CCC}
    3332        EndProjectSection
    3433EndProject
     
    4847        EndProjectSection
    4948        ProjectSection(ProjectDependencies) = postProject
     49                {4733BD1A-E04C-458D-8BFB-5010250EA497} = {4733BD1A-E04C-458D-8BFB-5010250EA497}
     50                {2240ECD7-2F48-4431-8E1B-25466A384CCC} = {2240ECD7-2F48-4431-8E1B-25466A384CCC}
    5051                {271715F3-5B90-4110-A552-70C788084A86} = {271715F3-5B90-4110-A552-70C788084A86}
    51                 {2240ECD7-2F48-4431-8E1B-25466A384CCC} = {2240ECD7-2F48-4431-8E1B-25466A384CCC}
    52                 {4733BD1A-E04C-458D-8BFB-5010250EA497} = {4733BD1A-E04C-458D-8BFB-5010250EA497}
    5352        EndProjectSection
    5453EndProject
     
    6564        EndGlobalSection
    6665        GlobalSection(ProjectConfigurationPlatforms) = postSolution
    67                 {35575B59-E1AE-40E8-89C4-2862B5B09B68}.Debug|Win32.ActiveCfg = Debug|Win32
    68                 {35575B59-E1AE-40E8-89C4-2862B5B09B68}.Debug|Win32.Build.0 = Debug|Win32
     66                {35575B59-E1AE-40E8-89C4-2862B5B09B68}.Debug|Win32.ActiveCfg = Release|Win32
     67                {35575B59-E1AE-40E8-89C4-2862B5B09B68}.Debug|Win32.Build.0 = Release|Win32
    6968                {35575B59-E1AE-40E8-89C4-2862B5B09B68}.Release|Win32.ActiveCfg = Release|Win32
    7069                {35575B59-E1AE-40E8-89C4-2862B5B09B68}.Release|Win32.Build.0 = Release|Win32
    71                 {271715F3-5B90-4110-A552-70C788084A86}.Debug|Win32.ActiveCfg = Debug|Win32
    72                 {271715F3-5B90-4110-A552-70C788084A86}.Debug|Win32.Build.0 = Debug|Win32
     70                {271715F3-5B90-4110-A552-70C788084A86}.Debug|Win32.ActiveCfg = Release|Win32
     71                {271715F3-5B90-4110-A552-70C788084A86}.Debug|Win32.Build.0 = Release|Win32
    7372                {271715F3-5B90-4110-A552-70C788084A86}.Release|Win32.ActiveCfg = Release|Win32
    7473                {271715F3-5B90-4110-A552-70C788084A86}.Release|Win32.Build.0 = Release|Win32
    75                 {0B6C5CFD-F91B-432A-80A3-2610F61E060B}.Debug|Win32.ActiveCfg = Debug|Win32
    76                 {0B6C5CFD-F91B-432A-80A3-2610F61E060B}.Debug|Win32.Build.0 = Debug|Win32
     74                {0B6C5CFD-F91B-432A-80A3-2610F61E060B}.Debug|Win32.ActiveCfg = Release|Win32
     75                {0B6C5CFD-F91B-432A-80A3-2610F61E060B}.Debug|Win32.Build.0 = Release|Win32
    7776                {0B6C5CFD-F91B-432A-80A3-2610F61E060B}.Release|Win32.ActiveCfg = Release|Win32
    7877                {0B6C5CFD-F91B-432A-80A3-2610F61E060B}.Release|Win32.Build.0 = Release|Win32
    79                 {4733BD1A-E04C-458D-8BFB-5010250EA497}.Debug|Win32.ActiveCfg = Debug|Win32
    80                 {4733BD1A-E04C-458D-8BFB-5010250EA497}.Debug|Win32.Build.0 = Debug|Win32
     78                {4733BD1A-E04C-458D-8BFB-5010250EA497}.Debug|Win32.ActiveCfg = Release|Win32
     79                {4733BD1A-E04C-458D-8BFB-5010250EA497}.Debug|Win32.Build.0 = Release|Win32
    8180                {4733BD1A-E04C-458D-8BFB-5010250EA497}.Release|Win32.ActiveCfg = Release|Win32
    8281                {4733BD1A-E04C-458D-8BFB-5010250EA497}.Release|Win32.Build.0 = Release|Win32
    83                 {E283910F-F911-40FB-A09D-D025CA821912}.Debug|Win32.ActiveCfg = Debug|Win32
    84                 {E283910F-F911-40FB-A09D-D025CA821912}.Debug|Win32.Build.0 = Debug|Win32
     82                {E283910F-F911-40FB-A09D-D025CA821912}.Debug|Win32.ActiveCfg = Release|Win32
    8583                {E283910F-F911-40FB-A09D-D025CA821912}.Release|Win32.ActiveCfg = Release|Win32
    86                 {E283910F-F911-40FB-A09D-D025CA821912}.Release|Win32.Build.0 = Release|Win32
    87                 {2240ECD7-2F48-4431-8E1B-25466A384CCC}.Debug|Win32.ActiveCfg = Debug|Win32
    88                 {2240ECD7-2F48-4431-8E1B-25466A384CCC}.Debug|Win32.Build.0 = Debug|Win32
     84                {2240ECD7-2F48-4431-8E1B-25466A384CCC}.Debug|Win32.ActiveCfg = Release|Win32
     85                {2240ECD7-2F48-4431-8E1B-25466A384CCC}.Debug|Win32.Build.0 = Release|Win32
    8986                {2240ECD7-2F48-4431-8E1B-25466A384CCC}.Release|Win32.ActiveCfg = Release|Win32
    9087                {2240ECD7-2F48-4431-8E1B-25466A384CCC}.Release|Win32.Build.0 = Release|Win32
  • code/branches/FICN/visual_studio/base_properties.vsprops

    r776 r782  
    1414                Detect64BitPortabilityProblems="true"
    1515                DebugInformationFormat="3"
     16                DisableSpecificWarnings="4267; 4244; 4251"
    1617        />
    1718        <Tool
  • code/branches/FICN/visual_studio/benixonox.vcproj

    r777 r782  
    4040                                Name="VCCLCompilerTool"
    4141                                AdditionalIncludeDirectories=""
    42                                 PreprocessorDefinitions="ORXONOX_SHARED_BUILD"
     42                                PreprocessorDefinitions="ORXONOX_SHARED_BUILD; LOADER_STATIC_BUILD"
    4343                                PrecompiledHeaderThrough=""
    4444                        />
     
    109109                                Name="VCCLCompilerTool"
    110110                                AdditionalIncludeDirectories=""
    111                                 PreprocessorDefinitions="LOADER_STATIC_BUILD; ORXONOX_SHARED_BUILD"
     111                                PreprocessorDefinitions="ORXONOX_SHARED_BUILD; LOADER_STATIC_BUILD"
    112112                        />
    113113                        <Tool
     
    317317                                </File>
    318318                        </Filter>
     319                        <Filter
     320                                Name="loader"
     321                                >
     322                                <File
     323                                        RelativePath="..\src\loader\LevelLoader.cc"
     324                                        >
     325                                </File>
     326                        </Filter>
    319327                </Filter>
    320328                <Filter
     
    479487                                </File>
    480488                        </Filter>
     489                        <Filter
     490                                Name="loader"
     491                                >
     492                                <File
     493                                        RelativePath="..\src\loader\LevelLoader.h"
     494                                        >
     495                                </File>
     496                                <File
     497                                        RelativePath="..\src\loader\LoaderPrereqs.h"
     498                                        >
     499                                </File>
     500                        </Filter>
    481501                </Filter>
    482502                <Filter
  • code/branches/FICN/visual_studio/loader.vcproj

    r776 r782  
    5353                        <Tool
    5454                                Name="VCLinkerTool"
    55                                 AdditionalDependencies="OgreMain_d.lib Orxonox_d.lib"
     55                                AdditionalDependencies="OgreMain_d.lib"
    5656                                OutputFile="$(OutDir)\$(ProjectName)_d.dll"
    5757                                AdditionalLibraryDirectories="$(OutDir)"
     
    120120                        <Tool
    121121                                Name="VCLinkerTool"
    122                                 AdditionalDependencies="OgreMain.lib Orxonox.lib"
     122                                AdditionalDependencies="OgreMain.lib"
    123123                                AdditionalLibraryDirectories="$(OutDir)"
    124124                        />
Note: See TracChangeset for help on using the changeset viewer.