From c4c936152e952479d48a4a0aeabea61502ef5100 Mon Sep 17 00:00:00 2001 From: cxgeorge <> Date: Wed, 2 Jan 2002 03:51:46 +0000 Subject: [PATCH] add dx-no-dithering config var --- panda/src/dxgsg/config_dxgsg.cxx | 1 + panda/src/dxgsg/config_dxgsg.h | 3 ++- panda/src/dxgsg/dxGraphicsStateGuardian.cxx | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/panda/src/dxgsg/config_dxgsg.cxx b/panda/src/dxgsg/config_dxgsg.cxx index 78a5697e2d..0592bbf1a1 100644 --- a/panda/src/dxgsg/config_dxgsg.cxx +++ b/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); diff --git a/panda/src/dxgsg/config_dxgsg.h b/panda/src/dxgsg/config_dxgsg.h index 6b101b4af8..3b64ca9c02 100644 --- a/panda/src/dxgsg/config_dxgsg.h +++ b/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; diff --git a/panda/src/dxgsg/dxGraphicsStateGuardian.cxx b/panda/src/dxgsg/dxGraphicsStateGuardian.cxx index 340aa48b01..adf6242e03 100644 --- a/panda/src/dxgsg/dxGraphicsStateGuardian.cxx +++ b/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);