From a9fdf0f34330258db071a405ae820021c25126af Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 8 Jun 2005 02:18:34 +0200 Subject: [PATCH] rnd-20050608-1-src --- ChangeLog | 4 +++- src/conftime.h | 2 +- src/editor.c | 1 + src/libgame/misc.c | 34 ++++++++++++++++++++++++++++++++-- src/libgame/system.c | 18 ++++++++++++++---- src/libgame/system.h | 1 + 6 files changed, 52 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index f3ba3c1d..e346627b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,10 @@ 2005-06-06 - * fixed bug with exploding bomb using R'n'D graphics in EM engine + * fixed graphic bug with exploding bomb and R'n'D graphics in EM engine + * added "no direction" to "walkable/passable from" selectbox options 2005-06-05 * enhanced tape autoplay to accept "autoplay [ ...]" format + * in tape autoplay, not only report broken, but also missing tapes 2005-05-31 * uploaded pre-release (test) version 3.2.0-2 binary and source code diff --git a/src/conftime.h b/src/conftime.h index 4a465568..3a27e147 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2005-06-05 23:57]" +#define COMPILE_DATE_STRING "[2005-06-08 02:17]" diff --git a/src/editor.c b/src/editor.c index 988c1cdc..0550f3e7 100644 --- a/src/editor.c +++ b/src/editor.c @@ -1256,6 +1256,7 @@ static struct ValueTextInfo options_access_protected[] = static struct ValueTextInfo options_access_direction[] = { + { MV_NO_DIRECTIONS, "no direction" }, { MV_LEFT, "left" }, { MV_RIGHT, "right" }, { MV_UP, "up" }, diff --git a/src/libgame/misc.c b/src/libgame/misc.c index a502ec49..f90b2c23 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -2472,6 +2472,12 @@ static void replaceArtworkListEntry(struct ArtworkListInfo *artwork_info, char *basename = file_list_entry->filename; char *filename = getCustomArtworkFilename(basename, artwork_info->type); +#if 0 + if (strcmp(file_list_entry->token, "background.DOOR") == 0) + printf("::: replaceArtworkListEntry: '%s' => '%s'\n", + basename, filename); +#endif + if (filename == NULL) { Error(ERR_WARN, "cannot find artwork file '%s'", basename); @@ -2532,6 +2538,11 @@ static void replaceArtworkListEntry(struct ArtworkListInfo *artwork_info, return; } +#if 0 + if (strcmp(file_list_entry->token, "background.DOOR") == 0) + printf("::: replaceArtworkListEntry: LOAD IT'\n"); +#endif + #if 0 printf("::: %s: '%s'\n", init_text[artwork_info->type], basename); #endif @@ -2669,6 +2680,12 @@ static void LoadCustomArtwork(struct ArtworkListInfo *artwork_info, printf("GOT CUSTOM ARTWORK FILE '%s'\n", filename); #endif +#if 0 + if (strcmp(file_list_entry->token, "background.DOOR") == 0) + printf("::: -> '%s' -> '%s'\n", + file_list_entry->token, file_list_entry->filename); +#endif + if (strcmp(file_list_entry->filename, UNDEFINED_FILENAME) == 0) { deleteArtworkListEntry(artwork_info, listnode); @@ -2711,7 +2728,7 @@ static void LoadArtworkToList(struct ArtworkListInfo *artwork_info, #if 0 printf("loading artwork '%s' ... [%d]\n", - basename, getNumNodes(artwork_info->content_list)); + file_list_entry->filename, getNumNodes(artwork_info->content_list)); #endif #if 1 @@ -2775,7 +2792,7 @@ void ReloadCustomArtworkList(struct ArtworkListInfo *artwork_info) for (i = 0; i < num_file_list_entries; i++) { #if 0 - if (strcmp(file_list[i].token, "background") == 0) + if (strcmp(file_list[i].token, "background.DOOR") == 0) printf("::: '%s' -> '%s'\n", file_list[i].token, file_list[i].filename); #endif @@ -2787,6 +2804,19 @@ void ReloadCustomArtworkList(struct ArtworkListInfo *artwork_info) file_list[i].filename, i); #endif +#if 0 + if (strcmp(file_list[i].token, "background.DOOR") == 0) + { + Bitmap *bitmap = getBitmapFromImageID(i); + + printf("::: BITMAP: %08lx\n", bitmap); + +#if 0 + BlitBitmap(bitmap, window, 0, 0, 100, 280, 0, 0); +#endif + } +#endif + #if 0 /* !!! NEW ARTWORK FALLBACK CODE !!! NEARLY UNTESTED !!! */ if (artwork_info->artwork_list[i] == NULL && diff --git a/src/libgame/system.c b/src/libgame/system.c index 78fd0200..1206c9ad 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -213,6 +213,8 @@ static void DrawBitmapFromTile(Bitmap *bitmap, Bitmap *tile, void SetBackgroundBitmap(Bitmap *background_bitmap_tile, int mask) { + /* !!! THIS DOES NOT WORK !!! REPLACED BITMAPS MAY HAVE SAME ADDRESS !!! */ +#if 0 static Bitmap *main_bitmap_tile = NULL; static Bitmap *door_bitmap_tile = NULL; @@ -226,14 +228,15 @@ void SetBackgroundBitmap(Bitmap *background_bitmap_tile, int mask) else if (mask == REDRAW_DOOR_1) { if (background_bitmap_tile == door_bitmap_tile) - return; /* main background tile has not changed */ + return; /* main background tile has not changed */ door_bitmap_tile = background_bitmap_tile; } - else /* should not happen */ + else /* should not happen */ return; +#endif - if (background_bitmap_tile) + if (background_bitmap_tile != NULL) gfx.background_bitmap_mask |= mask; else gfx.background_bitmap_mask &= ~mask; @@ -249,10 +252,12 @@ void SetBackgroundBitmap(Bitmap *background_bitmap_tile, int mask) DrawBitmapFromTile(gfx.background_bitmap, background_bitmap_tile, gfx.real_sx, gfx.real_sy, gfx.full_sxsize, gfx.full_sysize); - else + else if (mask == REDRAW_DOOR_1) + { DrawBitmapFromTile(gfx.background_bitmap, background_bitmap_tile, gfx.dx, gfx.dy, gfx.dxsize, gfx.dysize); + } } void SetMainBackgroundBitmap(Bitmap *background_bitmap_tile) @@ -439,8 +444,13 @@ inline boolean DrawingDeactivated(int x, int y, int width, int height) inline boolean DrawingOnBackground(int x, int y) { +#if 1 + return (CheckDrawingArea(x, y, 1, 1, gfx.background_bitmap_mask) && + CheckDrawingArea(x, y, 1, 1, gfx.draw_background_mask)); +#else return ((gfx.draw_background_mask & gfx.background_bitmap_mask) && CheckDrawingArea(x, y, 1, 1, gfx.draw_background_mask)); +#endif } inline void BlitBitmap(Bitmap *src_bitmap, Bitmap *dst_bitmap, diff --git a/src/libgame/system.h b/src/libgame/system.h index 903c982c..6ced002e 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -110,6 +110,7 @@ #define MV_VERTICAL (MV_UP | MV_DOWN) #define MV_ALL_DIRECTIONS (MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN) #define MV_ANY_DIRECTION (MV_ALL_DIRECTIONS) +#define MV_NO_DIRECTIONS (MV_NO_MOVING) #define KEY_BUTTON_1 (1 << BUTTON_1) #define KEY_BUTTON_2 (1 << BUTTON_2) -- 2.34.1