From: Holger Schemel Date: Sun, 5 Mar 2006 12:59:03 +0000 (+0100) Subject: rnd-20060305-2-src X-Git-Tag: 3.2.0^2~56 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=728442c17249f1ca5bb6b6aedb85c2b4fe7b8454;p=rocksndiamonds.git rnd-20060305-2-src * added "continuous snapping" (snapping many elements while holding the snap key pressed, without releasing the snap key after each element) as a new player setting for more compatibility with the classic games * finished scrolling for "focus on all players" in EMC graphics engine --- diff --git a/ChangeLog b/ChangeLog index c6957838..36366f10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-03-05 + * added "continuous snapping" (snapping many elements while holding the + snap key pressed, without releasing the snap key after each element) + as a new player setting for more compatibility with the classic games + +2006-03-04 + * finished scrolling for "focus on all players" in EMC graphics engine + 2006-02-28 * level sets with "levels: 0" are ignored for levels, but not artwork * fixed bug when scanning empty level group directories (endless loop) diff --git a/src/conftime.h b/src/conftime.h index c2c32d89..02bdb45e 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-03-05 03:42]" +#define COMPILE_DATE_STRING "[2006-03-05 13:50]" diff --git a/src/editor.c b/src/editor.c index 2e317c3d..4fccecf3 100644 --- a/src/editor.c +++ b/src/editor.c @@ -555,45 +555,46 @@ #define GADGET_ID_RANDOM_BALL_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 8) #define GADGET_ID_INITIAL_BALL_STATE (GADGET_ID_CHECKBUTTON_FIRST + 9) #define GADGET_ID_GROW_INTO_DIGGABLE (GADGET_ID_CHECKBUTTON_FIRST + 10) -#define GADGET_ID_BLOCK_SNAP_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 11) -#define GADGET_ID_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 12) -#define GADGET_ID_SP_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 13) -#define GADGET_ID_INSTANT_RELOCATION (GADGET_ID_CHECKBUTTON_FIRST + 14) -#define GADGET_ID_USE_START_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 15) -#define GADGET_ID_USE_ARTWORK_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 16) -#define GADGET_ID_USE_EXPLOSION_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 17) -#define GADGET_ID_CAN_PASS_TO_WALKABLE (GADGET_ID_CHECKBUTTON_FIRST + 18) -#define GADGET_ID_CAN_FALL_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 19) -#define GADGET_ID_CAN_MOVE_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 20) -#define GADGET_ID_DONT_COLLIDE_WITH (GADGET_ID_CHECKBUTTON_FIRST + 21) -#define GADGET_ID_CUSTOM_INDESTRUCTIBLE (GADGET_ID_CHECKBUTTON_FIRST + 22) -#define GADGET_ID_CUSTOM_CAN_EXPLODE (GADGET_ID_CHECKBUTTON_FIRST + 23) -#define GADGET_ID_CUSTOM_EXPLODE_FIRE (GADGET_ID_CHECKBUTTON_FIRST + 24) -#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 25) -#define GADGET_ID_CUSTOM_EXPLODE_IMPACT (GADGET_ID_CHECKBUTTON_FIRST + 26) -#define GADGET_ID_CUSTOM_WALK_TO_OBJECT (GADGET_ID_CHECKBUTTON_FIRST + 27) -#define GADGET_ID_CUSTOM_DEADLY (GADGET_ID_CHECKBUTTON_FIRST + 28) -#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 29) -#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 30) -#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 31) -#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 32) -#define GADGET_ID_CUSTOM_ACCESSIBLE (GADGET_ID_CHECKBUTTON_FIRST + 33) -#define GADGET_ID_CUSTOM_GRAV_REACHABLE (GADGET_ID_CHECKBUTTON_FIRST + 34) -#define GADGET_ID_CUSTOM_USE_LAST_VALUE (GADGET_ID_CHECKBUTTON_FIRST + 35) -#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 36) -#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 37) -#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 38) -#define GADGET_ID_CHANGE_USE_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 39) -#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 40) -#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 41) -#define GADGET_ID_CHANGE_USE_RANDOM (GADGET_ID_CHECKBUTTON_FIRST + 42) -#define GADGET_ID_CHANGE_HAS_ACTION (GADGET_ID_CHECKBUTTON_FIRST + 43) -#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 44) -#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 45) -#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 46) +#define GADGET_ID_CONTINUOUS_SNAPPING (GADGET_ID_CHECKBUTTON_FIRST + 11) +#define GADGET_ID_BLOCK_SNAP_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 12) +#define GADGET_ID_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 13) +#define GADGET_ID_SP_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 14) +#define GADGET_ID_INSTANT_RELOCATION (GADGET_ID_CHECKBUTTON_FIRST + 15) +#define GADGET_ID_USE_START_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 16) +#define GADGET_ID_USE_ARTWORK_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 17) +#define GADGET_ID_USE_EXPLOSION_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 18) +#define GADGET_ID_CAN_PASS_TO_WALKABLE (GADGET_ID_CHECKBUTTON_FIRST + 19) +#define GADGET_ID_CAN_FALL_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 20) +#define GADGET_ID_CAN_MOVE_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 21) +#define GADGET_ID_DONT_COLLIDE_WITH (GADGET_ID_CHECKBUTTON_FIRST + 22) +#define GADGET_ID_CUSTOM_INDESTRUCTIBLE (GADGET_ID_CHECKBUTTON_FIRST + 23) +#define GADGET_ID_CUSTOM_CAN_EXPLODE (GADGET_ID_CHECKBUTTON_FIRST + 24) +#define GADGET_ID_CUSTOM_EXPLODE_FIRE (GADGET_ID_CHECKBUTTON_FIRST + 25) +#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 26) +#define GADGET_ID_CUSTOM_EXPLODE_IMPACT (GADGET_ID_CHECKBUTTON_FIRST + 27) +#define GADGET_ID_CUSTOM_WALK_TO_OBJECT (GADGET_ID_CHECKBUTTON_FIRST + 28) +#define GADGET_ID_CUSTOM_DEADLY (GADGET_ID_CHECKBUTTON_FIRST + 29) +#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 30) +#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 31) +#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 32) +#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 33) +#define GADGET_ID_CUSTOM_ACCESSIBLE (GADGET_ID_CHECKBUTTON_FIRST + 34) +#define GADGET_ID_CUSTOM_GRAV_REACHABLE (GADGET_ID_CHECKBUTTON_FIRST + 35) +#define GADGET_ID_CUSTOM_USE_LAST_VALUE (GADGET_ID_CHECKBUTTON_FIRST + 36) +#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 37) +#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 38) +#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 39) +#define GADGET_ID_CHANGE_USE_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 40) +#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 41) +#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 42) +#define GADGET_ID_CHANGE_USE_RANDOM (GADGET_ID_CHECKBUTTON_FIRST + 43) +#define GADGET_ID_CHANGE_HAS_ACTION (GADGET_ID_CHECKBUTTON_FIRST + 44) +#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 45) +#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 46) +#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 47) /* gadgets for buttons in element list */ -#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 47) +#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 48) #define GADGET_ID_ELEMENTLIST_LAST (GADGET_ID_ELEMENTLIST_FIRST + \ ED_NUM_ELEMENTLIST_BUTTONS - 1) @@ -779,44 +780,45 @@ #define ED_CHECKBUTTON_ID_RANDOM_BALL_CONTENT 6 #define ED_CHECKBUTTON_ID_INITIAL_BALL_STATE 7 #define ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE 8 -#define ED_CHECKBUTTON_ID_BLOCK_SNAP_FIELD 9 -#define ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD 10 -#define ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD 11 -#define ED_CHECKBUTTON_ID_INSTANT_RELOCATION 12 -#define ED_CHECKBUTTON_ID_USE_START_ELEMENT 13 -#define ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT 14 -#define ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT 15 -#define ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE 16 -#define ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID 17 -#define ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID 18 -#define ED_CHECKBUTTON_ID_DONT_COLLIDE_WITH 19 -#define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC 20 -#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE 21 -#define ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE 22 -#define ED_CHECKBUTTON_ID_CUSTOM_GRAV_REACHABLE 23 -#define ED_CHECKBUTTON_ID_CUSTOM_USE_LAST_VALUE 24 -#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 25 -#define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE 26 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 27 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 28 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 29 -#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 30 -#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 31 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_EXPLODE 32 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 33 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 34 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 35 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 36 -#define ED_CHECKBUTTON_ID_CHANGE_DELAY 37 -#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 38 -#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT 39 -#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 40 -#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT 41 -#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 42 -#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM 43 -#define ED_CHECKBUTTON_ID_CHANGE_HAS_ACTION 44 - -#define ED_NUM_CHECKBUTTONS 45 +#define ED_CHECKBUTTON_ID_CONTINUOUS_SNAPPING 9 +#define ED_CHECKBUTTON_ID_BLOCK_SNAP_FIELD 10 +#define ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD 11 +#define ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD 12 +#define ED_CHECKBUTTON_ID_INSTANT_RELOCATION 13 +#define ED_CHECKBUTTON_ID_USE_START_ELEMENT 14 +#define ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT 15 +#define ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT 16 +#define ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE 17 +#define ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID 18 +#define ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID 19 +#define ED_CHECKBUTTON_ID_DONT_COLLIDE_WITH 20 +#define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC 21 +#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE 22 +#define ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE 23 +#define ED_CHECKBUTTON_ID_CUSTOM_GRAV_REACHABLE 24 +#define ED_CHECKBUTTON_ID_CUSTOM_USE_LAST_VALUE 25 +#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 26 +#define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE 27 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 28 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 29 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 30 +#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 31 +#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 32 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_EXPLODE 33 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 34 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 35 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 36 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 37 +#define ED_CHECKBUTTON_ID_CHANGE_DELAY 38 +#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 39 +#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT 40 +#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 41 +#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT 42 +#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 43 +#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM 44 +#define ED_CHECKBUTTON_ID_CHANGE_HAS_ACTION 45 + +#define ED_NUM_CHECKBUTTONS 46 #define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_INITIAL_GRAVITY #define ED_CHECKBUTTON_ID_LEVEL_LAST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED @@ -2523,6 +2525,13 @@ static struct NULL, "can grow into anything diggable", "grow into more than just sand" }, + { + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(7), + GADGET_ID_CONTINUOUS_SNAPPING, GADGET_ID_NONE, + &level.continuous_snapping, + NULL, + "continuos snapping", "use snapping without releasing key" + }, { ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(6), GADGET_ID_BLOCK_SNAP_FIELD, GADGET_ID_NONE, @@ -2552,21 +2561,21 @@ static struct "no scrolling when relocating", "player gets relocated without delay" }, { - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(7), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(8), GADGET_ID_USE_START_ELEMENT, GADGET_ID_NONE, &level.use_start_element[0], NULL, "use level start element:", "start level at this element's position" }, { - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(8), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(9), GADGET_ID_USE_ARTWORK_ELEMENT, GADGET_ID_NONE, &level.use_artwork_element[0], NULL, "use artwork from element:", "use player artwork from other element" }, { - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(9), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(10), GADGET_ID_USE_EXPLOSION_ELEMENT, GADGET_ID_NONE, &level.use_explosion_element[0], NULL, @@ -2909,7 +2918,7 @@ static struct /* ---------- level start element ---------------------------------------- */ { - -1, ED_AREA_1X1_SETTINGS_YPOS(7), + -1, ED_AREA_1X1_SETTINGS_YPOS(8), GADGET_ID_START_ELEMENT, GADGET_ID_USE_START_ELEMENT, &level.start_element[0], 1, 1, NULL, NULL, NULL, "level start element" @@ -2918,7 +2927,7 @@ static struct /* ---------- player artwork element ------------------------------------- */ { - -1, ED_AREA_1X1_SETTINGS_YPOS(8), + -1, ED_AREA_1X1_SETTINGS_YPOS(9), GADGET_ID_ARTWORK_ELEMENT, GADGET_ID_USE_ARTWORK_ELEMENT, &level.artwork_element[0], 1, 1, NULL, NULL, NULL, "element for player artwork" @@ -2927,7 +2936,7 @@ static struct /* ---------- player explosion element ----------------------------------- */ { - -1, ED_AREA_1X1_SETTINGS_YPOS(9), + -1, ED_AREA_1X1_SETTINGS_YPOS(10), GADGET_ID_EXPLOSION_ELEMENT, GADGET_ID_USE_EXPLOSION_ELEMENT, &level.explosion_element[0], 1, 1, NULL, NULL, NULL, "element for player explosion" @@ -7870,6 +7879,7 @@ static void DrawPropertiesConfig() ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD : ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BLOCK_SNAP_FIELD); + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CONTINUOUS_SNAPPING); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_INSTANT_RELOCATION); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_START_ELEMENT); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT); diff --git a/src/files.c b/src/files.c index a99ca6ba..c2b9d0e0 100644 --- a/src/files.c +++ b/src/files.c @@ -290,6 +290,10 @@ static struct EL_PLAYER_4, CONF_VALUE_BOOLEAN_4, &li.use_explosion_element[3], FALSE }, + { + EL_PLAYER_1, CONF_VALUE_BOOLEAN_5, + &li.continuous_snapping, TRUE + }, { EL_PLAYER_1, CONF_VALUE_INTEGER_1, &li.initial_player_stepsize, STEPSIZE_NORMAL @@ -572,7 +576,9 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) level->can_pass_to_walkable = FALSE; level->grow_into_diggable = TRUE; +#if 0 level->block_snap_field = TRUE; +#endif level->block_last_field = FALSE; /* EM does not block by default */ level->sp_block_last_field = TRUE; /* SP blocks the last field */ @@ -3307,6 +3313,12 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename) #endif } + if (level->game_version < VERSION_IDENT(3,2,0,7)) + { + /* default behaviour for snapping was "not continuous" before 3.2.0-7 */ + level->continuous_snapping = FALSE; + } + /* only few elements were able to actively move into acid before 3.1.0 */ /* trigger settings did not exist before 3.1.0; set to default "any" */ if (level->game_version < VERSION_IDENT(3,1,0,0)) diff --git a/src/game.c b/src/game.c index 92a181bb..ce69ee18 100644 --- a/src/game.c +++ b/src/game.c @@ -40,6 +40,7 @@ #define USE_NEW_SPRING_BUMPER (USE_NEW_STUFF * 1) #define USE_STOP_CHANGED_ELEMENTS (USE_NEW_STUFF * 1) #define USE_ELEMENT_TOUCHING_BUGFIX (USE_NEW_STUFF * 1) +#define USE_NEW_CONTINUOUS_SNAPPING (USE_NEW_STUFF * 1) #define USE_QUICKSAND_IMPACT_BUGFIX (USE_NEW_STUFF * 0) @@ -98,6 +99,11 @@ #define DX_TIME2 (DX + XX_TIME2) #define DY_TIME (DY + YY_TIME) +/* values for delayed check of falling and moving elements and for collision */ +#define CHECK_DELAY_MOVING 3 +#define CHECK_DELAY_FALLING 3 +#define CHECK_DELAY_COLLISION 2 + /* values for initial player move delay (initial delay counter value) */ #define INITIAL_MOVE_DELAY_OFF -1 #define INITIAL_MOVE_DELAY_ON 0 @@ -6484,13 +6490,13 @@ void ContinueMoving(int x, int y) int nextx = newx + dx, nexty = newy + dy; boolean check_collision_again = IN_LEV_FIELD_AND_IS_FREE(nextx, nexty); - WasJustMoving[newx][newy] = 3; + WasJustMoving[newx][newy] = CHECK_DELAY_MOVING; if (CAN_FALL(element) && direction == MV_DOWN) - WasJustFalling[newx][newy] = 3; + WasJustFalling[newx][newy] = CHECK_DELAY_FALLING; if ((!CAN_FALL(element) || direction == MV_DOWN) && check_collision_again) - CheckCollision[newx][newy] = 2; + CheckCollision[newx][newy] = CHECK_DELAY_COLLISION; } if (DONT_TOUCH(element)) /* object may be nasty to player or others */ @@ -11579,6 +11585,8 @@ boolean SnapField(struct PlayerInfo *player, int dx, int dy) dx == +1 ? MV_RIGHT : dy == -1 ? MV_UP : dy == +1 ? MV_DOWN : MV_NONE); + boolean can_continue_snapping = (level.continuous_snapping && + WasJustFalling[x][y] < CHECK_DELAY_FALLING); if (player->MovPos != 0 && game.engine_version >= VERSION_IDENT(2,2,0,0)) return FALSE; @@ -11606,8 +11614,14 @@ boolean SnapField(struct PlayerInfo *player, int dx, int dy) return FALSE; } +#if USE_NEW_CONTINUOUS_SNAPPING + /* prevent snapping with already pressed snap key when not allowed */ + if (player->is_snapping && !can_continue_snapping) + return FALSE; +#else if (player->is_snapping) return FALSE; +#endif player->MovDir = snap_direction; @@ -11762,7 +11776,7 @@ boolean DropElement(struct PlayerInfo *player) nexty = dropy + GET_DY_FROM_DIR(move_direction); ChangeCount[dropx][dropy] = 0; /* allow at least one more change */ - CheckCollision[dropx][dropy] = 2; + CheckCollision[dropx][dropy] = CHECK_DELAY_COLLISION; } player->drop_delay = GET_NEW_DROP_DELAY(drop_element); diff --git a/src/main.h b/src/main.h index c26e1a25..ef613199 100644 --- a/src/main.h +++ b/src/main.h @@ -1989,6 +1989,7 @@ struct LevelInfo boolean can_pass_to_walkable; /* player can pass to empty or walkable tile */ boolean grow_into_diggable; /* amoeba can grow into anything diggable */ + boolean continuous_snapping; /* repeated snapping without releasing key */ boolean block_snap_field; /* snapping blocks field to show animation */ boolean block_last_field; /* player blocks previous field while moving */ boolean sp_block_last_field; /* player blocks previous field while moving */