readded skin support

(only DirectDraw supports it)
This commit is contained in:
spacy51 2007-12-01 13:42:24 +00:00
parent 1dcf48df2a
commit a3de34c1fe
8 changed files with 109 additions and 83 deletions

View File

@ -2112,6 +2112,10 @@
RelativePath=".\src\win32\SelectPlugin.h"
>
</File>
<File
RelativePath=".\src\win32\skin.h"
>
</File>
<File
RelativePath=".\src\win32\StringTokenizer.h"
>
@ -2268,7 +2272,7 @@
<Globals>
<Global
Name="RESOURCE_FILE"
Value="res\VBA.rc"
Value="src\win32\VBA.rc"
/>
</Globals>
</VisualStudioProject>

View File

@ -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 },

View File

@ -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();
}

View File

@ -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);
};
/////////////////////////////////////////////////////////////////////////////

View File

@ -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
}

View File

@ -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;

View File

@ -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

View File

@ -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