Changeset 782 for code/branches
- Timestamp:
- Jan 1, 2008, 2:00:08 PM (17 years ago)
- Location:
- code/branches/FICN
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/audio/_AudioObject.cc
r560 r782 1 1 /* 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 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 */ 27 27 28 28 29 29 #include <iostream> 30 30 #include <string> 31 32 #include "core/Debug.h" 31 33 #include "AudioObject.h" 32 #include "../orxonox/core/Debug.h"33 34 34 35 namespace audio 35 36 { 36 37 38 39 40 41 37 AudioObject::AudioObject(std::string audioFile) 38 { 39 audioFile_ = audioFile; 40 SourcePos[0]=0; 41 SourcePos[1]=0; 42 SourcePos[2]=0; 42 43 43 44 45 44 SourceVel[0]=0; 45 SourceVel[1]=0; 46 SourceVel[2]=0; 46 47 47 48 49 48 ListenerPos[0]=0; 49 ListenerPos[1]=0; 50 ListenerPos[2]=0; 50 51 51 52 53 52 ListenerVel[0]=0; 53 ListenerVel[1]=0; 54 ListenerVel[2]=0; 54 55 55 56 57 58 59 60 56 ListenerOri[0]=0; 57 ListenerOri[1]=0; 58 ListenerOri[2]=-1; 59 ListenerOri[3]=0; 60 ListenerOri[4]=1; 61 ListenerOri[5]=0; 61 62 62 63 63 64 // Initialize OpenAL and clear the error bit. 64 65 65 66 66 alutInit(NULL, 0); 67 alGetError(); 67 68 68 69 // Load the wav data. 69 70 70 71 72 71 if(LoadALData() == AL_FALSE) 72 { 73 printf("Error loading sound data."); 73 74 74 75 } 75 76 76 77 78 77 SetListenerValues(); 78 COUT(3) << "Info: Play sone ambient background sound"; 79 } 79 80 80 81 82 83 81 AudioObject::~AudioObject() 82 { 83 KillALData(); 84 } 84 85 85 86 87 88 89 90 91 86 ALboolean AudioObject::LoadALData() 87 { 88 ALenum format; 89 ALsizei size; 90 ALvoid* data; 91 ALsizei freq; 92 ALboolean loop; 92 93 93 94 94 95 alGenBuffers(1, &Buffer); 95 96 96 97 97 if(alGetError() != AL_NO_ERROR) 98 return AL_FALSE; 98 99 99 100 101 100 alutLoadWAVFile((ALbyte*)audioFile_.c_str(), &format, &data, &size, &freq, &loop); 101 alBufferData(Buffer, format, data, size, freq); 102 alutUnloadWAV(format, data, size, freq); 102 103 103 104 alGenSources(1, &Source); 104 105 105 106 106 if(alGetError() != AL_NO_ERROR) 107 return AL_FALSE; 107 108 108 109 110 111 112 113 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 ); 114 115 115 116 116 if(alGetError() == AL_NO_ERROR) 117 return AL_TRUE; 117 118 118 119 119 120 120 return AL_FALSE; 121 } 121 122 122 123 124 125 126 127 123 void AudioObject::SetListenerValues() 124 { 125 alListenerfv(AL_POSITION, ListenerPos); 126 alListenerfv(AL_VELOCITY, ListenerVel); 127 alListenerfv(AL_ORIENTATION, ListenerOri); 128 } 128 129 129 130 131 132 133 134 130 void AudioObject::KillALData() 131 { 132 alDeleteBuffers(1, &Buffer); 133 alDeleteSources(1, &Source); 134 alutExit(); 135 } 135 136 136 void AudioObject::play() 137 { 138 alSourcePlay(Source); 137 void AudioObject::play() 138 { 139 alSourcePlay(Source); 140 } 139 141 140 }141 142 } 142 -
code/branches/FICN/src/loader/LoaderPrereqs.h
r682 r782 36 36 #include "orxonox/OrxonoxPlatform.h" 37 37 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 38 43 //----------------------------------------------------------------------- 39 44 // Shared library settings -
code/branches/FICN/src/network/GameStateClient.cc
r777 r782 136 136 } 137 137 // 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}; 139 140 return r; 140 141 } -
code/branches/FICN/src/network/GameStateManager.cc
r777 r782 182 182 } 183 183 // 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}; 185 186 return r; 186 187 } -
code/branches/FICN/src/orxonox/Orxonox.cc
r768 r782 282 282 COUT(3) << "Info: network framelistener added" << std::endl; 283 283 } 284 catch( std::exception &e)284 catch(...) 285 285 { 286 286 COUT(1) << "Error: There was a problem initialising the server :(" << std::endl; -
code/branches/FICN/src/orxonox/OrxonoxPlatform.h
r768 r782 211 211 212 212 // disable: "conversion from 'double' to 'float', possible loss of data 213 # pragma warning (disable : 4244)213 //# pragma warning (disable : 4244) 214 214 215 215 // disable: "conversion from 'size_t' to 'unsigned int', possible loss of data 216 # pragma warning (disable : 4267)216 //# pragma warning (disable : 4267) 217 217 218 218 // disable: "truncation from 'double' to 'float' … … 221 221 // disable: "<type> needs to have dll-interface to be used by clients' 222 222 // Happens on STL member variables which are not public therefore is ok 223 # pragma warning (disable : 4251)223 //# pragma warning (disable : 4251) 224 224 225 225 // disable: "non dll-interface class used as base for dll-interface class" -
code/branches/FICN/src/orxonox/core/Language.cc
r729 r782 245 245 if (lineString.compare("") != 0) 246 246 { 247 unsigned int pos = (unsigned int)lineString.find('=');247 unsigned int pos = lineString.find('='); 248 248 249 249 // Check if the length is at least 3 and if there's an entry before and behind the = … … 288 288 if (lineString.compare("") != 0) 289 289 { 290 unsigned int pos = (unsigned int)lineString.find('=');290 unsigned int pos = lineString.find('='); 291 291 292 292 // 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 69 69 70 70 void Model::registerAllVariables(){ 71 registerVar(&meshSrc_, (int)meshSrc_.length() + 1, network::STRING);71 registerVar(&meshSrc_, meshSrc_.length() + 1, network::STRING); 72 72 } 73 73 } -
code/branches/FICN/visual_studio/FICN.sln
r770 r782 26 26 EndProjectSection 27 27 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} 28 31 {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}33 32 EndProjectSection 34 33 EndProject … … 48 47 EndProjectSection 49 48 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} 50 51 {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}53 52 EndProjectSection 54 53 EndProject … … 65 64 EndGlobalSection 66 65 GlobalSection(ProjectConfigurationPlatforms) = postSolution 67 {35575B59-E1AE-40E8-89C4-2862B5B09B68}.Debug|Win32.ActiveCfg = Debug|Win3268 {35575B59-E1AE-40E8-89C4-2862B5B09B68}.Debug|Win32.Build.0 = Debug|Win3266 {35575B59-E1AE-40E8-89C4-2862B5B09B68}.Debug|Win32.ActiveCfg = Release|Win32 67 {35575B59-E1AE-40E8-89C4-2862B5B09B68}.Debug|Win32.Build.0 = Release|Win32 69 68 {35575B59-E1AE-40E8-89C4-2862B5B09B68}.Release|Win32.ActiveCfg = Release|Win32 70 69 {35575B59-E1AE-40E8-89C4-2862B5B09B68}.Release|Win32.Build.0 = Release|Win32 71 {271715F3-5B90-4110-A552-70C788084A86}.Debug|Win32.ActiveCfg = Debug|Win3272 {271715F3-5B90-4110-A552-70C788084A86}.Debug|Win32.Build.0 = Debug|Win3270 {271715F3-5B90-4110-A552-70C788084A86}.Debug|Win32.ActiveCfg = Release|Win32 71 {271715F3-5B90-4110-A552-70C788084A86}.Debug|Win32.Build.0 = Release|Win32 73 72 {271715F3-5B90-4110-A552-70C788084A86}.Release|Win32.ActiveCfg = Release|Win32 74 73 {271715F3-5B90-4110-A552-70C788084A86}.Release|Win32.Build.0 = Release|Win32 75 {0B6C5CFD-F91B-432A-80A3-2610F61E060B}.Debug|Win32.ActiveCfg = Debug|Win3276 {0B6C5CFD-F91B-432A-80A3-2610F61E060B}.Debug|Win32.Build.0 = Debug|Win3274 {0B6C5CFD-F91B-432A-80A3-2610F61E060B}.Debug|Win32.ActiveCfg = Release|Win32 75 {0B6C5CFD-F91B-432A-80A3-2610F61E060B}.Debug|Win32.Build.0 = Release|Win32 77 76 {0B6C5CFD-F91B-432A-80A3-2610F61E060B}.Release|Win32.ActiveCfg = Release|Win32 78 77 {0B6C5CFD-F91B-432A-80A3-2610F61E060B}.Release|Win32.Build.0 = Release|Win32 79 {4733BD1A-E04C-458D-8BFB-5010250EA497}.Debug|Win32.ActiveCfg = Debug|Win3280 {4733BD1A-E04C-458D-8BFB-5010250EA497}.Debug|Win32.Build.0 = Debug|Win3278 {4733BD1A-E04C-458D-8BFB-5010250EA497}.Debug|Win32.ActiveCfg = Release|Win32 79 {4733BD1A-E04C-458D-8BFB-5010250EA497}.Debug|Win32.Build.0 = Release|Win32 81 80 {4733BD1A-E04C-458D-8BFB-5010250EA497}.Release|Win32.ActiveCfg = Release|Win32 82 81 {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 85 83 {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 89 86 {2240ECD7-2F48-4431-8E1B-25466A384CCC}.Release|Win32.ActiveCfg = Release|Win32 90 87 {2240ECD7-2F48-4431-8E1B-25466A384CCC}.Release|Win32.Build.0 = Release|Win32 -
code/branches/FICN/visual_studio/base_properties.vsprops
r776 r782 14 14 Detect64BitPortabilityProblems="true" 15 15 DebugInformationFormat="3" 16 DisableSpecificWarnings="4267; 4244; 4251" 16 17 /> 17 18 <Tool -
code/branches/FICN/visual_studio/benixonox.vcproj
r777 r782 40 40 Name="VCCLCompilerTool" 41 41 AdditionalIncludeDirectories="" 42 PreprocessorDefinitions="ORXONOX_SHARED_BUILD "42 PreprocessorDefinitions="ORXONOX_SHARED_BUILD; LOADER_STATIC_BUILD" 43 43 PrecompiledHeaderThrough="" 44 44 /> … … 109 109 Name="VCCLCompilerTool" 110 110 AdditionalIncludeDirectories="" 111 PreprocessorDefinitions=" LOADER_STATIC_BUILD; ORXONOX_SHARED_BUILD"111 PreprocessorDefinitions="ORXONOX_SHARED_BUILD; LOADER_STATIC_BUILD" 112 112 /> 113 113 <Tool … … 317 317 </File> 318 318 </Filter> 319 <Filter 320 Name="loader" 321 > 322 <File 323 RelativePath="..\src\loader\LevelLoader.cc" 324 > 325 </File> 326 </Filter> 319 327 </Filter> 320 328 <Filter … … 479 487 </File> 480 488 </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> 481 501 </Filter> 482 502 <Filter -
code/branches/FICN/visual_studio/loader.vcproj
r776 r782 53 53 <Tool 54 54 Name="VCLinkerTool" 55 AdditionalDependencies="OgreMain_d.lib Orxonox_d.lib"55 AdditionalDependencies="OgreMain_d.lib" 56 56 OutputFile="$(OutDir)\$(ProjectName)_d.dll" 57 57 AdditionalLibraryDirectories="$(OutDir)" … … 120 120 <Tool 121 121 Name="VCLinkerTool" 122 AdditionalDependencies="OgreMain.lib Orxonox.lib"122 AdditionalDependencies="OgreMain.lib" 123 123 AdditionalLibraryDirectories="$(OutDir)" 124 124 />
Note: See TracChangeset
for help on using the changeset viewer.