DXGL r776 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r775‎ | r776 | r777 >
Date:06:52, 14 December 2017
Author:admin
Status:new
Tags:
Comment:
Add configuration variables for crop 640x480 to 640x400 and expand 512x448 to 640x480.
Implement hacks tab in DXGL Config.
Modified paths:
  • /cfgmgr/cfgmgr.c (modified) (history)
  • /cfgmgr/cfgmgr.h (modified) (history)
  • /dxglcfg/dxglcfg.cpp (modified) (history)

Diff [purge]

Index: cfgmgr/cfgmgr.c
@@ -580,6 +580,8 @@
581581 cfg->DebugNoGLSL130 = ReadBool(hKey, cfg->DebugNoGLSL130, &cfgmask->DebugNoGLSL130, _T("DebugNoGLSL130"));
582582 cfg->DebugMaxGLVersionMajor = ReadDWORD(hKey, cfg->DebugMaxGLVersionMajor, &cfgmask->DebugMaxGLVersionMajor, _T("DebugMaxGLVersionMajor"));
583583 cfg->DebugMaxGLVersionMinor = ReadDWORD(hKey, cfg->DebugMaxGLVersionMinor, &cfgmask->DebugMaxGLVersionMinor, _T("DebugMaxGLVersionMinor"));
 584+ cfg->HackCrop640480to640400 = ReadBool(hKey, cfg->HackCrop640480to640400, &cfgmask->HackCrop640480to640400, _T("HackCrop640480to640400"));
 585+ cfg->HackAutoScale512448to640480 = ReadBool(hKey, cfg->HackAutoScale512448to640480, &cfgmask->HackAutoScale512448to640480, _T("HackAutoScale512448to640480"));
584586 if(!global && dll)
585587 {
586588 sizeout = 0;
@@ -716,6 +718,8 @@
717719 WriteBool(hKey, cfg->DebugNoGLSL130, cfgmask->DebugNoGLSL130, _T("DebugNoGLSL130"));
718720 WriteDWORD(hKey, cfg->DebugMaxGLVersionMajor, cfgmask->DebugMaxGLVersionMajor, _T("DebugMaxGLVersionMajor"));
719721 WriteDWORD(hKey, cfg->DebugMaxGLVersionMinor, cfgmask->DebugMaxGLVersionMinor, _T("DebugMaxGLVersionMinor"));
 722+ WriteBool(hKey, cfg->HackCrop640480to640400, cfgmask->HackCrop640480to640400, _T("HackCrop640480to640400"));
 723+ WriteBool(hKey, cfg->HackAutoScale512448to640480, cfgmask->HackAutoScale512448to640480, _T("HackAutoScale512448to640480"));
720724 }
721725
722726 TCHAR newregname[MAX_PATH+65];
@@ -966,6 +970,11 @@
967971 if (!stricmp(name, "DebugMaxGLVersionMajor")) cfg->DebugMaxGLVersionMajor = INIIntValue(value);
968972 if (!stricmp(name, "DebugMaxGLVersionMinor")) cfg->DebugMaxGLVersionMinor = INIIntValue(value);
969973 }
 974+ if (!stricmp(section, "hacks"))
 975+ {
 976+ if (!stricmp(section, "HackCrop640480to640400")) cfg->HackCrop640480to640400 = INIBoolValue(value);
 977+ if (!stricmp(section, "HackAutoScale512448to640480")) cfg->HackAutoScale512448to640480 = INIBoolValue(value);
 978+ }
970979 return 1;
971980 }
972981
Index: cfgmgr/cfgmgr.h
@@ -78,6 +78,9 @@
7979 BOOL DebugNoGLSL130;
8080 DWORD DebugMaxGLVersionMajor;
8181 DWORD DebugMaxGLVersionMinor;
 82+ // [hacks]
 83+ BOOL HackCrop640480to640400;
 84+ BOOL HackAutoScale512448to640480;
8285 // internal
8386 BOOL Windows8Detected;
8487 BOOL ParsedAddColorDepths;
Index: dxglcfg/dxglcfg.cpp
@@ -1996,6 +1996,14 @@
19971997 {
19981998 switch (item)
19991999 {
 2000+ case 0:
 2001+ *value = cfg->HackCrop640480to640400;
 2002+ *mask = cfgmask->HackCrop640480to640400;
 2003+ break;
 2004+ case 1:
 2005+ *value = cfg->HackAutoScale512448to640480;
 2006+ *mask = cfgmask->HackAutoScale512448to640480;
 2007+ break;
20002008 default:
20012009 *value = FALSE;
20022010 *mask = FALSE;
@@ -2007,6 +2015,14 @@
20082016 {
20092017 switch (item)
20102018 {
 2019+ case 0:
 2020+ cfg->HackCrop640480to640400 = value;
 2021+ cfgmask->HackCrop640480to640400 = mask;
 2022+ break;
 2023+ case 1:
 2024+ cfg->HackAutoScale512448to640480 = value;
 2025+ cfgmask->HackAutoScale512448to640480 = mask;
 2026+ break;
20112027 default:
20122028 break;
20132029 }