From: Holger Schemel Date: Sat, 30 Aug 2014 08:57:17 +0000 (+0200) Subject: Merge branch 'master' into releases X-Git-Tag: 3.2.6.1 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=refs%2Ftags%2F3.2.6.1;hp=95e671b15104bb05c8302000facc906cbf0b133e;p=rocksndiamonds.git Merge branch 'master' into releases --- diff --git a/ChangeLog b/ChangeLog index 52445eae..41f88faf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,34 @@ +2009-06-15 + * version 3.2.6.1 released + +2009-05-31 + * fixed bug with element_info[e].gfx_element not being initialized in + early game stage, causing native graphics in EMC level sets to be + mapped completely to EL_EMPTY (causing a blank screen when playing) + (this only happened when starting the program with an EMC set with + native graphics, but not when switching to such a set at runtime) + +2009-03-30 + * deactivated blit-to-same-surface workaround again (see 2009-03-24) + and using self-compiled, patched SDL.dll that solves this problem + (interim solution until release of SDL 1.2.14 that should fix this) + +2009-03-26 + * extended backwards compatibility mode to allow already fixed bug with + change actions (see "2008-02-05") for existing levels (especially the + Zelda and Zelda II levels and other cool stuff by Alan Bond like FMV) + +2009-03-24 + * reactivated workaround to prevent program crashes due to blitting to + the same SDL surface that apparently only occurs on Windows systems + (this is no final solution; this problem needs further investigation) + +2008-11-05 + * version number set to 3.2.6.1 + +2008-11-04 + * version 3.2.6.0 released + 2008-10-11 * fixed behaviour of player option "no centering when relocating" which was incorrect when disabled and relocation target inside visible area diff --git a/src/conftime.h b/src/conftime.h index c8c6c656..e3b6bfc9 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2008-11-03 21:21" +#define COMPILE_DATE_STRING "2009-06-15 22:46" diff --git a/src/files.c b/src/files.c index c3277722..bfa49881 100644 --- a/src/files.c +++ b/src/files.c @@ -6345,6 +6345,32 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename) change->target_element = EL_PLAYER_1; } +#if 1 + /* try to detect and fix "Zelda" style levels, which are broken with 3.2.5 */ + if (level->game_version < VERSION_IDENT(3,2,5,0)) + { + /* This is needed to fix a problem that was caused by a bugfix in function + game.c/CheckTriggeredElementChangeExt() introduced with 3.2.5 that + corrects the behaviour when a custom element changes to another custom + element with a higher element number that has change actions defined. + Normally, only one change per frame is allowed for custom elements. + Therefore, it is checked if a custom element already changed in the + current frame; if it did, subsequent changes are suppressed. + Unfortunately, this is only checked for element changes, but not for + change actions, which are still executed. As the function above loops + through all custom elements from lower to higher, an element change + resulting in a lower CE number won't be checked again, while a target + element with a higher number will also be checked, and potential change + actions will get executed for this CE, too (which is wrong), while + further changes are ignored (which is correct). As this bugfix breaks + Zelda II (and introduces graphical bugs to Zelda I, and also breaks a + few other levels like Alan Bond's "FMV"), allow the previous, incorrect + behaviour for existing levels and tapes that make use of this bug */ + + level->use_action_after_change_bug = TRUE; + } +#else + /* !!! THIS DOES NOT FIX "Zelda I" (GRAPHICALLY) AND "Alan's FMV" LEVELS */ /* try to detect and fix "Zelda II" levels, which are broken with 3.2.5 */ { int element = EL_CUSTOM_16; @@ -6371,6 +6397,7 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename) strncmp(ei->description, "scanline - row 1", 16) == 0) level->use_action_after_change_bug = TRUE; } +#endif /* not centering level after relocating player was default only in 3.2.3 */ if (level->game_version == VERSION_IDENT(3,2,3,0)) /* (no pre-releases) */ diff --git a/src/init.c b/src/init.c index 9dab9371..ea5ec18d 100644 --- a/src/init.c +++ b/src/init.c @@ -5500,6 +5500,7 @@ void InitGfx() bitmap_db_field); InitGfxDoor1Info(DX, DY, DXSIZE, DYSIZE); InitGfxDoor2Info(VX, VY, VXSIZE, VYSIZE); + InitGfxWindowInfo(WIN_XSIZE, WIN_YSIZE); InitGfxScrollbufferInfo(FXSIZE, FYSIZE); InitGfxCustomArtworkInfo(); @@ -6190,6 +6191,7 @@ void OpenAll() InitElementPropertiesStatic(); InitElementPropertiesEngine(GAME_VERSION_ACTUAL); + InitElementPropertiesGfxElement(); print_timestamp_time("[post-video]"); diff --git a/src/libgame/msdos.c b/src/libgame/msdos.c index 60728bef..407752bc 100644 --- a/src/libgame/msdos.c +++ b/src/libgame/msdos.c @@ -440,7 +440,7 @@ Pixmap XCreatePixmap(Display *display, Drawable d, unsigned int width, BITMAP *bitmap = NULL; if (gfx_capabilities & GFX_HW_VRAM_BLIT && - width == gfx.scrollbuffer_width && height == gfx.scrollbuffer_height) + width == gfx.scrollbuffer_width && height == gfx.scrollbuffer_height) bitmap = create_video_bitmap(width, height); if (bitmap == NULL) diff --git a/src/libgame/system.c b/src/libgame/system.c index 20ea20be..d4b7f9a9 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -189,9 +189,16 @@ void InitGfxDoor2Info(int vx, int vy, int vxsize, int vysize) gfx.vysize = vysize; } +void InitGfxWindowInfo(int win_xsize, int win_ysize) +{ + gfx.win_xsize = win_xsize; + gfx.win_ysize = win_ysize; +} + void InitGfxScrollbufferInfo(int scrollbuffer_width, int scrollbuffer_height) { /* currently only used by MSDOS code to alloc VRAM buffer, if available */ + /* 2009-03-24: also (temporarily?) used for overlapping blit workaround */ gfx.scrollbuffer_width = scrollbuffer_width; gfx.scrollbuffer_height = scrollbuffer_height; } @@ -492,7 +499,12 @@ void BlitBitmap(Bitmap *src_bitmap, Bitmap *dst_bitmap, return; #if 0 - /* !!! APPARENTLY THIS HAS BEEN FIXED IN SDL 1.2.12 !!! */ + /* !!! 2009-03-30: Fixed by using self-compiled, patched SDL.dll !!! */ + /* (This bug still exists in the actual (as of 2009-06-15) version 1.2.13, + but is already fixed in SVN and should therefore finally be fixed with + the next official SDL release, which is probably version 1.2.14.) */ +#if 1 + /* !!! 2009-03-24: It seems that this problem still exists in 1.2.12 !!! */ #if defined(TARGET_SDL) && defined(PLATFORM_WIN32) if (src_bitmap == dst_bitmap) { @@ -502,19 +514,41 @@ void BlitBitmap(Bitmap *src_bitmap, Bitmap *dst_bitmap, recent SDL libraries, but apparently does not work in 1.2.11 directly */ static Bitmap *tmp_bitmap = NULL; + static int tmp_bitmap_xsize = 0; + static int tmp_bitmap_ysize = 0; + + /* start with largest static bitmaps for initial bitmap size ... */ + if (tmp_bitmap_xsize == 0 && tmp_bitmap_ysize == 0) + { + tmp_bitmap_xsize = MAX(gfx.win_xsize, gfx.scrollbuffer_width); + tmp_bitmap_ysize = MAX(gfx.win_ysize, gfx.scrollbuffer_height); + } + + /* ... and allow for later re-adjustments due to custom artwork bitmaps */ + if (src_bitmap->width > tmp_bitmap_xsize || + src_bitmap->height > tmp_bitmap_ysize) + { + tmp_bitmap_xsize = MAX(tmp_bitmap_xsize, src_bitmap->width); + tmp_bitmap_ysize = MAX(tmp_bitmap_ysize, src_bitmap->height); + + FreeBitmap(tmp_bitmap); + + tmp_bitmap = NULL; + } if (tmp_bitmap == NULL) - tmp_bitmap = CreateBitmap(MAX(FXSIZE, WIN_XSIZE), - MAX(FYSIZE, WIN_YSIZE), DEFAULT_DEPTH); + tmp_bitmap = CreateBitmap(tmp_bitmap_xsize, tmp_bitmap_ysize, + DEFAULT_DEPTH); sysCopyArea(src_bitmap, tmp_bitmap, src_x, src_y, width, height, dst_x, dst_y, BLIT_OPAQUE); sysCopyArea(tmp_bitmap, dst_bitmap, - src_x, src_y, width, height, dst_x, dst_y, BLIT_OPAQUE); + dst_x, dst_y, width, height, dst_x, dst_y, BLIT_OPAQUE); return; } #endif +#endif #endif sysCopyArea(src_bitmap, dst_bitmap, diff --git a/src/libgame/system.h b/src/libgame/system.h index 3791f1e6..aa1057fd 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -726,6 +726,8 @@ struct GfxInfo int vx, vy; int vxsize, vysize; + int win_xsize, win_ysize; + int draw_deactivation_mask; int draw_background_mask; @@ -1144,6 +1146,7 @@ void ClosePlatformDependentStuff(void); void InitGfxFieldInfo(int, int, int, int, int, int, int, int, Bitmap *); void InitGfxDoor1Info(int, int, int, int); void InitGfxDoor2Info(int, int, int, int); +void InitGfxWindowInfo(int, int); void InitGfxScrollbufferInfo(int, int); void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(void)); void InitGfxCustomArtworkInfo(); diff --git a/src/main.h b/src/main.h index d47b4068..68f1eed0 100644 --- a/src/main.h +++ b/src/main.h @@ -759,8 +759,23 @@ #define IS_DC_STEELWALL_2(e) ((e) >= EL_DC_STEELWALL_2_LEFT && \ (e) <= EL_DC_STEELWALL_2_SINGLE) +#if 1 + #if 1 #define GFX_ELEMENT(e) (element_info[e].gfx_element) +#else +#define GFX_ELEMENT(e) (element_info[e].gfx_element == \ + (element_info[e].use_gfx_element ? \ + element_info[e].gfx_element : e) ? \ + element_info[e].gfx_element : \ + element_info[e].gfx_element + \ + 0 * printf("::: %d: %d <-> %d\n", \ + e, \ + element_info[e].gfx_element, \ + element_info[e].use_gfx_element ? \ + element_info[e].gfx_element : e)) +#endif + #else #define GFX_ELEMENT(e) (element_info[e].use_gfx_element ? \ element_info[e].gfx_element : e) @@ -1992,7 +2007,7 @@ #define PROGRAM_VERSION_MAJOR 3 #define PROGRAM_VERSION_MINOR 2 #define PROGRAM_VERSION_PATCH 6 -#define PROGRAM_VERSION_BUILD 0 +#define PROGRAM_VERSION_BUILD 1 #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel"