# HG changeset patch # User Matti Hamalainen # Date 1432250414 -10800 # Node ID dde02bd758710a19f377ef35bff6cf7574ce2e94 # Parent 2cc284a77add2920dbe7ffbd9ddc272e014853c6 Scaling fixes. diff -r 2cc284a77add -r dde02bd75871 demo.c --- 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;