spu2x-sdl: restore WX2.8 build compilation

Signed-off-by: Gregory Hainaut <gregory.hainaut@gmail.com>
This commit is contained in:
Jonathan Li 2015-10-31 11:06:15 +01:00 committed by Gregory Hainaut
parent 66259dee17
commit e31cb8cbcd
2 changed files with 5 additions and 5 deletions

View File

@ -130,7 +130,7 @@ void ReadSettings()
#if SDL_MAJOR_VERSION >= 2
// YES It sucks ...
for (int i = 0; i < SDL_GetNumAudioDrivers(); ++i) {
if (!temp.Cmp(SDL_GetAudioDriver(i)))
if (!temp.Cmp(wxString(SDL_GetAudioDriver(i), wxConvUTF8)))
SdlOutputAPI = i;
}
#endif
@ -364,7 +364,7 @@ void DisplayDialog()
if (gtk_combo_box_get_active(GTK_COMBO_BOX(sdl_api_box)) != -1) {
SdlOutputAPI = gtk_combo_box_get_active(GTK_COMBO_BOX(sdl_api_box));
// YES It sucks ...
SDLOut->SetApiSettings(wxString(SDL_GetAudioDriver(SdlOutputAPI)));
SDLOut->SetApiSettings(wxString(SDL_GetAudioDriver(SdlOutputAPI), wxConvUTF8));
}
#endif

View File

@ -133,19 +133,19 @@ struct SDLAudioMod : public SndOutModule {
}
void WriteSettings() const {
CfgWriteStr(L"SDL", L"HostApi", m_api);
CfgWriteStr(L"SDL", L"HostApi", wxString(m_api.c_str(), wxConvUTF8));
};
void SetApiSettings(wxString api) {
#if SDL_MAJOR_VERSION >= 2
// Validate the api name
bool valid = false;
std::string api_name = std::string(api);
std::string api_name = std::string(api.utf8_str());
for (int i = 0; i < SDL_GetNumAudioDrivers(); ++i) {
valid |= (api_name.compare(SDL_GetAudioDriver(i)) == 0);
}
if (valid) {
m_api = api;
m_api = api.utf8_str();
} else {
std::cerr << "SDL audio driver configuration is invalid!" << std::endl
<< "It will be replaced by pulseaudio!" << std::endl;