changeset 7:dde02bd75871

Scaling fixes.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 22 May 2015 02:20:14 +0300
parents 2cc284a77add
children 0da5de9dcc75
files demo.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/demo.c	Fri May 22 01:59:23 2015 +0300
+++ b/demo.c	Fri May 22 02:20:14 2015 +0300
@@ -274,8 +274,8 @@
             ablit = dmGetScaledBlitFunc(bussi->format, engine->screen->format, DMD_TRANSPARENT);
         }
 
-        int x1 = - ((int)dmQX(engine, tausta, t * 0.2) % tausta->w),
-            x2 = x1 + tausta->w;
+        int x1 = - ((int)dmQX(engine, tausta, t * 0.2) % (int) dmQX(engine, tausta, 1)),
+            x2 = x1 + dmQX(engine, tausta, 1);
 
         int fadeVal;
         if (t < 3 || t > 64)
@@ -286,14 +286,14 @@
                 fadeVal = dmLerpSCurveClamp(&fadeLerp2, engineGetTime(engine, 64));
 
             dmClearSurface(engine->screen, dmMapRGB(engine->screen, 0,0,0));
-            dmScaledBlitSurface32to32TransparentGA(tausta, x1, 0, tausta->w, tausta->h, engine->screen, fadeVal);
-            dmScaledBlitSurface32to32TransparentGA(tausta, x2, 0, tausta->w, tausta->h, engine->screen, fadeVal);
+            dmScaledBlitSurface32to32TransparentGA(tausta, x1, 0, dmQX(engine, tausta, 1), dmQY(engine, tausta, 1), engine->screen, fadeVal);
+            dmScaledBlitSurface32to32TransparentGA(tausta, x2, 0, dmQX(engine, tausta, 1), dmQY(engine, tausta, 1), engine->screen, fadeVal);
         }
         else
         {
             fadeVal = 255;
-            cblit(tausta, x1, 0, tausta->w, tausta->h, engine->screen);
-            cblit(tausta, x2, 0, tausta->w, tausta->h, engine->screen);
+            cblit(tausta, x1, 0, dmQX(engine, tausta, 1), dmQY(engine, tausta, 1), engine->screen);
+            cblit(tausta, x2, 0, dmQX(engine, tausta, 1), dmQY(engine, tausta, 1), engine->screen);
         }
 
         float qm = sin(t * 0.1 + fftPow * 5) * 15, qm2 = qm*2;