DXGL r770 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r769‎ | r770 | r771 >
Date:06:29, 6 December 2017
Author:admin
Status:new
Tags:
Comment:
Add variables for low color D3D rendering and dithering control.
Modified paths:
  • /cfgmgr/ReadMe.txt (modified) (history)
  • /cfgmgr/cfgmgr.c (modified) (history)
  • /cfgmgr/cfgmgr.h (modified) (history)

Diff [purge]

Index: cfgmgr/ReadMe.txt
@@ -315,6 +315,25 @@
316316 1 - Expand viewable area. May have glitches on edge of screen.
317317 2 - Crop to viewable area. May cause graphics to get cut off.
318318
 319+Member LowColorRendering
 320+INI Entry LowColorRendering
 321+INI Group d3d
 322+REG_DWORD HKCU\DXGL\Profiles\<app>\LowColorRendering
 323+If nonzero, increases low color render targets to 32bpp.
 324+
 325+Member EnableDithering
 326+INI Entry EnableDithering
 327+INI Group d3d
 328+REG_DWORD HKCU\DXGL\Profiles\<app>\EnableDithering
 329+Determines when dithering is enabled for Direct3D rendering.
 330+Valid settings:
 331+0 - Enables dithering when requested by the application except when in a
 332+ true-color mode.
 333+1 - Disables dithering at all times.
 334+2 - Always enables dithering for low color modes.
 335+3 - Enables dithering per application, for all modes.
 336+4 - Always enables dithering, for all modes.
 337+
319338 Member vsync
320339 INI Entry VSync
321340 INI Group advanced
Index: cfgmgr/cfgmgr.c
@@ -546,6 +546,8 @@
547547 cfg->anisotropic = ReadDWORD(hKey,cfg->anisotropic,&cfgmask->anisotropic,_T("AnisotropicFiltering"));
548548 cfg->msaa = ReadDWORD(hKey,cfg->msaa,&cfgmask->msaa,_T("Antialiasing"));
549549 cfg->aspect3d = ReadDWORD(hKey,cfg->aspect3d,&cfgmask->aspect3d,_T("AdjustAspectRatio"));
 550+ cfg->LowColorRendering = ReadDWORD(hKey, cfg->LowColorRendering, &cfgmask->LowColorRendering, _T("LowColorRendering"));
 551+ cfg->EnableDithering = ReadDWORD(hKey, cfg->EnableDithering, &cfgmask->EnableDithering, _T("EnableDithering"));
550552 cfg->primaryscale = ReadDWORD(hKey,cfg->primaryscale,&cfgmask->primaryscale,_T("AdjustPrimaryResolution"));
551553 cfg->primaryscalex = ReadFloat(hKey,cfg->primaryscalex,&cfgmask->primaryscalex,_T("PrimaryScaleX"));
552554 cfg->primaryscaley = ReadFloat(hKey,cfg->primaryscaley,&cfgmask->primaryscaley,_T("PrimaryScaleY"));
@@ -680,6 +682,8 @@
681683 WriteDWORD(hKey,cfg->anisotropic,cfgmask->anisotropic,_T("AnisotropicFiltering"));
682684 WriteDWORD(hKey,cfg->msaa,cfgmask->msaa,_T("Antialiasing"));
683685 WriteDWORD(hKey,cfg->aspect3d,cfgmask->aspect3d,_T("AdjustAspectRatio"));
 686+ WriteDWORD(hKey, cfg->LowColorRendering, cfgmask->LowColorRendering, _T("LowColorRendering"));
 687+ WriteDWORD(hKey, cfg->EnableDithering, cfgmask->EnableDithering, _T("EnableDithering"));
684688 WriteDWORD(hKey,cfg->primaryscale,cfgmask->primaryscale,_T("AdjustPrimaryResolution"));
685689 WriteFloat(hKey,cfg->primaryscalex,cfgmask->primaryscalex,_T("PrimaryScaleX"));
686690 WriteFloat(hKey,cfg->primaryscaley,cfgmask->primaryscaley,_T("PrimaryScaleY"));
@@ -935,6 +939,8 @@
936940 if (!stricmp(name, "AnisotropicFiltering")) cfg->anisotropic = INIIntValue(value);
937941 if (!stricmp(name, "Antialiasing")) cfg->msaa = INIHexValue(value);
938942 if (!stricmp(name, "D3DAspect")) cfg->aspect3d = INIIntValue(value);
 943+ if (!stricmp(name, "LowColorRendering")) cfg->LowColorRendering = INIIntValue(value);
 944+ if (!stricmp(name, "EnableDithering")) cfg->EnableDithering = INIIntValue(value);
939945 }
940946 if (!stricmp(section, "advanced"))
941947 {
Index: cfgmgr/cfgmgr.h
@@ -60,6 +60,8 @@
6161 DWORD anisotropic;
6262 DWORD msaa;
6363 DWORD aspect3d;
 64+ DWORD LowColorRendering;
 65+ DWORD EnableDithering;
6466 // [advanced]
6567 DWORD vsync;
6668 DWORD TextureFormat;