win32: change define name, keep ifdefs to minimum, keep enum values

This commit is contained in:
OV2 2017-04-17 13:45:43 +02:00
parent 73c5e5623a
commit f815f25a00
7 changed files with 155 additions and 156 deletions

View File

@ -187,7 +187,7 @@
Nintendo Co., Limited and its subsidiary companies.
***********************************************************************************/
#if DIRECTDRAW_DEFINED
#if DIRECTDRAW_SUPPORT
// CDirectDraw.cpp: implementation of the CDirectDraw class.
//

View File

@ -203,7 +203,7 @@
#pragma once
#endif // _MSC_VER >= 1000
#if DIRECTDRAW_DEFINED
#if DIRECTDRAW_SUPPORT
class CDirectDraw: public IS9xDisplayOutput
{

View File

@ -17,7 +17,7 @@
#include <algorithm>
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
#if DIRECTDRAW_DEFINED
#if DIRECTDRAW_SUPPORT
#include <ddraw.h>
#endif
#include <d3d9.h>
@ -3014,7 +3014,7 @@ const WCHAR* WINAPI DXGetErrorStringW( _In_ HRESULT hr )
// -------------------------------------------------------------
// ddraw.h error codes
// -------------------------------------------------------------
#if DIRECTDRAW_DEFINED
#if DIRECTDRAW_SUPPORT
CHK_ERRA(DDERR_ALREADYINITIALIZED)
CHK_ERRA(DDERR_CANNOTATTACHSURFACE)
CHK_ERRA(DDERR_CANNOTDETACHSURFACE)
@ -6396,7 +6396,7 @@ const char* WINAPI DXGetErrorStringA(_In_ HRESULT hr)
CHK_ERR_WIN32A(ERROR_IPSEC_IKE_NEG_STATUS_END)
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
#if DIRECTDRAW_DEFINED
#if DIRECTDRAW_SUPPORT
// -------------------------------------------------------------
// ddraw.h error codes
// -------------------------------------------------------------
@ -6864,7 +6864,7 @@ void WINAPI DXGetErrorDescriptionW( _In_ HRESULT hr, _Out_cap_(count) WCHAR* des
// Commmented out codes are actually alises for other codes
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
#if DIRECTDRAW_DEFINED
#if DIRECTDRAW_SUPPORT
// -------------------------------------------------------------
// ddraw.h error codes
// -------------------------------------------------------------
@ -7387,7 +7387,7 @@ void WINAPI DXGetErrorDescriptionA(_In_ HRESULT hr, _Out_cap_(count) char* desc,
// Commmented out codes are actually alises for other codes
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
#if DIRECTDRAW_DEFINED
#if DIRECTDRAW_SUPPORT
// -------------------------------------------------------------
// ddraw.h error codes
// -------------------------------------------------------------

View File

@ -887,11 +887,7 @@ void WinRegisterConfigItems()
AddBoolC("DisplayFrameCount", Settings.DisplayMovieFrame, true, "true to show the frame count when a movie is playing");
#undef CATEGORY
#define CATEGORY "Display\\Win"
#if DIRECTDRAW_DEFINED
AddUIntC("OutputMethod", GUI.outputMethod, 1, "0=DirectDraw, 1=Direct3D, 2=OpenGL");
#else
AddUIntC("OutputMethod", GUI.outputMethod, 1, "0=Direct3D, 1=OpenGL");
#endif
AddUIntC("FilterType", GUI.Scale, 0, filterString);
AddUIntC("FilterHiRes", GUI.ScaleHiRes, 0, filterString2);
AddBoolC("BlendHiRes", GUI.BlendHiRes, true, "true to horizontally blend Hi-Res images (better transparency effect on filters that do not account for this)");
@ -910,9 +906,7 @@ void WinRegisterConfigItems()
AddBoolC("Stretch:MaintainAspectRatio", GUI.AspectRatio, true, "prevents stretching from changing the aspect ratio");
AddUIntC("Stretch:AspectRatioBaseWidth", GUI.AspectWidth, 256, "base width for aspect ratio calculation (AR=AspectRatioBaseWidth/224), default is 256 - set to 299 for 4:3 aspect ratio");
AddBoolC("Stretch:BilinearFilter", GUI.BilinearFilter, true, "allows bilinear filtering of stretching. Depending on your video card and the window size, this may result in a lower framerate.");
#if DIRECTDRAW_DEFINED
AddBoolC("Stretch:LocalVidMem", GUI.LocalVidMem, true, "determines the location of video memory in DirectDraw mode. May increase or decrease rendering performance, depending on your setup and which filter and stretching options are active.");
#endif
AddBool("Fullscreen:Enabled", GUI.FullScreen, false);
AddUInt("Fullscreen:Width", GUI.FullscreenMode.width, 640);
AddUInt("Fullscreen:Height", GUI.FullscreenMode.height, 480);

View File

@ -198,7 +198,7 @@
#include "wsnes9x.h"
#include "win32_display.h"
#include "CDirect3D.h"
#if DIRECTDRAW_DEFINED
#if DIRECTDRAW_SUPPORT
#include "CDirectDraw.h"
#endif
#include "COpenGL.h"
@ -209,7 +209,7 @@
// available display output methods
CDirect3D Direct3D;
#if DIRECTDRAW_DEFINED
#if DIRECTDRAW_SUPPORT
CDirectDraw DirectDraw;
#endif
COpenGL OpenGL;
@ -262,7 +262,7 @@ bool WinDisplayReset(void)
case DIRECT3D:
S9xDisplayOutput = &Direct3D;
break;
#if DIRECTDRAW_DEFINED
#if DIRECTDRAW_SUPPORT
case DIRECTDRAW:
S9xDisplayOutput = &DirectDraw;
break;
@ -481,7 +481,7 @@ void ReduceToPath(TCHAR *filename)
/* DirectDraw only begin */
void SwitchToGDI()
{
#if DIRECTDRAW_DEFINED
#if DIRECTDRAW_SUPPORT
if(GUI.outputMethod!=DIRECTDRAW)
return;
@ -494,7 +494,7 @@ void SwitchToGDI()
static void ClearSurface (LPDIRECTDRAWSURFACE2 lpDDSurface)
{
#if DIRECTDRAW_DEFINED
#if DIRECTDRAW_SUPPORT
DDBLTFX fx;
memset (&fx, 0, sizeof (fx));
@ -507,7 +507,7 @@ static void ClearSurface (LPDIRECTDRAWSURFACE2 lpDDSurface)
void UpdateBackBuffer()
{
#if DIRECTDRAW_DEFINED
#if DIRECTDRAW_SUPPORT
if (GUI.outputMethod==DIRECTDRAW && GUI.FullScreen)
{
SwitchToGDI();
@ -550,7 +550,7 @@ void UpdateBackBuffer()
void RestoreGUIDisplay ()
{
#if DIRECTDRAW_DEFINED
#if DIRECTDRAW_SUPPORT
if(GUI.outputMethod!=DIRECTDRAW)
return;
@ -571,7 +571,7 @@ void RestoreGUIDisplay ()
void RestoreSNESDisplay ()
{
#if DIRECTDRAW_DEFINED
#if DIRECTDRAW_SUPPORT
if(GUI.outputMethod!=DIRECTDRAW)
return;

View File

@ -609,9 +609,7 @@ static uint32 FrameTimings[] = {
struct sLanguages Languages[] = {
{ IDR_MENU_US,
TEXT("Failed to initialize currently selected display output!\n Try switching to a different output method in the display settings."),
#if DIRECTDRAW_DEFINED
TEXT("DirectDraw failed to set the selected display mode!"),
#endif
TEXT("DirectSound failed to initialize; no sound will be played."),
TEXT("These settings won't take effect until you restart the emulator."),
TEXT("The frame timer failed to initialize, please do NOT select the automatic framerate option or Snes9X will crash!")}
@ -1389,9 +1387,7 @@ int HandleKeyMessage(WPARAM wParam, LPARAM lParam)
{
case VK_ESCAPE:
if(
#if DIRECTDRAW_DEFINED
GUI.outputMethod!=DIRECTDRAW &&
#endif
GUI.FullScreen && !GUI.EmulateFullscreen)
ToggleFullScreen();
else
@ -7228,146 +7224,162 @@ INT_PTR CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
case WM_INITDIALOG:
WinRefreshDisplay();
{
WinRefreshDisplay();
CreateToolTip(IDC_EMUFULLSCREEN,hDlg,TEXT("Emulate fullscreen by creating a window that spans the entire screen when going fullscreen"));
CreateToolTip(IDC_AUTOFRAME,hDlg,TEXT("Try to achieve 50/60 fps by limiting the speed and skipping at most 'max skipped frames'"));
CreateToolTip(IDC_MAXSKIP,hDlg,TEXT("Try to achieve 50/60 fps by limiting the speed and skipping at most 'max skipped frames'"));
CreateToolTip(IDC_FIXEDSKIP,hDlg,TEXT("Always skip a fixed number of frames - no speed limit"));
CreateToolTip(IDC_SKIPCOUNT,hDlg,TEXT("Always skip a fixed number of frames - no speed limit"));
CreateToolTip(IDC_HIRES,hDlg,TEXT("Support the hi-res mode that a few games use, otherwise render them in low-res"));
CreateToolTip(IDC_HEIGHT_EXTEND,hDlg,TEXT("Display an extra 15 pixels at the bottom, which few games use. Also increases AVI output size from 256x224 to 256x240"));
CreateToolTip(IDC_MESSAGES_IN_IMAGE,hDlg,TEXT("Draw text inside the SNES image (will get into AVIs, screenshots, and filters)"));
CreateToolTip(IDC_EMUFULLSCREEN, hDlg, TEXT("Emulate fullscreen by creating a window that spans the entire screen when going fullscreen"));
CreateToolTip(IDC_AUTOFRAME, hDlg, TEXT("Try to achieve 50/60 fps by limiting the speed and skipping at most 'max skipped frames'"));
CreateToolTip(IDC_MAXSKIP, hDlg, TEXT("Try to achieve 50/60 fps by limiting the speed and skipping at most 'max skipped frames'"));
CreateToolTip(IDC_FIXEDSKIP, hDlg, TEXT("Always skip a fixed number of frames - no speed limit"));
CreateToolTip(IDC_SKIPCOUNT, hDlg, TEXT("Always skip a fixed number of frames - no speed limit"));
CreateToolTip(IDC_HIRES, hDlg, TEXT("Support the hi-res mode that a few games use, otherwise render them in low-res"));
CreateToolTip(IDC_HEIGHT_EXTEND, hDlg, TEXT("Display an extra 15 pixels at the bottom, which few games use. Also increases AVI output size from 256x224 to 256x240"));
CreateToolTip(IDC_MESSAGES_IN_IMAGE, hDlg, TEXT("Draw text inside the SNES image (will get into AVIs, screenshots, and filters)"));
prevOutputMethod = GUI.outputMethod;
prevScale = GUI.Scale;
prevScaleHiRes = GUI.ScaleHiRes;
prevPPL = GFX.RealPPL;
prevStretch = GUI.Stretch;
prevBilinearFilter = GUI.BilinearFilter;
prevAspectRatio = GUI.AspectRatio;
prevAspectWidth = GUI.AspectWidth;
prevHeightExtend = GUI.HeightExtend;
prevAutoDisplayMessages = Settings.AutoDisplayMessages != 0;
prevShaderEnabled = GUI.shaderEnabled;
prevBlendHires = GUI.BlendHiRes;
lstrcpy(prevD3DShaderFile,GUI.D3DshaderFileName);
lstrcpy(prevOGLShaderFile,GUI.OGLshaderFileName);
prevOutputMethod = GUI.outputMethod;
prevScale = GUI.Scale;
prevScaleHiRes = GUI.ScaleHiRes;
prevPPL = GFX.RealPPL;
prevStretch = GUI.Stretch;
prevBilinearFilter = GUI.BilinearFilter;
prevAspectRatio = GUI.AspectRatio;
prevAspectWidth = GUI.AspectWidth;
prevHeightExtend = GUI.HeightExtend;
prevAutoDisplayMessages = Settings.AutoDisplayMessages != 0;
prevShaderEnabled = GUI.shaderEnabled;
prevBlendHires = GUI.BlendHiRes;
lstrcpy(prevD3DShaderFile, GUI.D3DshaderFileName);
lstrcpy(prevOGLShaderFile, GUI.OGLshaderFileName);
_stprintf(s,TEXT("Current: %dx%d %dbit %dHz"),GUI.FullscreenMode.width,GUI.FullscreenMode.height,GUI.FullscreenMode.depth,GUI.FullscreenMode.rate);
SendDlgItemMessage(hDlg,IDC_CURRMODE,WM_SETTEXT,0,(LPARAM)s);
_stprintf(s, TEXT("Current: %dx%d %dbit %dHz"), GUI.FullscreenMode.width, GUI.FullscreenMode.height, GUI.FullscreenMode.depth, GUI.FullscreenMode.rate);
SendDlgItemMessage(hDlg, IDC_CURRMODE, WM_SETTEXT, 0, (LPARAM)s);
if(GUI.DoubleBuffered)
SendDlgItemMessage(hDlg, IDC_DBLBUFFER, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if(GUI.Vsync)
SendDlgItemMessage(hDlg, IDC_VSYNC, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
SendDlgItemMessage(hDlg,IDC_FRAMERATESKIPSLIDER,TBM_SETRANGE,(WPARAM)true,(LPARAM)MAKELONG(0,9));
if(Settings.SkipFrames!=AUTO_FRAMERATE)
SendDlgItemMessage(hDlg,IDC_FRAMERATESKIPSLIDER,TBM_SETPOS,(WPARAM)true,(LPARAM)Settings.SkipFrames);
EnableWindow(GetDlgItem(hDlg, IDC_TRANS), TRUE);
if(Settings.Transparency)
SendDlgItemMessage(hDlg, IDC_TRANS, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if (GUI.DoubleBuffered)
SendDlgItemMessage(hDlg, IDC_DBLBUFFER, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if (GUI.Vsync)
SendDlgItemMessage(hDlg, IDC_VSYNC, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
SendDlgItemMessage(hDlg, IDC_FRAMERATESKIPSLIDER, TBM_SETRANGE, (WPARAM)true, (LPARAM)MAKELONG(0, 9));
if (Settings.SkipFrames != AUTO_FRAMERATE)
SendDlgItemMessage(hDlg, IDC_FRAMERATESKIPSLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)Settings.SkipFrames);
EnableWindow(GetDlgItem(hDlg, IDC_TRANS), TRUE);
if (Settings.Transparency)
SendDlgItemMessage(hDlg, IDC_TRANS, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if(Settings.SupportHiRes)
SendDlgItemMessage(hDlg, IDC_HIRES, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if(GUI.BlendHiRes)
SendDlgItemMessage(hDlg, IDC_HIRESBLEND, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if(GUI.HeightExtend)
SendDlgItemMessage(hDlg, IDC_HEIGHT_EXTEND, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if(Settings.AutoDisplayMessages)
SendDlgItemMessage(hDlg, IDC_MESSAGES_IN_IMAGE, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if(Settings.SkipFrames==AUTO_FRAMERATE)
SendDlgItemMessage(hDlg, IDC_AUTOFRAME, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if(GUI.Stretch)
{
SendDlgItemMessage(hDlg, IDC_STRETCH, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
}
if (Settings.SupportHiRes)
SendDlgItemMessage(hDlg, IDC_HIRES, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if (GUI.BlendHiRes)
SendDlgItemMessage(hDlg, IDC_HIRESBLEND, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if (GUI.HeightExtend)
SendDlgItemMessage(hDlg, IDC_HEIGHT_EXTEND, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if (Settings.AutoDisplayMessages)
SendDlgItemMessage(hDlg, IDC_MESSAGES_IN_IMAGE, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if (Settings.SkipFrames == AUTO_FRAMERATE)
SendDlgItemMessage(hDlg, IDC_AUTOFRAME, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if (GUI.Stretch)
{
SendDlgItemMessage(hDlg, IDC_STRETCH, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
}
if(GUI.AspectRatio)
SendDlgItemMessage(hDlg, IDC_ASPECT, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
SendDlgItemMessage(hDlg,IDC_ASPECTDROP,CB_ADDSTRING,0,(LPARAM)TEXT("8:7"));
SendDlgItemMessage(hDlg,IDC_ASPECTDROP,CB_ADDSTRING,0,(LPARAM)TEXT("4:3"));
switch(GUI.AspectWidth) {
case 256:
SendDlgItemMessage(hDlg,IDC_ASPECTDROP,CB_SETCURSEL,(WPARAM)0,0);
break;
case 299:
SendDlgItemMessage(hDlg,IDC_ASPECTDROP,CB_SETCURSEL,(WPARAM)1,0);
break;
default:
SendDlgItemMessage(hDlg,IDC_ASPECTDROP,CB_ADDSTRING,0,(LPARAM)TEXT("Custom"));
SendDlgItemMessage(hDlg,IDC_ASPECTDROP,CB_SETCURSEL,(WPARAM)2,0);
break;
}
if (GUI.AspectRatio)
SendDlgItemMessage(hDlg, IDC_ASPECT, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
SendDlgItemMessage(hDlg, IDC_ASPECTDROP, CB_ADDSTRING, 0, (LPARAM)TEXT("8:7"));
SendDlgItemMessage(hDlg, IDC_ASPECTDROP, CB_ADDSTRING, 0, (LPARAM)TEXT("4:3"));
switch (GUI.AspectWidth) {
case 256:
SendDlgItemMessage(hDlg, IDC_ASPECTDROP, CB_SETCURSEL, (WPARAM)0, 0);
break;
case 299:
SendDlgItemMessage(hDlg, IDC_ASPECTDROP, CB_SETCURSEL, (WPARAM)1, 0);
break;
default:
SendDlgItemMessage(hDlg, IDC_ASPECTDROP, CB_ADDSTRING, 0, (LPARAM)TEXT("Custom"));
SendDlgItemMessage(hDlg, IDC_ASPECTDROP, CB_SETCURSEL, (WPARAM)2, 0);
break;
}
if(GUI.FullScreen || GUI.EmulatedFullscreen)
SendDlgItemMessage(hDlg, IDC_FULLSCREEN, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if(GUI.EmulateFullscreen)
SendDlgItemMessage(hDlg, IDC_EMUFULLSCREEN, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if(GUI.BilinearFilter)
SendDlgItemMessage(hDlg,IDC_BILINEAR, BM_SETCHECK, (WPARAM)BST_CHECKED,0);
if(Settings.DisplayFrameRate)
SendDlgItemMessage(hDlg, IDC_SHOWFPS, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if (GUI.FullScreen || GUI.EmulatedFullscreen)
SendDlgItemMessage(hDlg, IDC_FULLSCREEN, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if (GUI.EmulateFullscreen)
SendDlgItemMessage(hDlg, IDC_EMUFULLSCREEN, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if (GUI.BilinearFilter)
SendDlgItemMessage(hDlg, IDC_BILINEAR, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if (Settings.DisplayFrameRate)
SendDlgItemMessage(hDlg, IDC_SHOWFPS, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if(Settings.SkipFrames==AUTO_FRAMERATE) {
SendDlgItemMessage(hDlg, IDC_AUTOFRAME, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
EnableWindow(GetDlgItem(hDlg, IDC_SKIPCOUNT),FALSE);
} else {
SendDlgItemMessage(hDlg, IDC_FIXEDSKIP, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
EnableWindow(GetDlgItem(hDlg, IDC_MAXSKIP),FALSE);
}
SendDlgItemMessage(hDlg, IDC_SPIN_MAX_SKIP_DISP, UDM_SETRANGE, 0, MAKELPARAM((short)59, (short)0));
SendDlgItemMessage(hDlg, IDC_SPIN_MAX_SKIP_DISP, UDM_SETPOS,0, Settings.AutoMaxSkipFrames);
SendDlgItemMessage(hDlg, IDC_SPIN_MAX_SKIP_DISP_FIXED, UDM_SETRANGE, 0, MAKELPARAM((short)59, (short)0));
SendDlgItemMessage(hDlg, IDC_SPIN_MAX_SKIP_DISP_FIXED, UDM_SETPOS,0, Settings.SkipFrames==AUTO_FRAMERATE?0:Settings.SkipFrames);
if (Settings.SkipFrames == AUTO_FRAMERATE) {
SendDlgItemMessage(hDlg, IDC_AUTOFRAME, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
EnableWindow(GetDlgItem(hDlg, IDC_SKIPCOUNT), FALSE);
}
else {
SendDlgItemMessage(hDlg, IDC_FIXEDSKIP, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
EnableWindow(GetDlgItem(hDlg, IDC_MAXSKIP), FALSE);
}
SendDlgItemMessage(hDlg, IDC_SPIN_MAX_SKIP_DISP, UDM_SETRANGE, 0, MAKELPARAM((short)59, (short)0));
SendDlgItemMessage(hDlg, IDC_SPIN_MAX_SKIP_DISP, UDM_SETPOS, 0, Settings.AutoMaxSkipFrames);
SendDlgItemMessage(hDlg, IDC_SPIN_MAX_SKIP_DISP_FIXED, UDM_SETRANGE, 0, MAKELPARAM((short)59, (short)0));
SendDlgItemMessage(hDlg, IDC_SPIN_MAX_SKIP_DISP_FIXED, UDM_SETPOS, 0, Settings.SkipFrames == AUTO_FRAMERATE ? 0 : Settings.SkipFrames);
if(GUI.shaderEnabled) {
SendDlgItemMessage(hDlg, IDC_SHADER_ENABLED, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
EnableWindow(GetDlgItem(hDlg, IDC_SHADER_HLSL_FILE),TRUE);
EnableWindow(GetDlgItem(hDlg, IDC_SHADER_HLSL_BROWSE),TRUE);
EnableWindow(GetDlgItem(hDlg, IDC_SHADER_GLSL_FILE),TRUE);
EnableWindow(GetDlgItem(hDlg, IDC_SHADER_GLSL_BROWSE),TRUE);
}
SetDlgItemText(hDlg,IDC_SHADER_HLSL_FILE,GUI.D3DshaderFileName);
SetDlgItemText(hDlg,IDC_SHADER_GLSL_FILE,GUI.OGLshaderFileName);
if (GUI.shaderEnabled) {
SendDlgItemMessage(hDlg, IDC_SHADER_ENABLED, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
EnableWindow(GetDlgItem(hDlg, IDC_SHADER_HLSL_FILE), TRUE);
EnableWindow(GetDlgItem(hDlg, IDC_SHADER_HLSL_BROWSE), TRUE);
EnableWindow(GetDlgItem(hDlg, IDC_SHADER_GLSL_FILE), TRUE);
EnableWindow(GetDlgItem(hDlg, IDC_SHADER_GLSL_BROWSE), TRUE);
}
SetDlgItemText(hDlg, IDC_SHADER_HLSL_FILE, GUI.D3DshaderFileName);
SetDlgItemText(hDlg, IDC_SHADER_GLSL_FILE, GUI.OGLshaderFileName);
lpfnOldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hDlg,IDC_SHADER_GROUP),GWLP_WNDPROC,(LONG_PTR)GroupBoxCheckBoxTitle);
lpfnOldWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hDlg, IDC_SHADER_GROUP), GWLP_WNDPROC, (LONG_PTR)GroupBoxCheckBoxTitle);
EnableWindow(GetDlgItem(hDlg, IDC_ASPECT), GUI.Stretch);
EnableWindow(GetDlgItem(hDlg, IDC_ASPECT), GUI.Stretch);
#if DIRECTDRAW_DEFINED
SendDlgItemMessage(hDlg,IDC_OUTPUTMETHOD,CB_ADDSTRING,0,(LPARAM)TEXT("DirectDraw"));
// add output method to droplist with itemdata set to their enum value
int inserted_index = -1;
#if DIRECTDRAW_SUPPORT
inserted_index = SendDlgItemMessage(hDlg, IDC_OUTPUTMETHOD, CB_ADDSTRING, 0, (LPARAM)TEXT("DirectDraw"));
SendDlgItemMessage(hDlg, IDC_OUTPUTMETHOD, CB_SETITEMDATA, inserted_index, DIRECTDRAW);
#endif
SendDlgItemMessage(hDlg,IDC_OUTPUTMETHOD,CB_ADDSTRING,0,(LPARAM)TEXT("Direct3D"));
SendDlgItemMessage(hDlg,IDC_OUTPUTMETHOD,CB_ADDSTRING,0,(LPARAM)TEXT("OpenGL"));
SendDlgItemMessage(hDlg,IDC_OUTPUTMETHOD,CB_SETCURSEL,(WPARAM)GUI.outputMethod,0);
// add all the GUI.Scale filters to the combo box
for(int filter = 0 ; filter < (int)NUM_FILTERS ; filter++)
{
strcpy(temp,GetFilterName((RenderFilter)filter));
SendDlgItemMessageA(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp);
}
for(int filter = 0, hiResPos = 0 ; filter < (int)NUM_FILTERS ; filter++)
{
if(GetFilterHiResSupport((RenderFilter)filter))
{
strcpy(temp,GetFilterName((RenderFilter)filter));
SendDlgItemMessageA(hDlg,IDC_FILTERBOX2,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp);
if(GUI.ScaleHiRes==filter)
SendDlgItemMessage(hDlg,IDC_FILTERBOX2,CB_SETCURSEL,(WPARAM)hiResPos,0);
hiResPos++;
}
}
inserted_index = SendDlgItemMessage(hDlg, IDC_OUTPUTMETHOD, CB_ADDSTRING, 0, (LPARAM)TEXT("Direct3D"));
SendDlgItemMessage(hDlg, IDC_OUTPUTMETHOD, CB_SETITEMDATA, inserted_index, DIRECT3D);
inserted_index = SendDlgItemMessage(hDlg, IDC_OUTPUTMETHOD, CB_ADDSTRING, 0, (LPARAM)TEXT("OpenGL"));
SendDlgItemMessage(hDlg, IDC_OUTPUTMETHOD, CB_SETITEMDATA, inserted_index, OPENGL);
SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_SETCURSEL,(WPARAM)GUI.Scale,0);
// select item with corresponding itemdata
int item_count = SendDlgItemMessage(hDlg, IDC_OUTPUTMETHOD, CB_GETCOUNT, 0, 0);
for (int index = 0; index < item_count; index++) {
int item_data = SendDlgItemMessage(hDlg, IDC_OUTPUTMETHOD, CB_GETITEMDATA, index, 0);
if (item_data == GUI.outputMethod)
SendDlgItemMessage(hDlg, IDC_OUTPUTMETHOD, CB_SETCURSEL, index, 0);
}
UpdateModeComboBox(GetDlgItem(hDlg,IDC_RESOLUTION));
// add all the GUI.Scale filters to the combo box
for (int filter = 0; filter < (int)NUM_FILTERS; filter++)
{
strcpy(temp, GetFilterName((RenderFilter)filter));
SendDlgItemMessageA(hDlg, IDC_FILTERBOX, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)temp);
}
for (int filter = 0, hiResPos = 0; filter < (int)NUM_FILTERS; filter++)
{
if (GetFilterHiResSupport((RenderFilter)filter))
{
strcpy(temp, GetFilterName((RenderFilter)filter));
SendDlgItemMessageA(hDlg, IDC_FILTERBOX2, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)temp);
if (GUI.ScaleHiRes == filter)
SendDlgItemMessage(hDlg, IDC_FILTERBOX2, CB_SETCURSEL, (WPARAM)hiResPos, 0);
hiResPos++;
}
}
// have to start focus on something like this or Escape won't exit the dialog
SetFocus(hDlg);
SendDlgItemMessage(hDlg, IDC_FILTERBOX, CB_SETCURSEL, (WPARAM)GUI.Scale, 0);
break;
UpdateModeComboBox(GetDlgItem(hDlg, IDC_RESOLUTION));
// have to start focus on something like this or Escape won't exit the dialog
SetFocus(hDlg);
break;
}
case WM_CLOSE:
case WM_DESTROY:
break;
@ -7477,7 +7489,8 @@ INT_PTR CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
break;
case IDC_OUTPUTMETHOD:
if(HIWORD(wParam)==CBN_SELCHANGE) {
OutputMethod newOut = (OutputMethod)SendDlgItemMessage(hDlg,IDC_OUTPUTMETHOD,CB_GETCURSEL,0,0);
int index = SendDlgItemMessage(hDlg, IDC_OUTPUTMETHOD, CB_GETCURSEL, 0, 0);
OutputMethod newOut = (OutputMethod)SendDlgItemMessage(hDlg, IDC_OUTPUTMETHOD, CB_GETITEMDATA, index, 0);
if(GUI.outputMethod==newOut)
break;
if(GUI.FullScreen)

View File

@ -287,12 +287,8 @@ enum RenderFilter{
};
enum OutputMethod {
#if DIRECTDRAW_DEFINED
DIRECTDRAW = 0,
DIRECT3D,
#else
DIRECT3D = 0,
#endif
OPENGL
};
@ -334,9 +330,7 @@ struct sGUI {
bool EmulateFullscreen;
bool EmulatedFullscreen;
bool BilinearFilter;
#if DIRECTDRAW_DEFINED
bool LocalVidMem;
#endif
bool Vsync;
bool shaderEnabled;
TCHAR D3DshaderFileName[MAX_PATH];
@ -441,9 +435,7 @@ struct sGUI {
struct sLanguages {
int idMenu;
TCHAR *errInitDD;
#if DIRECTDRAW_DEFINED
TCHAR *errModeDD;
#endif
TCHAR *errInitDS;
TCHAR *ApplyNeedRestart;
TCHAR *errFrameTimer;