diff --git a/desmume/src/windows/main.c b/desmume/src/windows/main.c index c4c80f6a1..bbd358fa6 100644 --- a/desmume/src/windows/main.c +++ b/desmume/src/windows/main.c @@ -196,6 +196,18 @@ void SetWindowClientSize(HWND hwnd, int cx, int cy) //found at: http://blogs.msd rcWindow.bottom - rcWindow.top, SWP_NOMOVE | SWP_NOZORDER); } + +void ScaleScreen(float factor) +{ + factor -= 1 ; + RECT fullSize,clientSize ; + GetWindowRect(hwnd,&fullSize) ; + GetClientRect(hwnd,&clientSize) ; + fullSize.right += (clientSize.right - clientSize.left) * factor ; + fullSize.bottom += (clientSize.bottom - clientSize.top) * factor ; + SetWindowPos(hwnd, NULL, 0, 0, fullSize.right - fullSize.left, + fullSize.bottom - fullSize.top, SWP_NOMOVE | SWP_NOZORDER); +} void translateXY(s32 *x, s32*y) { @@ -1328,6 +1340,13 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM CheckMenuItem(menu, IDC_ROTATE180, MF_BYCOMMAND | MF_UNCHECKED); CheckMenuItem(menu, IDC_ROTATE270, MF_BYCOMMAND | MF_CHECKED); return 0; + case IDC_MAGNIFY: + ScaleScreen(1.2f) ; /* 100-> 120% */ + break ; + case IDC_DEMAGNIFY: + ScaleScreen(0.833333f) ; /* 120 -> 100% (== 100->83.33%) */ + break ; + } return 0; default: /* for messages that we don't deal with */ diff --git a/desmume/src/windows/resource.h b/desmume/src/windows/resource.h index 0cb8200fc..acbe38c09 100644 --- a/desmume/src/windows/resource.h +++ b/desmume/src/windows/resource.h @@ -224,5 +224,7 @@ void refreshAll(); #define IDC_ROTATE90 1004 #define IDC_ROTATE180 1005 #define IDC_ROTATE270 1006 +#define IDC_MAGNIFY 1007 +#define IDC_DEMAGNIFY 1008 #endif diff --git a/desmume/src/windows/resources.rc b/desmume/src/windows/resources.rc index c33b1caba..6b3455325 100644 --- a/desmume/src/windows/resources.rc +++ b/desmume/src/windows/resources.rc @@ -48,6 +48,18 @@ MENU_PRINCIPAL MENU MENUITEM "&Pause", IDM_PAUSE MENUITEM "&Reset", IDM_RESET } + POPUP "&View" + { + POPUP "&Rotation" + { + MENUITEM " 0", IDC_ROTATE0 + MENUITEM " 90", IDC_ROTATE90 + MENUITEM "180", IDC_ROTATE180 + MENUITEM "270", IDC_ROTATE270 + } + MENUITEM "&Magnify", IDC_MAGNIFY + MENUITEM "&DeMagnify", IDC_DEMAGNIFY + } POPUP "&Outils" { MENUITEM "&Desassembleur", IDM_DISASSEMBLER @@ -335,6 +347,18 @@ MENU_PRINCIPAL MENU MENUITEM "&Pause", IDM_PAUSE MENUITEM "&Reset", IDM_RESET } + POPUP "&View" + { + POPUP "&Rotation" + { + MENUITEM " 0", IDC_ROTATE0 + MENUITEM " 90", IDC_ROTATE90 + MENUITEM "180", IDC_ROTATE180 + MENUITEM "270", IDC_ROTATE270 + } + MENUITEM "&Magnify", IDC_MAGNIFY + MENUITEM "&DeMagnify", IDC_DEMAGNIFY + } POPUP "&Config" { POPUP "&Save Type" @@ -346,13 +370,6 @@ MENU_PRINCIPAL MENU MENUITEM "FRAM 256kbit", IDC_SAVETYPE5 MENUITEM "FLASH 2mbit", IDC_SAVETYPE6 } - POPUP "&Rotation" - { - MENUITEM " 0", IDC_ROTATE0 - MENUITEM " 90", IDC_ROTATE90 - MENUITEM "180", IDC_ROTATE180 - MENUITEM "270", IDC_ROTATE270 - } MENUITEM "Control Config", IDM_CONFIG MENUITEM "Sound Settings", IDM_SOUNDSETTINGS POPUP "&Frame Skip"