shithub: duke3d

Download patch

ref: d6e24c648eb4294039be65af0381492a50ba879b
parent: bdd2f0d98a59338af4cac1befd59b24d90347158
author: Fabien Sanglard <fabien.sanglard@gmail.com>
date: Sat Jan 5 13:42:00 EST 2013

Fixed a bug introduced in last refactor (anims where not draw properly).

--- a/Engine/src/engine.c
+++ b/Engine/src/engine.c
@@ -3695,7 +3695,7 @@
 
         if ((cx1 <= x1) && (x1 <= cx2)){
             pvWalls[nn] .cameraSpaceCoo[1][VEC_X] = x1;
-            pvWalls[nn] .cameraSpaceCoo[1][VEC_Y] = pvWalls[nn] .cameraSpaceCoo[0][VEC_Y];
+            pvWalls[nn] .cameraSpaceCoo[1][VEC_Y] = pvWalls[z] .cameraSpaceCoo[0][VEC_Y];
             nn++;
         }
         
@@ -8700,7 +8700,7 @@
                 continue;
             
             bakx1 = pvWalls[0].cameraSpaceCoo[0][VEC_X];
-            baky1 = mulscale16(pvWalls[3].cameraSpaceCoo[0][VEC_Y]-(ydim<<11),xyaspect)+(ydim<<11);
+            baky1 = mulscale16(pvWalls[0].cameraSpaceCoo[0][VEC_Y]-(ydim<<11),xyaspect)+(ydim<<11);
             if (i&0x0f)
             {
                 npoints = clippoly(npoints,i);
@@ -8875,7 +8875,7 @@
             y = dmulscale16(oy,xvect2,ox,yvect2) + (ydim<<11);
             i |= getclipmask(x-cx1,cx2-x,y-cy1,cy2-y);
             pvWalls[0].cameraSpaceCoo[0][VEC_X] = x;
-            pvWalls[3].cameraSpaceCoo[0][VEC_Y] = y;
+            pvWalls[0].cameraSpaceCoo[0][VEC_Y] = y;
 
             ox = x2 - dax;
             oy = y2 - day;
@@ -8901,7 +8901,7 @@
 
             if ((i&0xf0) != 0xf0) continue;
             bakx1 = pvWalls[0].cameraSpaceCoo[0][VEC_X];
-            baky1 = mulscale16(pvWalls[3].cameraSpaceCoo[0][VEC_Y]-(ydim<<11),xyaspect)+(ydim<<11);
+            baky1 = mulscale16(pvWalls[0].cameraSpaceCoo[0][VEC_Y]-(ydim<<11),xyaspect)+(ydim<<11);
             if (i&0x0f)
             {
                 npoints = clippoly(npoints,i);
--- a/Game/src/animlib.c
+++ b/Game/src/animlib.c
@@ -199,7 +199,7 @@
 //****************************************************************************
 
 void renderframe (uint16 framenumber, uint16 *pagepointer)
-   {
+{
    uint16 offset=0;
    uint16 i;
    uint16 destframe;
@@ -209,23 +209,18 @@
    destframe = framenumber - anim->curlp.baseRecord;
 
    for(i = 0; i < destframe; i++)
-      {
       offset += pagepointer[i];
-      }
+      
    ppointer = (byte *)pagepointer;
 
    ppointer+=anim->curlp.nRecords*2+offset;
    if(ppointer[1])
-      {
       ppointer += (4 + (((uint16 *)ppointer)[1] + (((uint16 *)ppointer)[1] & 1)));
-      }
    else
-      {
       ppointer+=4;
-      }
 
    CPlayRunSkipDump (ppointer, anim->imagebuffer);
-   }
+}
 
 
 //****************************************************************************