Changeset 2966 for code/branches
- Timestamp:
- May 11, 2009, 2:30:54 PM (16 years ago)
- Location:
- code/branches/sound/src
- Files:
-
- 1 added
- 1 deleted
- 3 edited
- 5 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sound/src/orxonox/CMakeLists.txt
r2950 r2966 31 31 ADD_SUBDIRECTORY(overlays) 32 32 ADD_SUBDIRECTORY(tools) 33 ADD_SUBDIRECTORY(sound) 33 34 GET_ALL_HEADER_FILES(ORXONOX_HDR_FILES) 34 35 SET(ORXONOX_FILES ${ORXONOX_SRC_FILES} ${ORXONOX_HDR_FILES}) … … 51 52 ${CEGUILUA_LIBRARY} 52 53 ${Boost_SYSTEM_LIBRARY} 54 ${OPENAL_LIBRARY} 55 ${ALUT_LIBRARY} 56 #${VORBISFILE_LIBRARY} 57 #${VORBIS_LIBRARY} 58 #${OGG_LIBRARY} 53 59 ogreceguirenderer_orxonox 54 60 tinyxml++_orxonox … … 58 64 core 59 65 network 60 sound61 66 ) 62 67 -
code/branches/sound/src/orxonox/objects/Level.cc
r2955 r2966 57 57 if (this->xmlfilename_.length() >= Core::getMediaPathString().length()) 58 58 this->xmlfilename_ = this->xmlfilename_.substr(Core::getMediaPathString().length()); 59 60 this->sndmgr_ = new SoundManager(); 59 61 } 60 62 … … 68 70 if (this->xmlfile_) 69 71 Loader::unload(this->xmlfile_); 72 73 if(this->ambientsound_ != NULL) 74 delete this->ambientsound_; 75 76 delete this->sndmgr_; 70 77 } 71 78 } … … 158 165 { 159 166 this->ambientsound_ = new SoundBase(); 160 this->sndmgr_ .addSound(this->ambientsound_);167 this->sndmgr_->addSound(this->ambientsound_); 161 168 } 162 169 -
code/branches/sound/src/orxonox/objects/Level.h
r2950 r2966 73 73 XMLFile* xmlfile_; 74 74 std::list<BaseObject*> objects_; 75 SoundManager 75 SoundManager* sndmgr_; 76 76 SoundBase* ambientsound_; 77 77 }; -
code/branches/sound/src/orxonox/sound/CMakeLists.txt
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/code/branches/buildsystem/src/sound/CMakeLists.txt 1874-2276,2278-2400 /code/branches/buildsystem2/src/sound/CMakeLists.txt 2506-2658 /code/branches/buildsystem3/src/sound/CMakeLists.txt 2662-2708 /code/branches/ceguilua/src/sound/CMakeLists.txt 1802-1808 /code/branches/core3/src/sound/CMakeLists.txt 1572-1739 /code/branches/gcc43/src/sound/CMakeLists.txt 1580 /code/branches/gui/src/sound/CMakeLists.txt 1635-1723 /code/branches/input/src/sound/CMakeLists.txt 1629-1636 /code/branches/lodfinal/src/sound/CMakeLists.txt 2372-2411 /code/branches/miniprojects/src/sound/CMakeLists.txt 2754-2824 /code/branches/network/src/sound/CMakeLists.txt 2356 /code/branches/network64/src/sound/CMakeLists.txt 2210-2355 /code/branches/objecthierarchy/src/sound/CMakeLists.txt 1911-2085,2100,2110-2169 /code/branches/objecthierarchy2/src/sound/CMakeLists.txt 2171-2479 /code/branches/overlay/src/sound/CMakeLists.txt 2117-2385 /code/branches/physics/src/sound/CMakeLists.txt 1912-2055,2107-2439 /code/branches/physics_merge/src/sound/CMakeLists.txt 2436-2457 /code/branches/pickups/src/sound/CMakeLists.txt 1926-2086,2127 /code/branches/pickups2/src/sound/CMakeLists.txt 2107-2497 /code/branches/presentation/src/sound/CMakeLists.txt 2369-2652,2654-2660 /code/branches/questsystem/src/sound/CMakeLists.txt 1894-2088 /code/branches/questsystem2/src/sound/CMakeLists.txt 2107-2259 /code/branches/script_trigger/src/sound/CMakeLists.txt 1295-1953,1955 /code/branches/weapon/src/sound/CMakeLists.txt 1925-2094 /code/branches/weapon2/src/sound/CMakeLists.txt 2107-2488
r2963 r2966 1 # 2 # ORXONOX - the hottest 3D action shooter ever to exist 3 # > www.orxonox.net < 4 # 5 # This program is free software; you can redistribute it and/or 6 # modify it under the terms of the GNU General Public License 7 # as published by the Free Software Foundation; either version 2 8 # of the License, or (at your option) any later version. 9 # 10 # This program is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU General Public License for more details. 14 # 15 # You should have received a copy of the GNU General Public License along 16 # with this program; if not, write to the Free Software Foundation, 17 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 # 19 20 SET_SOURCE_FILES(SOUND_FILES 1 ADD_SOURCE_FILES(ORXONOX_SRC_FILES 21 2 SoundManager.h 22 3 SoundBase.h … … 25 6 SoundBase.cc 26 7 ) 27 GENERATE_SOURCE_GROUPS(${SOUND_FILES})28 8 29 30 ADD_LIBRARY(sound SHARED ${SOUND_FILES})31 TARGET_LINK_LIBRARIES(sound32 ${OPENAL_LIBRARY}33 ${ALUT_LIBRARY}34 #${VORBISFILE_LIBRARY}35 #${VORBIS_LIBRARY}36 #${OGG_LIBRARY}37 core38 util39 )40 41 ORXONOX_INSTALL(sound) -
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
code/branches/sound/src/orxonox/sound/SoundBase.cc
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/code/branches/buildsystem/src/sound/SoundBase.cc 1874-2276,2278-2400 /code/branches/buildsystem2/src/sound/SoundBase.cc 2506-2658 /code/branches/buildsystem3/src/sound/SoundBase.cc 2662-2708 /code/branches/ceguilua/src/sound/SoundBase.cc 1802-1808 /code/branches/core3/src/sound/SoundBase.cc 1572-1739 /code/branches/gcc43/src/sound/SoundBase.cc 1580 /code/branches/gui/src/sound/SoundBase.cc 1635-1723 /code/branches/input/src/sound/SoundBase.cc 1629-1636 /code/branches/lodfinal/src/sound/SoundBase.cc 2372-2411 /code/branches/miniprojects/src/sound/SoundBase.cc 2754-2824 /code/branches/network/src/sound/SoundBase.cc 2356 /code/branches/network64/src/sound/SoundBase.cc 2210-2355 /code/branches/objecthierarchy/src/sound/SoundBase.cc 1911-2085,2100,2110-2169 /code/branches/objecthierarchy2/src/sound/SoundBase.cc 2171-2479 /code/branches/overlay/src/sound/SoundBase.cc 2117-2385 /code/branches/physics/src/sound/SoundBase.cc 1912-2055,2107-2439 /code/branches/physics_merge/src/sound/SoundBase.cc 2436-2457 /code/branches/pickups/src/sound/SoundBase.cc 1926-2086,2127 /code/branches/pickups2/src/sound/SoundBase.cc 2107-2497 /code/branches/presentation/src/sound/SoundBase.cc 2369-2652,2654-2660 /code/branches/questsystem/src/sound/SoundBase.cc 1894-2088 /code/branches/questsystem2/src/sound/SoundBase.cc 2107-2259 /code/branches/script_trigger/src/sound/SoundBase.cc 1295-1953,1955 /code/branches/weapon/src/sound/SoundBase.cc 1925-2094 /code/branches/weapon2/src/sound/SoundBase.cc 2107-2488
r2963 r2966 40 40 this->entity_ = NULL; 41 41 } 42 42 43 SoundBase::SoundBase(WorldEntity* entity) 43 44 { … … 45 46 this->buffer_ = 0; 46 47 this->entity_ = entity; 48 } 49 50 SoundBase::~SoundBase() 51 { 52 alSourcei(this->source_, AL_BUFFER, 0); 53 alDeleteSources(1, &this->source_); 54 alDeleteBuffers(1, &this->buffer_); 47 55 } 48 56 -
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
code/branches/sound/src/orxonox/sound/SoundBase.h
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/code/branches/buildsystem/src/sound/SoundBase.h 1874-2276,2278-2400 /code/branches/buildsystem2/src/sound/SoundBase.h 2506-2658 /code/branches/buildsystem3/src/sound/SoundBase.h 2662-2708 /code/branches/ceguilua/src/sound/SoundBase.h 1802-1808 /code/branches/core3/src/sound/SoundBase.h 1572-1739 /code/branches/gcc43/src/sound/SoundBase.h 1580 /code/branches/gui/src/sound/SoundBase.h 1635-1723 /code/branches/input/src/sound/SoundBase.h 1629-1636 /code/branches/lodfinal/src/sound/SoundBase.h 2372-2411 /code/branches/miniprojects/src/sound/SoundBase.h 2754-2824 /code/branches/network/src/sound/SoundBase.h 2356 /code/branches/network64/src/sound/SoundBase.h 2210-2355 /code/branches/objecthierarchy/src/sound/SoundBase.h 1911-2085,2100,2110-2169 /code/branches/objecthierarchy2/src/sound/SoundBase.h 2171-2479 /code/branches/overlay/src/sound/SoundBase.h 2117-2385 /code/branches/physics/src/sound/SoundBase.h 1912-2055,2107-2439 /code/branches/physics_merge/src/sound/SoundBase.h 2436-2457 /code/branches/pickups/src/sound/SoundBase.h 1926-2086,2127 /code/branches/pickups2/src/sound/SoundBase.h 2107-2497 /code/branches/presentation/src/sound/SoundBase.h 2369-2652,2654-2660 /code/branches/questsystem/src/sound/SoundBase.h 1894-2088 /code/branches/questsystem2/src/sound/SoundBase.h 2107-2259 /code/branches/script_trigger/src/sound/SoundBase.h 1295-1953,1955 /code/branches/weapon/src/sound/SoundBase.h 1925-2094 /code/branches/weapon2/src/sound/SoundBase.h 2107-2488
r2963 r2966 42 42 * 43 43 */ 44 class SoundBase44 class _OrxonoxExport SoundBase 45 45 { 46 46 public: 47 47 SoundBase(); 48 48 SoundBase(WorldEntity* entity); 49 ~SoundBase(); 49 50 50 51 void attachToEntity(WorldEntity* entity); -
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
code/branches/sound/src/orxonox/sound/SoundManager.cc
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/code/branches/buildsystem/src/sound/SoundManager.cc 1874-2276,2278-2400 /code/branches/buildsystem2/src/sound/SoundManager.cc 2506-2658 /code/branches/buildsystem3/src/sound/SoundManager.cc 2662-2708 /code/branches/ceguilua/src/sound/SoundManager.cc 1802-1808 /code/branches/core3/src/sound/SoundManager.cc 1572-1739 /code/branches/gcc43/src/sound/SoundManager.cc 1580 /code/branches/gui/src/sound/SoundManager.cc 1635-1723 /code/branches/input/src/sound/SoundManager.cc 1629-1636 /code/branches/lodfinal/src/sound/SoundManager.cc 2372-2411 /code/branches/miniprojects/src/sound/SoundManager.cc 2754-2824 /code/branches/network/src/sound/SoundManager.cc 2356 /code/branches/network64/src/sound/SoundManager.cc 2210-2355 /code/branches/objecthierarchy/src/sound/SoundManager.cc 1911-2085,2100,2110-2169 /code/branches/objecthierarchy2/src/sound/SoundManager.cc 2171-2479 /code/branches/overlay/src/sound/SoundManager.cc 2117-2385 /code/branches/physics/src/sound/SoundManager.cc 1912-2055,2107-2439 /code/branches/physics_merge/src/sound/SoundManager.cc 2436-2457 /code/branches/pickups/src/sound/SoundManager.cc 1926-2086,2127 /code/branches/pickups2/src/sound/SoundManager.cc 2107-2497 /code/branches/presentation/src/sound/SoundManager.cc 2369-2652,2654-2660 /code/branches/questsystem/src/sound/SoundManager.cc 1894-2088 /code/branches/questsystem2/src/sound/SoundManager.cc 2107-2259 /code/branches/script_trigger/src/sound/SoundManager.cc 1295-1953,1955 /code/branches/weapon/src/sound/SoundManager.cc 1925-2094 /code/branches/weapon2/src/sound/SoundManager.cc 2107-2488
r2963 r2966 37 37 namespace orxonox 38 38 { 39 ALCdevice* SoundManager::device_s = NULL; 40 39 41 /** 40 42 * Default constructor … … 42 44 SoundManager::SoundManager() 43 45 { 44 if(!alutInit(NULL,NULL)) { 46 if(!alutInitWithoutContext(NULL,NULL)) 47 { 45 48 COUT(2) << "OpenAL ALUT: " << alutGetErrorString(alutGetError()) << std::endl; 46 49 } 50 else 51 { 52 COUT(4) << "OpenAL ALUT version:" << alutGetMajorVersion() << "." << alutGetMinorVersion() << std::endl; 53 COUT(4) << "OpenAL ALUT supported MIME types:" << alutGetMIMETypes(ALUT_LOADER_BUFFER) << std::endl; 54 if(SoundManager::device_s == NULL) 55 { 56 COUT(3) << "OpenAL: open sound device..." << std::endl; 57 SoundManager::device_s = alcOpenDevice(NULL); 58 } 47 59 48 COUT(4) << "OpenAL ALUT version:" << alutGetMajorVersion() << "." << alutGetMinorVersion() << std::endl; 49 COUT(4) << "OpenAL ALUT supported MIME types:" << alutGetMIMETypes(ALUT_LOADER_BUFFER) << std::endl; 60 if(SoundManager::device_s == NULL) 61 { 62 COUT(2) << "OpenAL: Could not open sound device" << std::endl; 63 } 64 else 65 { 66 this->context_ = alcCreateContext(SoundManager::device_s, NULL); 67 if(this->context_ == NULL) 68 { 69 COUT(2) << "OpenAL: Could not create sound context"; 70 } 71 else 72 { 73 alcMakeContextCurrent(this->context_); 74 } 75 } 76 } 77 } 78 79 SoundManager::~SoundManager() 80 { 81 alcDestroyContext(this->context_); 82 alcCloseDevice(SoundManager::device_s); 83 alutExit(); 50 84 } 51 85 … … 72 106 pos = i; 73 107 } 74 108 75 109 delete (*pos); 76 110 this->soundlist_.erase(pos); … … 110 144 (*i)->update(); 111 145 } 112 113 } 146 } -
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
code/branches/sound/src/orxonox/sound/SoundManager.h
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/code/branches/buildsystem/src/sound/SoundManager.h 1874-2276,2278-2400 /code/branches/buildsystem2/src/sound/SoundManager.h 2506-2658 /code/branches/buildsystem3/src/sound/SoundManager.h 2662-2708 /code/branches/ceguilua/src/sound/SoundManager.h 1802-1808 /code/branches/core3/src/sound/SoundManager.h 1572-1739 /code/branches/gcc43/src/sound/SoundManager.h 1580 /code/branches/gui/src/sound/SoundManager.h 1635-1723 /code/branches/input/src/sound/SoundManager.h 1629-1636 /code/branches/lodfinal/src/sound/SoundManager.h 2372-2411 /code/branches/miniprojects/src/sound/SoundManager.h 2754-2824 /code/branches/network/src/sound/SoundManager.h 2356 /code/branches/network64/src/sound/SoundManager.h 2210-2355 /code/branches/objecthierarchy/src/sound/SoundManager.h 1911-2085,2100,2110-2169 /code/branches/objecthierarchy2/src/sound/SoundManager.h 2171-2479 /code/branches/overlay/src/sound/SoundManager.h 2117-2385 /code/branches/physics/src/sound/SoundManager.h 1912-2055,2107-2439 /code/branches/physics_merge/src/sound/SoundManager.h 2436-2457 /code/branches/pickups/src/sound/SoundManager.h 1926-2086,2127 /code/branches/pickups2/src/sound/SoundManager.h 2107-2497 /code/branches/presentation/src/sound/SoundManager.h 2369-2652,2654-2660 /code/branches/questsystem/src/sound/SoundManager.h 1894-2088 /code/branches/questsystem2/src/sound/SoundManager.h 2107-2259 /code/branches/script_trigger/src/sound/SoundManager.h 1295-1953,1955 /code/branches/weapon/src/sound/SoundManager.h 1925-2094 /code/branches/weapon2/src/sound/SoundManager.h 2107-2488
r2963 r2966 43 43 * 44 44 */ 45 class SoundManager : public Tickable45 class _OrxonoxExport SoundManager : public Tickable 46 46 { 47 47 public: 48 48 SoundManager(); 49 ~SoundManager(); 49 50 void addSound(SoundBase* sound); 50 51 void removeSound(SoundBase* sound); … … 53 54 54 55 private: 56 static ALCdevice* device_s; 57 ALCcontext* context_; 55 58 std::list<SoundBase*> soundlist_; 56 59 -
Property
svn:mergeinfo
set to
(toggle deleted branches)
Note: See TracChangeset
for help on using the changeset viewer.