Revision: 2391 http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2391&view=rev Author: ulteq Date: 2012-01-30 21:41:28 +0000 (Mon, 30 Jan 2012) Log Message: ----------- [bugfixes] -Codechange: Fixed headers
Modified Paths: -------------- branches/bugfixes/source/main/audio/Sound.cpp branches/bugfixes/source/main/audio/Sound.h branches/bugfixes/source/main/audio/SoundManager.cpp branches/bugfixes/source/main/audio/SoundManager.h branches/bugfixes/source/main/audio/SoundScriptManager.cpp branches/bugfixes/source/main/audio/SoundScriptManager.h Modified: branches/bugfixes/source/main/audio/Sound.cpp =================================================================== --- branches/bugfixes/source/main/audio/Sound.cpp 2012-01-30 15:04:51 UTC (rev 2390) +++ branches/bugfixes/source/main/audio/Sound.cpp 2012-01-30 21:41:28 UTC (rev 2391) @@ -25,6 +25,8 @@ #include "Sound.h" #include "SoundManager.h" +using namespace Ogre; + Sound::Sound(ALuint buffer, SoundManager *sound_mgr, int source_index) { this->buffer=buffer; Modified: branches/bugfixes/source/main/audio/Sound.h =================================================================== --- branches/bugfixes/source/main/audio/Sound.h 2012-01-30 15:04:51 UTC (rev 2390) +++ branches/bugfixes/source/main/audio/Sound.h 2012-01-30 21:41:28 UTC (rev 2391) @@ -24,8 +24,9 @@ #ifndef __Sound_H_ #define __Sound_H_ +#include "RoRPrerequisites.h" #include "Ogre.h" -#include "AL/al.h" +#include <AL/al.h> #define REASON_PLAY 0 #define REASON_STOP 1 @@ -35,8 +36,6 @@ #define REASON_POSN 5 #define REASON_VLCT 6 -using namespace Ogre; - class Sound { friend class SoundManager; @@ -46,8 +45,8 @@ void setPitch(float pitch); void setGain(float gain); - void setPosition(Vector3 pos); - void setVelocity(Vector3 vel); + void setPosition(Ogre::Vector3 pos); + void setVelocity(Ogre::Vector3 vel); void setLoop(bool loop); void setEnabled(bool e); void play(); @@ -57,7 +56,7 @@ bool isPlaying(); private: - void computeAudibility(Vector3 pos); + void computeAudibility(Ogre::Vector3 pos); float audibility; float gain; @@ -69,10 +68,10 @@ // This value is changed dynamically, depending on whether the input is played or not. int hardware_index; ALuint buffer; + + Ogre::Vector3 position; + Ogre::Vector3 velocity; - Vector3 position; - Vector3 velocity; - SoundManager* sound_mgr; // Must not be changed during the lifetime of this object int source_index; Modified: branches/bugfixes/source/main/audio/SoundManager.cpp =================================================================== --- branches/bugfixes/source/main/audio/SoundManager.cpp 2012-01-30 15:04:51 UTC (rev 2390) +++ branches/bugfixes/source/main/audio/SoundManager.cpp 2012-01-30 21:41:28 UTC (rev 2391) @@ -22,10 +22,9 @@ #ifdef USE_OPENAL -#include "Ogre.h" -#include "Settings.h" #include "Sound.h" #include "SoundManager.h" +#include "Settings.h" // some gcc fixes #if OGRE_PLATFORM == OGRE_PLATFORM_LINUX Modified: branches/bugfixes/source/main/audio/SoundManager.h =================================================================== --- branches/bugfixes/source/main/audio/SoundManager.h 2012-01-30 15:04:51 UTC (rev 2390) +++ branches/bugfixes/source/main/audio/SoundManager.h 2012-01-30 21:41:28 UTC (rev 2391) @@ -24,9 +24,10 @@ #ifndef __SoundManager_H_ #define __SoundManager_H_ +#include "RoRPrerequisites.h" #include "Ogre.h" -#include "AL/al.h" -#include "AL/alc.h" +#include <AL/al.h> +#include <AL/alc.h> // Maximum number of really mixed sources #define MAX_HARDWARE_SOURCES 32 @@ -35,8 +36,6 @@ // Maximum number of sound files #define MAX_AUDIO_BUFFERS 2048 -using namespace Ogre; - class SoundManager { friend class Sound; @@ -47,9 +46,9 @@ SoundManager(); ~SoundManager(); - Sound* createSound(String filename); + Sound* createSound(Ogre::String filename); - void setCamera(Vector3 position, Vector3 direction, Vector3 up, Vector3 velocity); + void setCamera(Ogre::Vector3 position, Ogre::Vector3 direction, Ogre::Vector3 up, Ogre::Vector3 velocity); void pauseAllSounds(); void resumeAllSounds(); @@ -61,13 +60,13 @@ private: void recomputeAllSources(); - void recomputeSource(int source_index, int reason, float vfl, Vector3 *vvec); + void recomputeSource(int source_index, int reason, float vfl, Ogre::Vector3 *vvec); ALuint getHardwareSource(int hardware_index) { return m_hardware_sources[hardware_index]; }; void assign(int source_index, int hardware_index); void retire(int source_index); - bool SoundManager::loadWAVFile(String filename, ALuint buffer); + bool SoundManager::loadWAVFile(Ogre::String filename, ALuint buffer); // Active audio sources (hardware sources) int m_hardware_sources_num; // Total number of available hardware sources < MAX_HARDWARE_SOURCES @@ -84,9 +83,9 @@ // Audio buffers: Array of AL buffers and filenames int m_audio_buffers_in_use_count; ALuint m_audio_buffers[MAX_AUDIO_BUFFERS]; - String m_audio_buffer_file_name[MAX_AUDIO_BUFFERS]; + Ogre::String m_audio_buffer_file_name[MAX_AUDIO_BUFFERS]; - Vector3 camera_position; + Ogre::Vector3 camera_position; ALCdevice *m_sound_device; ALCcontext *m_sound_context; }; Modified: branches/bugfixes/source/main/audio/SoundScriptManager.cpp =================================================================== --- branches/bugfixes/source/main/audio/SoundScriptManager.cpp 2012-01-30 15:04:51 UTC (rev 2390) +++ branches/bugfixes/source/main/audio/SoundScriptManager.cpp 2012-01-30 21:41:28 UTC (rev 2391) @@ -19,7 +19,6 @@ */ #ifdef USE_OPENAL -#include "Ogre.h" #include "Sound.h" #include "SoundScriptManager.h" #include "Settings.h" Modified: branches/bugfixes/source/main/audio/SoundScriptManager.h =================================================================== --- branches/bugfixes/source/main/audio/SoundScriptManager.h 2012-01-30 15:04:51 UTC (rev 2390) +++ branches/bugfixes/source/main/audio/SoundScriptManager.h 2012-01-30 21:41:28 UTC (rev 2391) @@ -23,7 +23,6 @@ #define __SoundScriptManager_H__ #include "RoRPrerequisites.h" - #include "Ogre.h" #include "Beam.h" #include "OgreScriptLoader.h" @@ -31,7 +30,6 @@ #include "Sound.h" #include "SoundManager.h" - #define MAX_SOUNDS_PER_SCRIPT 16 #define MAX_INSTANCES_PER_GROUP 256 @@ -133,21 +131,18 @@ #define SS_MOD_AOA 28 #define SS_MAX_MOD 29 - -using namespace Ogre; - class SoundScriptTemplate { public: - SoundScriptTemplate(String name, String groupname, String filename, bool baseTemplate); + SoundScriptTemplate(Ogre::String name, Ogre::String groupname, Ogre::String filename, bool baseTemplate); bool setParameter(StringVector vec); ~SoundScriptTemplate(); //private: - int parseModulation(String str); - String name; - String groupname; - String filename; + int parseModulation(Ogre::String str); + Ogre::String name; + Ogre::String groupname; + Ogre::String filename; int trigger_source; int pitch_source; float pitch_offset; @@ -159,24 +154,24 @@ float gain_square; bool has_start_sound; float start_sound_pitch; - String start_sound_name; + Ogre::String start_sound_name; bool has_stop_sound; float stop_sound_pitch; - String stop_sound_name; + Ogre::String stop_sound_name; bool unpitchable; int free_sound; float sound_pitches[MAX_SOUNDS_PER_SCRIPT]; - String sound_names[MAX_SOUNDS_PER_SCRIPT]; + Ogre::String sound_names[MAX_SOUNDS_PER_SCRIPT]; bool baseTemplate; }; class SoundScriptInstance { public: - SoundScriptInstance(int truck, SoundScriptTemplate* templ, SoundManager* sm, String instancename); + SoundScriptInstance(int truck, SoundScriptTemplate* templ, SoundManager* sm, Ogre::String instancename); void setPitch(float value); void setGain(float value); - void setPosition(Vector3 pos, Vector3 velocity); + void setPosition(Ogre::Vector3 pos, Ogre::Vector3 velocity); void runOnce(); void start(); void stop(); @@ -206,11 +201,11 @@ //ScriptLoader interface const StringVector& getScriptPatterns(void) const; - void parseScript(DataStreamPtr& stream, const String& groupName); + void parseScript(DataStreamPtr& stream, const Ogre::String& groupName); Real getLoadingOrder(void) const; - SoundScriptInstance* createInstance(String templatename, int truck, SceneNode *toAttach); - void unloadResourceGroup(String groupname); + SoundScriptInstance* createInstance(Ogre::String templatename, int truck, SceneNode *toAttach); + void unloadResourceGroup(Ogre::String groupname); void clearNonBaseTemplates(); //values update @@ -229,7 +224,7 @@ void soundEnable(bool state); - void setCamera(Vector3 position, Vector3 direction, Vector3 up, Vector3 velocity); + void setCamera(Ogre::Vector3 position, Ogre::Vector3 direction, Ogre::Vector3 up, Ogre::Vector3 velocity); void setLoadingBaseSounds(bool v) { loadingBase = v; }; float maxDistance; @@ -244,7 +239,7 @@ void skipToNextCloseBrace(DataStreamPtr& chunk); void skipToNextOpenBrace(DataStreamPtr& chunk); - SoundScriptTemplate* createTemplate(String name, String groupname, String filename); + SoundScriptTemplate* createTemplate(Ogre::String name, Ogre::String groupname, Ogre::String filename); //instances lookup tables int free_trigs[SS_MAX_TRIG]; SoundScriptInstance* trigs[SS_MAX_TRIG*MAX_INSTANCES_PER_GROUP]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _______________________________________________ Rigsofrods-devel mailing list Rigsofrods-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel