gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] libvob/include/vob/vobs Irregu.hxx


From: Janne V. Kujala
Subject: [Gzz-commits] libvob/include/vob/vobs Irregu.hxx
Date: Tue, 22 Apr 2003 06:16:50 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Changes by:     Janne V. Kujala <address@hidden>        03/04/22 06:16:50

Modified files:
        include/vob/vobs: Irregu.hxx 

Log message:
        Check for negative dicing in IrregularQuad

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Irregu.hxx.diff?tr1=1.5&tr2=1.6&r1=text&r2=text

Patches:
Index: libvob/include/vob/vobs/Irregu.hxx
diff -u libvob/include/vob/vobs/Irregu.hxx:1.5 
libvob/include/vob/vobs/Irregu.hxx:1.6
--- libvob/include/vob/vobs/Irregu.hxx:1.5      Sun Apr 20 06:24:04 2003
+++ libvob/include/vob/vobs/Irregu.hxx  Tue Apr 22 06:16:50 2003
@@ -57,7 +57,7 @@
                          .25 + .5 * yrelp
                          );
        coords1.vertex(p);
-       DBG(dbg_irregularquad) << "Vert: " << q<<p<<coords1.transform(p) 
<<"\\n";
+       DBG(dbg_irregularquad) << "Vert: " << q<<p<<coords1.transform(p) <<"\n";
     }
 
 
@@ -112,12 +112,8 @@
     
 
     template<class T> void render(const T &coords1, const T &coords2) const {
-        DBG(dbg_irregularquad) << "Irregular quad\\n";
+        DBG(dbg_irregularquad) << "Irregular quad\n";
 
-        glCallList(setup);
-        GLERR;
-
-        
         // Normalize tearaway part unit vectors in paper coords to get border 
widths
         // Note: we assume that coords2 is an affine transform so that the 
border (ripple) width
         //       is translation invariant
@@ -126,12 +122,12 @@
         ZVec yvec = (coords2.transform(ZPt(0,1,0)) - 
coords2.transform(ZPt(0,0,0))).normalized();
 
         //cout << (coords2.transform(ZPt(1,0,0)) - 
coords2.transform(ZPt(0,0,0)))
-        //     << (coords2.transform(ZPt(0,1,0)) - 
coords2.transform(ZPt(0,0,0))) << "\\n";
+        //     << (coords2.transform(ZPt(0,1,0)) - 
coords2.transform(ZPt(0,0,0))) << "\n";
         
         float bx = border * (cs2inv.transform(ZPt(0,0,0) + xvec) - 
cs2inv.transform(ZPt(0,0,0))).length();
         float by = border * (cs2inv.transform(ZPt(0,0,0) + yvec) - 
cs2inv.transform(ZPt(0,0,0))).length();
 
-        //cout << bx << "," << by << "\\n";
+        //cout << bx << "," << by << "\n";
 
         float x0 = 1;
         float x1 = 1 - bx;
@@ -192,7 +188,15 @@
          */
         float texf = 0.5;
 
-        DBG(dbg_irregularquad) << "Dice: " << dicex << " " << dicey << " " << 
diceb << "\\n";
+        DBG(dbg_irregularquad) << "Dice: " << dicex << " " << dicey << " " << 
diceb << "\n";
+
+       if (diceb <= 0 || dicex <= 0 || dicey <= 0) {
+           DBG(dbg_irregularquad) << "Skipping IrregularQuad because of 
invalid geometry\n";
+           return;
+       }
+
+        glCallList(setup);
+        GLERR;
 
         for (int pass = 0; pass < ((flags & IRREGU_SHIFTS) ? 4 : 1); pass++) {
 
@@ -270,7 +274,7 @@
 
         glPopAttrib();
 
-        DBG(dbg_irregularquad) << "IrregularQuad done\\n";
+        DBG(dbg_irregularquad) << "IrregularQuad done\n";
     }
 };
 
@@ -452,7 +456,7 @@
 
         glPopAttrib();
         GLERR;
-        DBG(dbg_irregularquad) << "IrregularEdge done\\n";
+        DBG(dbg_irregularquad) << "IrregularEdge done\n";
     }
 };
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]