Merge pull request #616 from ssakash/patch-22

swap value functions for Round sprite hack.
This commit is contained in:
refractionpcsx2 2015-07-02 19:33:03 +01:00
commit 193f47ebb1
2 changed files with 13 additions and 4 deletions

View File

@ -93,7 +93,7 @@ const char* dialog_message(int ID, bool* updateText) {
case IDC_ROUND_SPRITE: case IDC_ROUND_SPRITE:
return "Corrects the sampling of 2D sprite textures when upscaling.\n\n" return "Corrects the sampling of 2D sprite textures when upscaling.\n\n"
"Fixes lines in sprites of games like Ar tonelico when upscaling.\n\n" "Fixes lines in sprites of games like Ar tonelico when upscaling.\n\n"
"Carries a total of three states: Unchecked (off), Shaded (on for all sprites) and Checked (on for flat sprites)"; "Windows: Carries a total of three states: Unchecked (off), Checked (on for all sprites) and Shaded (on for flat sprites)";
case IDC_TCOFFSETX: case IDC_TCOFFSETX:
case IDC_TCOFFSETX2: case IDC_TCOFFSETX2:
case IDC_STATIC_TCOFFSETX: case IDC_STATIC_TCOFFSETX:

View File

@ -569,7 +569,16 @@ GSHacksDlg::GSHacksDlg() :
memset(msaa2cb, 0, sizeof(msaa2cb)); memset(msaa2cb, 0, sizeof(msaa2cb));
memset(cb2msaa, 0, sizeof(cb2msaa)); memset(cb2msaa, 0, sizeof(cb2msaa));
} }
int swap_states(int a)
{
switch(a)
{
case 0: return 0;
case 1: return 2;
case 2: return 1;
default: return 0; // If user's set more than 2 in ini file, set variable to 0.
}
}
void GSHacksDlg::OnInit() void GSHacksDlg::OnInit()
{ {
bool dx9 = (int)SendMessage(GetDlgItem(GetParent(m_hWnd), IDC_RENDERER), CB_GETCURSEL, 0, 0) / 3 == 0; bool dx9 = (int)SendMessage(GetDlgItem(GetParent(m_hWnd), IDC_RENDERER), CB_GETCURSEL, 0, 0) / 3 == 0;
@ -619,7 +628,7 @@ void GSHacksDlg::OnInit()
CheckDlgButton(m_hWnd, IDC_SPRITEHACK, theApp.GetConfig("UserHacks_SpriteHack", 0)); CheckDlgButton(m_hWnd, IDC_SPRITEHACK, theApp.GetConfig("UserHacks_SpriteHack", 0));
CheckDlgButton(m_hWnd, IDC_WILDHACK, theApp.GetConfig("UserHacks_WildHack", 0)); CheckDlgButton(m_hWnd, IDC_WILDHACK, theApp.GetConfig("UserHacks_WildHack", 0));
CheckDlgButton(m_hWnd, IDC_ALPHASTENCIL, theApp.GetConfig("UserHacks_AlphaStencil", 0)); CheckDlgButton(m_hWnd, IDC_ALPHASTENCIL, theApp.GetConfig("UserHacks_AlphaStencil", 0));
CheckDlgButton(m_hWnd, IDC_ROUND_SPRITE, theApp.GetConfig("UserHacks_round_sprite_offset", 0)); CheckDlgButton(m_hWnd, IDC_ROUND_SPRITE, swap_states(theApp.GetConfig("UserHacks_round_sprite_offset", 0)));
CheckDlgButton(m_hWnd, IDC_ALIGN_SPRITE, theApp.GetConfig("UserHacks_align_sprite_X", 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));
@ -680,7 +689,7 @@ bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
theApp.SetConfig("UserHacks_SkipDraw", (int)SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_GETPOS, 0, 0)); theApp.SetConfig("UserHacks_SkipDraw", (int)SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_GETPOS, 0, 0));
theApp.SetConfig("UserHacks_WildHack", (int)IsDlgButtonChecked(m_hWnd, IDC_WILDHACK)); theApp.SetConfig("UserHacks_WildHack", (int)IsDlgButtonChecked(m_hWnd, IDC_WILDHACK));
theApp.SetConfig("UserHacks_AlphaStencil", (int)IsDlgButtonChecked(m_hWnd, IDC_ALPHASTENCIL)); theApp.SetConfig("UserHacks_AlphaStencil", (int)IsDlgButtonChecked(m_hWnd, IDC_ALPHASTENCIL));
theApp.SetConfig("UserHacks_round_sprite_offset", (int)IsDlgButtonChecked(m_hWnd, IDC_ROUND_SPRITE)); theApp.SetConfig("UserHacks_round_sprite_offset", swap_states((int)IsDlgButtonChecked(m_hWnd, IDC_ROUND_SPRITE)));
theApp.SetConfig("Userhacks_align_sprite_X", (int)IsDlgButtonChecked(m_hWnd, IDC_ALIGN_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;