Browse Source

fix antialias typos

David Rose 22 years ago
parent
commit
f8ce9193c2

+ 3 - 6
panda/src/dxgsg7/dxGraphicsStateGuardian7.I

@@ -16,8 +16,6 @@
 //
 ////////////////////////////////////////////////////////////////////
 
-#include "config_dxgsg7.h"
-#include <graphicsWindow.h>
 
 ////////////////////////////////////////////////////////////////////
 //     Function: DXGraphicsStateGuardian7::enable_line_smooth
@@ -28,7 +26,7 @@ INLINE void DXGraphicsStateGuardian7::
 enable_line_smooth(bool val) {
   if(_line_smooth_enabled != val) {
     _line_smooth_enabled = val;
-  #ifdef NDEBUG
+  #ifndef NDEBUG
     {
         if(val && (_pScrn->D3DDevDesc.dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_ANTIALIASEDGES))
            dxgsg7_cat.error() << "no HW support for line smoothing!!\n";
@@ -47,16 +45,15 @@ enable_line_smooth(bool val) {
 INLINE void DXGraphicsStateGuardian7::
 enable_dither(bool val) {
   if (_dither_enabled != val) {
+    _dither_enabled = val;
 
-  #ifdef _DEBUG
+  #ifndef NDEBUG
     {
         if(val && !(_pScrn->D3DDevDesc.dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_DITHER))
            dxgsg7_cat.error() << "no HW support for color dithering!!\n";
-        return;
     }
   #endif
 
-    _dither_enabled = val;
     _pScrn->pD3DDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, (DWORD)val);
   }
 }

+ 2 - 0
panda/src/dxgsg7/dxGraphicsStateGuardian7.h

@@ -24,6 +24,7 @@
 #include "dxgsg7base.h"
 #include "dxGeomNodeContext7.h"
 #include "dxTextureContext7.h"
+#include "config_dxgsg7.h"
 
 #include "graphicsStateGuardian.h"
 #include "geomprimitives.h"
@@ -36,6 +37,7 @@
 #include "textureApplyAttrib.h"
 #include "fog.h"
 #include "pointerToArray.h"
+#include "graphicsWindow.h"
 
 class Light;
 

+ 3 - 6
panda/src/dxgsg8/dxGraphicsStateGuardian8.I

@@ -16,8 +16,6 @@
 //
 ////////////////////////////////////////////////////////////////////
 
-// for dxgsg8_cat stuff
-#include "config_dxgsg8.h"
 
 ////////////////////////////////////////////////////////////////////
 //     Function: DXGraphicsStateGuardian8::enable_line_smooth
@@ -28,7 +26,7 @@ INLINE void DXGraphicsStateGuardian8::
 enable_line_smooth(bool val) {
   if(_line_smooth_enabled != val) {
     _line_smooth_enabled = val;
-  #ifdef NDEBUG
+  #ifndef NDEBUG
     {
         if(val && (_pScrn->d3dcaps.RasterCaps & D3DPRASTERCAPS_ANTIALIASEDGES))
            dxgsg8_cat.error() << "no HW support for line smoothing!!\n";
@@ -47,16 +45,15 @@ enable_line_smooth(bool val) {
 INLINE void DXGraphicsStateGuardian8::
 enable_dither(bool val) {
   if (_dither_enabled != val) {
+    _dither_enabled = val;
 
-  #ifdef _DEBUG
+  #ifndef NDEBUG
     {
         if(val && !(_pScrn->d3dcaps.RasterCaps & D3DPRASTERCAPS_DITHER))
            dxgsg8_cat.error() << "no HW support for color dithering!!\n";
-        return;
     }
   #endif
 
-    _dither_enabled = val;
     _pD3DDevice->SetRenderState(D3DRS_DITHERENABLE, (DWORD)val);
   }
 }

+ 1 - 0
panda/src/dxgsg8/dxGraphicsStateGuardian8.h

@@ -25,6 +25,7 @@
 #include "dxGeomNodeContext8.h"
 #include "dxTextureContext8.h"
 #include "d3dfont8.h"
+#include "config_dxgsg8.h"
 
 #include "graphicsStateGuardian.h"
 #include "geomprimitives.h"

+ 4 - 7
panda/src/dxgsg9/dxGraphicsStateGuardian9.I

@@ -16,8 +16,6 @@
 //
 ////////////////////////////////////////////////////////////////////
 
-// for dxgsg9_cat stuff
-#include "config_dxgsg9.h"
 
 ////////////////////////////////////////////////////////////////////
 //     Function: DXGraphicsStateGuardian9::enable_line_smooth
@@ -28,9 +26,9 @@ INLINE void DXGraphicsStateGuardian9::
 enable_line_smooth(bool val) {
   if(_line_smooth_enabled != val) {
     _line_smooth_enabled = val;
-  #ifdef NDEBUG
+  #ifndef NDEBUG
     {
-        if(val && (_pScrn->d3dcaps.RasterCaps & D3DPRASTERCAPS_ANTIALIASEDGES))
+        if(val && (_pScrn->d3dcaps.LineCaps & D3DLINECAPS_ANTIALIAS))
            dxgsg9_cat.error() << "no HW support for line smoothing!!\n";
     }
   #endif
@@ -47,16 +45,15 @@ enable_line_smooth(bool val) {
 INLINE void DXGraphicsStateGuardian9::
 enable_dither(bool val) {
   if (_dither_enabled != val) {
+    _dither_enabled = val;
 
-  #ifdef _DEBUG
+  #ifndef NDEBUG
     {
         if(val && !(_pScrn->d3dcaps.RasterCaps & D3DPRASTERCAPS_DITHER))
            dxgsg9_cat.error() << "no HW support for color dithering!!\n";
-        return;
     }
   #endif
 
-    _dither_enabled = val;
     _pD3DDevice->SetRenderState(D3DRS_DITHERENABLE, (DWORD)val);
   }
 }

+ 1 - 0
panda/src/dxgsg9/dxGraphicsStateGuardian9.h

@@ -25,6 +25,7 @@
 #include "dxGeomNodeContext9.h"
 #include "dxTextureContext9.h"
 #include "d3dfont9.h"
+#include "config_dxgsg9.h"
 
 #include "graphicsStateGuardian.h"
 #include "geomprimitives.h"