From d225818b7c89b2b60e52ac228e47ce303b5d8ef8 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 28 Sep 2014 20:44:37 +0200 Subject: [PATCH] fixed bug with animation frames per line with non-standard tile size --- ChangeLog | 4 ++++ src/conftime.h | 2 +- src/init.c | 28 ++++++++++++++++++++++++---- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 644cdaa8..948f2d24 100644 --- 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 diff --git a/src/conftime.h b/src/conftime.h index e06a2aee..30924324 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2014-09-22 16:51" +#define COMPILE_DATE_STRING "2014-09-28 20:37" diff --git a/src/init.c b/src/init.c index e57e4aaf..83d01ab6 100644 --- a/src/init.c +++ b/src/init.c @@ -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; -- 2.34.1