diff dmscaledblit.h @ 85:c257d73cf790

Rename some macros.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 02 Oct 2012 10:23:42 +0300
parents d9251dd496ce
children baf72a99d5ee
line wrap: on
line diff
--- a/dmscaledblit.h	Tue Oct 02 10:23:29 2012 +0300
+++ b/dmscaledblit.h	Tue Oct 02 10:23:42 2012 +0300
@@ -5,12 +5,12 @@
  * (C) Copyright 2011-2012 Tecnic Software productions (TNSP)
  */
 
-int DM_SCALED_NAME (SDL_Surface *src,
+int DM_BLITFUNC_NAME (SDL_Surface *src,
     const int x0, const int y0,
     const int dwidth, const int dheight,
     SDL_Surface *dst
-#ifdef DM_SCALED_ARGS
-    DM_SCALED_ARGS
+#ifdef DM_BLITFUNC_ARGS
+    DM_BLITFUNC_ARGS
 #endif
     )
 {
@@ -18,8 +18,8 @@
     DMFixedPoint32 xv, yv, dx, dy;
     DMQValue xr, yr;
 
-#ifdef DM_SCALED_VARS
-    DM_SCALED_VARS
+#ifdef DM_BLITFUNC_VARS
+    DM_BLITFUNC_VARS
 #endif
     
     // Clip coordinates
@@ -30,8 +30,8 @@
         dst->clip_rect.y, dst->clip_rect.y + dst->clip_rect.h))
         return -1;
 
-#ifdef DM_SCALED_INIT
-    DM_SCALED_INIT
+#ifdef DM_BLITFUNC_INIT
+    DM_BLITFUNC_INIT
 #endif
 
     // Calculate "final" initial source bitmap offsets
@@ -42,44 +42,44 @@
     FP_MUL_R(dx, dx, xr.vdelta);
 
     // Take pitch into account
-    const int xadd = xr.vadd - dst->clip_rect.w + dst->clip_rect.x + (dst->pitch / DM_SCALED_DST_BYTES);
+    const int xadd = xr.vadd - dst->clip_rect.w + dst->clip_rect.x + (dst->pitch / DM_BLITFUNC_DST_BYTES);
 
     // Blit scaled
-    DM_SCALED_DST_TYPE * dp = ((DM_SCALED_DST_TYPE *) dst->pixels) + (yr.v0 * dst->pitch) / DM_SCALED_DST_BYTES + xr.v0;
+    DM_BLITFUNC_DST_TYPE * dp = ((DM_BLITFUNC_DST_TYPE *) dst->pixels) + (yr.v0 * dst->pitch) / DM_BLITFUNC_DST_BYTES + xr.v0;
     for (yc = yr.v0; yc < yr.v1; yc++)
     {
-        const DM_SCALED_SRC_TYPE * sp = ((DM_SCALED_SRC_TYPE *) src->pixels) + (FP_GETH(yv) * src->pitch) / DM_SCALED_SRC_BYTES;
+        const DM_BLITFUNC_SRC_TYPE * sp = ((DM_BLITFUNC_SRC_TYPE *) src->pixels) + (FP_GETH(yv) * src->pitch) / DM_BLITFUNC_SRC_BYTES;
         int xc;
 
-#ifdef DM_SCALED_INNER_INIT
-    DM_SCALED_INNER_INIT
+#ifdef DM_BLITFUNC_INNER_INIT
+    DM_BLITFUNC_INNER_INIT
 #endif
 
         for (xv.dw = dx.dw, xc = xr.v0; xc < xr.v1; xc++)
         {
-            DM_SCALED_INNER
+            DM_BLITFUNC_INNER
             FP_ADD(xv, xr.vdelta);
         }
         FP_ADD(yv, yr.vdelta);
         dp += xadd;
     }
 
-#ifdef DM_SCALED_FINISH
-    DM_SCALED_FINISH
+#ifdef DM_BLITFUNC_FINISH
+    DM_BLITFUNC_FINISH
 #endif
 
     return 0;
 }
 
 
-#undef DM_SCALED_NAME
-#undef DM_SCALED_ARGS
-#undef DM_SCALED_SRC_BYTES
-#undef DM_SCALED_DST_BYTES
-#undef DM_SCALED_SRC_TYPE
-#undef DM_SCALED_DST_TYPE
-#undef DM_SCALED_VARS
-#undef DM_SCALED_INIT
-#undef DM_SCALED_INNER_INIT
-#undef DM_SCALED_INNER
-#undef DM_SCALED_FINISH
+#undef DM_BLITFUNC_NAME
+#undef DM_BLITFUNC_ARGS
+#undef DM_BLITFUNC_SRC_BYTES
+#undef DM_BLITFUNC_DST_BYTES
+#undef DM_BLITFUNC_SRC_TYPE
+#undef DM_BLITFUNC_DST_TYPE
+#undef DM_BLITFUNC_VARS
+#undef DM_BLITFUNC_INIT
+#undef DM_BLITFUNC_INNER_INIT
+#undef DM_BLITFUNC_INNER
+#undef DM_BLITFUNC_FINISH