diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp index 4a81a3cd24..1f746917d5 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp @@ -242,7 +242,7 @@ void CConfigMain::InitializeGUILists() arrayStringFor_WiiSensBarPos.Add(wxT("Top")); // Aspect ratio - arrayStringFor_WiiAspectRatio.Add(wxT("4:3")); + arrayStringFor_WiiAspectRatio.Add(wxT("4:3")); arrayStringFor_WiiAspectRatio.Add(wxT("16:9")); // Wii Language arrayStrings @@ -320,7 +320,7 @@ void CConfigMain::InitializeGUIValues() FillChoiceBox(GraphicSelection, PLUGIN_TYPE_VIDEO, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin); FillChoiceBox(DSPSelection, PLUGIN_TYPE_DSP, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin); for (int i = 0; i < MAXPADS; i++) - FillChoiceBox(PADSelection, PLUGIN_TYPE_PAD, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin[i]); + FillChoiceBox(PADSelection, PLUGIN_TYPE_PAD, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin[i]); for (int i=0; i < MAXWIIMOTES; i++) FillChoiceBox(WiimoteSelection, PLUGIN_TYPE_WIIMOTE, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin[i]); } @@ -439,10 +439,10 @@ void CConfigMain::CreateGUIControls() wxStaticText* FullscreenResolutionText = new wxStaticText(DisplayPage, wxID_ANY, wxT("Fullscreen Display Resolution:"), wxDefaultPosition, wxDefaultSize, 0); FullscreenResolution = new wxChoice(DisplayPage, ID_DISPLAY_FULLSCREENRES, wxDefaultPosition, wxDefaultSize, arrayStringFor_FullscreenResolution, 0, wxDefaultValidator, arrayStringFor_FullscreenResolution[0]); wxStaticText *WindowSizeText = new wxStaticText(DisplayPage, wxID_ANY, wxT("Window Size:"), wxDefaultPosition, wxDefaultSize, 0); - WindowWidth = new wxSpinCtrl(DisplayPage, ID_DISPLAY_WINDOWWIDTH, wxEmptyString, wxDefaultPosition, wxDefaultSize); + WindowWidth = new wxSpinCtrl(DisplayPage, ID_DISPLAY_WINDOWWIDTH, wxEmptyString, wxDefaultPosition, wxSize(70, -1)); WindowWidth->SetRange(0,3280); wxStaticText *WindowXText = new wxStaticText(DisplayPage, wxID_ANY, wxT("x"), wxDefaultPosition, wxDefaultSize, 0); - WindowHeight = new wxSpinCtrl(DisplayPage, ID_DISPLAY_WINDOWHEIGHT, wxEmptyString, wxDefaultPosition, wxDefaultSize); + WindowHeight = new wxSpinCtrl(DisplayPage, ID_DISPLAY_WINDOWHEIGHT, wxEmptyString, wxDefaultPosition, wxSize(70, -1)); WindowHeight->SetRange(0,2048); Fullscreen = new wxCheckBox(DisplayPage, ID_DISPLAY_FULLSCREEN, wxT("Start Renderer in Fullscreen"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); HideCursor = new wxCheckBox(DisplayPage, ID_DISPLAY_HIDECURSOR, wxT("Hide Mouse Cursor")); @@ -827,7 +827,7 @@ void CConfigMain::CoreSettingsChanged(wxCommandEvent& event) case ID_CPUENGINE: SConfig::GetInstance().m_LocalCoreStartupParameter.iCPUCore = CPUEngine->GetSelection(); if (main_frame->g_pCodeWindow) - main_frame->g_pCodeWindow->GetMenuBar()->Check(IDM_INTERPRETER, + main_frame->g_pCodeWindow->GetMenuBar()->Check(IDM_INTERPRETER, SConfig::GetInstance().m_LocalCoreStartupParameter.iCPUCore?false:true); break; case ID_DSPTHREAD: @@ -939,7 +939,7 @@ void CConfigMain::ChooseMemcardPath(std::string& strMemcard, bool isSlotA) std::string filename = std::string(wxFileSelector( wxT("Choose a file to open"), wxString::FromAscii(File::GetUserPath(D_GCUSER_IDX)), - isSlotA ? wxT(GC_MEMCARDA) : wxT(GC_MEMCARDB), + isSlotA ? wxT(GC_MEMCARDA) : wxT(GC_MEMCARDB), wxEmptyString, wxT("Gamecube Memory Cards (*.raw,*.gcp)|*.raw;*.gcp")).mb_str()); @@ -1161,8 +1161,8 @@ void CConfigMain::OnConfig(wxCommandEvent& event) CallConfig(DSPSelection); break; case ID_PAD_CONFIG: - CallConfig(PADSelection); - break; + CallConfig(PADSelection); + break; case ID_WIIMOTE_CONFIG: CallConfig(WiimoteSelection); break; @@ -1227,7 +1227,6 @@ bool CConfigMain::GetFilename(wxChoice* _pChoice, std::string& _rFilename) void CConfigMain::AddResolutions() { #ifdef _WIN32 - DWORD iModeNum = 0; DEVMODE dmi; ZeroMemory(&dmi, sizeof(dmi)); @@ -1247,40 +1246,46 @@ void CConfigMain::AddResolutions() } ZeroMemory(&dmi, sizeof(dmi)); } - #elif defined(HAVE_XRANDR) && HAVE_XRANDR - main_frame->m_XRRConfig->AddResolutions(arrayStringFor_FullscreenResolution); - #elif defined(__APPLE__) - - CGDisplayModeRef mode; - CFArrayRef array; - CFIndex n, i; - int w, h; + CFDictionaryRef mode; + CFArrayRef array; + CFIndex n, i; + int w, h; std::vector resos; - array = CGDisplayCopyAllDisplayModes(CGMainDisplayID(), NULL); - n = CFArrayGetCount(array); + array = CGDisplayAvailableModes(CGMainDisplayID()); + n = CFArrayGetCount(array); for (i = 0; i < n; i++) { - mode = (CGDisplayModeRef)CFArrayGetValueAtIndex(array, i); - w = CGDisplayModeGetWidth(mode); - h = CGDisplayModeGetHeight(mode); + mode = (CFDictionaryRef)CFArrayGetValueAtIndex(array, i); + + CFNumberRef anWidth = (CFNumberRef)CFDictionaryGetValue(mode, + kCGDisplayWidth); + if (NULL == anWidth || + !CFNumberGetValue(anWidth, kCFNumberIntType, &w)) + continue; + + CFNumberRef anHeight = + (CFNumberRef)CFDictionaryGetValue(mode, + kCGDisplayHeight); + if (NULL == anHeight || + !CFNumberGetValue(anHeight, kCFNumberIntType, &h)) + continue; char res[32]; sprintf(res,"%dx%d", w, h); std::string strRes(res); + // Only add unique resolutions - if (std::find(resos.begin(), resos.end(), strRes) == resos.end()) + if (std::find(resos.begin(), resos.end(), strRes) == + resos.end()) { resos.push_back(strRes); - arrayStringFor_FullscreenResolution.Add(wxString::FromAscii(res)); + arrayStringFor_FullscreenResolution.Add(strRes); } } - CFRelease(array); - #endif } - diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 64ce1a66ca..1623291dec 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -949,7 +949,7 @@ void CFrame::DoFullscreen(bool bF) { ToggleDisplayMode(bF); - m_RenderFrame->ShowFullScreen(bF); + m_RenderFrame->ShowFullScreen(bF, wxFULLSCREEN_ALL); if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain) { if (bF) diff --git a/Source/Core/DolphinWX/Src/HotkeyDlg.cpp b/Source/Core/DolphinWX/Src/HotkeyDlg.cpp index 20dfc20578..0770db0856 100644 --- a/Source/Core/DolphinWX/Src/HotkeyDlg.cpp +++ b/Source/Core/DolphinWX/Src/HotkeyDlg.cpp @@ -93,7 +93,8 @@ void HotkeyConfigDialog::OnKeyDown(wxKeyEvent& event) g_Modkey = event.GetModifiers(); // Don't allow modifier keys - if (g_Pressed == WXK_CONTROL || g_Pressed == WXK_ALT || g_Pressed == WXK_SHIFT) + if (g_Pressed == WXK_CONTROL || g_Pressed == WXK_ALT || + g_Pressed == WXK_SHIFT || g_Pressed == WXK_COMMAND) return; // Use the space key to set a blank key diff --git a/Source/Core/DolphinWX/Src/SConscript b/Source/Core/DolphinWX/Src/SConscript index d44a627552..4635822bbd 100644 --- a/Source/Core/DolphinWX/Src/SConscript +++ b/Source/Core/DolphinWX/Src/SConscript @@ -8,7 +8,6 @@ wxenv = env.Clone() files = [ 'BootManager.cpp', - 'cmdline.c', ] libs = [ @@ -49,6 +48,10 @@ if wxenv['HAVE_WX']: ], libs = [ 'debwx', 'debugger_ui_util'] + libs +else: + files+= [ + 'cmdline.c', + ] if sys.platform == 'darwin': files += [ 'cocoaApp.m', ] diff --git a/Source/Core/InputCommon/Src/WXInputBase.cpp b/Source/Core/InputCommon/Src/WXInputBase.cpp index 3d01ad08d0..8255ba94e7 100644 --- a/Source/Core/InputCommon/Src/WXInputBase.cpp +++ b/Source/Core/InputCommon/Src/WXInputBase.cpp @@ -31,6 +31,10 @@ const wxString WXKeyToString(int keycode) case WXK_SPACE: return wxT("Space"); case WXK_DELETE: return wxT("Delete"); + // Undocumented wx keycodes + case 167: return wxT("Paragraph"); + case 177: return wxT("Plus-Minus"); + case WXK_START: return wxT("Start"); case WXK_LBUTTON: return wxT("L Button"); case WXK_RBUTTON: return wxT("R Button"); @@ -142,9 +146,12 @@ const wxString WXKeymodToString(int modifier) switch (modifier) { case wxMOD_ALT: return wxT("Alt"); - case wxMOD_CMD: return wxT("Ctrl"); + case wxMOD_CONTROL: return wxT("Ctrl"); case wxMOD_ALTGR: return wxT("Ctrl+Alt"); case wxMOD_SHIFT: return wxT("Shift"); + // wxWidgets can only use Alt/Ctrl/Shift as menu accelerators, + // so Meta (Command on OS X) is simply made equivalent to Ctrl. + case wxMOD_META: return wxT("Ctrl"); default: return wxT(""); } } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/cocoaApp.h b/Source/Plugins/Plugin_VideoOGL/Src/cocoaApp.h deleted file mode 100644 index cdd2a70650..0000000000 --- a/Source/Plugins/Plugin_VideoOGL/Src/cocoaApp.h +++ /dev/null @@ -1,29 +0,0 @@ -#import -#import - -#ifdef __cplusplus -extern "C" -{ -#endif - - -void cocoaGLCreateApp(); - -NSWindow *cocoaGLCreateWindow(int w,int h); - -void cocoaGLSetTitle(NSWindow *win, const char *title); - -void cocoaGLMakeCurrent(NSOpenGLContext *ctx, NSWindow *win); - -NSOpenGLContext* cocoaGLInit(int mode); - -void cocoaGLDelete(NSOpenGLContext *ctx); - -void cocoaGLDeleteWindow(NSWindow *window); - -void cocoaGLSwap(NSOpenGLContext *ctx,NSWindow *window); - -#ifdef __cplusplus -} -#endif - diff --git a/Source/Plugins/Plugin_VideoOGL/Src/cocoaApp.m b/Source/Plugins/Plugin_VideoOGL/Src/cocoaApp.m deleted file mode 100755 index 6a821635e2..0000000000 --- a/Source/Plugins/Plugin_VideoOGL/Src/cocoaApp.m +++ /dev/null @@ -1,149 +0,0 @@ -#import "cocoaGL.h" - -NSWindow *cocoaGLCreateWindow(int w,int h) -{ - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSWindow *window; - window = [[NSWindow alloc] initWithContentRect:NSMakeRect(50,50,w,h) - styleMask:NSTitledWindowMask | NSResizableWindowMask - backing:NSBackingStoreBuffered - defer:FALSE]; - [window setReleasedWhenClosed: YES]; - - [window setTitle:@"Dolphin on OSX"]; - //[window makeKeyAndOrderFront: nil]; - - [pool release]; - - return window; -} - -void cocoaGLSetTitle(NSWindow *win, const char *title) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - [win setTitle: [[[NSString alloc] initWithCString: title encoding: NSASCIIStringEncoding] autorelease]]; - - [pool release]; -} - -void cocoaGLMakeCurrent(NSOpenGLContext *ctx, NSWindow *win) -{ - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - - int value = 0; - [ctx setValues:&value forParameter:NSOpenGLCPSwapInterval]; - - if (ctx) { - [ctx setView:[win contentView]]; - [ctx update]; - [ctx makeCurrentContext]; - } - else - [NSOpenGLContext clearCurrentContext]; - - [pool release]; -} - - - -NSOpenGLContext* cocoaGLInit(int mode) -{ - NSAutoreleasePool *pool; - - NSOpenGLPixelFormatAttribute attr[32]; - NSOpenGLPixelFormat *fmt; - NSOpenGLContext *context; - int i = 0; - - pool = [[NSAutoreleasePool alloc] init]; - - attr[i++] = NSOpenGLPFADepthSize; - attr[i++] = 24; - attr[i++] = NSOpenGLPFADoubleBuffer; - - attr[i++] = NSOpenGLPFASampleBuffers; - attr[i++] = mode; - attr[i++] = NSOpenGLPFASamples; - attr[i++] = 1; - - attr[i++] = NSOpenGLPFANoRecovery; -#ifdef GL_VERSION_1_3 - -#else -#ifdef GL_VERSION_1_2 -#warning "your card only supports ogl 1.2, dolphin will use software renderer" - //if opengl < 1.3 uncomment this twoo lines to use software renderer - attr[i++] = NSOpenGLPFARendererID; - attr[i++] = kCGLRendererGenericFloatID; -#endif -#endif - attr[i++] = NSOpenGLPFAScreenMask; - attr[i++] = CGDisplayIDToOpenGLDisplayMask(CGMainDisplayID()); - - attr[i] = 0; - - fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attr]; - if (fmt == nil) { - printf("failed to create pixel format\n"); - [pool release]; - return NULL; - } - - context = [[NSOpenGLContext alloc] initWithFormat:fmt shareContext:nil]; - - [fmt release]; - - if (context == nil) { - printf("failed to create context\n"); - [pool release]; - return NULL; - } - - [pool release]; - - return context; - -} - -void cocoaGLDelete(NSOpenGLContext *ctx) -{ - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - - [ctx clearDrawable]; - [ctx release]; - - [pool release]; - -} -void cocoaGLDeleteWindow(NSWindow *window) -{ - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - [window close]; - [pool release]; - - return; -} - -void cocoaGLSwap(NSOpenGLContext *ctx,NSWindow *window) -{ - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - [window makeKeyAndOrderFront: nil]; - - ctx = [NSOpenGLContext currentContext]; - if (ctx != nil) - [ctx flushBuffer]; - else - printf("bad cocoa gl ctx\n"); - - [pool release]; -}