From 944d0e908728d07a5a8da809baf448592ba9e701 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Fri, 4 Sep 2009 20:03:27 +0000 Subject: [PATCH] Fixed sound stuff for gameplayer, no sound though as U.audiodevice is set to 0 (="No Audio"). --- .../GamePlayer/common/GPC_Engine.cpp | 15 +------- .../gameengine/GamePlayer/common/GPC_Engine.h | 3 -- .../GamePlayer/ghost/GPG_Application.cpp | 36 ++++--------------- .../GamePlayer/ghost/GPG_Application.h | 3 -- .../gameengine/GamePlayer/ghost/GPG_ghost.cpp | 5 --- 5 files changed, 7 insertions(+), 55 deletions(-) diff --git a/source/gameengine/GamePlayer/common/GPC_Engine.cpp b/source/gameengine/GamePlayer/common/GPC_Engine.cpp index f131987095a..85a362d042a 100644 --- a/source/gameengine/GamePlayer/common/GPC_Engine.cpp +++ b/source/gameengine/GamePlayer/common/GPC_Engine.cpp @@ -58,9 +58,6 @@ #include "NG_LoopBackNetworkDeviceInterface.h" #include "RAS_IRenderTools.h" -#if 0 //XXX - ADD SOUND - #include "SND_DeviceManager.h" -#endif #include "GPC_Engine.h" #include "GPC_KeyboardDevice.h" @@ -77,8 +74,7 @@ GPC_Engine::GPC_Engine(char *customLoadingAnimationURL, m_system(NULL), m_keyboarddev(NULL), m_mousedev(NULL), m_canvas(NULL), m_rendertools(NULL), m_portal(NULL), m_sceneconverter(NULL), m_networkdev(NULL), - m_audiodevice(NULL), m_curarea(NULL), - m_customLoadingAnimationURL(NULL), + m_curarea(NULL), m_customLoadingAnimationURL(NULL), m_foregroundColor(foregroundColor), m_backgroundColor(backgroundColor), m_frameRate(frameRate), m_BlenderLogo(0), m_Blender3DLogo(0)/*, m_NaNLogo(0)*/ @@ -203,7 +199,6 @@ bool GPC_Engine::StartKetsji(void) m_keyboarddev, m_mousedev, m_networkdev, - m_audiodevice, m_system); m_system->SetMainLoop(m_portal->m_ketsjieng); @@ -339,14 +334,6 @@ void GPC_Engine::Exit() m_networkdev = 0; } - if (m_audiodevice) - { -#if 0 //XXX - ADD SOUND - SND_DeviceManager::Unsubscribe(); -#endif - m_audiodevice = 0; - } - m_initialized = false; } diff --git a/source/gameengine/GamePlayer/common/GPC_Engine.h b/source/gameengine/GamePlayer/common/GPC_Engine.h index b7121599c6e..42234bcbcd6 100644 --- a/source/gameengine/GamePlayer/common/GPC_Engine.h +++ b/source/gameengine/GamePlayer/common/GPC_Engine.h @@ -40,7 +40,6 @@ class RAS_IRenderTools; class KetsjiPortal; class KX_ISceneConverter; class NG_LoopBackNetworkDeviceInterface; -class SND_IAudioDevice; class GPC_RawImage; @@ -77,8 +76,6 @@ public: KX_ISceneConverter* m_sceneconverter; /** Network interface. */ NG_LoopBackNetworkDeviceInterface* m_networkdev; - /** Audiodevice interface */ - SND_IAudioDevice* m_audiodevice; struct ScrArea *m_curarea; // for future use, not used yet diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index 879c2264247..8ec41968042 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -57,6 +57,7 @@ extern "C" #include "BLO_readfile.h" #include "BKE_global.h" #include "BKE_main.h" +#include "BKE_sound.h" #include "IMB_imbuf.h" #include "DNA_scene_types.h" #ifdef __cplusplus @@ -85,10 +86,6 @@ extern "C" #include "KX_BlenderSceneConverter.h" #include "NG_LoopBackNetworkDeviceInterface.h" -#if 0 //XXX - ADD SOUND - #include "SND_DeviceManager.h" -#endif - #include "GPC_MouseDevice.h" #include "GPC_RenderTools.h" #include "GPG_Canvas.h" @@ -128,8 +125,7 @@ GPG_Application::GPG_Application(GHOST_ISystem* system) m_rendertools(0), m_rasterizer(0), m_sceneconverter(0), - m_networkdevice(0), - m_audiodevice(0), + m_networkdevice(0), m_blendermat(0), m_blenderglslmat(0), m_pyGlobalDictString(0), @@ -587,15 +583,7 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) if (!m_networkdevice) goto initFailed; -#if 0 //XXX - ADD SOUND - // get an audiodevice - SND_DeviceManager::Subscribe(); - m_audiodevice = SND_DeviceManager::Instance(); - if (!m_audiodevice) - goto initFailed; - m_audiodevice->UseCD(); -#endif - + sound_init(); // create a ketsjisystem (only needed for timing and stuff) m_kxsystem = new GPG_System (m_system); @@ -613,9 +601,7 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) m_ketsjiengine->SetRenderTools(m_rendertools); m_ketsjiengine->SetRasterizer(m_rasterizer); m_ketsjiengine->SetNetworkDevice(m_networkdevice); -#if 0 //XXX - ADD SOUND - m_ketsjiengine->SetAudioDevice(m_audiodevice); -#endif + m_ketsjiengine->SetTimingDisplay(frameRate, false, false); CValue::SetDeprecationWarnings(nodepwarnings); @@ -628,10 +614,8 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) return m_engineInitialized; initFailed: + sound_exit(); delete m_kxsystem; -#if 0 // XXX - ADD SOUND - delete m_audiodevice; -#endif delete m_networkdevice; delete m_mouse; delete m_keyboard; @@ -644,7 +628,6 @@ initFailed: m_keyboard = NULL; m_mouse = NULL; m_networkdevice = NULL; - m_audiodevice = NULL; m_kxsystem = NULL; return false; } @@ -690,7 +673,6 @@ bool GPG_Application::startEngine(void) KX_Scene* startscene = new KX_Scene(m_keyboard, m_mouse, m_networkdevice, -// m_audiodevice, // XXX ADD SOUND startscenename, m_startScene); @@ -780,6 +762,7 @@ void GPG_Application::stopEngine() void GPG_Application::exitEngine() { + sound_exit(); if (m_ketsjiengine) { stopEngine(); @@ -791,13 +774,6 @@ void GPG_Application::exitEngine() delete m_kxsystem; m_kxsystem = 0; } - if (m_audiodevice) - { -#if 0 //XXX - ADD SOUND - SND_DeviceManager::Unsubscribe(); - m_audiodevice = 0; -#endif - } if (m_networkdevice) { delete m_networkdevice; diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.h b/source/gameengine/GamePlayer/ghost/GPG_Application.h index 845686f5770..73430213078 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.h +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.h @@ -38,7 +38,6 @@ class KX_KetsjiEngine; class KX_ISceneConverter; class NG_LoopBackNetworkDeviceInterface; -class SND_IAudioDevice; class RAS_IRasterizer; class GHOST_IEvent; class GHOST_ISystem; @@ -142,8 +141,6 @@ protected: KX_ISceneConverter* m_sceneconverter; /** Network interface. */ NG_LoopBackNetworkDeviceInterface* m_networkdevice; - /** Sound device. */ - SND_IAudioDevice* m_audiodevice; bool m_blendermat; bool m_blenderglslmat; diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index b7677d29507..edc32093eab 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -59,7 +59,6 @@ extern "C" #include "BKE_icons.h" #include "BKE_node.h" #include "BKE_report.h" -#include "BKE_sound.h" #include "BLI_blenlib.h" #include "DNA_scene_types.h" #include "BLO_readfile.h" @@ -362,8 +361,6 @@ int main(int argc, char** argv) quicktime_init(); #endif - sound_init(); - libtiff_init(); // Parse command line options @@ -824,8 +821,6 @@ int main(int argc, char** argv) } free_nodesystem(); - - sound_exit(); return error ? -1 : 0; }