From: Holger Schemel Date: Fri, 23 Mar 2007 19:35:54 +0000 (+0100) Subject: rnd-20070323-1-src X-Git-Tag: 3.2.4^2~57 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=0d03b05bd2b0faf67444063af59c3b0fef45dd09;p=rocksndiamonds.git rnd-20070323-1-src * added new player option "no centering when relocating" for "invisible" teleportations to level areas that look exactly the same, giving the illusion that the player did not relocate at all (this was the default since 3.2.3, but caused visual problems with room creation in "Zelda") --- diff --git a/ChangeLog b/ChangeLog index 02087c82..ce543daf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-03-23 + * added new player option "no centering when relocating" for "invisible" + teleportations to level areas that look exactly the same, giving the + illusion that the player did not relocate at all (this was the default + since 3.2.3, but caused visual problems with room creation in "Zelda") + 2007-03-21 * improved menu fading, adding separate fading definitions for entering and leaving a menu and for fading between menu and "content" screens diff --git a/src/conftime.h b/src/conftime.h index b44c1e5a..657a6810 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2007-03-22 00:11" +#define COMPILE_DATE_STRING "2007-03-23 20:29" diff --git a/src/editor.c b/src/editor.c index 134a3fcb..081dc373 100644 --- a/src/editor.c +++ b/src/editor.c @@ -559,44 +559,45 @@ #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_INITIAL_GRAVITY (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_ENVELOPE_AUTOWRAP (GADGET_ID_CHECKBUTTON_FIRST + 23) -#define GADGET_ID_ENVELOPE_CENTERED (GADGET_ID_CHECKBUTTON_FIRST + 24) -#define GADGET_ID_CUSTOM_INDESTRUCTIBLE (GADGET_ID_CHECKBUTTON_FIRST + 25) -#define GADGET_ID_CUSTOM_CAN_EXPLODE (GADGET_ID_CHECKBUTTON_FIRST + 26) -#define GADGET_ID_CUSTOM_EXPLODE_FIRE (GADGET_ID_CHECKBUTTON_FIRST + 27) -#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 28) -#define GADGET_ID_CUSTOM_EXPLODE_IMPACT (GADGET_ID_CHECKBUTTON_FIRST + 29) -#define GADGET_ID_CUSTOM_WALK_TO_OBJECT (GADGET_ID_CHECKBUTTON_FIRST + 30) -#define GADGET_ID_CUSTOM_DEADLY (GADGET_ID_CHECKBUTTON_FIRST + 31) -#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 32) -#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 33) -#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 34) -#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 35) -#define GADGET_ID_CUSTOM_ACCESSIBLE (GADGET_ID_CHECKBUTTON_FIRST + 36) -#define GADGET_ID_CUSTOM_GRAV_REACHABLE (GADGET_ID_CHECKBUTTON_FIRST + 37) -#define GADGET_ID_CUSTOM_USE_LAST_VALUE (GADGET_ID_CHECKBUTTON_FIRST + 38) -#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 39) -#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 40) -#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 41) -#define GADGET_ID_CHANGE_USE_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 42) -#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 43) -#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 44) -#define GADGET_ID_CHANGE_USE_RANDOM (GADGET_ID_CHECKBUTTON_FIRST + 45) -#define GADGET_ID_CHANGE_HAS_ACTION (GADGET_ID_CHECKBUTTON_FIRST + 46) -#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 47) -#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 48) -#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 49) +#define GADGET_ID_SHIFTED_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_INITIAL_GRAVITY (GADGET_ID_CHECKBUTTON_FIRST + 19) +#define GADGET_ID_CAN_PASS_TO_WALKABLE (GADGET_ID_CHECKBUTTON_FIRST + 20) +#define GADGET_ID_CAN_FALL_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 21) +#define GADGET_ID_CAN_MOVE_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 22) +#define GADGET_ID_DONT_COLLIDE_WITH (GADGET_ID_CHECKBUTTON_FIRST + 23) +#define GADGET_ID_ENVELOPE_AUTOWRAP (GADGET_ID_CHECKBUTTON_FIRST + 24) +#define GADGET_ID_ENVELOPE_CENTERED (GADGET_ID_CHECKBUTTON_FIRST + 25) +#define GADGET_ID_CUSTOM_INDESTRUCTIBLE (GADGET_ID_CHECKBUTTON_FIRST + 26) +#define GADGET_ID_CUSTOM_CAN_EXPLODE (GADGET_ID_CHECKBUTTON_FIRST + 27) +#define GADGET_ID_CUSTOM_EXPLODE_FIRE (GADGET_ID_CHECKBUTTON_FIRST + 28) +#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 29) +#define GADGET_ID_CUSTOM_EXPLODE_IMPACT (GADGET_ID_CHECKBUTTON_FIRST + 30) +#define GADGET_ID_CUSTOM_WALK_TO_OBJECT (GADGET_ID_CHECKBUTTON_FIRST + 31) +#define GADGET_ID_CUSTOM_DEADLY (GADGET_ID_CHECKBUTTON_FIRST + 32) +#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 33) +#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 34) +#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 35) +#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 36) +#define GADGET_ID_CUSTOM_ACCESSIBLE (GADGET_ID_CHECKBUTTON_FIRST + 37) +#define GADGET_ID_CUSTOM_GRAV_REACHABLE (GADGET_ID_CHECKBUTTON_FIRST + 38) +#define GADGET_ID_CUSTOM_USE_LAST_VALUE (GADGET_ID_CHECKBUTTON_FIRST + 39) +#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 40) +#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 41) +#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 42) +#define GADGET_ID_CHANGE_USE_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 43) +#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 44) +#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 45) +#define GADGET_ID_CHANGE_USE_RANDOM (GADGET_ID_CHECKBUTTON_FIRST + 46) +#define GADGET_ID_CHANGE_HAS_ACTION (GADGET_ID_CHECKBUTTON_FIRST + 47) +#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 48) +#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 49) +#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 50) /* gadgets for buttons in element list */ -#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 50) +#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 51) #define GADGET_ID_ELEMENTLIST_LAST (GADGET_ID_ELEMENTLIST_FIRST + \ ED_NUM_ELEMENTLIST_BUTTONS - 1) @@ -786,43 +787,44 @@ #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_INITIAL_GRAVITY 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_ENVELOPE_AUTOWRAP 21 -#define ED_CHECKBUTTON_ID_ENVELOPE_CENTERED 22 -#define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC 23 -#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE 24 -#define ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE 25 -#define ED_CHECKBUTTON_ID_CUSTOM_GRAV_REACHABLE 26 -#define ED_CHECKBUTTON_ID_CUSTOM_USE_LAST_VALUE 27 -#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 28 -#define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE 29 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 30 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 31 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 32 -#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 33 -#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 34 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_EXPLODE 35 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 36 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 37 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 38 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 39 -#define ED_CHECKBUTTON_ID_CHANGE_DELAY 40 -#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 41 -#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT 42 -#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 43 -#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT 44 -#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 45 -#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM 46 -#define ED_CHECKBUTTON_ID_CHANGE_HAS_ACTION 47 - -#define ED_NUM_CHECKBUTTONS 48 +#define ED_CHECKBUTTON_ID_SHIFTED_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_INITIAL_GRAVITY 17 +#define ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE 18 +#define ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID 19 +#define ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID 20 +#define ED_CHECKBUTTON_ID_DONT_COLLIDE_WITH 21 +#define ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP 22 +#define ED_CHECKBUTTON_ID_ENVELOPE_CENTERED 23 +#define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC 24 +#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE 25 +#define ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE 26 +#define ED_CHECKBUTTON_ID_CUSTOM_GRAV_REACHABLE 27 +#define ED_CHECKBUTTON_ID_CUSTOM_USE_LAST_VALUE 28 +#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 29 +#define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE 30 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 31 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 32 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 33 +#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 34 +#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 35 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_EXPLODE 36 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 37 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 38 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 39 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 40 +#define ED_CHECKBUTTON_ID_CHANGE_DELAY 41 +#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 42 +#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT 43 +#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 44 +#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT 45 +#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 46 +#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM 47 +#define ED_CHECKBUTTON_ID_CHANGE_HAS_ACTION 48 + +#define ED_NUM_CHECKBUTTONS 49 #define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED #define ED_CHECKBUTTON_ID_LEVEL_LAST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED @@ -2034,7 +2036,7 @@ static struct /* ---------- element settings: configure (several elements) ------------- */ { - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(5), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(6), GADGET_ID_PLAYER_SPEED, GADGET_ID_NONE, -1, options_player_speed, @@ -2558,14 +2560,14 @@ static struct "can grow into anything diggable", "grow into more than just sand" }, { - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(7), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(8), 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), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(7), GADGET_ID_BLOCK_SNAP_FIELD, GADGET_ID_NONE, &level.block_snap_field, NULL, @@ -2593,35 +2595,42 @@ static struct "no scrolling when relocating", "player gets relocated without delay" }, { - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(8), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(4), + GADGET_ID_SHIFTED_RELOCATION, GADGET_ID_NONE, + &level.shifted_relocation, + NULL, + "no centering when relocating", "level not centered after relocation" + }, + { + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(9), 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(9), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(10), 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(10), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(11), GADGET_ID_USE_EXPLOSION_ELEMENT, GADGET_ID_NONE, &level.use_explosion_element[0], NULL, "use explosion from element:", "use explosion properties from element" }, { - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(11), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(12), GADGET_ID_INITIAL_GRAVITY, GADGET_ID_NONE, &level.initial_player_gravity[0], NULL, "use initial gravity", "set initial player gravity" }, { - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(4), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(5), GADGET_ID_CAN_PASS_TO_WALKABLE, GADGET_ID_NONE, &level.can_pass_to_walkable, NULL, @@ -2997,7 +3006,7 @@ static struct /* ---------- level start element ---------------------------------------- */ { - -1, ED_AREA_1X1_SETTINGS_YPOS(8), + -1, ED_AREA_1X1_SETTINGS_YPOS(9), GADGET_ID_START_ELEMENT, GADGET_ID_USE_START_ELEMENT, &level.start_element[0], 1, 1, NULL, NULL, NULL, "level start element" @@ -3006,7 +3015,7 @@ static struct /* ---------- player artwork element ------------------------------------- */ { - -1, ED_AREA_1X1_SETTINGS_YPOS(9), + -1, ED_AREA_1X1_SETTINGS_YPOS(10), GADGET_ID_ARTWORK_ELEMENT, GADGET_ID_USE_ARTWORK_ELEMENT, &level.artwork_element[0], 1, 1, NULL, NULL, NULL, "element for player artwork" @@ -3015,7 +3024,7 @@ static struct /* ---------- player explosion element ----------------------------------- */ { - -1, ED_AREA_1X1_SETTINGS_YPOS(10), + -1, ED_AREA_1X1_SETTINGS_YPOS(11), GADGET_ID_EXPLOSION_ELEMENT, GADGET_ID_USE_EXPLOSION_ELEMENT, &level.explosion_element[0], 1, 1, NULL, NULL, NULL, "element for player explosion" @@ -8018,6 +8027,7 @@ static void DrawPropertiesConfig() MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BLOCK_SNAP_FIELD); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CONTINUOUS_SNAPPING); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_INSTANT_RELOCATION); + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_SHIFTED_RELOCATION); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_START_ELEMENT); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT); diff --git a/src/files.c b/src/files.c index daff33b9..88ca1817 100644 --- a/src/files.c +++ b/src/files.c @@ -264,6 +264,11 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = TYPE_BOOLEAN, CONF_VALUE_8_BIT(6), &li.continuous_snapping, TRUE }, + { + EL_PLAYER_1, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(12), + &li.shifted_relocation, FALSE + }, /* (these values are different for each player) */ { @@ -5948,6 +5953,10 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename) change->target_element == EL_SOKOBAN_FIELD_PLAYER) change->target_element = EL_PLAYER_1; } + + /* 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) */ + level->shifted_relocation = TRUE; } static void LoadLevel_InitElements(struct LevelInfo *level, char *filename) diff --git a/src/game.c b/src/game.c index 4f5731e4..8495b7b1 100644 --- a/src/game.c +++ b/src/game.c @@ -1897,7 +1897,7 @@ void DrawGameValue_Keys(int key[MAX_NUM_KEYS]) #if 1 struct TextPosInfo *pos = &game.panel.key[i]; #endif - int src_x = DOOR_GFX_PAGEX5 + 18; + int src_x = DOOR_GFX_PAGEX5 + 18 + (i % 4) * MINI_TILEX; int src_y = DOOR_GFX_PAGEY1 + 123; #if 1 int dst_x = PANEL_XPOS(pos); @@ -4191,8 +4191,10 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, if (!IN_VIS_FIELD(SCREENX(x), SCREENY(y)) || center_screen) { - if (center_screen) + if (!level.shifted_relocation || center_screen) { + /* quick relocation (without scrolling), with centering of screen */ + scroll_x = (x < SBX_Left + MIDPOSX ? SBX_Left : x > SBX_Right + MIDPOSX ? SBX_Right : x - MIDPOSX); @@ -4227,6 +4229,8 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, } else { + /* quick relocation (without scrolling), inside visible screen area */ + if ((move_dir == MV_LEFT && scroll_x > x - MIDPOSX + offset) || (move_dir == MV_RIGHT && scroll_x < x - MIDPOSX - offset)) scroll_x = x - MIDPOSX + (scroll_x < x - MIDPOSX ? -offset : +offset); @@ -4248,6 +4252,49 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, } else { +#if 1 + int scroll_xx, scroll_yy; + + if (!level.shifted_relocation || center_screen) + { + /* visible relocation (with scrolling), with centering of screen */ + + scroll_xx = (x < SBX_Left + MIDPOSX ? SBX_Left : + x > SBX_Right + MIDPOSX ? SBX_Right : + x - MIDPOSX); + + scroll_yy = (y < SBY_Upper + MIDPOSY ? SBY_Upper : + y > SBY_Lower + MIDPOSY ? SBY_Lower : + y - MIDPOSY); + } + else + { + /* visible relocation (with scrolling), but do not center screen */ + + int center_scroll_x = (old_x < SBX_Left + MIDPOSX ? SBX_Left : + old_x > SBX_Right + MIDPOSX ? SBX_Right : + old_x - MIDPOSX); + + int center_scroll_y = (old_y < SBY_Upper + MIDPOSY ? SBY_Upper : + old_y > SBY_Lower + MIDPOSY ? SBY_Lower : + old_y - MIDPOSY); + + int offset_x = x + (scroll_x - center_scroll_x); + int offset_y = y + (scroll_y - center_scroll_y); + + scroll_xx = (offset_x < SBX_Left + MIDPOSX ? SBX_Left : + offset_x > SBX_Right + MIDPOSX ? SBX_Right : + offset_x - MIDPOSX); + + scroll_yy = (offset_y < SBY_Upper + MIDPOSY ? SBY_Upper : + offset_y > SBY_Lower + MIDPOSY ? SBY_Lower : + offset_y - MIDPOSY); + } + +#else + + /* visible relocation (with scrolling), with centering of screen */ + int scroll_xx = (x < SBX_Left + MIDPOSX ? SBX_Left : x > SBX_Right + MIDPOSX ? SBX_Right : x - MIDPOSX); @@ -4255,6 +4302,7 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, int scroll_yy = (y < SBY_Upper + MIDPOSY ? SBY_Upper : y > SBY_Lower + MIDPOSY ? SBY_Lower : y - MIDPOSY); +#endif ScrollScreen(NULL, SCROLL_GO_ON); /* scroll last frame to full tile */ diff --git a/src/main.h b/src/main.h index a9c8c3cb..0ca05c7c 100644 --- a/src/main.h +++ b/src/main.h @@ -2249,6 +2249,7 @@ struct LevelInfo boolean use_spring_bug; /* for compatibility with old levels */ boolean use_time_orb_bug; /* for compatibility with old levels */ boolean instant_relocation; /* no visual delay when relocating player */ + boolean shifted_relocation; /* no level centering when relocating player */ boolean can_pass_to_walkable; /* player can pass to empty or walkable tile */ boolean grow_into_diggable; /* amoeba can grow into anything diggable */