From a04bb286a6863151907673d6ba7ebe58a0a69b4f Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 12 Dec 2002 00:55:35 +0100 Subject: [PATCH] rnd-20021212-1-src --- src/conftime.h | 2 +- src/init.c | 3 ++- src/screens.c | 2 +- src/tools.c | 22 ++++++++++++++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/conftime.h b/src/conftime.h index 0b60fc5a..722ce91f 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2002-12-11 00:49]" +#define COMPILE_DATE_STRING "[2002-12-11 23:34]" diff --git a/src/init.c b/src/init.c index f682a3fc..5b14e98d 100644 --- a/src/init.c +++ b/src/init.c @@ -1279,6 +1279,7 @@ static void InitGraphicInfo() src_y + TILEY > src_bitmap->height) Error(ERR_EXIT, "InitGraphicInfo: image bitmap '%s' too small for graphic object %d (normal size)", src_bitmap->source_filename, i); +#if 0 getMiniGraphicSource(i, &src_bitmap, &src_x, &src_y); if (src_x + MINI_TILEX > src_bitmap->width || src_y + MINI_TILEY > src_bitmap->height) @@ -1288,7 +1289,7 @@ static void InitGraphicInfo() if (src_x + MICRO_TILEX > src_bitmap->width || src_y + MICRO_TILEY > src_bitmap->height) Error(ERR_EXIT, "InitGraphicInfo: image bitmap '%s' too small for graphic object %d ('micro' size)", src_bitmap->source_filename, i); - +#endif #if 0 { diff --git a/src/screens.c b/src/screens.c index adb8c3fb..6e2948aa 100644 --- a/src/screens.c +++ b/src/screens.c @@ -549,7 +549,7 @@ static char *helpscreen_eltext[][2] = {"THE HERO:", "(Is _this_ guy good old Rockford?)"}, {"Normal sand:", "You can dig through it"}, {"Empty field:", "You can walk through it"}, - {"Quicksand: You cannot pass it,", "but rocks can fall though it"}, + {"Quicksand: You cannot pass it,", "but rocks can fall through it"}, {"Massive Wall:", "Nothing can go through it"}, {"Normal Wall: You can't go through", "it, but you can bomb it away"}, {"Growing Wall: Grows in several di-", "rections if there is an empty field"}, diff --git a/src/tools.c b/src/tools.c index 328ad13e..6a9bf818 100644 --- a/src/tools.c +++ b/src/tools.c @@ -966,6 +966,17 @@ void getMiniGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y) int src_x = mini_startx + new_graphic_info[graphic].src_x / 2; int src_y = mini_starty + new_graphic_info[graphic].src_y / 2; + if (src_x + MINI_TILEX > src_bitmap->width || + src_y + MINI_TILEY > src_bitmap->height) + { + /* graphic of desired size seems not to be contained in this image; + dirty workaround: get it from the middle of the normal sized image */ + + getGraphicSource(graphic, 0, &src_bitmap, &src_x, &src_y); + src_x += (TILEX / 2 - MINI_TILEX / 2); + src_y += (TILEY / 2 - MINI_TILEY / 2); + } + *bitmap = src_bitmap; *x = src_x; *y = src_y; @@ -1683,6 +1694,17 @@ void getMicroGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y) int src_x = mini_startx + new_graphic_info[graphic].src_x / 8; int src_y = mini_starty + new_graphic_info[graphic].src_y / 8; + if (src_x + MICRO_TILEX > src_bitmap->width || + src_y + MICRO_TILEY > src_bitmap->height) + { + /* graphic of desired size seems not to be contained in this image; + dirty workaround: get it from the middle of the normal sized image */ + + getGraphicSource(graphic, 0, &src_bitmap, &src_x, &src_y); + src_x += (TILEX / 2 - MICRO_TILEX / 2); + src_y += (TILEY / 2 - MICRO_TILEY / 2); + } + *bitmap = src_bitmap; *x = src_x; *y = src_y; -- 2.34.1