Browse Source

fix problem in draw_tri

cxgeorge 24 years ago
parent
commit
1f278496ea
1 changed files with 4 additions and 5 deletions
  1. 4 5
      panda/src/dxgsg/dxGraphicsStateGuardian.cxx

+ 4 - 5
panda/src/dxgsg/dxGraphicsStateGuardian.cxx

@@ -3398,16 +3398,15 @@ draw_multitri(Geom *geom, D3DPRIMITIVETYPE trilisttype) {
         _perComp = 0x0;
         _perComp = 0x0;
 
 
         bool bIsTriList=(trilisttype==D3DPT_TRIANGLESTRIP);
         bool bIsTriList=(trilisttype==D3DPT_TRIANGLESTRIP);
-        bool bPerPrimColor=false;
+        bool bPerPrimColor=(ColorBinding == G_PER_PRIM);
         bool bPerPrimNormal;
         bool bPerPrimNormal;
-        bool bUseTexCoordOnlyLoop = (((ColorBinding == G_OVERALL) || (ColorBinding == G_PER_PRIM)) &&
+        bool bUseTexCoordOnlyLoop = (((ColorBinding == G_OVERALL) || bPerPrimColor) &&
                                      (NormalBinding == G_OFF) &&
                                      (NormalBinding == G_OFF) &&
                                      (TexCoordBinding != G_OFF));
                                      (TexCoordBinding != G_OFF));
 
 
         if(bUseTexCoordOnlyLoop) {
         if(bUseTexCoordOnlyLoop) {
-           if(ColorBinding == G_PER_PRIM) {
-                _perPrim |= PER_COLOR;
-                 bPerPrimColor=true;
+           if(bPerPrimColor) {
+              _perPrim = PER_COLOR;
            }
            }
         } else {
         } else {
             switch (NormalBinding) {
             switch (NormalBinding) {