netpanzer-cvs
[Top][All Lists]
Advanced

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

[netPanzer-CVS] netpanzer/src/Lib/2D Surface.cpp


From: Matthias Braun
Subject: [netPanzer-CVS] netpanzer/src/Lib/2D Surface.cpp
Date: Mon, 08 Sep 2003 09:12:03 -0400

CVSROOT:        /cvsroot/netpanzer
Module name:    netpanzer
Branch:         
Changes by:     Matthias Braun <address@hidden> 03/09/08 09:12:03

Modified files:
        src/Lib/2D     : Surface.cpp 

Log message:
        added a very slow ad-hoc scaling blitter -> the minimap is displayed now

Patches:
Index: netpanzer/src/Lib/2D/Surface.cpp
diff -u netpanzer/src/Lib/2D/Surface.cpp:1.10 
netpanzer/src/Lib/2D/Surface.cpp:1.11
--- netpanzer/src/Lib/2D/Surface.cpp:1.10       Sun Sep  7 16:49:02 2003
+++ netpanzer/src/Lib/2D/Surface.cpp    Mon Sep  8 09:12:02 2003
@@ -2092,16 +2092,31 @@
        int stepWholePart = xSrcDelta >> 16;
        int srcX1FracWithCount = (srcX1 << 16) | pixelsPerRow;
 
+#if 0
+       printf("Source: %d %d\n", source.pix.x, source.pix.y);
+       printf("DestRect: %d %d - %d %d\n", destRect.min.x, destRect.min.y,
+                                                                               
destRect.max.x, destRect.max.y);
+       printf("ScaledVals: %d %d - %d %d %d\n", srcX1, xSrcDelta,
+                       srcX1FracWithCount, stepAndDecCount, stepWholePart);
+#endif
+       float xdelta = float(source.pix.x) / float(max.x - min.x);
        for (int yCount = 0 ; yCount < numRows ; yCount++)
        {
                const PIX *sRow = source.rowPtr(srcY >> 16) + (srcX1 >> 16);
 
+               /*
                bltScaleSpan(dRow, sRow, srcX1FracWithCount, stepAndDecCount, 
stepWholePart);
+               */
+               // XXX: WARNING SLOW CODE
+               float sPos = 0;
+               for(int x=0; x<pixelsPerRow; x++) {
+                       dRow[x] = sRow[(size_t) sPos];
+                       sPos += xdelta;
+               }
 
                srcY += ySrcDelta;
                dRow += stride;
        }
-
 }
 
 void Surface::bltScaleTrans(const Surface &source, const iRect &destRect) 
const {




reply via email to

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