From 811d9a3c18aefa6befad7c98861e8f0abb035d46 Mon Sep 17 00:00:00 2001 From: SuuperW Date: Thu, 30 Aug 2018 11:01:57 -0500 Subject: [PATCH] (Windows) Move TwiddleLayer from main.cpp to display.cpp (prepare for new hotkeys) --- desmume/src/frontend/windows/display.cpp | 9 +++++++++ desmume/src/frontend/windows/display.h | 1 + desmume/src/frontend/windows/main.cpp | 10 ---------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/desmume/src/frontend/windows/display.cpp b/desmume/src/frontend/windows/display.cpp index 61021e197..a538bb336 100644 --- a/desmume/src/frontend/windows/display.cpp +++ b/desmume/src/frontend/windows/display.cpp @@ -959,3 +959,12 @@ void _ServiceDisplayThreadInvocation() display_invoke_function = NULL; SetEvent(display_invoke_done_event); } + +void TwiddleLayer(UINT ctlid, int core, int layer) +{ + GPUEngineBase *gpu = ((GPUEngineID)core == GPUEngineID_Main) ? (GPUEngineBase *)GPU->GetEngineMain() : (GPUEngineBase *)GPU->GetEngineSub(); + + const bool newLayerState = !CommonSettings.dispLayers[core][layer]; + gpu->SetLayerEnableState(layer, newLayerState); + MainWindow->checkMenu(ctlid, newLayerState); +} diff --git a/desmume/src/frontend/windows/display.h b/desmume/src/frontend/windows/display.h index e43c801fa..ea3662bf5 100644 --- a/desmume/src/frontend/windows/display.h +++ b/desmume/src/frontend/windows/display.h @@ -104,5 +104,6 @@ FORCEINLINE void ServiceDisplayThreadInvocations() } void UpdateWndRects(HWND hwnd, RECT* newClientRect = NULL); +void TwiddleLayer(UINT ctlid, int core, int layer); #endif \ No newline at end of file diff --git a/desmume/src/frontend/windows/main.cpp b/desmume/src/frontend/windows/main.cpp index ff735a4f9..e96a9358e 100755 --- a/desmume/src/frontend/windows/main.cpp +++ b/desmume/src/frontend/windows/main.cpp @@ -3500,16 +3500,6 @@ void SaveWindowPos(HWND hwnd) WritePrivateProfileInt("Video", "WindowPosY", WndY/*MainWindowRect.top*/, IniName); } - -static void TwiddleLayer(UINT ctlid, int core, int layer) -{ - GPUEngineBase *gpu = ((GPUEngineID)core == GPUEngineID_Main) ? (GPUEngineBase *)GPU->GetEngineMain() : (GPUEngineBase *)GPU->GetEngineSub(); - - const bool newLayerState = !CommonSettings.dispLayers[core][layer]; - gpu->SetLayerEnableState(layer, newLayerState); - MainWindow->checkMenu(ctlid, newLayerState); -} - //======================================================================================== LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {