From 7834880925f91d845283babece4a020bdb80d505 Mon Sep 17 00:00:00 2001 From: Soren Jorvang Date: Fri, 21 Jan 2011 02:56:54 +0000 Subject: [PATCH] Make sure the game list gets created with automatic starts. When rendering to the main window, the wxGLCanvas should really be owned by the DolphinWX code for it to be safely freed. Hack around the problem by just hiding the canvas for now. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6890 8ced0084-cf51-0410-be5f-012b33b47a6e --- SConstruct | 1 - Source/Core/DolphinWX/Src/Main.cpp | 7 +++---- Source/Core/DolphinWX/Src/Main.h | 1 + Source/Core/DolphinWX/Src/SConscript | 1 + Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp | 3 ++- Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp | 3 ++- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/SConstruct b/SConstruct index 2f7b5e823c..6606dd17ee 100644 --- a/SConstruct +++ b/SConstruct @@ -133,7 +133,6 @@ if sys.platform == 'darwin': env['FRAMEWORKS'] += ['IOBluetooth', 'IOKit', 'OpenGL'] env['FRAMEWORKSFLAGS'] = ['-Xarch_i386', '-Wl,-framework,QuickTime'] env['LIBPATH'] += ['/usr/lib'] - env['LIBS'] = ['iconv'] env['LINKFLAGS'] += ccld env['LINKFLAGS'] += ['-Wl,-search_paths_first', '-Wl,-Z', '-F' + system] env['SHCCFLAGS'] = env['CCFLAGS'] # Get rid of the -fPIC added in gcc.py diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index bca9d8b252..4c074abcc4 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -96,7 +96,6 @@ bool DolphinApp::OnInit() // Declarations and definitions bool UseDebugger = false; - bool BatchMode = false; bool UseLogger = false; bool selectVideoPlugin = false; bool selectAudioPlugin = false; @@ -350,6 +349,9 @@ void DolphinApp::AfterInit(wxTimerEvent& WXUNUSED(event)) delete m_afterinit; m_afterinit = NULL; + if (!BatchMode) + main_frame->UpdateGameList(); + // First check if we have an exec command line. if (LoadFile && FileToLoad != wxEmptyString) { @@ -375,9 +377,6 @@ void DolphinApp::AfterInit(wxTimerEvent& WXUNUSED(event)) } } } - // No automatic start was requested; let the user make a selection. - else - main_frame->UpdateGameList(); } void DolphinApp::InitLanguageSupport() diff --git a/Source/Core/DolphinWX/Src/Main.h b/Source/Core/DolphinWX/Src/Main.h index ea44afac49..bffcaad86e 100644 --- a/Source/Core/DolphinWX/Src/Main.h +++ b/Source/Core/DolphinWX/Src/Main.h @@ -38,6 +38,7 @@ private: DECLARE_EVENT_TABLE() wxTimer *m_afterinit; + bool BatchMode; bool LoadFile; wxString FileToLoad; wxLocale *m_locale; diff --git a/Source/Core/DolphinWX/Src/SConscript b/Source/Core/DolphinWX/Src/SConscript index 8b9c2e05f0..595cf49fe9 100644 --- a/Source/Core/DolphinWX/Src/SConscript +++ b/Source/Core/DolphinWX/Src/SConscript @@ -61,6 +61,7 @@ if sys.platform == 'win32': files += [ "stdafx.cpp" ] elif sys.platform == 'darwin': ldflags += [ '-Wl,-pagezero_size,0x1000' ] + libs += [ 'iconv' ] exe = '#' + env['prefix'] + '/Dolphin.app/Contents/MacOS/Dolphin' if env['HAVE_WX']: diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp index 75c79772b1..f0a134dc5d 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp @@ -494,7 +494,7 @@ bool OpenGL_MakeCurrent() { // connect the glx-context to the window #if defined(USE_WX) && USE_WX - GLWin.glCanvas->SetCurrent(*GLWin.glCtxt); + return GLWin.glCanvas->SetCurrent(*GLWin.glCtxt); #elif defined(__APPLE__) [GLWin.cocoaCtx makeCurrentContext]; #elif defined(_WIN32) @@ -572,6 +572,7 @@ void OpenGL_Update() void OpenGL_Shutdown() { #if defined(USE_WX) && USE_WX + GLWin.glCanvas->Hide(); delete GLWin.glCtxt; #elif defined(__APPLE__) [GLWin.cocoaWin close]; diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp index d62ce2e630..d34ac78c16 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp @@ -296,7 +296,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _twidth, int _theight bool OpenGL_MakeCurrent() { #if defined(USE_WX) && USE_WX - GLWin.glCanvas->SetCurrent(*GLWin.glCtxt); + return GLWin.glCanvas->SetCurrent(*GLWin.glCtxt); #elif defined(_WIN32) return wglMakeCurrent(hDC,hRC) ? true : false; #elif defined(HAVE_X11) && HAVE_X11 @@ -383,6 +383,7 @@ void OpenGL_Update() void OpenGL_Shutdown() { #if defined(USE_WX) && USE_WX + GLWin.glCanvas->Hide(); delete GLWin.glCtxt; #elif defined(_WIN32) if (hRC) // Do We Have A Rendering Context?