diff --git a/Source/Project64/User Interface/Settings/Settings Page - Game - Plugin.cpp b/Source/Project64/User Interface/Settings/Settings Page - Game - Plugin.cpp index 7295fe112..e796a002b 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Game - Plugin.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Game - Plugin.cpp @@ -93,7 +93,13 @@ void CGamePluginPage::ShowAboutButton ( int id ) return; } - const CPluginList::PLUGIN * Plugin = (const CPluginList::PLUGIN *)ComboBox->GetItemDataPtr(index); + const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox->GetItemDataPtr(index); + if (PluginPtr == NULL) + { + return; + } + + const CPluginList::PLUGIN * Plugin = *PluginPtr; if (Plugin == NULL) { return; @@ -140,11 +146,16 @@ void CGamePluginPage::PluginItemChanged ( int id, int AboutID, bool bSetChanged { return; } - const CPluginList::PLUGIN * Plugin = (const CPluginList::PLUGIN *)ComboBox->GetItemDataPtr(index); - if (Plugin) + const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox->GetItemDataPtr(index); + if (PluginPtr) { - ::EnableWindow(GetDlgItem(AboutID),Plugin->AboutFunction); + const CPluginList::PLUGIN * Plugin = *PluginPtr; + if (Plugin) + { + ::EnableWindow(GetDlgItem(AboutID),Plugin->AboutFunction); + } } + if (bSetChanged) { ComboBox->SetChanged(true); @@ -225,7 +236,14 @@ void CGamePluginPage::ApplyComboBoxes ( void ) { return; } - const CPluginList::PLUGIN * Plugin = (const CPluginList::PLUGIN *)ComboBox->GetItemDataPtr(index); + + const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox->GetItemDataPtr(index); + if (PluginPtr == NULL) + { + return; + } + + const CPluginList::PLUGIN * Plugin = *PluginPtr; if (Plugin) { @@ -261,7 +279,12 @@ bool CGamePluginPage::ResetComboBox ( CModifiedComboBox & ComboBox, SettingID Ty ComboBox.SetReset(true); for (int i = 0, n = ComboBox.GetCount(); i < n; i++) { - if (ComboBox.GetItemDataPtr(i) != NULL) + const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox.GetItemDataPtr(i); + if (PluginPtr == NULL) + { + continue; + } + if (*PluginPtr != NULL) { continue; } diff --git a/Source/Project64/User Interface/Settings/Settings Page - Plugin.cpp b/Source/Project64/User Interface/Settings/Settings Page - Plugin.cpp index c012ff679..22aa6949d 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Plugin.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Plugin.cpp @@ -85,7 +85,13 @@ void COptionPluginPage::ShowAboutButton ( int id ) return; } - const CPluginList::PLUGIN * Plugin = (const CPluginList::PLUGIN *)ComboBox->GetItemDataPtr(index); + const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox->GetItemDataPtr(index); + if (PluginPtr == NULL) + { + return; + } + + const CPluginList::PLUGIN * Plugin = *PluginPtr; if (Plugin == NULL) { return; @@ -132,11 +138,16 @@ void COptionPluginPage::PluginItemChanged ( int id, int AboutID, bool bSetChange { return; } - const CPluginList::PLUGIN * Plugin = (const CPluginList::PLUGIN *)ComboBox->GetItemDataPtr(index); - if (Plugin) + const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox->GetItemDataPtr(index); + if (PluginPtr) { - ::EnableWindow(GetDlgItem(AboutID),Plugin->AboutFunction); + const CPluginList::PLUGIN * Plugin = *PluginPtr; + if (Plugin) + { + ::EnableWindow(GetDlgItem(AboutID),Plugin->AboutFunction); + } } + if (bSetChanged) { ComboBox->SetChanged(true); @@ -153,9 +164,14 @@ void COptionPluginPage::UpdatePageSettings ( void ) stdstr SelectedValue; ComboBox->SetChanged(_Settings->LoadString(cb_iter->first,SelectedValue)); - for (int i = 0, n = m_PluginList.GetPluginCount(); i < n; i++ ) + for (int i = 0, n = ComboBox->GetCount(); i < n; i++ ) { - const CPluginList::PLUGIN * Plugin = m_PluginList.GetPluginInfo(i); + const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox->GetItemDataPtr(i); + if (PluginPtr == NULL) + { + continue; + } + const CPluginList::PLUGIN * Plugin = *PluginPtr; if (Plugin == NULL) { continue; @@ -211,7 +227,14 @@ void COptionPluginPage::ApplyComboBoxes ( void ) { return; } - const CPluginList::PLUGIN * Plugin = (const CPluginList::PLUGIN *)ComboBox->GetItemDataPtr(index); + + const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox->GetItemDataPtr(index); + if (PluginPtr == NULL) + { + return; + } + + const CPluginList::PLUGIN * Plugin = *PluginPtr; _Settings->SaveString(cb_iter->first,Plugin->FileName.c_str()); switch (Plugin->Info.Type) @@ -243,7 +266,13 @@ bool COptionPluginPage::ResetComboBox ( CModifiedComboBox & ComboBox, SettingID stdstr Value = _Settings->LoadDefaultString(Type); for (int i = 0, n = ComboBox.GetCount(); i < n; i++) { - const CPluginList::PLUGIN * Plugin = (const CPluginList::PLUGIN *)ComboBox.GetItemDataPtr(i); + const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox.GetItemDataPtr(i); + if (PluginPtr == NULL) + { + continue; + } + + const CPluginList::PLUGIN * Plugin = *PluginPtr; if (Plugin->FileName != Value) { continue; diff --git a/Source/RSP/Main.cpp b/Source/RSP/Main.cpp index dd33c8ccf..736cd1d7f 100644 --- a/Source/RSP/Main.cpp +++ b/Source/RSP/Main.cpp @@ -83,12 +83,12 @@ ULONG Set_AudioHle = 0, Set_GraphicsHle = 0; /************ DLL info **************/ const char * AppName ( void ) { - static stdstr_f Name("RSP %s",VersionInfo(VERSION_PRODUCT_VERSION,hinstDLL)); + static stdstr_f Name("RSP %s",VersionInfo(VERSION_PRODUCT_VERSION,hinstDLL).c_str()); return Name.c_str(); } const char * AboutMsg ( void ) { - static stdstr_f Msg("RSP emulation Plugin\nMade for Project64 (c)\nVersion %s\n\nby Jabo & Zilmar",VersionInfo(VERSION_PRODUCT_VERSION,hinstDLL)); + static stdstr_f Msg("RSP emulation Plugin\nMade for Project64 (c)\nVersion %s\n\nby Jabo & Zilmar",VersionInfo(VERSION_PRODUCT_VERSION,hinstDLL).c_str()); return Msg.c_str(); }