Sfoglia il codice sorgente

add dx-no-dithering config var

cxgeorge 24 anni fa
parent
commit
c4c936152e

+ 1 - 0
panda/src/dxgsg/config_dxgsg.cxx

@@ -75,6 +75,7 @@ bool dx_ignore_mipmaps = config_dxgsg.GetBool("dx-ignore-mipmaps", false);
 // if this is set, more accurate but more expensive fog computations are performed
 bool dx_use_rangebased_fog = config_dxgsg.GetBool("dx-use-rangebased-fog", false);
 bool dx_force_16bpptextures = config_dxgsg.GetBool("dx-force-16bpptextures", false);
+bool dx_no_dithering = config_dxgsg.GetBool("dx-no-dithering", false);
 
 #ifdef _DEBUG
 float dx_global_miplevel_bias = config_dxgsg.GetFloat("dx-global-miplevel-bias", 0.0);

+ 2 - 1
panda/src/dxgsg/config_dxgsg.h

@@ -35,11 +35,12 @@ extern bool dx_auto_normalize_lighting;
 extern bool dx_use_rangebased_fog;
 extern const bool link_tristrips;
 
-// debug flags
+// debug flags we might want to use in full optimized build
 extern bool dx_ignore_mipmaps;
 extern bool dx_mipmap_everything;
 extern bool dx_show_transforms;
 extern bool dx_force_16bpptextures;
+extern bool dx_no_dithering;
 
 #ifndef NDEBUG
 extern int dx_force_backface_culling;

+ 1 - 1
panda/src/dxgsg/dxGraphicsStateGuardian.cxx

@@ -702,7 +702,7 @@ dx_init(  LPDIRECTDRAW7     context,
     // turn on dithering if the rendertarget is < 8bits/color channel
     DX_DECLARE_CLEAN(DDSURFACEDESC2, ddsd_back);
     _back->GetSurfaceDesc(&ddsd_back);
-    _dither_enabled = ((ddsd_back.ddpfPixelFormat.dwRGBBitCount < 24) &&
+    _dither_enabled = (!dx_no_dithering) && ((ddsd_back.ddpfPixelFormat.dwRGBBitCount < 24) &&
                        (_D3DDevDesc.dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_DITHER));
     _d3dDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, _dither_enabled);