diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2012-03-19 10:37:15 -0700 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2012-03-19 10:37:15 -0700 |
| commit | ff6023df2793bf7c4ef81e90efcf0068ed3f09b8 (patch) | |
| tree | 1f67befebf49fd0ec89abe0a43169999be5090ad /Source | |
| parent | 4a1e8ba30a974d7a852e1ac4657da2c7bc9f7c65 (diff) | |
Change wxString(<string>, wxConvUTF8) method of creating unicode from filenames to wxSafeConvertMB2WX()
(Just applied to FrameTools.cpp for now)
Allows one to properly restart Pokémon by hitting play :P
Ignore non-ASCII strings passed to DisplayMessage(). These strings would end up going to renderer display and statusbar/titlebar, which can't handle them properly.
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/Core/Src/Core.cpp | 15 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/FrameTools.cpp | 6 |
2 files changed, 15 insertions, 6 deletions
diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index bd4267c074..a8f2349c0a 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -73,6 +73,8 @@ #include "State.h" #include "Movie.h" +#include <ctype.h> + // TODO: ugly, remove bool g_aspect_wide; @@ -129,11 +131,18 @@ void DisplayMessage(const char *message, int time_in_ms) SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter; + // Actually displaying non-ASCII could cause things to go pear-shaped + if (!isascii(message)) + return; + g_video_backend->Video_AddMessage(message, time_in_ms); + if (_CoreParameter.bRenderToMain && - SConfig::GetInstance().m_InterfaceStatusbar) { - Host_UpdateStatusBar(message); - } else + SConfig::GetInstance().m_InterfaceStatusbar) + { + Host_UpdateStatusBar(message); + } + else Host_UpdateTitle(message); } diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index eafebe131f..4da736bbaa 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -632,12 +632,12 @@ void CFrame::BootGame(const std::string& filename) bootfile = m_GameListCtrl->GetSelectedISO()->GetFileName(); } else if (!StartUp.m_strDefaultGCM.empty() - && wxFileExists(wxString(StartUp.m_strDefaultGCM.c_str(), wxConvUTF8))) + && wxFileExists(wxSafeConvertMB2WX(StartUp.m_strDefaultGCM.c_str()))) bootfile = StartUp.m_strDefaultGCM; else { if (!SConfig::GetInstance().m_LastFilename.empty() - && wxFileExists(wxString(SConfig::GetInstance().m_LastFilename.c_str(), wxConvUTF8))) + && wxFileExists(wxSafeConvertMB2WX(SConfig::GetInstance().m_LastFilename.c_str()))) bootfile = SConfig::GetInstance().m_LastFilename; else { @@ -1646,7 +1646,7 @@ void CFrame::UpdateGUI() } // Prepare to load last selected file, enable play button else if (!SConfig::GetInstance().m_LastFilename.empty() - && wxFileExists(wxString(SConfig::GetInstance().m_LastFilename.c_str(), wxConvUTF8))) + && wxFileExists(wxSafeConvertMB2WX(SConfig::GetInstance().m_LastFilename.c_str()))) { if (m_ToolBar) m_ToolBar->EnableTool(IDM_PLAY, true); |
