Posts: 8.597
Threads: 105
Joined: May 2014
Reputation:
168
Location: 127.0.0.1
Sorry, I'm on my smart phone right now. You can check the Gsdx hw renderer.cpp at GSdx to take a look at the code. Also, refer to blyss's recent PR to get more details on the code.
We're supposed to be working as a team, if we aren't helping and suggesting things to each other, we aren't working as a team.
- Refraction
Sponsored links
Posts: 3.377
Threads: 57
Joined: Feb 2013
Reputation:
57
You can post the code when you use your PC. I wouldn't bother to find the code myself.
Posts: 5.076
Threads: 18
Joined: Oct 2010
Reputation:
154
I always hate these three state checkboxes...
Why don't you use a drop-down combobox (as MSAA)? That is much clearer... Nobody would expect that a check box has three states. Therefore doing so is a usability crime.
Posts: 1.977
Threads: 25
Joined: Sep 2009
Reputation:
31
(04-17-2015, 10:59 PM)willkuer Wrote: I always hate these three state checkboxes...
Why don't you use a drop-down combobox (as MSAA)? That is much clearer... Nobody would expect that a check box has three states. Therefore doing so is a usability crime.
cause 3 other hack use the same system changing it to drop down mean other should be changed to to keep things consistent which probably more work to do?
it probably Simpler to just keep things as is and put info in the info box that states said hack has 3 states and what each state does.
Posts: 5.076
Threads: 18
Joined: Oct 2010
Reputation:
154
04-18-2015, 12:05 AM
(This post was last modified: 04-18-2015, 12:06 AM by willkuer.)
MSAA is a drop down combobox. Reimplementation shouldn't be an issue therefore... It would be rather problematic that everybody is used to these three-state checkboxes. But if some of them might be removed sooner or later as the new hacks make them obsolete one can just keep them for now.
I would also say that those hardware settings (8-bit, filtering, log-z, alpha corr) should be in the hardware hacks window. I would then just call that advanced settings and remove that enable hw hacks tickbox.
Everybody is talking about redesigning the gui. So I would not fear to simplify it and make some changes.
Posts: 3.377
Threads: 57
Joined: Feb 2013
Reputation:
57
Three-state check boxes are okay for multi-level selection, but it's confusing in this case. Regarding the amount of work, it shouldn't be the excuse. And it's not necessary that everything has to be changed at once.
Posts: 1.977
Threads: 25
Joined: Sep 2009
Reputation:
31
(04-18-2015, 12:05 AM)willkuer Wrote: MSAA is a drop down combobox. Reimplementation shouldn't be an issue therefore... It would be rather problematic that everybody is used to these three-state checkboxes. But if some of them might be removed sooner or later as the new hacks make them obsolete one can just keep them for now.
I would also say that those hardware settings (8-bit, filtering, log-z, alpha corr) should be in the hardware hacks window. I would then just call that advanced settings and remove that enable hw hacks tickbox.
Everybody is talking about redesigning the gui. So I would not fear to simplify it and make some changes.
talk of redesigning the GUI didnt go no where, till such a thing happens its best to keep every thing consistent
Posts: 3.377
Threads: 57
Joined: Feb 2013
Reputation:
57
04-18-2015, 12:37 AM
(This post was last modified: 04-18-2015, 12:37 AM by Akio.)
I think it's not a big deal. It can be a three-state check box or a drop-down list. By the way, if somebody wants to add a drop-down list, they should be able to change Sprite and WildArmsOffet to use drop-down lists as well while they're at it. It should be a trivial task.
Posts: 8.597
Threads: 105
Joined: May 2014
Reputation:
168
Location: 127.0.0.1
04-18-2015, 07:26 AM
(This post was last modified: 04-18-2015, 07:27 AM by ssakash.)
willkuer Wrote:Nobody would expect that a check box has three states. Therefore doing so is a usability crime. I have also added a description to make people understand that there are three states.
Code: case IDC_ROUND_SPRITE:
helpstr = "Corrects the sampling of 2D sprite textures when upscaling.\n"
"Fixes lines in sprites of games like Ar tonelico when upscaling.\n"
"Works best at 2x, but helps at any resolution.";
"carries total of three states, are 0 (off) /1 (on for flat sprites)/2 (on all sprites)";
xenmas99 Wrote:I think it's not a big deal. It can be a three-state check box or a drop-down list. By the way, if somebody wants to add a drop-down list yes, Implementation of a drop-down list is a easy task but, It will affect the consistency since, we are changing something which we have been accustomed for since the 1.2.1 release.
btw, here are the codes co-relating with the UI, this is the current situation. I have replaced the stretch sprite offset as round sprite offset in my own commit.
Code: // Dialog
//
IDD_HACKS DIALOGEX 0, 0, 315, 278
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Hacks Configuration"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,258,257,50,14
GROUPBOX "Hack",IDC_STATIC,7,7,86,246,0,WS_EX_TRANSPARENT
GROUPBOX "Description",IDC_STATIC,96,7,212,246
LTEXT "MSAA",IDC_STATIC_MSAA,14,20,20,8
LTEXT "Skipdraw",IDC_STATIC_SKIPDRAW,14,37,30,8
EDITTEXT IDC_SKIPDRAWHACKEDIT,53,35,35,14,ES_RIGHT | ES_AUTOHSCROLL
CONTROL "",IDC_SKIPDRAWHACK,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,88,35,10,14
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 "Sprite",IDC_SPRITEHACK,"Button",BS_AUTO3STATE | WS_TABSTOP,14,85,35,10
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
CONTROL "WildArmsOffset",IDC_WILDHACK,"Button",BS_AUTO3STATE | WS_TABSTOP,14,102,64,10
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 "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 "Stretch Sprite",IDC_STRETCH_SPRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,184,66,10
CONTROL "Align Sprite",IDC_ALIGN_SPRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,200,60,10
LTEXT "TC Offset X",IDC_STATIC_TCOFFSETX,14,218,37,8
EDITTEXT IDC_TCOFFSETX2,53,216,35,14,ES_RIGHT | ES_AUTOHSCROLL
CONTROL "",IDC_TCOFFSETX,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,86,216,11,14
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
END
Code: CheckDlgButton(m_hWnd, IDC_ALPHAHACK, theApp.GetConfig("UserHacks_AlphaHack", 0));
CheckDlgButton(m_hWnd, IDC_OFFSETHACK, theApp.GetConfig("UserHacks_HalfPixelOffset", 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_AGGRESSIVECRC, theApp.GetConfig("UserHacks_AggressiveCRC", 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_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_SETPOS, 0, MAKELPARAM(theApp.GetConfig("UserHacks_SkipDraw", 0), 0));
SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETX), UDM_SETRANGE, 0, MAKELPARAM(10000, 0));
SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETX), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfig("UserHacks_TCOffset", 0) & 0xFFFF, 0));
SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETY), UDM_SETRANGE, 0, MAKELPARAM(10000, 0));
SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETY), UDM_SETPOS, 0, MAKELPARAM((theApp.GetConfig("UserHacks_TCOffset", 0) >> 16) & 0xFFFF, 0));
// Hacks descriptions
SetWindowText(GetDlgItem(m_hWnd, IDC_HACK_DESCRIPTION), "Hover over an item to get a description.");
}
void GSHacksDlg::UpdateControls()
{}
bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_SETCURSOR:
{
bool updateText = true;
POINT pos;
GetCursorPos(&pos);
ScreenToClient(m_hWnd, &pos);
HWND hoveredwnd = ChildWindowFromPointEx(m_hWnd, pos, CWP_SKIPINVISIBLE | CWP_SKIPTRANSPARENT);
if (hoveredwnd != hovered_window)
hovered_window = hoveredwnd;
else
break;
const char *helpstr = dialog_message(GetDlgCtrlID(hoveredwnd), &updateText);
if(updateText)
SetWindowText(GetDlgItem(m_hWnd, IDC_HACK_DESCRIPTION), helpstr);
} break;
case WM_COMMAND:
{
int id = LOWORD(wParam);
switch(id)
{
case IDOK:
{
theApp.SetConfig("UserHacks_MSAA", cb2msaa[(int)SendMessage(GetDlgItem(m_hWnd, IDC_MSAACB), CB_GETCURSEL, 0, 0)]);
theApp.SetConfig("UserHacks_AlphaHack", (int)IsDlgButtonChecked(m_hWnd, IDC_ALPHAHACK));
theApp.SetConfig("UserHacks_HalfPixelOffset", (int)IsDlgButtonChecked(m_hWnd, IDC_OFFSETHACK));
theApp.SetConfig("UserHacks_SpriteHack", (int)IsDlgButtonChecked(m_hWnd, IDC_SPRITEHACK));
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_AggressiveCRC", (int)IsDlgButtonChecked(m_hWnd, IDC_AGGRESSIVECRC));
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_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;
TCOFFSET |= (SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETY), UDM_GETPOS, 0, 0) & 0xFFFF) << 16;
theApp.SetConfig("UserHacks_TCOffset", TCOFFSET);
EndDialog(m_hWnd, id);
} break;
If you want to know how the BS_AUTO3STATE function works then, take a look at nativdlg.cpp , anybutton.cpp at Wx widgets.
We're supposed to be working as a team, if we aren't helping and suggesting things to each other, we aren't working as a team.
- Refraction
Posts: 21.718
Threads: 401
Joined: Sep 2013
Reputation:
476
Location: 私の夢の中
Perhaps the easy way would be to get gregory to change the hack where 1 = full on and 2 = half on. Other than that, conditional statement may be the only way.
Gaming Rig: Intel i7 6700k @ 4.8Ghz | GTX 1070 TI | 32GB RAM | 960GB(480GB+480GB RAID0) SSD | 2x 1TB HDD
|