diff --git a/panda/src/audio/audioManager.cxx b/panda/src/audio/audioManager.cxx index 417c24c824..2b00338578 100644 --- a/panda/src/audio/audioManager.cxx +++ b/panda/src/audio/audioManager.cxx @@ -102,3 +102,96 @@ get_null_sound() { return _null_sound; } + +//////////////////////////////////////////////////////////////////// +// Function: AudioManager::audio_3d_update +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +void AudioManager:: +audio_3d_update() { + // intentionally blank. +} + +//////////////////////////////////////////////////////////////////// +// Function: AudioManager::audio_3d_set_listener_attributes +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +void AudioManager:: +audio_3d_set_listener_attributes(float px, float py, float pz, float vx, float vy, float vz, float fx, float fy, float fz, float ux, float uy, float uz) { + // intentionally blank. +} + +//////////////////////////////////////////////////////////////////// +// Function: AudioManager::audio_3d_get_listener_attributes +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +void AudioManager:: +audio_3d_get_listener_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz, float *fx, float *fy, float *fz, float *ux, float *uy, float *uz) { + // intentionally blank. +} + +//////////////////////////////////////////////////////////////////// +// Function: AudioManager::audio_3d_set_distance_factor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +void AudioManager:: +audio_3d_set_distance_factor(float factor) { + // intentionally blank. +} + +//////////////////////////////////////////////////////////////////// +// Function: AudioManager::audio_3d_get_distance_factor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +float AudioManager:: +audio_3d_get_distance_factor() const { + // intentionally blank. + return 0.0f; +} + +//////////////////////////////////////////////////////////////////// +// Function: AudioManager::audio_3d_set_doppler_factor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +void AudioManager:: +audio_3d_set_doppler_factor(float factor) { + // intentionally blank. +} + +//////////////////////////////////////////////////////////////////// +// Function: AudioManager::audio_3d_get_doppler_factor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +float AudioManager:: +audio_3d_get_doppler_factor() const { + // intentionally blank. + return 0.0f; +} + +//////////////////////////////////////////////////////////////////// +// Function: AudioManager::audio_3d_set_drop_off_factor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +void AudioManager:: +audio_3d_set_drop_off_factor(float factor) { + // intentionally blank. +} + +//////////////////////////////////////////////////////////////////// +// Function: AudioManager::audio_3d_get_drop_off_factor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +float AudioManager:: +audio_3d_get_drop_off_factor() const { + // intentionally blank. + return 0.0f; +} diff --git a/panda/src/audio/audioManager.h b/panda/src/audio/audioManager.h index 64f0bd8ae9..65a61f301e 100644 --- a/panda/src/audio/audioManager.h +++ b/panda/src/audio/audioManager.h @@ -108,41 +108,40 @@ PUBLISHED: // Changes to the positions of 3D spacialized sounds and the listener // are all made at once when this method is called. It should be put // in the main program loop. - virtual void audio_3d_update() = 0; + virtual void audio_3d_update(); // This controls the "set of ears" that listens to 3D spacialized sound - // px, py, pz are position coordinates. Can be NULL to ignore. - // vx, vy, vz are a velocity vector in UNITS PER SECOND (default: meters). Can be NULL to ignore. + // px, py, pz are position coordinates. + // vx, vy, vz are a velocity vector in UNITS PER SECOND (default: meters). // fx, fy and fz are the respective components of a unit forward-vector // ux, uy and uz are the respective components of a unit up-vector // These changes will NOT be invoked until audio_3d_update() is called. virtual void audio_3d_set_listener_attributes(float px, float py, float pz, float vx, float vy, float vz, float fx, float fy, float fz, - float ux, float uy, float uz) = 0; - // Values should all default to NULL, so you can just pass the one you want to get. - virtual void audio_3d_get_listener_attributes(float px = NULL, float py = NULL, float pz = NULL, - float vx = NULL, float vy = NULL, float vz = NULL, - float fx = NULL, float fy = NULL, float fz = NULL, - float ux = NULL, float uy = NULL, float uz = NULL) = 0; + float ux, float uy, float uz); + virtual void audio_3d_get_listener_attributes(float *px, float *py, float *pz, + float *vx, float *vy, float *vz, + float *fx, float *fy, float *fz, + float *ux, float *uy, float *uz); // Control the "relative distance factor" for 3D spacialized audio. Default is 1.0 // Fmod uses meters internally, so give a float in Units-per meter // Don't know what Miles uses. - virtual void audio_3d_set_distance_factor(float factor) = 0; - virtual float audio_3d_get_distance_factor() const = 0; + virtual void audio_3d_set_distance_factor(float factor); + virtual float audio_3d_get_distance_factor() const; // Control the presence of the Doppler effect. Default is 1.0 // Exaggerated Doppler, use >1.0 // Diminshed Doppler, use <1.0 - virtual void audio_3d_set_doppler_factor(float factor) = 0; - virtual float audio_3d_get_doppler_factor() const = 0; + virtual void audio_3d_set_doppler_factor(float factor); + virtual float audio_3d_get_doppler_factor() const; // Exaggerate or diminish the effect of distance on sound. Default is 1.0 // Faster drop off, use >1.0 // Slower drop off, use <1.0 - virtual void audio_3d_set_drop_off_factor(float factor) = 0; - virtual float audio_3d_get_drop_off_factor() const = 0; + virtual void audio_3d_set_drop_off_factor(float factor); + virtual float audio_3d_get_drop_off_factor() const; public: static void register_AudioManager_creator(Create_AudioManager_proc* proc); diff --git a/panda/src/audio/audioSound.h b/panda/src/audio/audioSound.h index 6ea9c727c3..d17ae5880e 100644 --- a/panda/src/audio/audioSound.h +++ b/panda/src/audio/audioSound.h @@ -98,12 +98,12 @@ PUBLISHED: // Controls the position of this sound's emitter. // px, py and pz are the emitter's position. // vx, vy and vz are the emitter's velocity in UNITS PER SECOND (default: meters). - // You can pass NULL to either value for either function to ignore that value + // You can pass 0.0 to either value for either function to ignore that value // if you only want to set/get one of them for some reason. - virtual void set_3d_attributes(float px = NULL, float py = NULL, float pz = NULL, - float vx = NULL, float vy = NULL, float vz = NULL) = 0; - virtual void get_3d_attributes(float px = NULL, float py = NULL, float pz = NULL, - float vx = NULL, float vy = NULL, float vz = NULL) = 0; + virtual void set_3d_attributes(float px = 0.0f, float py = 0.0f, float pz = 0.0f, + float vx = 0.0f, float vy = 0.0f, float vz = 0.0f) = 0; + virtual void get_3d_attributes(float px = 0.0f, float py = 0.0f, float pz = 0.0f, + float vx = 0.0f, float vy = 0.0f, float vz = 0.0f) = 0; enum SoundStatus { BAD, READY, PLAYING }; virtual SoundStatus status() const = 0; diff --git a/panda/src/audio/nullAudioManager.cxx b/panda/src/audio/nullAudioManager.cxx index 17d3ce9fb0..498f94eee8 100644 --- a/panda/src/audio/nullAudioManager.cxx +++ b/panda/src/audio/nullAudioManager.cxx @@ -211,7 +211,7 @@ audio_3d_set_listener_attributes(float px, float py, float pz, float vx, float v // Description: //////////////////////////////////////////////////////////////////// void NullAudioManager:: -audio_3d_get_listener_attributes(float px, float py, float pz, float vx, float vy, float vz, float fx, float fy, float fz, float ux, float uy, float uz) { +audio_3d_get_listener_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz, float *fx, float *fy, float *fz, float *ux, float *uy, float *uz) { // intentionally blank. } @@ -276,4 +276,4 @@ float NullAudioManager:: audio_3d_get_drop_off_factor() const { // intentionally blank. return 0.0f; -} \ No newline at end of file +} diff --git a/panda/src/audio/nullAudioManager.h b/panda/src/audio/nullAudioManager.h index 65b8a6b1b5..e1cf37c4be 100644 --- a/panda/src/audio/nullAudioManager.h +++ b/panda/src/audio/nullAudioManager.h @@ -59,10 +59,10 @@ public: float vx, float vy, float vz, float fx, float fy, float fz, float ux, float uy, float uz); - virtual void audio_3d_get_listener_attributes(float px = NULL, float py = NULL, float pz = NULL, - float vx = NULL, float vy = NULL, float vz = NULL, - float fx = NULL, float fy = NULL, float fz = NULL, - float ux = NULL, float uy = NULL, float uz = NULL); + virtual void audio_3d_get_listener_attributes(float *px, float *py, float *pz, + float *vx, float *vy, float *vz, + float *fx, float *fy, float *fz, + float *ux, float *uy, float *uz); virtual void audio_3d_set_distance_factor(float factor); virtual float audio_3d_get_distance_factor() const; diff --git a/panda/src/audio/nullAudioSound.cxx b/panda/src/audio/nullAudioSound.cxx index 7b23cbdad5..2a9c2c23df 100644 --- a/panda/src/audio/nullAudioSound.cxx +++ b/panda/src/audio/nullAudioSound.cxx @@ -22,7 +22,7 @@ namespace { static const string blank=""; - static float no_attributes [] = {0.0f,0.0f,0.0f, 0.0f,0.0f,0.0f}; + // static float no_attributes [] = {0.0f,0.0f,0.0f, 0.0f,0.0f,0.0f}; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/audiotraits/fmodAudioManager.cxx b/panda/src/audiotraits/fmodAudioManager.cxx index a885007287..7d023e0773 100644 --- a/panda/src/audiotraits/fmodAudioManager.cxx +++ b/panda/src/audiotraits/fmodAudioManager.cxx @@ -608,7 +608,7 @@ audio_3d_set_listener_attributes(float px, float py, float pz, float vx, float v // Description: Get position of the "ear" that picks up 3d sounds //////////////////////////////////////////////////////////////////// void FmodAudioManager:: -audio_3d_get_listener_attributes(float px, float py, float pz, float vx, float vy, float vz, float fx, float fy, float fz, float ux, float uy, float uz) { +audio_3d_get_listener_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz, float *fx, float *fy, float *fz, float *ux, float *uy, float *uz) { audio_error("audio3dGetListenerAttributes: currently unimplemented. Get the attributes of the attached object"); //audio_debug("FmodAudioManager::audio_3d_get_listener_attributes()"); // NOTE: swap the +y with the +z axis to convert between FMOD diff --git a/panda/src/audiotraits/fmodAudioManager.h b/panda/src/audiotraits/fmodAudioManager.h index 28e0b3f505..eec98b414e 100644 --- a/panda/src/audiotraits/fmodAudioManager.h +++ b/panda/src/audiotraits/fmodAudioManager.h @@ -76,8 +76,8 @@ public: virtual void audio_3d_update(); // This controls the "set of ears" that listens to 3D spacialized sound - // px, py, pz are position coordinates. Can be NULL to ignore. - // vx, vy, vz are a velocity vector in UNITS PER SECOND (default: meters). Can be NULL to ignore. + // px, py, pz are position coordinates. Can be 0.0f to ignore. + // vx, vy, vz are a velocity vector in UNITS PER SECOND (default: meters). // fx, fy and fz are the respective components of a unit forward-vector // ux, uy and uz are the respective components of a unit up-vector // These changes will NOT be invoked until audio_3d_update() is called. @@ -85,11 +85,10 @@ public: float vx, float xy, float xz, float fx, float fy, float fz, float ux, float uy, float uz); - // Values should all default to NULL, so you can just pass the one you want to get. - virtual void audio_3d_get_listener_attributes(float px = NULL, float py = NULL, float pz = NULL, - float vx = NULL, float vy = NULL, float vz = NULL, - float fx = NULL, float fy = NULL, float fz = NULL, - float ux = NULL, float uy = NULL, float uz = NULL); + virtual void audio_3d_get_listener_attributes(float *px, float *py, float *pz, + float *vx, float *vy, float *vz, + float *fx, float *fy, float *fz, + float *ux, float *uy, float *uz); // Control the "relative distance factor" for 3D spacialized audio. Default is 1.0 // Fmod uses meters internally, so give a float in Units-per meter diff --git a/panda/src/audiotraits/fmodAudioSound.cxx b/panda/src/audiotraits/fmodAudioSound.cxx index c3b20f9734..10f3737b99 100644 --- a/panda/src/audiotraits/fmodAudioSound.cxx +++ b/panda/src/audiotraits/fmodAudioSound.cxx @@ -432,7 +432,7 @@ set_3d_attributes(float px, float py, float pz, float vx, float vy, float vz) { // Description: Get position and velocity of this sound //////////////////////////////////////////////////////////////////// void FmodAudioSound:: -get_3d_attributes(float px, float py, float pz, float vx, float vy, float vz) { +get_3d_attributes(float *px, float *py, float *pz, float *vx, float *vy, float *vz) { audio_error("get3dAttributes: Currently unimplemented. Get the attributes of the attached object."); // NOTE: swap the +y with the +z axis to convert between FMOD // coordinates and Panda3D coordinates diff --git a/panda/src/audiotraits/fmodAudioSound.h b/panda/src/audiotraits/fmodAudioSound.h index ba2d311b1b..0157d420f5 100644 --- a/panda/src/audiotraits/fmodAudioSound.h +++ b/panda/src/audiotraits/fmodAudioSound.h @@ -81,12 +81,10 @@ public: // Controls the position of this sound's emitter. // pos is a pointer to an xyz triplet of the emitter's position. // vel is a pointer to an xyz triplet of the emitter's velocity. - // You can pass NULL to either value for either function to ignore that value - // if you only want to set/get one of them for some reason. - void set_3d_attributes(float px = NULL, float py = NULL, float pz = NULL, - float vx = NULL, float vy = NULL, float vz = NULL); - void get_3d_attributes(float px = NULL, float py = NULL, float pz = NULL, - float vx = NULL, float vy = NULL, float vz = NULL); + void set_3d_attributes(float px, float py, float pz, + float vx, float vy, float vz); + void get_3d_attributes(float *px, float *py, float *pz, + float *vx, float *vy, float *vz); AudioSound::SoundStatus status() const; diff --git a/panda/src/effects/cgShader.cxx b/panda/src/effects/cgShader.cxx index a870ffc706..0a102b33e2 100755 --- a/panda/src/effects/cgShader.cxx +++ b/panda/src/effects/cgShader.cxx @@ -270,7 +270,7 @@ CgShader(const string &name, const string &vertex_shader, _name = name; _vertex_shader = vertex_shader; _fragment_shader = fragment_shader; - bool res = init_cg(); + init_cg(); } diff --git a/panda/src/glstuff/glCgShaderContext_src.I b/panda/src/glstuff/glCgShaderContext_src.I index c030f56487..694dd1ad1a 100755 --- a/panda/src/glstuff/glCgShaderContext_src.I +++ b/panda/src/glstuff/glCgShaderContext_src.I @@ -26,7 +26,7 @@ INLINE CLP(CgShaderContext):: CLP(CgShaderContext)(PT(CgShader) cg_shader) : CgShaderContext(cg_shader) { - bool res = init_cg_shader_context(); + init_cg_shader_context(); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index fbdf729d31..d13dffb52c 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -2365,7 +2365,7 @@ issue_cg_shader_bind(const CgShaderAttrib *attrib) { (*csci).second->bind(this); // Bind the current shader } else {// First time CgShader object...need to make a new GLCgShaderContext PT(CLP(CgShaderContext)) csc = new CLP(CgShaderContext)(_cg_shader); - bool result = _cg_shader->load_shaders(); // Profiles created lets load from HD + _cg_shader->load_shaders(); // Profiles created lets load from HD csc->load_shaders(); // Programs loaded, compile and download to GPU CGSHADERCONTEXTS::value_type shader_and_context(_cg_shader, csc); _gl_cg_shader_contexts.insert(shader_and_context);