From b54420e5a74b443366d9c66dc5bcc0a92fadf12a Mon Sep 17 00:00:00 2001 From: p989 Date: Wed, 15 Jul 2009 18:41:29 +0000 Subject: [PATCH] win32: save and load filter settings --- desmume/src/windows/main.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index a9b70c417..1ebebe6b5 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -1303,9 +1303,6 @@ int _main() Desmume_InitOnce(); InitDecoder(); - video.height = 384; - video.width = 256; - #ifdef WX_STUB wxInitialize(); #endif @@ -1373,6 +1370,8 @@ int _main() ForceRatio = GetPrivateProfileInt("Video","Window Force Ratio", 1, IniName); WndX = GetPrivateProfileInt("Video","WindowPosX", CW_USEDEFAULT, IniName); WndY = GetPrivateProfileInt("Video","WindowPosY", CW_USEDEFAULT, IniName); + video.width = GetPrivateProfileInt("Video", "Width", 256, IniName); + video.height = GetPrivateProfileInt("Video", "Height", 384, IniName); CommonSettings.hud.FpsDisplay = GetPrivateProfileBool("Display","Display Fps", 0, IniName); CommonSettings.hud.FrameCounterDisplay = GetPrivateProfileBool("Display","FrameCounter", 0, IniName); @@ -1622,6 +1621,10 @@ int _main() CommonSettings.wifiBridgeAdapterNum = GetPrivateProfileInt("Wifi", "BridgeAdapter", 0, IniName); + video.currentfilter = GetPrivateProfileInt("Video", "Filter", video.NONE, IniName); + void FilterUpdate(HWND hwnd); + FilterUpdate(MainWindow->getHWnd()); + /* Read the firmware settings from the init file */ win_fw_config.fav_colour = GetPrivateProfileInt("Firmware","favColor", 10, IniName); win_fw_config.birth_month = GetPrivateProfileInt("Firmware","bMonth", 7, IniName); @@ -2369,6 +2372,9 @@ void FilterUpdate (HWND hwnd){ UpdateWndRects(hwnd); SetScreenGap(video.screengap); SetRotate(hwnd, video.rotation); + WritePrivateProfileInt("Video", "Filter", video.currentfilter, IniName); + WritePrivateProfileInt("Video", "Width", video.width, IniName); + WritePrivateProfileInt("Video", "Height", video.height, IniName); } //========================================================================================