rnd-20140819-2-src
authorHolger Schemel <info@artsoft.org>
Tue, 19 Aug 2014 19:54:21 +0000 (21:54 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 09:01:38 +0000 (11:01 +0200)
* fixed nasty (typo) bug in native EM engine causing broken player
  graphics when using different (redefined) playfield size

ChangeLog
src/conftime.h
src/game_em/graphics.c

index 57b72711879c73e591e35cababa488f7dc3eb1fc..cec3597aaf0e423336f16e7a677e670c2f15eeca 100644 (file)
--- 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)
 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
 
 2014-08-18
        * fixed bug causing EM/EMC graphics sets containing original 16x16 tiles
index 0f6c266f59924cfffe0a618abfed7f1057c19872..590154cff7319f1b84aab068cd55677edad810eb 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2014-08-19 00:00"
+#define COMPILE_DATE_STRING "2014-08-19 21:46"
index d7f7025ac6f28583e86234692e734bc0bc80263a..5e53a433708cac6e390b9000cb28266d5aa2d298 100644 (file)
@@ -71,6 +71,12 @@ void BlitScreenToBitmap_EM(Bitmap *target_bitmap)
   int full_xsize = lev.width  * TILEX;
   int full_ysize = lev.height * TILEY;
 
   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);
   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 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_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
 #if 0
     int old_crm = crumbled_state[old_sy][old_sx];
 #endif