X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/05c9ccbe622515f0c32c996a95e86a316b13a59b..8c23ed4e210434ceea7edaa45382fd749a0256db:/src/mgl/app.cpp diff --git a/src/mgl/app.cpp b/src/mgl/app.cpp index 9112462198..994448650d 100644 --- a/src/mgl/app.cpp +++ b/src/mgl/app.cpp @@ -220,6 +220,20 @@ wxApp::~wxApp() { } +wxDisplayModeInfo wxGetDefaultDisplayMode() +{ + wxString mode; + unsigned w, h, bpp; + + if ( !wxGetEnv(wxT("WXMODE"), &mode) || + (wxSscanf(mode.c_str(), _T("%ux%u-%u"), &w, &h, &bpp) != 3) ) + { + w = 640, h = 480, bpp = 16; + } + + return wxDisplayModeInfo(w, h, bpp); +} + bool wxApp::SetDisplayMode(const wxDisplayModeInfo& mode) { if ( !mode.IsOk() ) @@ -397,8 +411,6 @@ bool wxApp::Initialize() wxClassInfo::InitializeClasses(); - wxSystemSettings::Init(); - #if wxUSE_INTL wxFont::SetDefaultEncoding(wxLocale::GetSystemEncoding()); #endif @@ -461,13 +473,10 @@ void wxApp::CleanUp() wxDeleteStockObjects(); wxDeleteStockLists(); - // Can't do this in wxModule, because fonts are needed by stock lists - delete wxTheFontsManager; - wxTheFontsManager = (wxFontsManager*) NULL; - delete wxTheApp; wxTheApp = (wxApp*) NULL; + // GL: I'm annoyed ... I don't know where to put this and I don't want to // create a module for that as it's part of the core. #if wxUSE_THREADS @@ -475,11 +484,15 @@ void wxApp::CleanUp() delete wxPendingEventsLocker; #endif - wxSystemSettings::Done(); + wxClassInfo::CleanUpClasses(); - delete[] wxBuffer; + // Can't do this in wxModule, because fonts are needed by stock lists + // (do it after deleting wxTheApp and cleaning modules up, since somebody + // may be deleting fonts that lately) + delete wxTheFontsManager; + wxTheFontsManager = (wxFontsManager*) NULL; - wxClassInfo::CleanUpClasses(); + delete[] wxBuffer; // check for memory leaks #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT