From 494b886d5c5041013ea361a12a07d7cd87551d52 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 7 Aug 2005 00:48:45 +0200 Subject: [PATCH] rnd-20050807-1-src * changed some va_arg() arguments from 'long' to 'int', fixing problems on 64-bit architecture systems with LP64 data model * fixed bug with bombs not exploding when hitting the last level line (introduced after the release of 3.1.0) * added support for dumping small-sized level sketches from editor --- ChangeLog | 11 +++ src/conf_gfx.c | 172 +++++++++++++++++++----------------------- src/conftime.h | 2 +- src/editor.c | 46 ++++++++++- src/editor.h | 1 + src/events.c | 4 + src/game.c | 30 ++++---- src/game_em/convert.c | 3 +- src/init.c | 5 ++ src/libgame/gadgets.c | 14 ++-- src/libgame/gadgets.h | 6 +- src/libgame/image.c | 2 +- src/libgame/misc.c | 4 + src/libgame/setup.c | 4 +- src/libgame/system.h | 21 ++++++ src/main.h | 15 ++-- 16 files changed, 208 insertions(+), 132 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6ea090be..5fb78a8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-08-07 + * changed some va_arg() arguments from 'long' to 'int', fixing problems + on 64-bit architecture systems with LP64 data model + +2005-08-06 + * fixed bug with bombs not exploding when hitting the last level line + (introduced after the release of 3.1.0) + +2005-08-06 + * added support for dumping small-sized level sketches from editor + 2005-07-24 * added recognition of "trigger element" for "change digged element to" (this is not really what the "trigger element" was made for, but its diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 4e8af670..9aa3e6bb 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -1465,21 +1465,18 @@ struct ConfigInfo image_config[] = { "emc_steelwall_1.xpos", "14" }, { "emc_steelwall_1.ypos", "0" }, { "emc_steelwall_1.frames", "1" }, - { "emc_steelwall_2", "emc_object.pcx" }, - { "emc_steelwall_2.xpos", "25" }, - { "emc_steelwall_2.ypos", "20" }, + { "emc_steelwall_2", "RocksEMC.pcx" }, + { "emc_steelwall_2.xpos", "9" }, + { "emc_steelwall_2.ypos", "8" }, { "emc_steelwall_2.frames", "1" }, - { "emc_steelwall_2.scale_up_factor", "2" }, - { "emc_steelwall_3", "emc_object.pcx" }, - { "emc_steelwall_3.xpos", "25" }, - { "emc_steelwall_3.ypos", "21" }, + { "emc_steelwall_3", "RocksEMC.pcx" }, + { "emc_steelwall_3.xpos", "9" }, + { "emc_steelwall_3.ypos", "9" }, { "emc_steelwall_3.frames", "1" }, - { "emc_steelwall_3.scale_up_factor", "2" }, - { "emc_steelwall_4", "emc_object.pcx" }, - { "emc_steelwall_4.xpos", "25" }, - { "emc_steelwall_4.ypos", "22" }, + { "emc_steelwall_4", "RocksEMC.pcx" }, + { "emc_steelwall_4.xpos", "9" }, + { "emc_steelwall_4.ypos", "10" }, { "emc_steelwall_4.frames", "1" }, - { "emc_steelwall_4.scale_up_factor", "2" }, { "emc_wall_1", "RocksDC.pcx" }, { "emc_wall_1.xpos", "13" }, @@ -1509,11 +1506,10 @@ struct ConfigInfo image_config[] = { "emc_wall_7.xpos", "15" }, { "emc_wall_7.ypos", "2" }, { "emc_wall_7.frames", "1" }, - { "emc_wall_8", "emc_object.pcx" }, - { "emc_wall_8.xpos", "25" }, - { "emc_wall_8.ypos", "31" }, + { "emc_wall_8", "RocksEMC.pcx" }, + { "emc_wall_8.xpos", "8" }, + { "emc_wall_8.ypos", "7" }, { "emc_wall_8.frames", "1" }, - { "emc_wall_8.scale_up_factor", "2" }, /* images for Diamond Caves style elements and actions */ @@ -3401,12 +3397,10 @@ struct ConfigInfo image_config[] = { "emc_gate_8_gray.EDITOR.xpos", "3" }, { "emc_gate_8_gray.EDITOR.ypos", "7" }, - { "emc_android", "emc_object.pcx" }, - { "emc_android.xpos", "7" }, - { "emc_android.ypos", "13" }, + { "emc_android", "RocksEMC.pcx" }, + { "emc_android.xpos", "0" }, + { "emc_android.ypos", "8" }, { "emc_android.frames", "8" }, - { "emc_android.vertical", "true" }, - { "emc_android.scale_up_factor", "2" }, { "emc_grass", "RocksEMC.pcx" }, { "emc_grass.xpos", "0" }, @@ -3465,30 +3459,26 @@ struct ConfigInfo image_config[] = { "emc_grass.digging.down.CRUMBLED.delay", "2" }, { "emc_grass.digging.down.CRUMBLED.anim_mode","linear" }, - { "emc_magic_ball", "emc_object.pcx" }, - { "emc_magic_ball.xpos", "22" }, - { "emc_magic_ball.ypos", "18" }, + { "emc_magic_ball", "RocksEMC.pcx" }, + { "emc_magic_ball.xpos", "0" }, + { "emc_magic_ball.ypos", "9" }, { "emc_magic_ball.frames", "1" }, - { "emc_magic_ball.scale_up_factor", "2" }, - { "emc_magic_ball.active", "emc_object.pcx" }, - { "emc_magic_ball.active.xpos", "22" }, - { "emc_magic_ball.active.ypos", "18" }, + { "emc_magic_ball.active", "RocksEMC.pcx" }, + { "emc_magic_ball.active.xpos", "0" }, + { "emc_magic_ball.active.ypos", "9" }, { "emc_magic_ball.active.frames", "16" }, - { "emc_magic_ball.active.vertical", "true" }, - { "emc_magic_ball.active.scale_up_factor", "2" }, + { "emc_magic_ball.active.frames_per_line", "8" }, - { "emc_magic_ball_switch", "emc_object.pcx" }, - { "emc_magic_ball_switch.xpos", "25" }, + { "emc_magic_ball_switch", "RocksEMC.pcx" }, + { "emc_magic_ball_switch.xpos", "8" }, { "emc_magic_ball_switch.ypos", "10" }, { "emc_magic_ball_switch.frames", "1" }, - { "emc_magic_ball_switch.scale_up_factor", "2" }, - { "emc_magic_ball_switch.active", "emc_object.pcx" }, - { "emc_magic_ball_switch.active.xpos", "25" }, + { "emc_magic_ball_switch.active", "RocksEMC.pcx" }, + { "emc_magic_ball_switch.active.xpos", "8" }, { "emc_magic_ball_switch.active.ypos", "9" }, { "emc_magic_ball_switch.active.frames", "1" }, - { "emc_magic_ball_switch.active.scale_up_factor", "2" }, { "emc_spring_bumper", "RocksEMC.pcx" }, { "emc_spring_bumper.xpos", "8" }, @@ -3520,67 +3510,55 @@ struct ConfigInfo image_config[] = { "emc_magnifier.ypos", "4" }, { "emc_magnifier.frames", "1" }, - { "emc_wall_9", "emc_object.pcx" }, - { "emc_wall_9.xpos", "26" }, - { "emc_wall_9.ypos", "4" }, + { "emc_wall_9", "RocksEMC.pcx" }, + { "emc_wall_9.xpos", "10" }, + { "emc_wall_9.ypos", "5" }, { "emc_wall_9.frames", "1" }, - { "emc_wall_9.scale_up_factor", "2" }, - { "emc_wall_10", "emc_object.pcx" }, - { "emc_wall_10.xpos", "26" }, - { "emc_wall_10.ypos", "5" }, + { "emc_wall_10", "RocksEMC.pcx" }, + { "emc_wall_10.xpos", "10" }, + { "emc_wall_10.ypos", "6" }, { "emc_wall_10.frames", "1" }, - { "emc_wall_10.scale_up_factor", "2" }, - { "emc_wall_11", "emc_object.pcx" }, - { "emc_wall_11.xpos", "26" }, - { "emc_wall_11.ypos", "9" }, + { "emc_wall_11", "RocksEMC.pcx" }, + { "emc_wall_11.xpos", "11" }, + { "emc_wall_11.ypos", "5" }, { "emc_wall_11.frames", "1" }, - { "emc_wall_11.scale_up_factor", "2" }, - { "emc_wall_12", "emc_object.pcx" }, - { "emc_wall_12.xpos", "26" }, - { "emc_wall_12.ypos", "10" }, + { "emc_wall_12", "RocksEMC.pcx" }, + { "emc_wall_12.xpos", "11" }, + { "emc_wall_12.ypos", "6" }, { "emc_wall_12.frames", "1" }, - { "emc_wall_12.scale_up_factor", "2" }, - { "emc_wall_13", "emc_object.pcx" }, - { "emc_wall_13.xpos", "25" }, - { "emc_wall_13.ypos", "23" }, + { "emc_wall_13", "RocksEMC.pcx" }, + { "emc_wall_13.xpos", "10" }, + { "emc_wall_13.ypos", "7" }, { "emc_wall_13.frames", "1" }, - { "emc_wall_13.scale_up_factor", "2" }, - { "emc_wall_14", "emc_object.pcx" }, - { "emc_wall_14.xpos", "25" }, - { "emc_wall_14.ypos", "24" }, + { "emc_wall_14", "RocksEMC.pcx" }, + { "emc_wall_14.xpos", "10" }, + { "emc_wall_14.ypos", "8" }, { "emc_wall_14.frames", "1" }, - { "emc_wall_14.scale_up_factor", "2" }, - { "emc_wall_15", "emc_object.pcx" }, - { "emc_wall_15.xpos", "25" }, - { "emc_wall_15.ypos", "25" }, + { "emc_wall_15", "RocksEMC.pcx" }, + { "emc_wall_15.xpos", "10" }, + { "emc_wall_15.ypos", "9" }, { "emc_wall_15.frames", "1" }, - { "emc_wall_15.scale_up_factor", "2" }, - { "emc_wall_16", "emc_object.pcx" }, - { "emc_wall_16.xpos", "25" }, - { "emc_wall_16.ypos", "26" }, + { "emc_wall_16", "RocksEMC.pcx" }, + { "emc_wall_16.xpos", "10" }, + { "emc_wall_16.ypos", "10" }, { "emc_wall_16.frames", "1" }, - { "emc_wall_16.scale_up_factor", "2" }, - { "emc_wall_slippery_1", "emc_object.pcx" }, - { "emc_wall_slippery_1.xpos", "25" }, - { "emc_wall_slippery_1.ypos", "27" }, + { "emc_wall_slippery_1", "RocksEMC.pcx" }, + { "emc_wall_slippery_1.xpos", "11" }, + { "emc_wall_slippery_1.ypos", "7" }, { "emc_wall_slippery_1.frames", "1" }, - { "emc_wall_slippery_1.scale_up_factor", "2" }, - { "emc_wall_slippery_2", "emc_object.pcx" }, - { "emc_wall_slippery_2.xpos", "25" }, - { "emc_wall_slippery_2.ypos", "28" }, + { "emc_wall_slippery_2", "RocksEMC.pcx" }, + { "emc_wall_slippery_2.xpos", "11" }, + { "emc_wall_slippery_2.ypos", "8" }, { "emc_wall_slippery_2.frames", "1" }, - { "emc_wall_slippery_2.scale_up_factor", "2" }, - { "emc_wall_slippery_3", "emc_object.pcx" }, - { "emc_wall_slippery_3.xpos", "25" }, - { "emc_wall_slippery_3.ypos", "29" }, + { "emc_wall_slippery_3", "RocksEMC.pcx" }, + { "emc_wall_slippery_3.xpos", "11" }, + { "emc_wall_slippery_3.ypos", "9" }, { "emc_wall_slippery_3.frames", "1" }, - { "emc_wall_slippery_3.scale_up_factor", "2" }, - { "emc_wall_slippery_4", "emc_object.pcx" }, - { "emc_wall_slippery_4.xpos", "25" }, - { "emc_wall_slippery_4.ypos", "30" }, + { "emc_wall_slippery_4", "RocksEMC.pcx" }, + { "emc_wall_slippery_4.xpos", "11" }, + { "emc_wall_slippery_4.ypos", "10" }, { "emc_wall_slippery_4.frames", "1" }, - { "emc_wall_slippery_4.scale_up_factor", "2" }, { "emc_fake_grass", "RocksEMC.pcx" }, { "emc_fake_grass.xpos", "0" }, @@ -3610,15 +3588,13 @@ struct ConfigInfo image_config[] = { "emc_dripper.xpos", "0" }, { "emc_dripper.ypos", "0" }, { "emc_dripper.frames", "1" }, - { "emc_dripper.EDITOR", "emc_object.pcx" }, - { "emc_dripper.EDITOR.xpos", "25" }, - { "emc_dripper.EDITOR.ypos", "15" }, - { "emc_dripper.EDITOR.scale_up_factor", "2" }, - { "emc_dripper.active", "emc_object.pcx" }, - { "emc_dripper.active.xpos", "25" }, - { "emc_dripper.active.ypos", "15" }, + { "emc_dripper.EDITOR", "RocksEMC.pcx" }, + { "emc_dripper.EDITOR.xpos", "8" }, + { "emc_dripper.EDITOR.ypos", "8" }, + { "emc_dripper.active", "RocksEMC.pcx" }, + { "emc_dripper.active.xpos", "8" }, + { "emc_dripper.active.ypos", "8" }, { "emc_dripper.active.frames", "1" }, - { "emc_dripper.active.scale_up_factor", "2" }, #include "conf_chr.c" /* include auto-generated data structure definitions */ #include "conf_cus.c" /* include auto-generated data structure definitions */ @@ -3627,13 +3603,21 @@ struct ConfigInfo image_config[] = /* images not associated to game elements (used for menu screens etc.) */ /* keyword to stop parser: "NO_MORE_ELEMENT_IMAGES" <-- do not change! */ +#if 1 /* !!! TEMPORARILY STORED HERE -- PROBABLY TO BE CHANGED !!! */ - { "emc_object", "emc_object.pcx" }, + /* (for testing, change filename back to "emc_object dot pcx") */ + { "emc_object", "RocksEMC.pcx" }, +#if 0 { "emc_object.scale_up_factor", "2" }, +#endif - { "emc_sprite", "emc_sprite.pcx" }, + /* (for testing, change filename back to "emc_sprite dot pcx") */ + { "emc_sprite", "RocksEMC.pcx" }, +#if 0 { "emc_sprite.scale_up_factor", "2" }, +#endif +#endif { "toon_1", "RocksToons.pcx" }, { "toon_1.x", "2" }, diff --git a/src/conftime.h b/src/conftime.h index 0cedaf28..a82deead 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2005-07-24 14:45]" +#define COMPILE_DATE_STRING "[2005-08-07 00:47]" diff --git a/src/editor.c b/src/editor.c index 1ff0015f..f4b017cc 100644 --- a/src/editor.c +++ b/src/editor.c @@ -879,6 +879,9 @@ static struct char *text; } control_info[ED_NUM_CTRL_BUTTONS] = { + /* note: some additional characters are already reserved for "cheat mode" + shortcuts (":XYZ" style) -- for details, see "events.c" */ + { 's', "draw single items" }, { 'd', "draw connected items" }, { 'l', "draw lines" }, @@ -2765,10 +2768,18 @@ static int editor_el_emerald_mine_club[] = EL_EMC_WALL_11, EL_EMC_WALL_12, +#if RELEASE_311 + EL_EMPTY, +#else EL_EMC_ANDROID, +#endif EL_BALLOON, EL_BALLOON_SWITCH_ANY, +#if RELEASE_311 + EL_EMPTY, +#else EL_BALLOON_SWITCH_NONE, +#endif EL_BALLOON_SWITCH_LEFT, EL_BALLOON_SWITCH_RIGHT, @@ -2777,15 +2788,33 @@ static int editor_el_emerald_mine_club[] = EL_EMC_GRASS, EL_EMC_PLANT, +#if RELEASE_311 + EL_EMPTY, + EL_EMPTY, +#else EL_EMC_LENSES, EL_EMC_MAGNIFIER, +#endif +#if RELEASE_311 + EL_EMPTY, + EL_EMPTY, +#else EL_EMC_MAGIC_BALL, EL_EMC_MAGIC_BALL_SWITCH, +#endif EL_SPRING, +#if RELEASE_311 + EL_EMPTY, +#else EL_EMC_SPRING_BUMPER, +#endif +#if RELEASE_311 + EL_EMPTY, +#else EL_EMC_DRIPPER, +#endif EL_EMC_FAKE_GRASS, EL_EMPTY, EL_EMPTY, @@ -7897,6 +7926,7 @@ static void SelectArea(int from_x, int from_y, int to_x, int to_y, #define CB_BRUSH_TO_LEVEL 2 #define CB_DELETE_OLD_CURSOR 3 #define CB_DUMP_BRUSH 4 +#define CB_DUMP_BRUSH_SMALL 5 static void CopyBrushExt(int from_x, int from_y, int to_x, int to_y, int button, int mode) @@ -7908,7 +7938,8 @@ static void CopyBrushExt(int from_x, int from_y, int to_x, int to_y, int new_element = BUTTON_ELEMENT(button); int x, y; - if (mode == CB_DUMP_BRUSH) + if (mode == CB_DUMP_BRUSH || + mode == CB_DUMP_BRUSH_SMALL) { if (!draw_with_brush) { @@ -7955,10 +7986,12 @@ static void CopyBrushExt(int from_x, int from_y, int to_x, int to_y, if (IS_CUSTOM_ELEMENT(element)) element_mapped = EL_CUSTOM_START; - else if (element > EL_ENVELOPE_4) - element_mapped = EL_CHAR_QUESTION; /* change to EL_UNKNOWN ... */ + else if (IS_GROUP_ELEMENT(element)) + element_mapped = EL_GROUP_START; + else if (element >= NUM_FILE_ELEMENTS) + element_mapped = EL_UNKNOWN; - printf("`%03d", element_mapped); + printf("%c%03d", (mode == CB_DUMP_BRUSH ? '`' : '¸'), element_mapped); #endif } @@ -8087,6 +8120,11 @@ void DumpBrush() CopyBrushExt(0, 0, 0, 0, 0, CB_DUMP_BRUSH); } +void DumpBrush_Small() +{ + CopyBrushExt(0, 0, 0, 0, 0, CB_DUMP_BRUSH_SMALL); +} + static void FloodFill(int from_x, int from_y, int fill_element) { int i,x,y; diff --git a/src/editor.h b/src/editor.h index 7eaa7743..62617108 100644 --- a/src/editor.h +++ b/src/editor.h @@ -31,5 +31,6 @@ void RequestExitLevelEditor(boolean); void PrintEditorElementList(); void DumpBrush(); +void DumpBrush_Small(); #endif diff --git a/src/events.c b/src/events.c index 6b5ec687..debb368b 100644 --- a/src/events.c +++ b/src/events.c @@ -569,6 +569,10 @@ static void HandleKeysSpecial(Key key) { DumpBrush(); } + else if (is_string_suffix(cheat_input, ":DDB")) + { + DumpBrush_Small(); + } } } diff --git a/src/game.c b/src/game.c index ba4c8f9d..b0d7ec6b 100644 --- a/src/game.c +++ b/src/game.c @@ -4404,9 +4404,9 @@ static void ActivateTimegateSwitch(int x, int y) void Impact(int x, int y) { - boolean lastline = (y == lev_fieldy-1); + boolean last_line = (y == lev_fieldy - 1); boolean object_hit = FALSE; - boolean impact = (lastline || object_hit); + boolean impact = (last_line || object_hit); int element = Feld[x][y]; int smashed = EL_STEELWALL; @@ -4414,7 +4414,7 @@ void Impact(int x, int y) printf("IMPACT!\n"); #endif - if (!lastline) /* check if element below was hit */ + if (!last_line) /* check if element below was hit */ { if (Feld[x][y + 1] == EL_PLAYER_IS_LEAVING) return; @@ -4435,10 +4435,10 @@ void Impact(int x, int y) if (object_hit) smashed = MovingOrBlocked2Element(x, y + 1); - impact = (lastline || object_hit); + impact = (last_line || object_hit); } - if (!lastline && smashed == EL_ACID) /* element falls into acid */ + if (!last_line && smashed == EL_ACID) /* element falls into acid */ { SplashAcid(x, y + 1); return; @@ -4637,7 +4637,7 @@ void Impact(int x, int y) } /* play sound of magic wall / mill */ - if (!lastline && + if (!last_line && (Feld[x][y + 1] == EL_MAGIC_WALL_ACTIVE || Feld[x][y + 1] == EL_BD_MAGIC_WALL_ACTIVE)) { @@ -4650,7 +4650,7 @@ void Impact(int x, int y) } /* play sound of object that hits the ground */ - if (lastline || object_hit) + if (last_line || object_hit) PlayLevelSoundElementAction(x, y, element, ACTION_IMPACT); } @@ -6461,6 +6461,10 @@ void StartMoving(int x, int y) ContinueMoving(x, y); } +void dummy() +{ +} + void ContinueMoving(int x, int y) { int element = Feld[x][y]; @@ -6479,6 +6483,7 @@ void ContinueMoving(int x, int y) #else boolean pushed_by_player = Pushed[x][y]; #endif + boolean last_line = (newy == lev_fieldy - 1); MovPos[x][y] += getElementMoveStepsize(x, y); @@ -6774,20 +6779,19 @@ void ContinueMoving(int x, int y) #if USE_NEW_MOVE_STYLE #if 0 if (CAN_FALL(element) && direction == MV_DOWN && - (newy == lev_fieldy - 1 || !IS_FREE(x, newy + 1)) && - IS_PLAYER(x, newy + 1)) + !last_line && IS_PLAYER(x, newy + 1)) printf("::: we would now kill the player [%d]\n", FrameCounter); #endif /* give the player one last chance (one more frame) to move away */ if (CAN_FALL(element) && direction == MV_DOWN && - (newy == lev_fieldy - 1 || !IS_FREE(x, newy + 1)) && - ((newy < lev_fieldy - 1 && !IS_PLAYER(x, newy + 1)) || - game.engine_version < VERSION_IDENT(3,1,1,0))) + (last_line || (!IS_FREE(x, newy + 1) && + (!IS_PLAYER(x, newy + 1) || + game.engine_version < VERSION_IDENT(3,1,1,0))))) Impact(x, newy); #else if (CAN_FALL(element) && direction == MV_DOWN && - (newy == lev_fieldy - 1 || !IS_FREE(x, newy + 1))) + (last_line || !IS_FREE(x, newy + 1))) Impact(x, newy); #endif diff --git a/src/game_em/convert.c b/src/game_em/convert.c index 6aac3b7d..6287eea2 100644 --- a/src/game_em/convert.c +++ b/src/game_em/convert.c @@ -382,7 +382,8 @@ int cleanup_em_level(unsigned char *src, int length) length = 2172; #if 1 - printf("::: EM level file version: %d\n", file_version); + if (options.debug) + printf("::: EM level file version: %d\n", file_version); #endif return file_version; diff --git a/src/init.c b/src/init.c index 798f4b4a..1f580732 100644 --- a/src/init.c +++ b/src/init.c @@ -4710,7 +4710,12 @@ static char *getNewArtworkIdentifier(int type) artwork_current_identifier) != 0) artwork_new_identifier = artwork_current_identifier; +#if 1 + *(ARTWORK_CURRENT_IDENTIFIER_PTR(artwork, type))= artwork_current_identifier; +#else + /* newer versions of gcc do not like this anymore :-/ */ *(&(ARTWORK_CURRENT_IDENTIFIER(artwork, type))) = artwork_current_identifier; +#endif #if 0 if (type == ARTWORK_TYPE_GRAPHICS) diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index aaf01eb7..5ac104c8 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -744,11 +744,11 @@ static void HandleGadgetTags(struct GadgetInfo *gi, int first_tag, va_list ap) break; case GDI_TYPE: - gi->type = va_arg(ap, unsigned long); + gi->type = va_arg(ap, unsigned int); break; case GDI_STATE: - gi->state = va_arg(ap, unsigned long); + gi->state = va_arg(ap, unsigned int); break; case GDI_ACTIVE: @@ -770,18 +770,18 @@ static void HandleGadgetTags(struct GadgetInfo *gi, int first_tag, va_list ap) break; case GDI_RADIO_NR: - gi->radio_nr = va_arg(ap, unsigned long); + gi->radio_nr = va_arg(ap, unsigned int); break; case GDI_NUMBER_VALUE: - gi->textinput.number_value = va_arg(ap, long); + gi->textinput.number_value = va_arg(ap, int); sprintf(gi->textinput.value, "%d", gi->textinput.number_value); strcpy(gi->textinput.last_value, gi->textinput.value); gi->textinput.cursor_position = strlen(gi->textinput.value); break; case GDI_NUMBER_MIN: - gi->textinput.number_min = va_arg(ap, long); + gi->textinput.number_min = va_arg(ap, int); if (gi->textinput.number_value < gi->textinput.number_min) { gi->textinput.number_value = gi->textinput.number_min; @@ -791,7 +791,7 @@ static void HandleGadgetTags(struct GadgetInfo *gi, int first_tag, va_list ap) break; case GDI_NUMBER_MAX: - gi->textinput.number_max = va_arg(ap, long); + gi->textinput.number_max = va_arg(ap, int); if (gi->textinput.number_value > gi->textinput.number_max) { gi->textinput.number_value = gi->textinput.number_max; @@ -919,7 +919,7 @@ static void HandleGadgetTags(struct GadgetInfo *gi, int first_tag, va_list ap) break; case GDI_EVENT_MASK: - gi->event_mask = va_arg(ap, unsigned long); + gi->event_mask = va_arg(ap, unsigned int); break; case GDI_AREA_SIZE: diff --git a/src/libgame/gadgets.h b/src/libgame/gadgets.h index d69c4017..ac14cb81 100644 --- a/src/libgame/gadgets.h +++ b/src/libgame/gadgets.h @@ -213,8 +213,8 @@ struct GadgetInfo char info_text[MAX_INFO_TEXTSIZE]; /* short popup info text */ int x, y; /* gadget position */ int width, height; /* gadget size */ - unsigned long type; /* type (button, text input, ...) */ - unsigned long state; /* state (pressed, released, ...) */ + unsigned int type; /* type (button, text input, ...) */ + unsigned int state; /* state (pressed, released, ...) */ boolean checked; /* check/radio button state */ int radio_nr; /* number of radio button series */ boolean mapped; /* gadget is mapped on the screen */ @@ -226,7 +226,7 @@ struct GadgetInfo struct GadgetDesign design[2]; /* 0: normal; 1: pressed */ struct GadgetDesign alt_design[2]; /* alternative design */ struct GadgetDecoration deco; /* decoration on top of gadget */ - unsigned long event_mask; /* possible events for this gadget */ + unsigned int event_mask; /* possible events for this gadget */ struct GadgetEvent event; /* actual gadget event */ gadget_function callback_info; /* function for pop-up info text */ gadget_function callback_action; /* function for gadget action */ diff --git a/src/libgame/image.c b/src/libgame/image.c index 1475fe1e..09ec64f6 100644 --- a/src/libgame/image.c +++ b/src/libgame/image.c @@ -718,7 +718,7 @@ void ZoomPixmap(Display *display, GC gc, Pixmap src_pixmap, Pixmap dst_pixmap, for (i = 0; i < bytes_per_pixel; i++) *dst_ptr++ = *(src_ptr + i); - src_ptr += i; + src_ptr += bytes_per_pixel; } } } diff --git a/src/libgame/misc.c b/src/libgame/misc.c index a3c32479..8d8f8aae 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -2122,6 +2122,10 @@ static void LoadArtworkConfigFromFilename(struct ArtworkListInfo *artwork_info, boolean base_prefix_found = FALSE; boolean parameter_suffix_found = FALSE; +#if 0 + printf("::: examining '%s' -> '%s'\n", token, HASH_ITERATION_VALUE(itr)); +#endif + /* skip all parameter definitions (handled by read_token_parameters()) */ for (i = 0; i < num_suffix_list_entries && !parameter_suffix_found; i++) { diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 967fbcfa..7c4fc880 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -302,8 +302,8 @@ char *setLevelArtworkDir(TreeInfo *ti) if (ti == NULL || leveldir_current == NULL) return NULL; - artwork_path_ptr = &(LEVELDIR_ARTWORK_PATH(leveldir_current, ti->type)); - artwork_set_ptr = &(LEVELDIR_ARTWORK_SET( leveldir_current, ti->type)); + artwork_path_ptr = LEVELDIR_ARTWORK_PATH_PTR(leveldir_current, ti->type); + artwork_set_ptr = LEVELDIR_ARTWORK_SET_PTR( leveldir_current, ti->type); checked_free(*artwork_path_ptr); diff --git a/src/libgame/system.h b/src/libgame/system.h index 95c18af1..0b210ed0 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -337,6 +337,13 @@ /* values for artwork handling */ +#define LEVELDIR_ARTWORK_SET_PTR(leveldir, type) \ + ((type) == ARTWORK_TYPE_GRAPHICS ? \ + &(leveldir)->graphics_set : \ + (type) == ARTWORK_TYPE_SOUNDS ? \ + &(leveldir)->sounds_set : \ + &(leveldir)->music_set) + #define LEVELDIR_ARTWORK_SET(leveldir, type) \ ((type) == ARTWORK_TYPE_GRAPHICS ? \ (leveldir)->graphics_set : \ @@ -344,6 +351,13 @@ (leveldir)->sounds_set : \ (leveldir)->music_set) +#define LEVELDIR_ARTWORK_PATH_PTR(leveldir, type) \ + ((type) == ARTWORK_TYPE_GRAPHICS ? \ + &(leveldir)->graphics_path : \ + (type) == ARTWORK_TYPE_SOUNDS ? \ + &(leveldir)->sounds_path : \ + &(leveldir)->music_path) + #define LEVELDIR_ARTWORK_PATH(leveldir, type) \ ((type) == ARTWORK_TYPE_GRAPHICS ? \ (leveldir)->graphics_path : \ @@ -372,6 +386,13 @@ (artwork).snd_first : \ (artwork).mus_first) +#define ARTWORK_CURRENT_IDENTIFIER_PTR(artwork, type) \ + ((type) == ARTWORK_TYPE_GRAPHICS ? \ + &(artwork).gfx_current_identifier : \ + (type) == ARTWORK_TYPE_SOUNDS ? \ + &(artwork).snd_current_identifier : \ + &(artwork).mus_current_identifier) + #define ARTWORK_CURRENT_IDENTIFIER(artwork, type) \ ((type) == ARTWORK_TYPE_GRAPHICS ? \ (artwork).gfx_current_identifier : \ diff --git a/src/main.h b/src/main.h index 55aba370..2a2714a8 100644 --- a/src/main.h +++ b/src/main.h @@ -1388,21 +1388,24 @@ /* program information and versioning definitions */ -#if 1 +#define RELEASE_311 TRUE + +#if RELEASE_311 #define PROGRAM_VERSION_MAJOR 3 #define PROGRAM_VERSION_MINOR 1 #define PROGRAM_VERSION_PATCH 1 #define PROGRAM_VERSION_BUILD 0 #else -#define PROGRAM_VERSION_MAJOR 3 -#define PROGRAM_VERSION_MINOR 2 -#define PROGRAM_VERSION_PATCH 0 -#define PROGRAM_VERSION_BUILD 3 +/* !!! make sure that packaging script can find unique version number !!! */ +#define X_PROGRAM_VERSION_MAJOR 3 +#define X_PROGRAM_VERSION_MINOR 2 +#define X_PROGRAM_VERSION_PATCH 0 +#define X_PROGRAM_VERSION_BUILD 3 #endif #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel" -#define PROGRAM_COPYRIGHT_STRING "Copyright ©1995-2004 by Holger Schemel" +#define PROGRAM_COPYRIGHT_STRING "Copyright ©1995-2005 by Holger Schemel" #define ICON_TITLE_STRING PROGRAM_TITLE_STRING #define COOKIE_PREFIX "ROCKSNDIAMONDS" -- 2.34.1