From 931481fe085a820997fc0184263ced9d6475aea5 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 19 Aug 2014 21:54:21 +0200 Subject: [PATCH] rnd-20140819-2-src * fixed nasty (typo) bug in native EM engine causing broken player graphics when using different (redefined) playfield size --- ChangeLog | 2 ++ src/conftime.h | 2 +- src/game_em/graphics.c | 10 ++++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 57b72711..cec3597a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2014-08-19 * fixed bug causing wrong screen updates while playing (whole screen update from backbuffer instead of playfield buffer if REDRAW_ALL set) + * fixed nasty (typo) bug in native EM engine causing broken player + graphics when using different (redefined) playfield size 2014-08-18 * fixed bug causing EM/EMC graphics sets containing original 16x16 tiles diff --git a/src/conftime.h b/src/conftime.h index 0f6c266f..590154cf 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2014-08-19 00:00" +#define COMPILE_DATE_STRING "2014-08-19 21:46" diff --git a/src/game_em/graphics.c b/src/game_em/graphics.c index d7f7025a..5e53a433 100644 --- a/src/game_em/graphics.c +++ b/src/game_em/graphics.c @@ -71,6 +71,12 @@ void BlitScreenToBitmap_EM(Bitmap *target_bitmap) int full_xsize = lev.width * TILEX; int full_ysize = lev.height * TILEY; +#if 0 + printf("::: %d, %d\n", screenBitmap->width, screenBitmap->height); + printf("::: %d / %d, %d / %d\n", + MAX_BUF_XSIZE, MAX_BUF_YSIZE, SXSIZE, SYSIZE); +#endif + sxsize = (full_xsize < xsize ? full_xsize : xsize); sysize = (full_ysize < ysize ? full_ysize : ysize); sx = SX + (full_xsize < xsize ? (xsize - full_xsize) / 2 : 0); @@ -613,9 +619,9 @@ static void blitplayer(struct PLAYER *ply) int new_x = old_x + SIGN(dx); int new_y = old_y + SIGN(dy); int old_sx = old_x % MAX_BUF_XSIZE; - int old_sy = old_y % MAX_BUF_XSIZE; + int old_sy = old_y % MAX_BUF_YSIZE; int new_sx = new_x % MAX_BUF_XSIZE; - int new_sy = new_y % MAX_BUF_XSIZE; + int new_sy = new_y % MAX_BUF_YSIZE; #if 0 int old_crm = crumbled_state[old_sy][old_sx]; #endif -- 2.34.1