void CPlugins::DestroyGfxPlugin( void ) { if (m_Gfx == NULL) { return; } WriteTrace(TraceGfxPlugin,__FUNCTION__ ": before delete m_Gfx"); delete m_Gfx; WriteTrace(TraceGfxPlugin,__FUNCTION__ ": after delete m_Gfx"); m_Gfx = NULL; // g_Settings->UnknownSetting_GFX = NULL; DestroyRspPlugin(); }
void CPlugins::DestroyGfxPlugin(void) { if (m_Gfx == NULL) { return; } WriteTrace(TraceGFXPlugin, TraceInfo, "before delete m_Gfx"); delete m_Gfx; WriteTrace(TraceGFXPlugin, TraceInfo, "after delete m_Gfx"); m_Gfx = NULL; // g_Settings->UnknownSetting_GFX = NULL; DestroyRspPlugin(); }
void CPlugins::Reset ( void ) { bool bGfxChange = _stricmp(m_GfxFile.c_str(),g_Settings->LoadString(Game_Plugin_Gfx).c_str()) != 0; bool bAudioChange = _stricmp(m_AudioFile.c_str(),g_Settings->LoadString(Game_Plugin_Audio).c_str()) != 0; bool bRspChange = _stricmp(m_RSPFile.c_str(),g_Settings->LoadString(Game_Plugin_RSP).c_str()) != 0; bool bContChange = _stricmp(m_ControlFile.c_str(),g_Settings->LoadString(Game_Plugin_Controller).c_str()) != 0; if (bGfxChange) { DestroyGfxPlugin(); } if (bAudioChange) { DestroyAudioPlugin(); } if (bRspChange) { DestroyRspPlugin(); } if (bContChange) { DestroyControlPlugin(); } CreatePlugins(); }
void CPlugins::DestroyAudioPlugin( void ) { if (m_Audio == NULL) { return; } WriteTrace(TraceDebug,__FUNCTION__ ": 5"); m_Audio->Close(); WriteTrace(TraceDebug,__FUNCTION__ ": 6"); delete m_Audio; WriteTrace(TraceDebug,__FUNCTION__ ": 7"); m_Audio = NULL; WriteTrace(TraceDebug,__FUNCTION__ ": 8"); // g_Settings->UnknownSetting_AUDIO = NULL; DestroyRspPlugin(); }
void CPlugins::DestroyGfxPlugin(void) { if (m_Gfx == NULL) { return; } WriteTrace(TraceGFXPlugin, TraceDebug, "before close"); m_Gfx->Close(m_MainWindow); WriteTrace(TraceGFXPlugin, TraceInfo, "deleting"); delete m_Gfx; WriteTrace(TraceGFXPlugin, TraceInfo, "m_Gfx deleted"); m_Gfx = NULL; // g_Settings->UnknownSetting_GFX = NULL; DestroyRspPlugin(); WriteTrace(TraceGFXPlugin, TraceInfo, "Done"); }
bool CPlugins::Reset ( CN64System * System ) { WriteTrace(TraceDebug,__FUNCTION__ ": Start"); bool bGfxChange = _stricmp(m_GfxFile.c_str(),g_Settings->LoadStringVal(Game_Plugin_Gfx).c_str()) != 0; bool bAudioChange = _stricmp(m_AudioFile.c_str(),g_Settings->LoadStringVal(Game_Plugin_Audio).c_str()) != 0; bool bRspChange = _stricmp(m_RSPFile.c_str(),g_Settings->LoadStringVal(Game_Plugin_RSP).c_str()) != 0; bool bContChange = _stricmp(m_ControlFile.c_str(),g_Settings->LoadStringVal(Game_Plugin_Controller).c_str()) != 0; //if GFX and Audio has changed we also need to force reset of RSP if (bGfxChange || bAudioChange) bRspChange = true; if (bGfxChange) { DestroyGfxPlugin(); } if (bAudioChange) { DestroyAudioPlugin(); } if (bRspChange) { DestroyRspPlugin(); } if (bContChange) { DestroyControlPlugin(); } CreatePlugins(); if (m_Gfx && bGfxChange) { WriteTrace(TraceGfxPlugin,__FUNCTION__ ": Gfx Initiate Starting"); if (!m_Gfx->Initiate(System,m_RenderWindow)) { return false; } WriteTrace(TraceGfxPlugin,__FUNCTION__ ": Gfx Initiate Done"); } if (m_Audio && bAudioChange) { WriteTrace(TraceDebug,__FUNCTION__ ": Audio Initiate Starting"); if (!m_Audio->Initiate(System,m_RenderWindow)) { return false; } WriteTrace(TraceDebug,__FUNCTION__ ": Audio Initiate Done"); } if (m_Control && bContChange) { WriteTrace(TraceDebug, __FUNCTION__ ": Control Initiate Starting"); if (!m_Control->Initiate(System,m_RenderWindow)) { return false; } WriteTrace(TraceDebug, __FUNCTION__ ": Control Initiate Done"); } if (m_RSP && bRspChange) { WriteTrace(TraceRSP,__FUNCTION__ ": RSP Initiate Starting"); if (!m_RSP->Initiate(this,System)) { return false; } WriteTrace(TraceRSP,__FUNCTION__ ": RSP Initiate Done"); } WriteTrace(TraceDebug,__FUNCTION__ ": Done"); return true; }
void CPlugins::DestroyAudioPlugin(void) { if (m_Audio == NULL) { return; } WriteTrace(TraceAudioPlugin, TraceDebug, "before close"); m_Audio->Close(); WriteTrace(TraceAudioPlugin, TraceDebug, "before delete"); delete m_Audio; WriteTrace(TraceAudioPlugin, TraceDebug, "after delete"); m_Audio = NULL; WriteTrace(TraceAudioPlugin, TraceDebug, "before DestroyRspPlugin"); // g_Settings->UnknownSetting_AUDIO = NULL; DestroyRspPlugin(); WriteTrace(TraceAudioPlugin, TraceDebug, "after DestroyRspPlugin"); }
CPlugins::~CPlugins (void) { g_Settings->UnregisterChangeCB(Plugin_RSP_Current,this,(CSettings::SettingChangedFunc)PluginChanged); g_Settings->UnregisterChangeCB(Plugin_GFX_Current,this,(CSettings::SettingChangedFunc)PluginChanged); g_Settings->UnregisterChangeCB(Plugin_AUDIO_Current,this,(CSettings::SettingChangedFunc)PluginChanged); g_Settings->UnregisterChangeCB(Plugin_CONT_Current,this,(CSettings::SettingChangedFunc)PluginChanged); g_Settings->UnregisterChangeCB(Plugin_UseHleGfx,this,(CSettings::SettingChangedFunc)PluginChanged); g_Settings->UnregisterChangeCB(Plugin_UseHleAudio,this,(CSettings::SettingChangedFunc)PluginChanged); g_Settings->UnregisterChangeCB(Game_EditPlugin_Gfx,this,(CSettings::SettingChangedFunc)PluginChanged); g_Settings->UnregisterChangeCB(Game_EditPlugin_Audio,this,(CSettings::SettingChangedFunc)PluginChanged); g_Settings->UnregisterChangeCB(Game_EditPlugin_Contr,this,(CSettings::SettingChangedFunc)PluginChanged); g_Settings->UnregisterChangeCB(Game_EditPlugin_RSP,this,(CSettings::SettingChangedFunc)PluginChanged); DestroyGfxPlugin(); DestroyAudioPlugin(); DestroyRspPlugin(); DestroyControlPlugin(); }
bool CPlugins::Reset(CN64System * System) { WriteTrace(TracePlugins, TraceDebug, "Start"); bool bGfxChange = _stricmp(m_GfxFile.c_str(), g_Settings->LoadStringVal(Game_Plugin_Gfx).c_str()) != 0; bool bAudioChange = _stricmp(m_AudioFile.c_str(), g_Settings->LoadStringVal(Game_Plugin_Audio).c_str()) != 0; bool bRspChange = _stricmp(m_RSPFile.c_str(), g_Settings->LoadStringVal(Game_Plugin_RSP).c_str()) != 0; bool bContChange = _stricmp(m_ControlFile.c_str(), g_Settings->LoadStringVal(Game_Plugin_Controller).c_str()) != 0; if (g_Settings->LoadBool(Plugin_ForceGfxReset)) { //this is a hack and should not be here, glide64 is not correctly freeing something on restart, this needs to be fixed but this is a short term workaround bGfxChange = true; } //if GFX and Audio has changed we also need to force reset of RSP if (bGfxChange || bAudioChange) { bRspChange = true; } if (bGfxChange) { DestroyGfxPlugin(); } if (bAudioChange) { DestroyAudioPlugin(); } if (bRspChange) { DestroyRspPlugin(); } if (bContChange) { DestroyControlPlugin(); } CreatePlugins(); if (m_Gfx && bGfxChange) { WriteTrace(TraceGFXPlugin, TraceDebug, "Gfx Initiate Starting"); if (!m_Gfx->Initiate(System, m_MainWindow)) { return false; } WriteTrace(TraceGFXPlugin, TraceDebug, "Gfx Initiate Done"); } if (m_Audio && bAudioChange) { WriteTrace(TraceAudioPlugin, TraceDebug, "Audio Initiate Starting"); if (!m_Audio->Initiate(System, m_MainWindow)) { return false; } WriteTrace(TraceAudioPlugin, TraceDebug, "Audio Initiate Done"); } if (m_Control && bContChange) { WriteTrace(TraceControllerPlugin, TraceDebug, "Control Initiate Starting"); if (!m_Control->Initiate(System, m_MainWindow)) { return false; } WriteTrace(TraceControllerPlugin, TraceDebug, "Control Initiate Done"); } if (m_RSP && bRspChange) { WriteTrace(TraceRSPPlugin, TraceDebug, "RSP Initiate Starting"); if (!m_RSP->Initiate(this, System)) { return false; } WriteTrace(TraceRSPPlugin, TraceDebug, "RSP Initiate Done"); } WriteTrace(TracePlugins, TraceDebug, "Done"); return true; }