From 176556dfd3dd65ce091115f11de1c265bfbf604c Mon Sep 17 00:00:00 2001 From: BearOso Date: Sun, 12 Mar 2023 11:09:10 -0500 Subject: [PATCH] Add menu items to scale windows up to 10x. --- gtk/src/gtk_s9xwindow.cpp | 2 +- gtk/src/snes9x.ui | 45 +++++++++++++++++++++++++++++++++++++++ win32/rsrc/resource.h | 28 ++++++++++++++---------- win32/rsrc/snes9x.rc | 6 ++++++ win32/wsnes9x.cpp | 6 ++++++ 5 files changed, 75 insertions(+), 12 deletions(-) diff --git a/gtk/src/gtk_s9xwindow.cpp b/gtk/src/gtk_s9xwindow.cpp index 95117de5..5b7216a5 100644 --- a/gtk/src/gtk_s9xwindow.cpp +++ b/gtk/src/gtk_s9xwindow.cpp @@ -258,7 +258,7 @@ void Snes9xWindow::connect_signals() toggle_ui(); }); - for (int i = 1; i <= 5; i++) + for (int i = 1; i <= 10; i++) { std::string name = "exact_pixels_" + std::to_string(i) + "x_item"; get_object(name.c_str())->signal_activate().connect([i, this] { diff --git a/gtk/src/snes9x.ui b/gtk/src/snes9x.ui index 5b179729..98acdc08 100644 --- a/gtk/src/snes9x.ui +++ b/gtk/src/snes9x.ui @@ -1793,6 +1793,51 @@ + + + True + False + _6x + True + + + + + + True + False + _7x + True + + + + + + True + False + _8x + True + + + + + + True + False + _9x + True + + + + + + True + False + 1_0x + True + + + diff --git a/win32/rsrc/resource.h b/win32/rsrc/resource.h index 3957bbcf..766b0501 100644 --- a/win32/rsrc/resource.h +++ b/win32/rsrc/resource.h @@ -528,16 +528,22 @@ #define ID_WINDOW_SIZE_2X 40170 #define ID_WINDOW_SIZE_3X 40171 #define ID_WINDOW_SIZE_4X 40172 -#define ID_DEBUG_APU_TRACE 40173 -#define ID_EMULATION_BACKGROUNDINPUT 40174 -#define ID_SAVEMEMPACK 40175 -#define ID_INPUT_BACKGROUNDKEYBOARDHOTKEYS 40176 -#define ID_INPUT_DETECTGAMEPADCHANGES 40177 -#define ID_EMULATION_HACKS 40178 -#define ID_FILE_LOAD_PREVIEW 40179 -#define ID_FILE_SAVE_PREVIEW 40180 -#define ID_FILE_SAVE_POPUP 40181 -#define ID_FILE_LOAD_POPUP 40182 +#define ID_WINDOW_SIZE_5X 40173 +#define ID_WINDOW_SIZE_6X 40174 +#define ID_WINDOW_SIZE_7X 40175 +#define ID_WINDOW_SIZE_8X 40176 +#define ID_WINDOW_SIZE_9X 40177 +#define ID_WINDOW_SIZE_10X 40178 +#define ID_DEBUG_APU_TRACE 40179 +#define ID_EMULATION_BACKGROUNDINPUT 40180 +#define ID_SAVEMEMPACK 40181 +#define ID_INPUT_BACKGROUNDKEYBOARDHOTKEYS 40182 +#define ID_INPUT_DETECTGAMEPADCHANGES 40183 +#define ID_EMULATION_HACKS 40184 +#define ID_FILE_LOAD_PREVIEW 40185 +#define ID_FILE_SAVE_PREVIEW 40186 +#define ID_FILE_SAVE_POPUP 40187 +#define ID_FILE_LOAD_POPUP 40188 #define ID_FILE_SAVE0 44000 #define ID_FILE_SAVE_LAST 44100 #define ID_FILE_LOAD0 44200 @@ -553,7 +559,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 169 -#define _APS_NEXT_COMMAND_VALUE 40181 +#define _APS_NEXT_COMMAND_VALUE 40189 #define _APS_NEXT_CONTROL_VALUE 3040 #define _APS_NEXT_SYMED_VALUE 101 #endif diff --git a/win32/rsrc/snes9x.rc b/win32/rsrc/snes9x.rc index f556ba52..dd22bb2f 100644 --- a/win32/rsrc/snes9x.rc +++ b/win32/rsrc/snes9x.rc @@ -1061,6 +1061,12 @@ BEGIN MENUITEM "&2x", ID_WINDOW_SIZE_2X,MFT_STRING,MFS_ENABLED MENUITEM "&3x", ID_WINDOW_SIZE_3X,MFT_STRING,MFS_ENABLED MENUITEM "&4x", ID_WINDOW_SIZE_4X,MFT_STRING,MFS_ENABLED + MENUITEM "&5x", ID_WINDOW_SIZE_5X,MFT_STRING,MFS_ENABLED + MENUITEM "&6x", ID_WINDOW_SIZE_6X,MFT_STRING,MFS_ENABLED + MENUITEM "&7x", ID_WINDOW_SIZE_7X,MFT_STRING,MFS_ENABLED + MENUITEM "&8x", ID_WINDOW_SIZE_8X,MFT_STRING,MFS_ENABLED + MENUITEM "&9x", ID_WINDOW_SIZE_9X,MFT_STRING,MFS_ENABLED + MENUITEM "1&0x", ID_WINDOW_SIZE_10X,MFT_STRING,MFS_ENABLED END MENUITEM MFT_SEPARATOR MENUITEM "&Stretch Image\tAlt+Backspace", ID_WINDOW_STRETCH,MFT_STRING,MFS_ENABLED diff --git a/win32/wsnes9x.cpp b/win32/wsnes9x.cpp index d3b1aaad..8238e949 100644 --- a/win32/wsnes9x.cpp +++ b/win32/wsnes9x.cpp @@ -2099,6 +2099,12 @@ LRESULT CALLBACK WinProc( case ID_WINDOW_SIZE_2X: case ID_WINDOW_SIZE_3X: case ID_WINDOW_SIZE_4X: + case ID_WINDOW_SIZE_5X: + case ID_WINDOW_SIZE_6X: + case ID_WINDOW_SIZE_7X: + case ID_WINDOW_SIZE_8X: + case ID_WINDOW_SIZE_9X: + case ID_WINDOW_SIZE_10X: UINT factor, newWidth, newHeight; RECT margins; factor = (wParam & 0xffff) - ID_WINDOW_SIZE_1X + 1;