win32: add option to disable message scaling with epx

This commit is contained in:
OV2 2018-01-03 20:40:29 +01:00
parent ba9c1e33f8
commit 4c69595ffe
6 changed files with 57 additions and 39 deletions

View File

@ -2,9 +2,6 @@
// Microsoft Visual C++ generated include file.
// Used by snes9x.rc
//
#define IDC_STATIC (-1)
#define IDR_RT_MANIFEST2 1
#define IDR_MENU_US 101
#define IDC_CURSOR_SCOPE 101
@ -266,6 +263,7 @@
#define IDC_ASPECT 1199
#define IDC_MESSAGES_IN_IMAGE 1200
#define IDC_RECORD_NOW 1201
#define IDC_MESSAGES_SCALE 1201
#define IDC_RECORD_RESET 1202
#define IDC_JOY1 1203
#define IDC_JOY2 1204
@ -506,12 +504,13 @@
#define ID_SAVEMEMPACK 40175
#define ID_FILE_SAVE_FILE 40176
#define ID_FILE_LOAD_FILE 40177
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 152
#define _APS_NEXT_RESOURCE_VALUE 153
#define _APS_NEXT_COMMAND_VALUE 40178
#define _APS_NEXT_CONTROL_VALUE 3022
#define _APS_NEXT_SYMED_VALUE 101

View File

@ -192,21 +192,21 @@ BEGIN
CONTROL "Sync By Reset",IDC_SYNCBYRESET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,90,174,15
END
IDD_NEWDISPLAY DIALOGEX 0, 0, 353, 274
IDD_NEWDISPLAY DIALOGEX 0, 0, 353, 283
STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CLIPCHILDREN | WS_CAPTION
CAPTION "Display Settings"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,239,251,50,14
PUSHBUTTON "Cancel",IDCANCEL,296,251,50,14
DEFPUSHBUTTON "OK",IDOK,239,259,50,14
PUSHBUTTON "Cancel",IDCANCEL,296,259,50,14
COMBOBOX IDC_OUTPUTMETHOD,68,17,101,58,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Fullscreen",IDC_FULLSCREEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,36,48,10
CONTROL "Emulate Fullscreen",IDC_EMUFULLSCREEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,47,75,10
CONTROL "Stretch Image",IDC_STRETCH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,58,60,10
CONTROL "Maintain Aspect Ratio",IDC_ASPECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,69,81,8
CONTROL "Maintain Aspect Ratio",IDC_ASPECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,69,81,10
COMBOBOX IDC_ASPECTDROP,104,67,63,41,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Bilinear Filtering",IDC_BILINEAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,80,75,8
CONTROL "Show Frame Rate",IDC_SHOWFPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,91,73,8
CONTROL "Bilinear Filtering",IDC_BILINEAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,80,75,10
CONTROL "Show Frame Rate",IDC_SHOWFPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,91,73,10
CONTROL "Automatic",IDC_AUTOFRAME,"Button",BS_AUTORADIOBUTTON,11,140,43,8
CONTROL "Fixed",IDC_FIXEDSKIP,"Button",BS_AUTORADIOBUTTON,11,157,43,10
EDITTEXT IDC_MAXSKIP,133,139,35,14,ES_AUTOHSCROLL | ES_NUMBER
@ -220,14 +220,14 @@ BEGIN
CONTROL "Enable Triple Buffering",IDC_DBLBUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,86,87,10
CONTROL "Transparency Effects",IDC_TRANS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,113,153,10
CONTROL "Hi Resolution Support",IDC_HIRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,124,85,10
CONTROL "Extend Height of SNES Image",IDC_HEIGHT_EXTEND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,147,111,10
CONTROL "Extend Height of SNES Image",IDC_HEIGHT_EXTEND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,146,111,10
CONTROL "Display messages before applying filters",IDC_MESSAGES_IN_IMAGE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,158,140,10
GROUPBOX "",IDC_SHADER_GROUP,8,176,338,71,0,WS_EX_TRANSPARENT
EDITTEXT IDC_SHADER_HLSL_FILE,13,198,306,14,ES_AUTOHSCROLL | WS_DISABLED
PUSHBUTTON "...",IDC_SHADER_HLSL_BROWSE,322,198,19,14,WS_DISABLED
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,157,140,10
GROUPBOX "",IDC_SHADER_GROUP,8,184,338,71,0,WS_EX_TRANSPARENT
EDITTEXT IDC_SHADER_HLSL_FILE,13,206,306,14,ES_AUTOHSCROLL | WS_DISABLED
PUSHBUTTON "...",IDC_SHADER_HLSL_BROWSE,322,206,19,14,WS_DISABLED
GROUPBOX "Frame Skipping:",IDC_STATIC,7,127,167,46,0,WS_EX_TRANSPARENT
GROUPBOX "SNES Image",IDC_STATIC,180,103,166,71,0,WS_EX_TRANSPARENT
GROUPBOX "SNES Image",IDC_STATIC,180,103,166,79,0,WS_EX_TRANSPARENT
GROUPBOX "Output Image Processing",IDC_STATIC,179,7,166,46,0,WS_EX_TRANSPARENT
GROUPBOX "Fullscreen Display Settings",IDC_STATIC,179,56,166,44,0,WS_EX_TRANSPARENT
LTEXT "Hi Res:",IDC_HIRESLABEL,186,36,31,8
@ -235,13 +235,15 @@ BEGIN
LTEXT "Max skipped frames:",IDC_STATIC,62,140,67,8
LTEXT "Amount skipped:",IDC_STATIC,62,158,67,8
LTEXT "Output Method",IDC_STATIC,10,19,51,11
CONTROL "Use Shader",IDC_SHADER_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,176,52,9
LTEXT "Direct3D Shader File",IDC_STATIC,13,187,104,8
EDITTEXT IDC_SHADER_GLSL_FILE,13,227,306,14,ES_AUTOHSCROLL | WS_DISABLED
PUSHBUTTON "...",IDC_SHADER_GLSL_BROWSE,322,227,19,14,WS_DISABLED
LTEXT "OpenGL Shader File",IDC_STATIC,13,216,104,8
CONTROL "Blend Hi-Res Images",IDC_HIRESBLEND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,136,82,10
CONTROL "Use Shader",IDC_SHADER_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,184,52,9
LTEXT "Direct3D Shader File",IDC_STATIC,13,195,104,8
EDITTEXT IDC_SHADER_GLSL_FILE,13,235,306,14,ES_AUTOHSCROLL | WS_DISABLED
PUSHBUTTON "...",IDC_SHADER_GLSL_BROWSE,322,235,19,14,WS_DISABLED
LTEXT "OpenGL Shader File",IDC_STATIC,13,224,104,8
CONTROL "Blend Hi-Res Images",IDC_HIRESBLEND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,135,82,10
CONTROL "VSync",IDC_VSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,102,37,10
CONTROL "Scale messages with EPX if possible",IDC_MESSAGES_SCALE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,168,131,10
END
IDD_CHEATER DIALOGEX 0, 0, 262, 218
@ -614,7 +616,7 @@ BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 346
TOPMARGIN, 7
BOTTOMMARGIN, 266
BOTTOMMARGIN, 275
END
IDD_CHEATER, DIALOG
@ -998,6 +1000,11 @@ BEGIN
0
END
IDD_NEWDISPLAY AFX_DIALOG_LAYOUT
BEGIN
0
END
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////

View File

@ -918,6 +918,7 @@ void WinRegisterConfigItems()
AddBoolC("Fullscreen:EmulateFullscreen", GUI.EmulateFullscreen, true,"true makes snes9x create a window that spans the entire screen when going fullscreen");
AddBoolC("HideMenu", GUI.HideMenu, false, "true to auto-hide the menu bar on startup.");
AddBoolC("Vsync", GUI.Vsync, false, "true to enable Vsync");
AddBoolC("FilterMessageFont", GUI.filterMessagFont, true, "true to filter message font with EPX on 2x/3x scales if MessagesInImage is false)");
#undef CATEGORY
#define CATEGORY "Settings"
AddUIntC("FrameSkip", Settings.SkipFrames, AUTO_FRAMERATE, "200=automatic (limits at 50/60 fps), 0=none, 1=skip every other, ...");

View File

@ -849,26 +849,25 @@ void WinDisplayChar (screenPtrType *s, uint8 c)
int line = ((c - 32) >> 4) * fontheight_scaled;
int offset = ((c - 32) & 15) * fontwidth_scaled;
if(displayScale == 1) {
for(h=0; h<fontheight_scaled; h++, line++, s+=displayPpl-fontwidth_scaled)
for(w=0; w<fontwidth_scaled; w++, s++)
FontPixToScreen(font [(line)] [(offset + w)], s);
} else if(displayScale == 2) {
for(h=0; h<fontheight_scaled; h+=2, line+=2, s+=2*displayPpl-fontwidth_scaled)
for(w=0; w<fontwidth_scaled; w+=2, s+=2)
FontPixToScreenEPX((offset + w)/2, line/2, s);
} else if(displayScale == 3) {
for(h=0; h<fontheight_scaled; h+=3, line+=3, s+=3*displayPpl-fontwidth_scaled)
for(w=0; w<fontwidth_scaled; w+=3, s+=3)
FontPixToScreenEPXSimple3((offset + w)/3, line/3, s);
} else {
if (GUI.filterMessagFont && (displayScale == 2 || displayScale == 3))
{
if (displayScale == 2) {
for (h = 0; h < fontheight_scaled; h += 2, line += 2, s += 2 * displayPpl - fontwidth_scaled)
for (w = 0; w < fontwidth_scaled; w += 2, s += 2)
FontPixToScreenEPX((offset + w) / 2, line / 2, s);
}
else if (displayScale == 3) {
for (h = 0; h < fontheight_scaled; h += 3, line += 3, s += 3 * displayPpl - fontwidth_scaled)
for (w = 0; w < fontwidth_scaled; w += 3, s += 3)
FontPixToScreenEPXSimple3((offset + w) / 3, line / 3, s);
}
}
else
{
for(h=0; h<fontheight_scaled; h++, line++, s+=displayPpl-fontwidth_scaled)
for(w=0; w<fontwidth_scaled; w++, s++)
FontPixToScreen(font [(line)/displayScale] [(offset + w)/displayScale], s);
}
}
static inline void FontPixToScreen(char p, uint16 *s)

View File

@ -7325,6 +7325,7 @@ INT_PTR CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
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_MESSAGES_SCALE, hDlg, TEXT("Try to scale messages with EPX instead of Simple, only works for 2x and 3x and when displaying after filters"));
prevOutputMethod = GUI.outputMethod;
prevScale = GUI.Scale;
@ -7364,6 +7365,8 @@ INT_PTR CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
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 (GUI.filterMessagFont)
SendDlgItemMessage(hDlg, IDC_MESSAGES_SCALE, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if (Settings.SkipFrames == AUTO_FRAMERATE)
SendDlgItemMessage(hDlg, IDC_AUTOFRAME, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
if (GUI.Stretch)
@ -7507,7 +7510,9 @@ INT_PTR CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
break;
case IDC_MESSAGES_IN_IMAGE:
case IDC_MESSAGES_SCALE:
Settings.AutoDisplayMessages = (bool)(IsDlgButtonChecked(hDlg,IDC_MESSAGES_IN_IMAGE)==BST_CHECKED);
GUI.filterMessagFont = (bool)(IsDlgButtonChecked(hDlg, IDC_MESSAGES_SCALE) == BST_CHECKED);
if(Settings.AutoDisplayMessages)
{
if(!GFX.InfoString || !*GFX.InfoString){
@ -7515,6 +7520,11 @@ INT_PTR CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
GFX.InfoStringTimeout = 1;
}
S9xDisplayMessages(GFX.Screen, GFX.RealPPL, IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight, 1);
EnableWindow(GetDlgItem(hDlg, IDC_MESSAGES_SCALE), FALSE);
}
else
{
EnableWindow(GetDlgItem(hDlg, IDC_MESSAGES_SCALE), TRUE);
}
// refresh screen, so the user can see the new mode
WinRefreshDisplay();
@ -7742,6 +7752,7 @@ updateFilterBox2:
Settings.SupportHiRes = false;
GUI.HeightExtend = IsDlgButtonChecked(hDlg, IDC_HEIGHT_EXTEND)!=0;
Settings.AutoDisplayMessages = IsDlgButtonChecked(hDlg, IDC_MESSAGES_IN_IMAGE);
GUI.filterMessagFont = IsDlgButtonChecked(hDlg, IDC_MESSAGES_SCALE);
GUI.DoubleBuffered = (bool)(IsDlgButtonChecked(hDlg, IDC_DBLBUFFER)==BST_CHECKED);
GUI.Vsync = (bool)(IsDlgButtonChecked(hDlg, IDC_VSYNC

View File

@ -339,6 +339,7 @@ struct sGUI {
TCHAR OGLshaderFileName[MAX_PATH];
bool OGLdisablePBOs;
bool filterMessagFont;
bool IgnoreNextMouseMove;
RECT window_size;