Merge pull request #493 from Sarania/GSdx-new-hacks-tickbox

GSdx: UI for hacks: stretch sprites and align sprites
This commit is contained in:
avih 2015-04-06 21:56:21 +03:00
commit 91f0730373
4 changed files with 30 additions and 14 deletions

View File

@ -32,8 +32,8 @@ GSRendererHW::GSRendererHW(GSTextureCache* tc)
{ {
m_upscale_multiplier = theApp.GetConfig("upscale_multiplier", 1); m_upscale_multiplier = theApp.GetConfig("upscale_multiplier", 1);
m_userhacks_skipdraw = !!theApp.GetConfig("UserHacks", 0) ? theApp.GetConfig("UserHacks_SkipDraw", 0) : 0; m_userhacks_skipdraw = !!theApp.GetConfig("UserHacks", 0) ? theApp.GetConfig("UserHacks_SkipDraw", 0) : 0;
m_userhacks_align_sprite_X = !!theApp.GetConfig("UserHacks_align_sprite_X", 0); m_userhacks_align_sprite_X = !!theApp.GetConfig("UserHacks_align_sprite_X", 0) && !!theApp.GetConfig("UserHacks", 0);
m_userhacks_stretch_sprite = !!theApp.GetConfig("UserHacks_stretch_sprite", 0); m_userhacks_stretch_sprite = !!theApp.GetConfig("UserHacks_stretch_sprite", 0) && !!theApp.GetConfig("UserHacks", 0);
if(!m_nativeres) if(!m_nativeres)
{ {

View File

@ -600,6 +600,8 @@ void GSHacksDlg::OnInit()
CheckDlgButton(m_hWnd, IDC_ALPHASTENCIL, theApp.GetConfig("UserHacks_AlphaStencil", 0)); CheckDlgButton(m_hWnd, IDC_ALPHASTENCIL, theApp.GetConfig("UserHacks_AlphaStencil", 0));
CheckDlgButton(m_hWnd, IDC_CHECK_NVIDIA_HACK, theApp.GetConfig("UserHacks_NVIDIAHack", 0)); CheckDlgButton(m_hWnd, IDC_CHECK_NVIDIA_HACK, theApp.GetConfig("UserHacks_NVIDIAHack", 0));
CheckDlgButton(m_hWnd, IDC_CHECK_DISABLE_ALL_HACKS, theApp.GetConfig("UserHacks_DisableCrcHacks", 0)); CheckDlgButton(m_hWnd, IDC_CHECK_DISABLE_ALL_HACKS, theApp.GetConfig("UserHacks_DisableCrcHacks", 0));
CheckDlgButton(m_hWnd, IDC_STRETCH_SPRITE, theApp.GetConfig("UserHacks_stretch_sprite", 0));
CheckDlgButton(m_hWnd, IDC_ALIGN_SPRITE, theApp.GetConfig("UserHacks_align_sprite_X", 0));
SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_SETRANGE, 0, MAKELPARAM(1000, 0)); SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_SETRANGE, 0, MAKELPARAM(1000, 0));
SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfig("UserHacks_SkipDraw", 0), 0)); SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfig("UserHacks_SkipDraw", 0), 0));
@ -691,6 +693,14 @@ bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
"It's possible to exclude CRC hacks also via the gsdx.ini. E.g.:\n" "It's possible to exclude CRC hacks also via the gsdx.ini. E.g.:\n"
"CrcHacksExclusions=all\n" "CrcHacksExclusions=all\n"
"CrcHacksExclusions=0x0F0C4A9C, 0x0EE5646B, 0x7ACF7E03"; "CrcHacksExclusions=0x0F0C4A9C, 0x0EE5646B, 0x7ACF7E03";
case IDC_ALIGN_SPRITE:
helpstr = "Sprite Alignment Hack\n\n"
"Fixes issues with upscaling(vertical lines) in Namco games like Ace Combat, Tekken, Soul Calibur, etc.";
break;
case IDC_STRETCH_SPRITE:
helpstr = "Corrects the sampling of 2D sprite textures when upscaling.\n\n"
"Fixes lines in sprites of games like Ar tonelico when upscaling.\n"
"Works best at 2x, but helps at any resolution.";
break; break;
case IDC_TCOFFSETX: case IDC_TCOFFSETX:
@ -733,6 +743,8 @@ bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
theApp.SetConfig("UserHacks_AlphaStencil", (int)IsDlgButtonChecked(m_hWnd, IDC_ALPHASTENCIL)); theApp.SetConfig("UserHacks_AlphaStencil", (int)IsDlgButtonChecked(m_hWnd, IDC_ALPHASTENCIL));
theApp.SetConfig("UserHacks_NVIDIAHack", (int)IsDlgButtonChecked(m_hWnd, IDC_CHECK_NVIDIA_HACK)); theApp.SetConfig("UserHacks_NVIDIAHack", (int)IsDlgButtonChecked(m_hWnd, IDC_CHECK_NVIDIA_HACK));
theApp.SetConfig("UserHacks_DisableCrcHacks", (int)IsDlgButtonChecked(m_hWnd, IDC_CHECK_DISABLE_ALL_HACKS)); theApp.SetConfig("UserHacks_DisableCrcHacks", (int)IsDlgButtonChecked(m_hWnd, IDC_CHECK_DISABLE_ALL_HACKS));
theApp.SetConfig("Userhacks_stretch_sprite", (int)IsDlgButtonChecked(m_hWnd, IDC_STRETCH_SPRITE));
theApp.SetConfig("Userhacks_align_sprite_X", (int)IsDlgButtonChecked(m_hWnd, IDC_ALIGN_SPRITE));
unsigned int TCOFFSET = SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETX), UDM_GETPOS, 0, 0) & 0xFFFF; unsigned int TCOFFSET = SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETX), UDM_GETPOS, 0, 0) & 0xFFFF;
TCOFFSET |= (SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETY), UDM_GETPOS, 0, 0) & 0xFFFF) << 16; TCOFFSET |= (SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETY), UDM_GETPOS, 0, 0) & 0xFFFF) << 16;

View File

@ -88,14 +88,14 @@ IDB_LOGO10 BITMAP "res\\logo10.bmp"
// Dialog // Dialog
// //
IDD_HACKS DIALOGEX 0, 0, 315, 246 IDD_HACKS DIALOGEX 0, 0, 315, 278
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Hacks Configuration" CAPTION "Hacks Configuration"
FONT 8, "MS Shell Dlg", 400, 0, 0x1 FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN BEGIN
DEFPUSHBUTTON "OK",IDOK,258,225,50,14 DEFPUSHBUTTON "OK",IDOK,258,257,50,14
GROUPBOX "Hack",IDC_STATIC,7,7,86,214,0,WS_EX_TRANSPARENT GROUPBOX "Hack",IDC_STATIC,7,7,86,246,0,WS_EX_TRANSPARENT
GROUPBOX "Description",IDC_STATIC,96,7,212,214 GROUPBOX "Description",IDC_STATIC,96,7,212,246
LTEXT "MSAA",IDC_STATIC_MSAA,14,20,20,8 LTEXT "MSAA",IDC_STATIC_MSAA,14,20,20,8
LTEXT "Skipdraw",IDC_STATIC_SKIPDRAW,14,37,30,8 LTEXT "Skipdraw",IDC_STATIC_SKIPDRAW,14,37,30,8
EDITTEXT IDC_SKIPDRAWHACKEDIT,53,35,35,14,ES_RIGHT | ES_AUTOHSCROLL EDITTEXT IDC_SKIPDRAWHACKEDIT,53,35,35,14,ES_RIGHT | ES_AUTOHSCROLL
@ -103,19 +103,21 @@ BEGIN
CONTROL "Alpha",IDC_ALPHAHACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,53,34,10 CONTROL "Alpha",IDC_ALPHAHACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,53,34,10
CONTROL "Half-pixel Offset",IDC_OFFSETHACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,69,65,10 CONTROL "Half-pixel Offset",IDC_OFFSETHACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,69,65,10
CONTROL "Sprite",IDC_SPRITEHACK,"Button",BS_AUTO3STATE | WS_TABSTOP,14,85,35,10 CONTROL "Sprite",IDC_SPRITEHACK,"Button",BS_AUTO3STATE | WS_TABSTOP,14,85,35,10
LTEXT "USE AT YOUR OWN RISK!",IDC_STATIC,7,228,84,11,WS_DISABLED LTEXT "USE AT YOUR OWN RISK!",IDC_STATIC,7,260,84,11,WS_DISABLED
COMBOBOX IDC_MSAACB,35,18,54,63,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_MSAACB,35,18,54,63,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "WildArmsOffset",IDC_WILDHACK,"Button",BS_AUTO3STATE | WS_TABSTOP,14,102,64,10 CONTROL "WildArmsOffset",IDC_WILDHACK,"Button",BS_AUTO3STATE | WS_TABSTOP,14,102,64,10
LTEXT "TEXT_GOES_HERE",IDC_HACK_DESCRIPTION,102,20,199,192 LTEXT "TEXT_GOES_HERE",IDC_HACK_DESCRIPTION,102,20,199,192
CONTROL "Aggressive-CRC",IDC_AGGRESSIVECRC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,119,66,10 CONTROL "Aggressive-CRC",IDC_AGGRESSIVECRC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,119,66,10
CONTROL "Alpha Stencil",IDC_ALPHASTENCIL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,136,66,10 CONTROL "Alpha Stencil",IDC_ALPHASTENCIL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,136,66,10
CONTROL "Disable CRCs",IDC_CHECK_DISABLE_ALL_HACKS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,168,58,10 CONTROL "Disable CRCs",IDC_CHECK_DISABLE_ALL_HACKS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,168,58,10
LTEXT "TC Offset X",IDC_STATIC_TCOFFSETX,14,186,37,8 CONTROL "Stretch Sprite",IDC_STRETCH_SPRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,184,66,10
EDITTEXT IDC_TCOFFSETX2,53,184,35,14,ES_RIGHT | ES_AUTOHSCROLL CONTROL "Align Sprite",IDC_ALIGN_SPRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,200,60,10
CONTROL "",IDC_TCOFFSETX,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,86,184,11,14 LTEXT "TC Offset X",IDC_STATIC_TCOFFSETX,14,218,37,8
EDITTEXT IDC_TCOFFSETY2,53,201,35,14,ES_RIGHT | ES_AUTOHSCROLL EDITTEXT IDC_TCOFFSETX2,53,216,35,14,ES_RIGHT | ES_AUTOHSCROLL
CONTROL "",IDC_TCOFFSETY,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,86,201,11,14 CONTROL "",IDC_TCOFFSETX,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,86,216,11,14
LTEXT "TC Offset Y",IDC_STATIC_TCOFFSETY,14,203,37,8 EDITTEXT IDC_TCOFFSETY2,53,233,35,14,ES_RIGHT | ES_AUTOHSCROLL
CONTROL "",IDC_TCOFFSETY,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,86,233,11,14
LTEXT "TC Offset Y",IDC_STATIC_TCOFFSETY,14,235,37,8
CONTROL "NVIDIA Hack",IDC_CHECK_NVIDIA_HACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,152,57,10 CONTROL "NVIDIA Hack",IDC_CHECK_NVIDIA_HACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,152,57,10
END END

View File

@ -72,6 +72,8 @@
#define IDC_ANISOTROPIC 2089 #define IDC_ANISOTROPIC 2089
#define IDC_AFCOMBO 2090 #define IDC_AFCOMBO 2090
#define IDC_OPENCL_DEVICE 2091 #define IDC_OPENCL_DEVICE 2091
#define IDC_STRETCH_SPRITE 2092
#define IDC_ALIGN_SPRITE 2093
#define IDC_COLORSPACE 3000 #define IDC_COLORSPACE 3000
#define IDR_CONVERT_FX 10000 #define IDR_CONVERT_FX 10000
#define IDR_TFX_FX 10001 #define IDR_TFX_FX 10001
@ -92,7 +94,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 10012 #define _APS_NEXT_RESOURCE_VALUE 10012
#define _APS_NEXT_COMMAND_VALUE 32771 #define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 2092 #define _APS_NEXT_CONTROL_VALUE 2094
#define _APS_NEXT_SYMED_VALUE 5000 #define _APS_NEXT_SYMED_VALUE 5000
#endif #endif
#endif #endif