From 85cbe285f0f80f150fdcb6798db9dbaf4ffc5ff4 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 16 Apr 2015 19:20:17 +0200 Subject: [PATCH] gsdx dialog: move hack info into a separate file This way it can be reused on linux. --- plugins/GSdx/GSSetting.cpp | 73 +++++++++++++++++++++++++++++ plugins/GSdx/GSSetting.h | 28 ++++++++++++ plugins/GSdx/GSSettingsDlg.cpp | 84 +--------------------------------- 3 files changed, 103 insertions(+), 82 deletions(-) diff --git a/plugins/GSdx/GSSetting.cpp b/plugins/GSdx/GSSetting.cpp index c2e140569b..ce7253d49f 100644 --- a/plugins/GSdx/GSSetting.cpp +++ b/plugins/GSdx/GSSetting.cpp @@ -22,3 +22,76 @@ #include "stdafx.h" #include "GSSetting.h" +const char* dialog_message(int ID, bool* updateText) { + if (updateText) + *updateText = true; + switch (ID) + { + case IDC_SKIPDRAWHACK: + case IDC_SKIPDRAWHACKEDIT: + case IDC_STATIC_SKIPDRAW: + return "Skipdraw\n\nSkips drawing n surfaces completely. " + "Use it, for example, to try and get rid of bad post processing effects." + " Try values between 1 and 100."; + case IDC_ALPHAHACK: + return "Alpha Hack\n\nDifferent alpha handling. Can work around some shadow problems."; + case IDC_OFFSETHACK: + return "Halfpixel\n\nMight fix some misaligned fog, bloom, or blend effect."; + case IDC_SPRITEHACK: + return "Sprite Hack\n\nHelps getting rid of black inner lines in some filtered sprites." + " Half option is the preferred one. Use it for Mana Khemia or Ar Tonelico for example." + " Full can be used for Tales of Destiny."; + case IDC_WILDHACK: + return "WildArms\n\nLowers the GS precision to avoid gaps between pixels when" + " upscaling. Full option fixes the text on WildArms games, while Half option might improve portraits" + " in Ar Tonelico.\n\n" + "Strech hack might work too"; + case IDC_MSAACB: + case IDC_STATIC_MSAA: + return "Multisample Anti-Aliasing\n\nEnables hardware Anti-Aliasing. Needs lots of memory." + " The Z-24 modes might need to have LogarithmicZ to compensate for the bits lost (only in DX9 mode)."; + case IDC_AGGRESSIVECRC: + return "Use more aggressive CRC hacks on some games\n\n" + "Only affects few games, removing some effects which might make the image sharper/clearer.\n" + "Affected games: FFX, FFX2, FFXII, GOW2, ICO, SoTC, SSX3.\n" + "Works as a speedhack for: Steambot Chronicles."; + case IDC_ALPHASTENCIL: + return "Extend stencil based emulation of destination alpha to perform stencil operations while drawing.\n\n" + "Improves many shadows which are normally overdrawn in parts, may affect other effects.\n" + "Will disable partial transparency in some games or even prevent drawing some elements altogether."; + case IDC_CHECK_NVIDIA_HACK: + return "This is a hack to work around problems with recent NVIDIA drivers causing odd stretching problems in DirectX 11 only " + "when using Upscaling.\n\n" + "Try not to use this unless your game Videos or 2D screens are stretching outside the frame.\n\n" + "If you have an AMD/ATi graphics card you should not need this."; + case IDC_CHECK_DISABLE_ALL_HACKS: + return "FOR TESTING ONLY!!\n\n" + "Disable all CRC hacks - will break many games. Overrides CrcHacksExclusion at gsdx.ini\n" + "\n" + "It's possible to exclude CRC hacks also via the gsdx.ini. E.g.:\n" + "CrcHacksExclusions=all\n" + "CrcHacksExclusions=0x0F0C4A9C, 0x0EE5646B, 0x7ACF7E03"; + case IDC_ALIGN_SPRITE: + return "Sprite Alignment Hack\n\n" + "Fixes issues with upscaling(vertical lines) in Namco games like Ace Combat, Tekken, Soul Calibur, etc."; + case IDC_STRETCH_SPRITE: + return "Corrects the sampling of 2D sprite textures when upscaling.\n\n" + "Fixes lines in sprites of games like Ar tonelico when upscaling."; + case IDC_TCOFFSETX: + case IDC_TCOFFSETX2: + case IDC_STATIC_TCOFFSETX: + case IDC_TCOFFSETY: + case IDC_TCOFFSETY2: + case IDC_STATIC_TCOFFSETY: + return "Texture Coordinates Offset Hack\n\n" + "Offset for the ST/UV texture coordinates. Fixes some odd texture issues and might fix some post processing alignment too.\n\n" + " 0500 0500, fixes Persona 3 minimap, helps Haunting Ground.\n" + " 0000 1000, fixes Xenosaga hair edges (DX10+ Issue)\n"; + + default: + if (updateText) + *updateText = false; + return ""; + } + return ""; +} diff --git a/plugins/GSdx/GSSetting.h b/plugins/GSdx/GSSetting.h index 2bb40e3d2d..cb71307bfe 100644 --- a/plugins/GSdx/GSSetting.h +++ b/plugins/GSdx/GSSetting.h @@ -37,3 +37,31 @@ struct GSSetting this->note = note; } }; + +const char* dialog_message(int ID, bool* updateText = NULL); + +#ifdef __linux__ +enum { + IDC_SKIPDRAWHACK, + IDC_SKIPDRAWHACKEDIT, + IDC_STATIC_SKIPDRAW, + IDC_ALPHAHACK, + IDC_OFFSETHACK, + IDC_SPRITEHACK, + IDC_WILDHACK, + IDC_MSAACB, + IDC_STATIC_MSAA, + IDC_AGGRESSIVECRC, + IDC_ALPHASTENCIL, + IDC_CHECK_NVIDIA_HACK, + IDC_CHECK_DISABLE_ALL_HACKS, + IDC_ALIGN_SPRITE, + IDC_STRETCH_SPRITE, + IDC_TCOFFSETX, + IDC_TCOFFSETX2, + IDC_STATIC_TCOFFSETX, + IDC_TCOFFSETY, + IDC_TCOFFSETY2, + IDC_STATIC_TCOFFSETY +}; +#endif diff --git a/plugins/GSdx/GSSettingsDlg.cpp b/plugins/GSdx/GSSettingsDlg.cpp index e061c2ced9..c0482afb0d 100644 --- a/plugins/GSdx/GSSettingsDlg.cpp +++ b/plugins/GSdx/GSSettingsDlg.cpp @@ -26,6 +26,7 @@ #include "GSDevice9.h" #include "GSDevice11.h" #include "resource.h" +#include "GSSetting.h" GSSettingsDlg::GSSettingsDlg(bool isOpen2) : GSDialog(isOpen2 ? IDD_CONFIG2 : IDD_CONFIG) @@ -625,7 +626,6 @@ bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam) { case WM_SETCURSOR: { - const char *helpstr = ""; bool updateText = true; POINT pos; @@ -639,87 +639,7 @@ bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam) else break; - switch (GetDlgCtrlID(hoveredwnd)) - { - case IDC_SKIPDRAWHACK: - case IDC_SKIPDRAWHACKEDIT: - case IDC_STATIC_SKIPDRAW: - helpstr = "Skipdraw\n\nSkips drawing n surfaces completely. " - "Use it, for example, to try and get rid of bad post processing effects." - " Try values between 1 and 100."; - break; - case IDC_ALPHAHACK: - helpstr = "Alpha Hack\n\nDifferent alpha handling. Can work around some shadow problems."; - break; - case IDC_OFFSETHACK: - helpstr = "Halfpixel\n\nMight fix some misaligned fog, bloom, or blend effect."; - break; - case IDC_SPRITEHACK: - helpstr = "Sprite Hack\n\nHelps getting rid of black inner lines in some filtered sprites." - " Half option is the preferred one. Use it for Mana Khemia or Ar Tonelico for example." - " Full can be used for Tales of Destiny."; - break; - case IDC_WILDHACK: - helpstr = "WildArms\n\nLowers the GS precision to avoid gaps between pixels when" - " upscaling. Full option fixes the text on WildArms games, while Half option might improve portraits" - " in Ar Tonelico."; - break; - case IDC_MSAACB: - case IDC_STATIC_MSAA: - helpstr = "Multisample Anti-Aliasing\n\nEnables hardware Anti-Aliasing. Needs lots of memory." - " The Z-24 modes might need to have LogarithmicZ to compensate for the bits lost (only in DX9 mode)."; - break; - case IDC_AGGRESSIVECRC: - helpstr = "Use more aggressive CRC hacks on some games\n\n" - "Only affects few games, removing some effects which might make the image sharper/clearer.\n" - "Affected games: FFX, FFX2, FFXII, GOW2, ICO, SoTC, SSX3.\n" - "Works as a speedhack for: Steambot Chronicles."; - break; - case IDC_ALPHASTENCIL: - helpstr = "Extend stencil based emulation of destination alpha to perform stencil operations while drawing.\n\n" - "Improves many shadows which are normally overdrawn in parts, may affect other effects.\n" - "Will disable partial transparency in some games or even prevent drawing some elements altogether."; - break; - case IDC_CHECK_NVIDIA_HACK: - helpstr = "This is a hack to work around problems with recent NVIDIA drivers causing odd stretching problems in DirectX 11 only " - "when using Upscaling.\n\n" - "Try not to use this unless your game Videos or 2D screens are stretching outside the frame.\n\n" - "If you have an AMD/ATi graphics card you should not need this."; - break; - case IDC_CHECK_DISABLE_ALL_HACKS: - helpstr = "FOR TESTING ONLY!!\n\n" - "Disable all CRC hacks - will break many games. Overrides CrcHacksExclusion at gsdx.ini\n" - "\n" - "It's possible to exclude CRC hacks also via the gsdx.ini. E.g.:\n" - "CrcHacksExclusions=all\n" - "CrcHacksExclusions=0x0F0C4A9C, 0x0EE5646B, 0x7ACF7E03"; - break; - 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; - - case IDC_TCOFFSETX: - case IDC_TCOFFSETX2: - case IDC_STATIC_TCOFFSETX: - case IDC_TCOFFSETY: - case IDC_TCOFFSETY2: - case IDC_STATIC_TCOFFSETY: - helpstr = "Texture Coordinates Offset Hack\n\n" - "Offset for the ST/UV texture coordinates. Fixes some odd texture issues and might fix some post processing alignment too.\n\n" - " 0500 0500, fixes Persona 3 minimap, helps Haunting Ground.\n" - " 0000 1000, fixes Xenosaga hair edges (DX10+ Issue)\n"; - break; - - default: - updateText = false; - break; - } + const char *helpstr = dialog_message(GetDlgCtrlID(hoveredwnd), &updateText); if(updateText) SetWindowText(GetDlgItem(m_hWnd, IDC_HACK_DESCRIPTION), helpstr);