From 4b50a9ec03e2ec8071027ff9099eee9ed8af082d Mon Sep 17 00:00:00 2001 From: nitsuja Date: Sat, 5 Sep 2009 04:19:56 +0000 Subject: [PATCH] win32: customizable gap color (white/gray/black) --- desmume/src/windows/main.cpp | 19 ++++++++++++++++++- desmume/src/windows/resource.h | 3 +++ desmume/src/windows/resources.rc | Bin 689324 -> 690884 bytes 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 28982130b..b620ddef7 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -249,6 +249,7 @@ void SetRotate(HWND hwnd, int rot); bool ForceRatio = true; bool SeparationBorderDrag = true; +int ScreenGapColor = 0xFFFFFF; float DefaultWidth; float DefaultHeight; float widthTradeOff; @@ -883,7 +884,7 @@ static void DD_DoDisplay() { //u32 color = gapColors[win_fw_config.fav_colour]; //u32 color_rev = (((color & 0xFF) << 16) | (color & 0xFF00) | ((color & 0xFF0000) >> 16)); - u32 color_rev = 0xFFFFFF; + u32 color_rev = (u32)ScreenGapColor; HDC dc; HBRUSH brush; @@ -1849,6 +1850,7 @@ int _main() video.screengap = GetPrivateProfileInt("Display", "ScreenGap", 0, IniName); SeparationBorderDrag = GetPrivateProfileBool("Display", "Window Split Border Drag", true, IniName); + ScreenGapColor = GetPrivateProfileInt("Display", "ScreenGapColor", 0xFFFFFF, IniName); FrameLimit = GetPrivateProfileBool("FrameLimit", "FrameLimit", true, IniName); CommonSettings.showGpu.main = GetPrivateProfileInt("Display", "MainGpu", 1, IniName) != 0; CommonSettings.showGpu.sub = GetPrivateProfileInt("Display", "SubGpu", 1, IniName) != 0; @@ -2971,6 +2973,9 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM MainWindow->checkMenu(IDM_SCREENSEP_NDSGAP, ((video.screengap==kGapNDS))); MainWindow->checkMenu(IDM_SCREENSEP_NDSGAP2, ((video.screengap==kGapNDS2))); MainWindow->checkMenu(IDM_SCREENSEP_DRAGEDIT, (SeparationBorderDrag)); + MainWindow->checkMenu(IDM_SCREENSEP_COLORWHITE, ((ScreenGapColor&0xFFFFFF) == 0xFFFFFF)); + MainWindow->checkMenu(IDM_SCREENSEP_COLORGRAY, ((ScreenGapColor&0xFFFFFF) == 0x7F7F7F)); + MainWindow->checkMenu(IDM_SCREENSEP_COLORBLACK, ((ScreenGapColor&0xFFFFFF) == 0x000000)); //Counters / Etc. MainWindow->checkMenu(ID_VIEW_FRAMECOUNTER,CommonSettings.hud.FrameCounterDisplay); @@ -3062,6 +3067,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM //Save frame counter status WritePrivateProfileInt("Display", "FrameCounter", CommonSettings.hud.FrameCounterDisplay, IniName); + WritePrivateProfileInt("Display", "ScreenGap", video.screengap, IniName); //Save Ram Watch information @@ -4049,6 +4055,17 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM SeparationBorderDrag = !SeparationBorderDrag; WritePrivateProfileInt("Display","Window Split Border Drag",(int)SeparationBorderDrag,IniName); break; + case IDM_SCREENSEP_COLORWHITE: + case IDM_SCREENSEP_COLORGRAY: + case IDM_SCREENSEP_COLORBLACK: + switch(LOWORD(wParam)) + { + case IDM_SCREENSEP_COLORWHITE: ScreenGapColor = 0xFFFFFF; break; + case IDM_SCREENSEP_COLORGRAY: ScreenGapColor = 0x7F7F7F; break; + case IDM_SCREENSEP_COLORBLACK: ScreenGapColor = 0x000000; break; + } + WritePrivateProfileInt("Display", "ScreenGapColor", ScreenGapColor, IniName); + break; case IDM_WEBSITE: ShellExecute(NULL, "open", "http://desmume.sourceforge.net", NULL, NULL, SW_SHOWNORMAL); return 0; diff --git a/desmume/src/windows/resource.h b/desmume/src/windows/resource.h index f45064860..29884cbf6 100644 --- a/desmume/src/windows/resource.h +++ b/desmume/src/windows/resource.h @@ -707,6 +707,9 @@ #define IDC_LANG_CHINESE_SIMPLIFIED 40020 #define IDM_SCREENSEP_NDSGAP2 40021 #define IDM_SCREENSEP_DRAGEDIT 40022 +#define IDM_SCREENSEP_COLORWHITE 40023 +#define IDM_SCREENSEP_COLORGRAY 40024 +#define IDM_SCREENSEP_COLORBLACK 40025 #define ID_FILE_RECENTROM 40034 #define IDC_SAVETYPE7 40037 #define IDM_DEFSIZE 40038 diff --git a/desmume/src/windows/resources.rc b/desmume/src/windows/resources.rc index bf00a1b1a90ddcc478af65fbe0e1ce38667a5d3c..21cdd34c02165d7ca0567843454bcda963c3c9b2 100644 GIT binary patch delta 601 zcmZ3}sdZ$k)&@P($qj5A(*?dTTYwmo3q(ZNYs-q7lo)g-HyX?HIy3k)_yBPbLpX!S zbVD;%X}Ge20=P1Mgfe%aQpf2Nzp{wK6<(YNS1627=ma#^k-?e4dpe^9r*m_RX?u(* zBM>ufk1=JAxrgGc=?XTSVytBhnG7k@3x!#f@i>dsouP=~DOeS5S6v7fW6cMuD*>y+ z>8S0`gjvMCqqqbdK;aA-K&O;U&lhG<#p4uqkW&&FDhW6S804Hz3^_oR$qd;z9W?o& zq;0zjH!Bdc0Wmueb8J`P=KQ3C;XbHoc?`*5(+IgRlc5;D3#TXWvx34alc5Nw^V)%t LxSi30Yqbvmp@NWU delta 98 zcmX>yRclSB)&@P(=@SH5q$U@Lh&10YYrkQ}2*ga=Z