fixed bug with animation frames per line with non-standard tile size
authorHolger Schemel <info@artsoft.org>
Sun, 28 Sep 2014 18:44:37 +0000 (20:44 +0200)
committerHolger Schemel <info@artsoft.org>
Sun, 28 Sep 2014 18:44:37 +0000 (20:44 +0200)
ChangeLog
src/conftime.h
src/init.c

index 644cdaa8f14d4411e60b1b8d9eb6a376037e773a..948f2d24124bcb3e961774517eb8408efb67e241 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-09-28
+       * fixed bug with animation frames per line with non-standard tile size
+         (relevant for example for 64x64 sized frames continued on next row)
+
 2014-09-22
        * removed checking of file identifier tokens for configuration files
 
index e06a2aee6645449a834da650228b69c39882a3b6..30924324edd5aa89bb296571d47e1f077dbc5733 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2014-09-22 16:51"
+#define COMPILE_DATE_STRING "2014-09-28 20:37"
index e57e4aafa5a7cd068ebfdc5b52095aa918caa0b8..83d01ab6d529d75b9c80edfc4de8c0ca7d07a63f 100644 (file)
@@ -1024,9 +1024,21 @@ static void set_graphic_parameters_ext(int graphic, int *parameter,
 
   /* optional tile size for using non-standard image size */
   if (parameter[GFX_ARG_TILE_SIZE] != ARG_UNDEFINED_VALUE)
+  {
     g->tile_size = parameter[GFX_ARG_TILE_SIZE];
-  if (g->tile_size < TILESIZE)
-    g->tile_size = TILESIZE;           /* standard tile size */
+
+#if 0
+    // CHECK: should tile sizes less than standard tile size be allowed?
+    if (g->tile_size < TILESIZE)
+      g->tile_size = TILESIZE;         /* standard tile size */
+#endif
+
+#if 0
+    // CHECK: when setting tile size, should this set width and height?
+    g->width  = g->tile_size;
+    g->height = g->tile_size;
+#endif
+  }
 
   if (g->use_image_size)
   {
@@ -1089,8 +1101,16 @@ static void set_graphic_parameters_ext(int graphic, int *parameter,
       src_image_height = src_bitmap->height;
     }
 
-    anim_frames_per_row = src_image_width  / g->width;
-    anim_frames_per_col = src_image_height / g->height;
+    if (parameter[GFX_ARG_TILE_SIZE] != ARG_UNDEFINED_VALUE)
+    {
+      anim_frames_per_row = src_image_width  / g->tile_size;
+      anim_frames_per_col = src_image_height / g->tile_size;
+    }
+    else
+    {
+      anim_frames_per_row = src_image_width  / g->width;
+      anim_frames_per_col = src_image_height / g->height;
+    }
 
     g->src_image_width  = src_image_width;
     g->src_image_height = src_image_height;