diff --git a/trunk/VBA.vcproj b/trunk/VBA.vcproj index abcc5055..cb79a096 100644 --- a/trunk/VBA.vcproj +++ b/trunk/VBA.vcproj @@ -2112,6 +2112,10 @@ RelativePath=".\src\win32\SelectPlugin.h" > + + @@ -2268,7 +2272,7 @@ diff --git a/trunk/src/win32/Commands.cpp b/trunk/src/win32/Commands.cpp index f0362aaf..daa9f328 100644 --- a/trunk/src/win32/Commands.cpp +++ b/trunk/src/win32/Commands.cpp @@ -104,8 +104,8 @@ struct { { "OptionsVideoRenderDDRAW", ID_OPTIONS_VIDEO_RENDERMETHOD_DIRECTDRAW }, { "OptionsVideoRenderD3D", ID_OPTIONS_VIDEO_RENDERMETHOD_DIRECT3D }, { "OptionsVideoRenderOGL", ID_OPTIONS_VIDEO_RENDERMETHOD_OPENGL }, - { "OptionsVideoRenderSelectSkin", ID_OPTIONS_VIDEO_RENDEROPTIONS_SELECTSKIN }, - { "OptionsVideoRenderSkin", ID_OPTIONS_VIDEO_RENDEROPTIONS_SKIN }, + { "OptionsUserInterfaceSkinSelect", ID_SKIN_SELECT }, + { "OptionsUserInterfaceSkinUse", ID_SKIN_USE }, { "OptionsVideoVsync", ID_OPTIONS_VIDEO_VSYNC }, { "OptionsVideoX1", ID_OPTIONS_VIDEO_X1 }, { "OptionsVideoX2", ID_OPTIONS_VIDEO_X2 }, diff --git a/trunk/src/win32/MainWnd.cpp b/trunk/src/win32/MainWnd.cpp index a78f00cd..25218483 100644 --- a/trunk/src/win32/MainWnd.cpp +++ b/trunk/src/win32/MainWnd.cpp @@ -181,10 +181,6 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd) ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLPOLYGONS, OnOptionsVideoRenderoptionsGlpolygons) ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLPOLYGONS, OnUpdateOptionsVideoRenderoptionsGlpolygons) - ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_SELECTSKIN, OnOptionsVideoRenderoptionsSelectskin) - ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_SELECTSKIN, OnUpdateOptionsVideoRenderoptionsSelectskin) - ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_SKIN, OnOptionsVideoRenderoptionsSkin) - ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_SKIN, OnUpdateOptionsVideoRenderoptionsSkin) ON_WM_CONTEXTMENU() ON_COMMAND(ID_OPTIONS_EMULATOR_ASSOCIATE, OnOptionsEmulatorAssociate) ON_COMMAND(ID_OPTIONS_EMULATOR_DIRECTORIES, OnOptionsEmulatorDirectories) @@ -452,6 +448,10 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd) ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_SOUND_PCMINTERPOLATION_NONE, ID_OPTIONS_SOUND_PCMINTERPOLATION_LIBRESAMPLE, OnUpdateOptionsSoundPcminterpolation) ON_WM_SETFOCUS() ON_WM_KILLFOCUS() + ON_COMMAND(ID_SKIN_USE, &MainWnd::OnSkinUse) + ON_UPDATE_COMMAND_UI(ID_SKIN_USE, &MainWnd::OnUpdateSkinUse) + ON_COMMAND(ID_SKIN_SELECT, &MainWnd::OnSkinSelect) + ON_UPDATE_COMMAND_UI(ID_SKIN_SELECT, &MainWnd::OnUpdateSkinSelect) END_MESSAGE_MAP() @@ -1319,4 +1319,3 @@ LRESULT MainWnd::OnMySysCommand(WPARAM wParam, LPARAM lParam) } return Default(); } - diff --git a/trunk/src/win32/MainWnd.h b/trunk/src/win32/MainWnd.h index f04d7eeb..0f8ec83e 100644 --- a/trunk/src/win32/MainWnd.h +++ b/trunk/src/win32/MainWnd.h @@ -448,6 +448,10 @@ public: afx_msg void OnUpdateOptionsLinkRFU(CCmdUI* pCmdUI) ; afx_msg void OnOptionsLinkEnable() ; afx_msg void OnUpdateOptionsLinkEnable(CCmdUI* pCmdUI) ; + afx_msg void OnSkinUse(); + afx_msg void OnUpdateSkinUse(CCmdUI *pCmdUI); + afx_msg void OnSkinSelect(); + afx_msg void OnUpdateSkinSelect(CCmdUI *pCmdUI); }; ///////////////////////////////////////////////////////////////////////////// diff --git a/trunk/src/win32/MainWndOptions.cpp b/trunk/src/win32/MainWndOptions.cpp index 444b6310..2e706393 100644 --- a/trunk/src/win32/MainWndOptions.cpp +++ b/trunk/src/win32/MainWndOptions.cpp @@ -611,77 +611,11 @@ void MainWnd::OnOptionsVideoRenderoptionsGlpolygons() } } - void MainWnd::OnUpdateOptionsVideoRenderoptionsGlpolygons(CCmdUI* pCmdUI) { pCmdUI->SetCheck(theApp.glType == 2); } - -void MainWnd::OnOptionsVideoRenderoptionsSelectskin() -{ -#ifndef NOSKINS - LPCTSTR exts[] = {".ini" }; - CString filter = winLoadFilter(IDS_FILTER_INI); - CString title = winResLoadString(IDS_SELECT_SKIN_FILE); - - FileDlg dlg(this, - theApp.skinName, - filter, - 0, - "INI", - exts, - "", - title, - false); - - if(dlg.DoModal() == IDCANCEL) { - return; - } - - bool result = false; - if(!theApp.skinEnabled) { - theApp.skinEnabled = !theApp.skinEnabled; - regSetDwordValue("skinEnabled", theApp.skinEnabled); - } - - if(theApp.skin && theApp.skinEnabled) { - delete theApp.skin; - theApp.skin = NULL; - } - - theApp.skinName = dlg.GetPathName(); - - theApp.winUpdateSkin(); - theApp.winAccelMgr.UpdateMenu(theApp.menu); -#else - systemMessage( 0, _T("This build of VBA does not support skins!") ); -#endif -} - -void MainWnd::OnUpdateOptionsVideoRenderoptionsSelectskin(CCmdUI* pCmdUI) -{ - pCmdUI->Enable(theApp.display && theApp.display->isSkinSupported() && - theApp.videoOption <= VIDEO_4X); -} - -void MainWnd::OnOptionsVideoRenderoptionsSkin() -{ -#ifndef NOSKINS - theApp.skinEnabled = !theApp.skinEnabled; - theApp.updateRenderMethod(true); - theApp.winAccelMgr.UpdateMenu(theApp.menu); -#else - systemMessage( 0, _T("This build of VBA does not support skins!") ); -#endif -} - -void MainWnd::OnUpdateOptionsVideoRenderoptionsSkin(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck(theApp.skinEnabled); - pCmdUI->Enable(theApp.display && theApp.display->isSkinSupported() && theApp.videoOption <= VIDEO_4X); -} - void MainWnd::OnOptionsEmulatorAssociate() { theApp.winCheckFullscreen(); @@ -1965,3 +1899,75 @@ void MainWnd::OnOptionsSelectPlugin() theApp.updateFilter(); } } + +void MainWnd::OnSkinUse() +{ +#ifndef NOSKINS + theApp.skinEnabled = !theApp.skinEnabled; + theApp.updateRenderMethod(true); + theApp.winAccelMgr.UpdateMenu(theApp.menu); +#else + systemMessage( 0, _T("This build of VBA does not support skins!") ); +#endif +} + +void MainWnd::OnUpdateSkinUse(CCmdUI *pCmdUI) +{ +#ifndef NOSKINS + pCmdUI->SetCheck( theApp.skinEnabled ); + pCmdUI->Enable( theApp.display && theApp.display->isSkinSupported() && theApp.videoOption <= VIDEO_4X ); +#endif +} + +void MainWnd::OnSkinSelect() +{ +#ifndef NOSKINS + LPCTSTR exts[] = { ".ini" }; + CString filter = winLoadFilter( IDS_FILTER_INI ); + CString title = winResLoadString( IDS_SELECT_SKIN_FILE ); + + FileDlg dlg( + this, + theApp.skinName, + filter, + 0, + "INI", + exts, + "", + title, + false); + + if( dlg.DoModal() == IDCANCEL ) { + return; + } + + bool result = false; + if( !theApp.skinEnabled ) { + theApp.skinEnabled = !theApp.skinEnabled; + regSetDwordValue( "skinEnabled", theApp.skinEnabled ); + } + + if( theApp.skin && theApp.skinEnabled ) { + delete theApp.skin; + theApp.skin = NULL; + } + + theApp.skinName = dlg.GetPathName(); + + theApp.winUpdateSkin(); + theApp.winAccelMgr.UpdateMenu( theApp.menu ); +#else + systemMessage( 0, _T("This build of VBA does not support skins!") ); +#endif +} + +void MainWnd::OnUpdateSkinSelect(CCmdUI *pCmdUI) +{ +#ifndef NOSKINS + pCmdUI->Enable( + theApp.display && + theApp.display->isSkinSupported() && + theApp.videoOption <= VIDEO_4X + ); +#endif +} diff --git a/trunk/src/win32/VBA.h b/trunk/src/win32/VBA.h index 016e850d..2ba7f3d5 100644 --- a/trunk/src/win32/VBA.h +++ b/trunk/src/win32/VBA.h @@ -38,6 +38,8 @@ #include "../System.h" #include "../Util.h" +#include "skin.h" + ///////////////////////////////////////////////////////////////////////////// // VBA: // See VBA.cpp for the implementation of this class @@ -65,7 +67,7 @@ enum pixelFilterType #define REWIND_SIZE 400000 -class CSkin; +//class CSkin; class AVIWrite; class WavWriter; diff --git a/trunk/src/win32/VBA.rc b/trunk/src/win32/VBA.rc index fdee14d2..4ef0b873 100644 --- a/trunk/src/win32/VBA.rc +++ b/trunk/src/win32/VBA.rc @@ -1786,13 +1786,21 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Colors...", ID_OPTIONS_GAMEBOY_COLORS END - POPUP "&Language" + POPUP "&User Interface" BEGIN - MENUITEM "&System", ID_OPTIONS_LANGUAGE_SYSTEM - MENUITEM "&English", ID_OPTIONS_LANGUAGE_ENGLISH - MENUITEM "&Other...", ID_OPTIONS_LANGUAGE_OTHER + POPUP "&Language" + BEGIN + MENUITEM "&System", ID_OPTIONS_LANGUAGE_SYSTEM + MENUITEM "&English", ID_OPTIONS_LANGUAGE_ENGLISH + MENUITEM "&Other...", ID_OPTIONS_LANGUAGE_OTHER + END + POPUP "&Skin" + BEGIN + MENUITEM "&Use", ID_SKIN_USE + MENUITEM "&Select", ID_SKIN_SELECT + END END - POPUP "Li&nk" + POPUP "&Link" BEGIN MENUITEM "Enable GBA Linking", ID_OPTIONS_LINK_ENABLE MENUITEM "&Wireless Adapter", ID_OPTIONS_LINK_WIRELESSADAPTER diff --git a/trunk/src/win32/resource.h b/trunk/src/win32/resource.h index e075363d..a805a3ab 100644 --- a/trunk/src/win32/resource.h +++ b/trunk/src/win32/resource.h @@ -716,8 +716,6 @@ #define ID_OPTIONS_VIDEO_RENDEROPTIONS_GLBILINEAR 40238 #define ID_OPTIONS_VIDEO_RENDEROPTIONS_GLTRIANGLE 40239 #define ID_OPTIONS_VIDEO_RENDEROPTIONS_GLQUADS 40240 -#define ID_OPTIONS_VIDEO_RENDEROPTIONS_SELECTSKIN 40245 -#define ID_OPTIONS_VIDEO_RENDEROPTIONS_SKIN 40246 #define ID_OPTIONS_EMULATOR_AGBPRINT 40247 #define ID_OPTIONS_EMULATOR_REALTIMECLOCK 40248 #define ID_OPTIONS_GAMEBOY_SGB2 40249 @@ -798,6 +796,11 @@ #define ID_OPTIONS_LINK_ENABLE 40335 #define ID_RENDERAPI_VERTEX 40336 #define ID_OPTIONS_VIDEO_RENDEROPTIONS_GLPOLYGONS 40337 +#define ID_VIDEO_SKIN 40338 +#define ID_OPTIONS_UI 40339 +#define ID_USERINTERFACE_SKIN 40340 +#define ID_SKIN_USE 40341 +#define ID_SKIN_SELECT 40342 #define ID_OPTIONS_FILTER_PLUGIN 40343 #define ID_OPTIONS_SELECT_PLUGIN 40344 #define IDC_COMBO_PLUGIN 40345 @@ -807,7 +810,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 159 -#define _APS_NEXT_COMMAND_VALUE 40338 +#define _APS_NEXT_COMMAND_VALUE 40343 #define _APS_NEXT_CONTROL_VALUE 1269 #define _APS_NEXT_SYMED_VALUE 103 #endif