mirror of https://github.com/snes9xgit/snes9x.git
win32: change define name, keep ifdefs to minimum, keep enum values
This commit is contained in:
parent
73c5e5623a
commit
f815f25a00
|
@ -187,7 +187,7 @@
|
||||||
Nintendo Co., Limited and its subsidiary companies.
|
Nintendo Co., Limited and its subsidiary companies.
|
||||||
***********************************************************************************/
|
***********************************************************************************/
|
||||||
|
|
||||||
#if DIRECTDRAW_DEFINED
|
#if DIRECTDRAW_SUPPORT
|
||||||
|
|
||||||
// CDirectDraw.cpp: implementation of the CDirectDraw class.
|
// CDirectDraw.cpp: implementation of the CDirectDraw class.
|
||||||
//
|
//
|
||||||
|
|
|
@ -203,7 +203,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#endif // _MSC_VER >= 1000
|
#endif // _MSC_VER >= 1000
|
||||||
|
|
||||||
#if DIRECTDRAW_DEFINED
|
#if DIRECTDRAW_SUPPORT
|
||||||
|
|
||||||
class CDirectDraw: public IS9xDisplayOutput
|
class CDirectDraw: public IS9xDisplayOutput
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
|
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
|
||||||
#if DIRECTDRAW_DEFINED
|
#if DIRECTDRAW_SUPPORT
|
||||||
#include <ddraw.h>
|
#include <ddraw.h>
|
||||||
#endif
|
#endif
|
||||||
#include <d3d9.h>
|
#include <d3d9.h>
|
||||||
|
@ -3014,7 +3014,7 @@ const WCHAR* WINAPI DXGetErrorStringW( _In_ HRESULT hr )
|
||||||
// -------------------------------------------------------------
|
// -------------------------------------------------------------
|
||||||
// ddraw.h error codes
|
// ddraw.h error codes
|
||||||
// -------------------------------------------------------------
|
// -------------------------------------------------------------
|
||||||
#if DIRECTDRAW_DEFINED
|
#if DIRECTDRAW_SUPPORT
|
||||||
CHK_ERRA(DDERR_ALREADYINITIALIZED)
|
CHK_ERRA(DDERR_ALREADYINITIALIZED)
|
||||||
CHK_ERRA(DDERR_CANNOTATTACHSURFACE)
|
CHK_ERRA(DDERR_CANNOTATTACHSURFACE)
|
||||||
CHK_ERRA(DDERR_CANNOTDETACHSURFACE)
|
CHK_ERRA(DDERR_CANNOTDETACHSURFACE)
|
||||||
|
@ -6396,7 +6396,7 @@ const char* WINAPI DXGetErrorStringA(_In_ HRESULT hr)
|
||||||
CHK_ERR_WIN32A(ERROR_IPSEC_IKE_NEG_STATUS_END)
|
CHK_ERR_WIN32A(ERROR_IPSEC_IKE_NEG_STATUS_END)
|
||||||
|
|
||||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
|
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
|
||||||
#if DIRECTDRAW_DEFINED
|
#if DIRECTDRAW_SUPPORT
|
||||||
// -------------------------------------------------------------
|
// -------------------------------------------------------------
|
||||||
// ddraw.h error codes
|
// 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
|
// Commmented out codes are actually alises for other codes
|
||||||
|
|
||||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
|
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
|
||||||
#if DIRECTDRAW_DEFINED
|
#if DIRECTDRAW_SUPPORT
|
||||||
// -------------------------------------------------------------
|
// -------------------------------------------------------------
|
||||||
// ddraw.h error codes
|
// 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
|
// Commmented out codes are actually alises for other codes
|
||||||
|
|
||||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
|
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
|
||||||
#if DIRECTDRAW_DEFINED
|
#if DIRECTDRAW_SUPPORT
|
||||||
// -------------------------------------------------------------
|
// -------------------------------------------------------------
|
||||||
// ddraw.h error codes
|
// ddraw.h error codes
|
||||||
// -------------------------------------------------------------
|
// -------------------------------------------------------------
|
||||||
|
|
|
@ -887,11 +887,7 @@ void WinRegisterConfigItems()
|
||||||
AddBoolC("DisplayFrameCount", Settings.DisplayMovieFrame, true, "true to show the frame count when a movie is playing");
|
AddBoolC("DisplayFrameCount", Settings.DisplayMovieFrame, true, "true to show the frame count when a movie is playing");
|
||||||
#undef CATEGORY
|
#undef CATEGORY
|
||||||
#define CATEGORY "Display\\Win"
|
#define CATEGORY "Display\\Win"
|
||||||
#if DIRECTDRAW_DEFINED
|
|
||||||
AddUIntC("OutputMethod", GUI.outputMethod, 1, "0=DirectDraw, 1=Direct3D, 2=OpenGL");
|
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("FilterType", GUI.Scale, 0, filterString);
|
||||||
AddUIntC("FilterHiRes", GUI.ScaleHiRes, 0, filterString2);
|
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)");
|
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");
|
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");
|
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.");
|
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.");
|
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);
|
AddBool("Fullscreen:Enabled", GUI.FullScreen, false);
|
||||||
AddUInt("Fullscreen:Width", GUI.FullscreenMode.width, 640);
|
AddUInt("Fullscreen:Width", GUI.FullscreenMode.width, 640);
|
||||||
AddUInt("Fullscreen:Height", GUI.FullscreenMode.height, 480);
|
AddUInt("Fullscreen:Height", GUI.FullscreenMode.height, 480);
|
||||||
|
|
|
@ -198,7 +198,7 @@
|
||||||
#include "wsnes9x.h"
|
#include "wsnes9x.h"
|
||||||
#include "win32_display.h"
|
#include "win32_display.h"
|
||||||
#include "CDirect3D.h"
|
#include "CDirect3D.h"
|
||||||
#if DIRECTDRAW_DEFINED
|
#if DIRECTDRAW_SUPPORT
|
||||||
#include "CDirectDraw.h"
|
#include "CDirectDraw.h"
|
||||||
#endif
|
#endif
|
||||||
#include "COpenGL.h"
|
#include "COpenGL.h"
|
||||||
|
@ -209,7 +209,7 @@
|
||||||
|
|
||||||
// available display output methods
|
// available display output methods
|
||||||
CDirect3D Direct3D;
|
CDirect3D Direct3D;
|
||||||
#if DIRECTDRAW_DEFINED
|
#if DIRECTDRAW_SUPPORT
|
||||||
CDirectDraw DirectDraw;
|
CDirectDraw DirectDraw;
|
||||||
#endif
|
#endif
|
||||||
COpenGL OpenGL;
|
COpenGL OpenGL;
|
||||||
|
@ -262,7 +262,7 @@ bool WinDisplayReset(void)
|
||||||
case DIRECT3D:
|
case DIRECT3D:
|
||||||
S9xDisplayOutput = &Direct3D;
|
S9xDisplayOutput = &Direct3D;
|
||||||
break;
|
break;
|
||||||
#if DIRECTDRAW_DEFINED
|
#if DIRECTDRAW_SUPPORT
|
||||||
case DIRECTDRAW:
|
case DIRECTDRAW:
|
||||||
S9xDisplayOutput = &DirectDraw;
|
S9xDisplayOutput = &DirectDraw;
|
||||||
break;
|
break;
|
||||||
|
@ -481,7 +481,7 @@ void ReduceToPath(TCHAR *filename)
|
||||||
/* DirectDraw only begin */
|
/* DirectDraw only begin */
|
||||||
void SwitchToGDI()
|
void SwitchToGDI()
|
||||||
{
|
{
|
||||||
#if DIRECTDRAW_DEFINED
|
#if DIRECTDRAW_SUPPORT
|
||||||
if(GUI.outputMethod!=DIRECTDRAW)
|
if(GUI.outputMethod!=DIRECTDRAW)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -494,7 +494,7 @@ void SwitchToGDI()
|
||||||
|
|
||||||
static void ClearSurface (LPDIRECTDRAWSURFACE2 lpDDSurface)
|
static void ClearSurface (LPDIRECTDRAWSURFACE2 lpDDSurface)
|
||||||
{
|
{
|
||||||
#if DIRECTDRAW_DEFINED
|
#if DIRECTDRAW_SUPPORT
|
||||||
DDBLTFX fx;
|
DDBLTFX fx;
|
||||||
|
|
||||||
memset (&fx, 0, sizeof (fx));
|
memset (&fx, 0, sizeof (fx));
|
||||||
|
@ -507,7 +507,7 @@ static void ClearSurface (LPDIRECTDRAWSURFACE2 lpDDSurface)
|
||||||
|
|
||||||
void UpdateBackBuffer()
|
void UpdateBackBuffer()
|
||||||
{
|
{
|
||||||
#if DIRECTDRAW_DEFINED
|
#if DIRECTDRAW_SUPPORT
|
||||||
if (GUI.outputMethod==DIRECTDRAW && GUI.FullScreen)
|
if (GUI.outputMethod==DIRECTDRAW && GUI.FullScreen)
|
||||||
{
|
{
|
||||||
SwitchToGDI();
|
SwitchToGDI();
|
||||||
|
@ -550,7 +550,7 @@ void UpdateBackBuffer()
|
||||||
|
|
||||||
void RestoreGUIDisplay ()
|
void RestoreGUIDisplay ()
|
||||||
{
|
{
|
||||||
#if DIRECTDRAW_DEFINED
|
#if DIRECTDRAW_SUPPORT
|
||||||
if(GUI.outputMethod!=DIRECTDRAW)
|
if(GUI.outputMethod!=DIRECTDRAW)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -571,7 +571,7 @@ void RestoreGUIDisplay ()
|
||||||
|
|
||||||
void RestoreSNESDisplay ()
|
void RestoreSNESDisplay ()
|
||||||
{
|
{
|
||||||
#if DIRECTDRAW_DEFINED
|
#if DIRECTDRAW_SUPPORT
|
||||||
if(GUI.outputMethod!=DIRECTDRAW)
|
if(GUI.outputMethod!=DIRECTDRAW)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -609,9 +609,7 @@ static uint32 FrameTimings[] = {
|
||||||
struct sLanguages Languages[] = {
|
struct sLanguages Languages[] = {
|
||||||
{ IDR_MENU_US,
|
{ IDR_MENU_US,
|
||||||
TEXT("Failed to initialize currently selected display output!\n Try switching to a different output method in the display settings."),
|
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!"),
|
TEXT("DirectDraw failed to set the selected display mode!"),
|
||||||
#endif
|
|
||||||
TEXT("DirectSound failed to initialize; no sound will be played."),
|
TEXT("DirectSound failed to initialize; no sound will be played."),
|
||||||
TEXT("These settings won't take effect until you restart the emulator."),
|
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!")}
|
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:
|
case VK_ESCAPE:
|
||||||
if(
|
if(
|
||||||
#if DIRECTDRAW_DEFINED
|
|
||||||
GUI.outputMethod!=DIRECTDRAW &&
|
GUI.outputMethod!=DIRECTDRAW &&
|
||||||
#endif
|
|
||||||
GUI.FullScreen && !GUI.EmulateFullscreen)
|
GUI.FullScreen && !GUI.EmulateFullscreen)
|
||||||
ToggleFullScreen();
|
ToggleFullScreen();
|
||||||
else
|
else
|
||||||
|
@ -7228,146 +7224,162 @@ INT_PTR CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
|
||||||
case WM_INITDIALOG:
|
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_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_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_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_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_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_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_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_MESSAGES_IN_IMAGE, hDlg, TEXT("Draw text inside the SNES image (will get into AVIs, screenshots, and filters)"));
|
||||||
|
|
||||||
prevOutputMethod = GUI.outputMethod;
|
prevOutputMethod = GUI.outputMethod;
|
||||||
prevScale = GUI.Scale;
|
prevScale = GUI.Scale;
|
||||||
prevScaleHiRes = GUI.ScaleHiRes;
|
prevScaleHiRes = GUI.ScaleHiRes;
|
||||||
prevPPL = GFX.RealPPL;
|
prevPPL = GFX.RealPPL;
|
||||||
prevStretch = GUI.Stretch;
|
prevStretch = GUI.Stretch;
|
||||||
prevBilinearFilter = GUI.BilinearFilter;
|
prevBilinearFilter = GUI.BilinearFilter;
|
||||||
prevAspectRatio = GUI.AspectRatio;
|
prevAspectRatio = GUI.AspectRatio;
|
||||||
prevAspectWidth = GUI.AspectWidth;
|
prevAspectWidth = GUI.AspectWidth;
|
||||||
prevHeightExtend = GUI.HeightExtend;
|
prevHeightExtend = GUI.HeightExtend;
|
||||||
prevAutoDisplayMessages = Settings.AutoDisplayMessages != 0;
|
prevAutoDisplayMessages = Settings.AutoDisplayMessages != 0;
|
||||||
prevShaderEnabled = GUI.shaderEnabled;
|
prevShaderEnabled = GUI.shaderEnabled;
|
||||||
prevBlendHires = GUI.BlendHiRes;
|
prevBlendHires = GUI.BlendHiRes;
|
||||||
lstrcpy(prevD3DShaderFile,GUI.D3DshaderFileName);
|
lstrcpy(prevD3DShaderFile, GUI.D3DshaderFileName);
|
||||||
lstrcpy(prevOGLShaderFile,GUI.OGLshaderFileName);
|
lstrcpy(prevOGLShaderFile, GUI.OGLshaderFileName);
|
||||||
|
|
||||||
|
|
||||||
_stprintf(s,TEXT("Current: %dx%d %dbit %dHz"),GUI.FullscreenMode.width,GUI.FullscreenMode.height,GUI.FullscreenMode.depth,GUI.FullscreenMode.rate);
|
_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);
|
SendDlgItemMessage(hDlg, IDC_CURRMODE, WM_SETTEXT, 0, (LPARAM)s);
|
||||||
|
|
||||||
if(GUI.DoubleBuffered)
|
if (GUI.DoubleBuffered)
|
||||||
SendDlgItemMessage(hDlg, IDC_DBLBUFFER, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
SendDlgItemMessage(hDlg, IDC_DBLBUFFER, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||||
if(GUI.Vsync)
|
if (GUI.Vsync)
|
||||||
SendDlgItemMessage(hDlg, IDC_VSYNC, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
SendDlgItemMessage(hDlg, IDC_VSYNC, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||||
SendDlgItemMessage(hDlg,IDC_FRAMERATESKIPSLIDER,TBM_SETRANGE,(WPARAM)true,(LPARAM)MAKELONG(0,9));
|
SendDlgItemMessage(hDlg, IDC_FRAMERATESKIPSLIDER, TBM_SETRANGE, (WPARAM)true, (LPARAM)MAKELONG(0, 9));
|
||||||
if(Settings.SkipFrames!=AUTO_FRAMERATE)
|
if (Settings.SkipFrames != AUTO_FRAMERATE)
|
||||||
SendDlgItemMessage(hDlg,IDC_FRAMERATESKIPSLIDER,TBM_SETPOS,(WPARAM)true,(LPARAM)Settings.SkipFrames);
|
SendDlgItemMessage(hDlg, IDC_FRAMERATESKIPSLIDER, TBM_SETPOS, (WPARAM)true, (LPARAM)Settings.SkipFrames);
|
||||||
EnableWindow(GetDlgItem(hDlg, IDC_TRANS), TRUE);
|
EnableWindow(GetDlgItem(hDlg, IDC_TRANS), TRUE);
|
||||||
if(Settings.Transparency)
|
if (Settings.Transparency)
|
||||||
SendDlgItemMessage(hDlg, IDC_TRANS, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
SendDlgItemMessage(hDlg, IDC_TRANS, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||||
|
|
||||||
if(Settings.SupportHiRes)
|
if (Settings.SupportHiRes)
|
||||||
SendDlgItemMessage(hDlg, IDC_HIRES, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
SendDlgItemMessage(hDlg, IDC_HIRES, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||||
if(GUI.BlendHiRes)
|
if (GUI.BlendHiRes)
|
||||||
SendDlgItemMessage(hDlg, IDC_HIRESBLEND, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
SendDlgItemMessage(hDlg, IDC_HIRESBLEND, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||||
if(GUI.HeightExtend)
|
if (GUI.HeightExtend)
|
||||||
SendDlgItemMessage(hDlg, IDC_HEIGHT_EXTEND, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
SendDlgItemMessage(hDlg, IDC_HEIGHT_EXTEND, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||||
if(Settings.AutoDisplayMessages)
|
if (Settings.AutoDisplayMessages)
|
||||||
SendDlgItemMessage(hDlg, IDC_MESSAGES_IN_IMAGE, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
SendDlgItemMessage(hDlg, IDC_MESSAGES_IN_IMAGE, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||||
if(Settings.SkipFrames==AUTO_FRAMERATE)
|
if (Settings.SkipFrames == AUTO_FRAMERATE)
|
||||||
SendDlgItemMessage(hDlg, IDC_AUTOFRAME, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
SendDlgItemMessage(hDlg, IDC_AUTOFRAME, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||||
if(GUI.Stretch)
|
if (GUI.Stretch)
|
||||||
{
|
{
|
||||||
SendDlgItemMessage(hDlg, IDC_STRETCH, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
SendDlgItemMessage(hDlg, IDC_STRETCH, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(GUI.AspectRatio)
|
if (GUI.AspectRatio)
|
||||||
SendDlgItemMessage(hDlg, IDC_ASPECT, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
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("8:7"));
|
||||||
SendDlgItemMessage(hDlg,IDC_ASPECTDROP,CB_ADDSTRING,0,(LPARAM)TEXT("4:3"));
|
SendDlgItemMessage(hDlg, IDC_ASPECTDROP, CB_ADDSTRING, 0, (LPARAM)TEXT("4:3"));
|
||||||
switch(GUI.AspectWidth) {
|
switch (GUI.AspectWidth) {
|
||||||
case 256:
|
case 256:
|
||||||
SendDlgItemMessage(hDlg,IDC_ASPECTDROP,CB_SETCURSEL,(WPARAM)0,0);
|
SendDlgItemMessage(hDlg, IDC_ASPECTDROP, CB_SETCURSEL, (WPARAM)0, 0);
|
||||||
break;
|
break;
|
||||||
case 299:
|
case 299:
|
||||||
SendDlgItemMessage(hDlg,IDC_ASPECTDROP,CB_SETCURSEL,(WPARAM)1,0);
|
SendDlgItemMessage(hDlg, IDC_ASPECTDROP, CB_SETCURSEL, (WPARAM)1, 0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SendDlgItemMessage(hDlg,IDC_ASPECTDROP,CB_ADDSTRING,0,(LPARAM)TEXT("Custom"));
|
SendDlgItemMessage(hDlg, IDC_ASPECTDROP, CB_ADDSTRING, 0, (LPARAM)TEXT("Custom"));
|
||||||
SendDlgItemMessage(hDlg,IDC_ASPECTDROP,CB_SETCURSEL,(WPARAM)2,0);
|
SendDlgItemMessage(hDlg, IDC_ASPECTDROP, CB_SETCURSEL, (WPARAM)2, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(GUI.FullScreen || GUI.EmulatedFullscreen)
|
if (GUI.FullScreen || GUI.EmulatedFullscreen)
|
||||||
SendDlgItemMessage(hDlg, IDC_FULLSCREEN, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
SendDlgItemMessage(hDlg, IDC_FULLSCREEN, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||||
if(GUI.EmulateFullscreen)
|
if (GUI.EmulateFullscreen)
|
||||||
SendDlgItemMessage(hDlg, IDC_EMUFULLSCREEN, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
SendDlgItemMessage(hDlg, IDC_EMUFULLSCREEN, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||||
if(GUI.BilinearFilter)
|
if (GUI.BilinearFilter)
|
||||||
SendDlgItemMessage(hDlg,IDC_BILINEAR, BM_SETCHECK, (WPARAM)BST_CHECKED,0);
|
SendDlgItemMessage(hDlg, IDC_BILINEAR, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||||
if(Settings.DisplayFrameRate)
|
if (Settings.DisplayFrameRate)
|
||||||
SendDlgItemMessage(hDlg, IDC_SHOWFPS, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
SendDlgItemMessage(hDlg, IDC_SHOWFPS, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||||
|
|
||||||
if(Settings.SkipFrames==AUTO_FRAMERATE) {
|
if (Settings.SkipFrames == AUTO_FRAMERATE) {
|
||||||
SendDlgItemMessage(hDlg, IDC_AUTOFRAME, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
SendDlgItemMessage(hDlg, IDC_AUTOFRAME, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||||
EnableWindow(GetDlgItem(hDlg, IDC_SKIPCOUNT),FALSE);
|
EnableWindow(GetDlgItem(hDlg, IDC_SKIPCOUNT), FALSE);
|
||||||
} else {
|
}
|
||||||
SendDlgItemMessage(hDlg, IDC_FIXEDSKIP, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
else {
|
||||||
EnableWindow(GetDlgItem(hDlg, IDC_MAXSKIP),FALSE);
|
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, UDM_SETRANGE, 0, MAKELPARAM((short)59, (short)0));
|
||||||
SendDlgItemMessage(hDlg, IDC_SPIN_MAX_SKIP_DISP_FIXED, 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_SETPOS,0, Settings.SkipFrames==AUTO_FRAMERATE?0:Settings.SkipFrames);
|
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) {
|
if (GUI.shaderEnabled) {
|
||||||
SendDlgItemMessage(hDlg, IDC_SHADER_ENABLED, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
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_FILE), TRUE);
|
||||||
EnableWindow(GetDlgItem(hDlg, IDC_SHADER_HLSL_BROWSE),TRUE);
|
EnableWindow(GetDlgItem(hDlg, IDC_SHADER_HLSL_BROWSE), TRUE);
|
||||||
EnableWindow(GetDlgItem(hDlg, IDC_SHADER_GLSL_FILE),TRUE);
|
EnableWindow(GetDlgItem(hDlg, IDC_SHADER_GLSL_FILE), TRUE);
|
||||||
EnableWindow(GetDlgItem(hDlg, IDC_SHADER_GLSL_BROWSE),TRUE);
|
EnableWindow(GetDlgItem(hDlg, IDC_SHADER_GLSL_BROWSE), TRUE);
|
||||||
}
|
}
|
||||||
SetDlgItemText(hDlg,IDC_SHADER_HLSL_FILE,GUI.D3DshaderFileName);
|
SetDlgItemText(hDlg, IDC_SHADER_HLSL_FILE, GUI.D3DshaderFileName);
|
||||||
SetDlgItemText(hDlg,IDC_SHADER_GLSL_FILE,GUI.OGLshaderFileName);
|
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
|
// add output method to droplist with itemdata set to their enum value
|
||||||
SendDlgItemMessage(hDlg,IDC_OUTPUTMETHOD,CB_ADDSTRING,0,(LPARAM)TEXT("DirectDraw"));
|
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
|
#endif
|
||||||
SendDlgItemMessage(hDlg,IDC_OUTPUTMETHOD,CB_ADDSTRING,0,(LPARAM)TEXT("Direct3D"));
|
inserted_index = 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_SETITEMDATA, inserted_index, DIRECT3D);
|
||||||
SendDlgItemMessage(hDlg,IDC_OUTPUTMETHOD,CB_SETCURSEL,(WPARAM)GUI.outputMethod,0);
|
inserted_index = SendDlgItemMessage(hDlg, IDC_OUTPUTMETHOD, CB_ADDSTRING, 0, (LPARAM)TEXT("OpenGL"));
|
||||||
// add all the GUI.Scale filters to the combo box
|
SendDlgItemMessage(hDlg, IDC_OUTPUTMETHOD, CB_SETITEMDATA, inserted_index, OPENGL);
|
||||||
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++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
SendDlgItemMessage(hDlg, IDC_FILTERBOX, CB_SETCURSEL, (WPARAM)GUI.Scale, 0);
|
||||||
SetFocus(hDlg);
|
|
||||||
|
|
||||||
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_CLOSE:
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
break;
|
break;
|
||||||
|
@ -7477,7 +7489,8 @@ INT_PTR CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
break;
|
break;
|
||||||
case IDC_OUTPUTMETHOD:
|
case IDC_OUTPUTMETHOD:
|
||||||
if(HIWORD(wParam)==CBN_SELCHANGE) {
|
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)
|
if(GUI.outputMethod==newOut)
|
||||||
break;
|
break;
|
||||||
if(GUI.FullScreen)
|
if(GUI.FullScreen)
|
||||||
|
|
|
@ -287,12 +287,8 @@ enum RenderFilter{
|
||||||
};
|
};
|
||||||
|
|
||||||
enum OutputMethod {
|
enum OutputMethod {
|
||||||
#if DIRECTDRAW_DEFINED
|
|
||||||
DIRECTDRAW = 0,
|
DIRECTDRAW = 0,
|
||||||
DIRECT3D,
|
DIRECT3D,
|
||||||
#else
|
|
||||||
DIRECT3D = 0,
|
|
||||||
#endif
|
|
||||||
OPENGL
|
OPENGL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -334,9 +330,7 @@ struct sGUI {
|
||||||
bool EmulateFullscreen;
|
bool EmulateFullscreen;
|
||||||
bool EmulatedFullscreen;
|
bool EmulatedFullscreen;
|
||||||
bool BilinearFilter;
|
bool BilinearFilter;
|
||||||
#if DIRECTDRAW_DEFINED
|
|
||||||
bool LocalVidMem;
|
bool LocalVidMem;
|
||||||
#endif
|
|
||||||
bool Vsync;
|
bool Vsync;
|
||||||
bool shaderEnabled;
|
bool shaderEnabled;
|
||||||
TCHAR D3DshaderFileName[MAX_PATH];
|
TCHAR D3DshaderFileName[MAX_PATH];
|
||||||
|
@ -441,9 +435,7 @@ struct sGUI {
|
||||||
struct sLanguages {
|
struct sLanguages {
|
||||||
int idMenu;
|
int idMenu;
|
||||||
TCHAR *errInitDD;
|
TCHAR *errInitDD;
|
||||||
#if DIRECTDRAW_DEFINED
|
|
||||||
TCHAR *errModeDD;
|
TCHAR *errModeDD;
|
||||||
#endif
|
|
||||||
TCHAR *errInitDS;
|
TCHAR *errInitDS;
|
||||||
TCHAR *ApplyNeedRestart;
|
TCHAR *ApplyNeedRestart;
|
||||||
TCHAR *errFrameTimer;
|
TCHAR *errFrameTimer;
|
||||||
|
|
Loading…
Reference in New Issue