From bf1e4db1ffa9a313b8d1b68e55633ace682fef96 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 28 Dec 2003 03:48:21 +0100 Subject: [PATCH] rnd-20031228-1-src * changed default snap/drop keys from left/right Shift to Control keys * fixed bug with dead player getting reanimated from custom element --- ChangeLog | 6 +++ src/conftime.h | 2 +- src/editor.c | 7 ++- src/events.c | 10 ++-- src/files.c | 12 ++--- src/game.c | 118 ++++++++++++++++++++++++++++++++++++++---- src/libgame/gadgets.c | 88 ++++++++++++++++++++++++++++--- src/libgame/misc.c | 9 ++++ src/libgame/system.h | 17 +++--- src/main.h | 12 ++++- src/screens.c | 16 +++--- 11 files changed, 246 insertions(+), 51 deletions(-) diff --git a/ChangeLog b/ChangeLog index 599127a4..e41fb393 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ +2003-12-27 + * changed default snap/drop keys from left/right Shift to Control keys + +2003-12-27 + * fixed bug with dead player getting reanimated from custom element + 2003-12-14 * fixed bug with wrong penguin graphics (when entering exit) diff --git a/src/conftime.h b/src/conftime.h index 9cf18e64..b09b190c 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-12-14 22:52]" +#define COMPILE_DATE_STRING "[2003-12-28 03:38]" diff --git a/src/editor.c b/src/editor.c index 9914b16f..5c9ab317 100644 --- a/src/editor.c +++ b/src/editor.c @@ -1070,11 +1070,16 @@ static struct ValueTextInfo options_move_pattern[] = { MV_ALONG_RIGHT_SIDE, "along right side" }, { MV_TURNING_LEFT, "turning left" }, { MV_TURNING_RIGHT, "turning right" }, + { MV_TURNING_LEFT_RIGHT, "turning left, right" }, + { MV_TURNING_RIGHT_LEFT, "turning right, left" }, + { MV_TURNING_RANDOM, "turning random" }, { MV_WHEN_PUSHED, "when pushed" }, -#if 0 +#if 1 { MV_MAZE_RUNNER, "maze runner style" }, { MV_MAZE_HUNTER, "maze hunter style" }, #endif + { MV_PROJECTILE, "projectile style" }, + { MV_PROJECTILE, "projectile style" }, { -1, NULL } }; diff --git a/src/events.c b/src/events.c index 19c47763..facafec6 100644 --- a/src/events.c +++ b/src/events.c @@ -523,14 +523,14 @@ void HandleKey(Key key, int key_status) { &custom_key.up, DEFAULT_KEY_UP, JOY_UP }, { &custom_key.down, DEFAULT_KEY_DOWN, JOY_DOWN }, { &custom_key.snap, DEFAULT_KEY_SNAP, JOY_BUTTON_1 }, - { &custom_key.bomb, DEFAULT_KEY_BOMB, JOY_BUTTON_2 } + { &custom_key.drop, DEFAULT_KEY_DROP, JOY_BUTTON_2 } }; if (game_status == GAME_MODE_PLAYING) { /* only needed for single-step tape recording mode */ static boolean clear_button_2[MAX_PLAYERS] = { FALSE,FALSE,FALSE,FALSE }; - static boolean bomb_placed[MAX_PLAYERS] = { FALSE,FALSE,FALSE,FALSE }; + static boolean element_dropped[MAX_PLAYERS] = { FALSE,FALSE,FALSE,FALSE }; int pnr; for (pnr = 0; pnr < MAX_PLAYERS; pnr++) @@ -568,13 +568,13 @@ void HandleKey(Key key, int key_status) if (key_action & KEY_MOTION) { if (stored_player[pnr].action & KEY_BUTTON_2) - bomb_placed[pnr] = TRUE; + element_dropped[pnr] = TRUE; } } else if (key_status == KEY_RELEASED && (key_action & KEY_BUTTON_2)) { - if (!bomb_placed[pnr]) + if (!element_dropped[pnr]) { TapeTogglePause(TAPE_TOGGLE_AUTOMATIC); @@ -582,7 +582,7 @@ void HandleKey(Key key, int key_status) clear_button_2[pnr] = TRUE; } - bomb_placed[pnr] = FALSE; + element_dropped[pnr] = FALSE; } } else if (tape.recording && tape.pausing && (key_action & KEY_ACTION)) diff --git a/src/files.c b/src/files.c index d1bb0144..5bd23127 100644 --- a/src/files.c +++ b/src/files.c @@ -2329,13 +2329,13 @@ void SaveScore(int level_nr) #define SETUP_TOKEN_PLAYER_JOY_YMIDDLE 6 #define SETUP_TOKEN_PLAYER_JOY_YLOWER 7 #define SETUP_TOKEN_PLAYER_JOY_SNAP 8 -#define SETUP_TOKEN_PLAYER_JOY_BOMB 9 +#define SETUP_TOKEN_PLAYER_JOY_DROP 9 #define SETUP_TOKEN_PLAYER_KEY_LEFT 10 #define SETUP_TOKEN_PLAYER_KEY_RIGHT 11 #define SETUP_TOKEN_PLAYER_KEY_UP 12 #define SETUP_TOKEN_PLAYER_KEY_DOWN 13 #define SETUP_TOKEN_PLAYER_KEY_SNAP 14 -#define SETUP_TOKEN_PLAYER_KEY_BOMB 15 +#define SETUP_TOKEN_PLAYER_KEY_DROP 15 #define NUM_PLAYER_SETUP_TOKENS 16 @@ -2418,13 +2418,13 @@ static struct TokenInfo player_setup_tokens[] = { TYPE_INTEGER, &sii.joy.ymiddle, ".joy.ymiddle" }, { TYPE_INTEGER, &sii.joy.ylower, ".joy.ylower" }, { TYPE_INTEGER, &sii.joy.snap, ".joy.snap_field" }, - { TYPE_INTEGER, &sii.joy.bomb, ".joy.place_bomb" }, + { TYPE_INTEGER, &sii.joy.drop, ".joy.place_bomb" }, { TYPE_KEY_X11, &sii.key.left, ".key.move_left" }, { TYPE_KEY_X11, &sii.key.right, ".key.move_right" }, { TYPE_KEY_X11, &sii.key.up, ".key.move_up" }, { TYPE_KEY_X11, &sii.key.down, ".key.move_down" }, { TYPE_KEY_X11, &sii.key.snap, ".key.snap_field" }, - { TYPE_KEY_X11, &sii.key.bomb, ".key.place_bomb" } + { TYPE_KEY_X11, &sii.key.drop, ".key.place_bomb" } }; static struct TokenInfo system_setup_tokens[] = @@ -2513,13 +2513,13 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->input[i].joy.ymiddle = JOYSTICK_YMIDDLE; si->input[i].joy.ylower = JOYSTICK_YLOWER; si->input[i].joy.snap = (i == 0 ? JOY_BUTTON_1 : 0); - si->input[i].joy.bomb = (i == 0 ? JOY_BUTTON_2 : 0); + si->input[i].joy.drop = (i == 0 ? JOY_BUTTON_2 : 0); si->input[i].key.left = (i == 0 ? DEFAULT_KEY_LEFT : KSYM_UNDEFINED); si->input[i].key.right = (i == 0 ? DEFAULT_KEY_RIGHT : KSYM_UNDEFINED); si->input[i].key.up = (i == 0 ? DEFAULT_KEY_UP : KSYM_UNDEFINED); si->input[i].key.down = (i == 0 ? DEFAULT_KEY_DOWN : KSYM_UNDEFINED); si->input[i].key.snap = (i == 0 ? DEFAULT_KEY_SNAP : KSYM_UNDEFINED); - si->input[i].key.bomb = (i == 0 ? DEFAULT_KEY_BOMB : KSYM_UNDEFINED); + si->input[i].key.drop = (i == 0 ? DEFAULT_KEY_DROP : KSYM_UNDEFINED); } si->system.sdl_audiodriver = getStringCopy(ARG_DEFAULT); diff --git a/src/game.c b/src/game.c index de6aa0c5..af65d866 100644 --- a/src/game.c +++ b/src/game.c @@ -144,9 +144,14 @@ Feld[x][y] == EL_EXIT_OPEN || \ Feld[x][y] == EL_ACID)) +#if 1 +#define MAZE_RUNNER_CAN_ENTER_FIELD(x, y) \ + (IN_LEV_FIELD(x, y) && IS_FREE(x, y)) +#else #define MAZE_RUNNER_CAN_ENTER_FIELD(x, y) \ (IN_LEV_FIELD(x, y) && (IS_FREE(x, y) || \ IS_FOOD_DARK_YAMYAM(Feld[x][y]))) +#endif #define MOLE_CAN_ENTER_FIELD(x, y, condition) \ (IN_LEV_FIELD(x, y) && (IS_FREE(x, y) || (condition))) @@ -1124,6 +1129,8 @@ void InitGame() player->push_delay = 0; player->push_delay_value = game.initial_push_delay_value; + player->drop_delay = 0; + player->last_jx = player->last_jy = 0; player->jx = player->jy = 0; @@ -1607,7 +1614,10 @@ void InitMovDir(int x, int y) MovDir[x][y] = element_info[element].move_direction_initial; else if (element_info[element].move_pattern == MV_ALL_DIRECTIONS || element_info[element].move_pattern == MV_TURNING_LEFT || - element_info[element].move_pattern == MV_TURNING_RIGHT) + element_info[element].move_pattern == MV_TURNING_RIGHT || + element_info[element].move_pattern == MV_TURNING_LEFT_RIGHT || + element_info[element].move_pattern == MV_TURNING_RIGHT_LEFT || + element_info[element].move_pattern == MV_TURNING_RANDOM) MovDir[x][y] = 1 << RND(4); else if (element_info[element].move_pattern == MV_HORIZONTAL) MovDir[x][y] = (RND(2) ? MV_LEFT : MV_RIGHT); @@ -2136,6 +2146,9 @@ void RelocatePlayer(int x, int y, int element) { struct PlayerInfo *player = &stored_player[element - EL_PLAYER_1]; + if (player->GameOver) /* do not reanimate dead player */ + return; + #if 1 RemoveField(x, y); /* temporarily remove newly placed player */ DrawLevelField(x, y); @@ -2525,6 +2538,12 @@ void Explode(int ex, int ey, int phase, int mode) #endif int frame = getGraphicAnimationFrame(graphic, phase - delay); +#if 0 + printf("::: %d ['%s'] -> %d\n", GfxElement[x][y], + element_info[GfxElement[x][y]].token_name, + graphic); +#endif + if (phase == delay) DrawLevelFieldCrumbledSand(x, y); @@ -3680,9 +3699,12 @@ inline static void TurnRoundExt(int x, int y) } } } - else if (move_pattern == MV_ALL_DIRECTIONS || - move_pattern == MV_TURNING_LEFT || - move_pattern == MV_TURNING_RIGHT) + else if (move_pattern == MV_TURNING_LEFT || + move_pattern == MV_TURNING_RIGHT || + move_pattern == MV_TURNING_LEFT_RIGHT || + move_pattern == MV_TURNING_RIGHT_LEFT || + move_pattern == MV_TURNING_RANDOM || + move_pattern == MV_ALL_DIRECTIONS) { boolean can_turn_left = ELEMENT_CAN_ENTER_FIELD(element, left_x, left_y); boolean can_turn_right = ELEMENT_CAN_ENTER_FIELD(element, right_x,right_y); @@ -3691,6 +3713,14 @@ inline static void TurnRoundExt(int x, int y) MovDir[x][y] = left_dir; else if (move_pattern == MV_TURNING_RIGHT) MovDir[x][y] = right_dir; + else if (move_pattern == MV_TURNING_LEFT_RIGHT) + MovDir[x][y] = (can_turn_left || !can_turn_right ? left_dir : right_dir); + else if (move_pattern == MV_TURNING_RIGHT_LEFT) + MovDir[x][y] = (can_turn_right || !can_turn_left ? right_dir : left_dir); + else if (move_pattern == MV_TURNING_RANDOM) + MovDir[x][y] = (can_turn_left && !can_turn_right ? left_dir : + can_turn_right && !can_turn_left ? right_dir : + RND(2) ? left_dir : right_dir); else if (can_turn_left && can_turn_right) MovDir[x][y] = (RND(3) ? (RND(2) ? left_dir : right_dir) : back_dir); else if (can_turn_left) @@ -4267,7 +4297,10 @@ void StartMoving(int x, int y) element != EL_PACMAN && !(move_pattern & MV_ANY_DIRECTION) && move_pattern != MV_TURNING_LEFT && - move_pattern != MV_TURNING_RIGHT) + move_pattern != MV_TURNING_RIGHT && + move_pattern != MV_TURNING_LEFT_RIGHT && + move_pattern != MV_TURNING_RIGHT_LEFT && + move_pattern != MV_TURNING_RANDOM) { TurnRound(x, y); @@ -4502,7 +4535,11 @@ void StartMoving(int x, int y) else if ((move_pattern & MV_MAZE_RUNNER_STYLE || element == EL_MAZE_RUNNER) && IN_LEV_FIELD(newx, newy)) { +#if 1 + if (IS_FREE(newx, newy)) +#else if (IS_FOOD_DARK_YAMYAM(Feld[newx][newy])) +#endif { if (IS_MOVING(newx, newy)) RemoveMovingField(newx, newy); @@ -4881,8 +4918,10 @@ void ContinueMoving(int x, int y) if (!IN_LEV_FIELD(nextx, nexty) || !IS_FREE(nextx, nexty)) { + int hitting_element = Feld[newx][newy]; + /* !!! fix side (direction) orientation here and elsewhere !!! */ - CheckElementSideChange(newx, newy, Feld[newx][newy], + CheckElementSideChange(newx, newy, hitting_element, direction, CE_COLLISION_ACTIVE, -1); #if 0 @@ -4899,7 +4938,6 @@ void ContinueMoving(int x, int y) int opposite_direction = opposite_directions[move_dir_bit]; int hitting_side = direction; int touched_side = opposite_direction; - int hitting_element = Feld[newx][newy]; int touched_element = MovingOrBlocked2Element(nextx, nexty); boolean object_hit = (!IS_MOVING(nextx, nexty) || MovDir[nextx][nexty] != direction || @@ -4909,7 +4947,7 @@ void ContinueMoving(int x, int y) { int i; - CheckElementSideChange(nextx, nexty, Feld[nextx][nexty], + CheckElementSideChange(nextx, nexty, touched_element, opposite_direction, CE_COLLISION_PASSIVE, -1); if (IS_CUSTOM_ELEMENT(hitting_element) && @@ -7094,6 +7132,9 @@ void GameActions() if (stored_player[i].MovPos != 0) stored_player[i].StepFrame += move_frames; + + if (stored_player[i].drop_delay > 0) + stored_player[i].drop_delay--; } #endif @@ -7293,6 +7334,8 @@ boolean MovePlayerOneStep(struct PlayerInfo *player, player->step_counter++; + player->drop_delay = 0; + PlayerVisit[jx][jy] = FrameCounter; ScrollPlayer(player, SCROLL_INIT); @@ -8848,8 +8891,9 @@ boolean DropElement(struct PlayerInfo *player) { int jx = player->jx, jy = player->jy; int old_element; + int new_element; - if (!player->active || player->MovPos) + if (!player->active || player->MovPos || player->drop_delay > 0) return FALSE; old_element = Feld[jx][jy]; @@ -8871,14 +8915,24 @@ boolean DropElement(struct PlayerInfo *player) if (old_element != EL_EMPTY) Back[jx][jy] = old_element; /* store old element on this field */ + + + /* !!! CHANGE !!! CHANGE !!! */ + +#if 0 MovDelay[jx][jy] = 96; +#endif + + /* !!! CHANGE !!! CHANGE !!! */ + + ResetGfxAnimation(jx, jy); ResetRandomAnimationValue(jx, jy); if (player->inventory_size > 0) { - int new_element = player->inventory_element[--player->inventory_size]; + new_element = player->inventory_element[--player->inventory_size]; Feld[jx][jy] = (new_element == EL_DYNAMITE ? EL_DYNAMITE_ACTIVE : new_element == EL_SP_DISK_RED ? EL_SP_DISK_RED_ACTIVE : @@ -8908,8 +8962,52 @@ boolean DropElement(struct PlayerInfo *player) DrawGraphicThruMask(SCREENX(jx), SCREENY(jy), el2img(Feld[jx][jy]), 0); PlayLevelSoundAction(jx, jy, ACTION_DROPPING); + + MovDelay[jx][jy] = 96; } + + +#if 1 + InitField(jx, jy, FALSE); + if (CAN_MOVE(Feld[jx][jy])) + InitMovDir(jx, jy); + + new_element = Feld[jx][jy]; + + if (IS_CUSTOM_ELEMENT(new_element) && CAN_MOVE(new_element) && + element_info[new_element].move_pattern == MV_PROJECTILE) + { + int direction, dx, dy, nextx, nexty; + + if (element_info[new_element].move_direction_initial == MV_NO_MOVING) + MovDir[jx][jy] = player->MovDir; + + direction = MovDir[jx][jy]; + dx = (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0); + dy = (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0); + nextx = jx + dx; + nexty = jy + dy; + + if (IN_LEV_FIELD(nextx, nexty) && IS_FREE(nextx, nexty)) + { + InitMovingField(jx, jy, MovDir[jx][jy]); + ContinueMoving(jx, jy); + } + else + { + Changed[jx][jy] = 0; /* allow another change */ + CheckElementSideChange(jx, jy, new_element, + direction, CE_COLLISION_ACTIVE, -1); + } + } + +#endif + + player->drop_delay = 8 + 8 + 8; + + + return TRUE; } diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index ddc5ac60..a97fe3bd 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -552,15 +552,15 @@ static void DrawGadget(struct GadgetInfo *gi, boolean pressed, boolean direct) { gi->selectbox.open = FALSE; - /* redraw closed selectbox */ - DrawGadget(gi, FALSE, FALSE); - /* restore background under selectbox */ BlitBitmap(gfx.field_save_buffer, drawto, gi->selectbox.x, gi->selectbox.y, gi->selectbox.width, gi->selectbox.height, gi->selectbox.x, gi->selectbox.y); + /* redraw closed selectbox */ + DrawGadget(gi, FALSE, FALSE); + redraw_selectbox = TRUE; } } @@ -1282,6 +1282,22 @@ static boolean anySelectboxGadgetActive() return (last_gi && (last_gi->type & GD_TYPE_SELECTBOX) && last_gi->mapped); } +static boolean insideSelectboxLine(struct GadgetInfo *gi, int mx, int my) +{ + return(gi != NULL && + gi->type & GD_TYPE_SELECTBOX && + mx >= gi->x && mx < gi->x + gi->width && + my >= gi->y && my < gi->y + gi->height); +} + +static boolean insideSelectboxArea(struct GadgetInfo *gi, int mx, int my) +{ + return(gi != NULL && + gi->type & GD_TYPE_SELECTBOX && + mx >= gi->selectbox.x && mx < gi->selectbox.x + gi->selectbox.width && + my >= gi->selectbox.y && my < gi->selectbox.y + gi->selectbox.height); +} + boolean anyTextGadgetActive() { return (anyTextInputGadgetActive() || @@ -1308,13 +1324,19 @@ boolean HandleGadgets(int mx, int my, int button) static unsigned long pressed_delay = 0; static int last_button = 0; static int last_mx = 0, last_my = 0; + static int pressed_mx = 0, pressed_my = 0; int scrollbar_mouse_pos = 0; struct GadgetInfo *new_gi, *gi; boolean press_event; boolean release_event; boolean mouse_moving; + boolean mouse_inside_select_line; + boolean mouse_inside_select_area; + boolean mouse_released_where_pressed; boolean gadget_pressed; boolean gadget_pressed_repeated; + boolean gadget_pressed_off_borders; + boolean gadget_pressed_inside_select_line; boolean gadget_moving; boolean gadget_moving_inside; boolean gadget_moving_off_borders; @@ -1349,9 +1371,34 @@ boolean HandleGadgets(int mx, int my, int button) last_mx = mx; last_my = my; + if (press_event && new_gi != last_gi) + { + pressed_mx = mx; + pressed_my = my; + } + + mouse_released_where_pressed = + (release_event && mx == pressed_mx && my == pressed_my); + + mouse_inside_select_line = insideSelectboxLine(new_gi, mx, my); + mouse_inside_select_area = insideSelectboxArea(new_gi, mx, my); + + gadget_pressed_off_borders = (press_event && new_gi != last_gi); + + gadget_pressed_inside_select_line = + (press_event && new_gi != NULL && + new_gi->type & GD_TYPE_SELECTBOX && new_gi->selectbox.open && + insideSelectboxLine(new_gi, mx, my)); + /* if mouse button pressed outside text or selectbox gadget, deactivate it */ +#if 1 + if (anyTextGadgetActive() && + (gadget_pressed_off_borders || + (gadget_pressed_inside_select_line && !mouse_inside_select_area))) +#else if (anyTextGadgetActive() && button != 0 && !motion_status && new_gi != last_gi) +#endif { CheckRangeOfNumericInputGadget(last_gi); /* in case of numeric gadget */ @@ -1363,6 +1410,9 @@ boolean HandleGadgets(int mx, int my, int button) last_gi->callback_action(last_gi); last_gi = NULL; + + if (gadget_pressed_inside_select_line) + new_gi = NULL; } gadget_pressed = @@ -1383,12 +1433,17 @@ boolean HandleGadgets(int mx, int my, int button) { struct GadgetInfo *gi = last_gi; +#if 1 + gadget_released_inside_select_line = insideSelectboxLine(gi, mx, my); + gadget_released_inside_select_area = insideSelectboxArea(gi, mx, my); +#else gadget_released_inside_select_line = (mx >= gi->x && mx < gi->x + gi->width && my >= gi->y && my < gi->y + gi->height); gadget_released_inside_select_area = (mx >= gi->selectbox.x && mx < gi->selectbox.x + gi->selectbox.width && my >= gi->selectbox.y && my < gi->selectbox.y + gi->selectbox.height); +#endif } else { @@ -1411,12 +1466,23 @@ boolean HandleGadgets(int mx, int my, int button) /* if mouse button released, no gadget needs to be handled anymore */ if (gadget_released) { - if (last_gi->type & GD_TYPE_SELECTBOX && +#if 1 + if (gi->type & GD_TYPE_SELECTBOX && + (mouse_released_where_pressed || + !gadget_released_inside_select_area)) /* selectbox stays open */ + { + gi->selectbox.stay_open = TRUE; + pressed_mx = 0; + pressed_my = 0; + } +#else + if (gi->type & GD_TYPE_SELECTBOX && (gadget_released_inside_select_line || gadget_released_off_borders)) /* selectbox stays open */ gi->selectbox.stay_open = TRUE; - else if (!(last_gi->type & GD_TYPE_TEXT_INPUT || - last_gi->type & GD_TYPE_TEXT_AREA)) /* text input stays open */ +#endif + else if (!(gi->type & GD_TYPE_TEXT_INPUT || + gi->type & GD_TYPE_TEXT_AREA)) /* text input stays open */ last_gi = NULL; } @@ -1470,7 +1536,7 @@ boolean HandleGadgets(int mx, int my, int button) if (gi->textarea.cursor_position != old_cursor_position) DrawGadget(gi, DG_PRESSED, gi->direct_draw); } - else if (gi->type & GD_TYPE_SELECTBOX) + else if (gi->type & GD_TYPE_SELECTBOX && gi->selectbox.open) { int old_index = gi->selectbox.current_index; @@ -1689,9 +1755,15 @@ boolean HandleGadgets(int mx, int my, int button) if (gi->type & GD_TYPE_SELECTBOX) { +#if 1 + if (mouse_released_where_pressed || + !gadget_released_inside_select_area) /* selectbox stays open */ + deactivate_gadget = FALSE; +#else if (gadget_released_inside_select_line || - gadget_released_off_borders) /* selectbox stays open */ + gadget_released_off_borders) /* selectbox stays open */ deactivate_gadget = FALSE; +#endif else gi->selectbox.index = gi->selectbox.current_index; } diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 06ca9357..c7b8eea4 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -1880,6 +1880,7 @@ static void add_dynamic_file_list_entry(struct FileInfo **list, new_list_entry = &(*list)[*num_list_entries - 1]; new_list_entry->token = getStringCopy(token); + new_list_entry->default_filename = NULL; new_list_entry->filename = NULL; new_list_entry->parameter = checked_calloc(parameter_array_size); @@ -2549,9 +2550,17 @@ void ReloadCustomArtworkList(struct ArtworkListInfo *artwork_info) #endif for (i = 0; i < num_dynamic_file_list_entries; i++) + { LoadArtworkToList(artwork_info, &artwork_info->dynamic_artwork_list[i], dynamic_file_list[i].filename, i); +#if 0 + printf("::: '%s', '0x%08x'\n", + dynamic_file_list[i].filename, + dynamic_file_list[i].default_filename); +#endif + } + #if 0 dumpList(artwork_info->content_list); #endif diff --git a/src/libgame/system.h b/src/libgame/system.h index d0594377..abed03f0 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -55,10 +55,10 @@ #define DEFAULT_KEY_DOWN KSYM_Down #if defined(PLATFORM_MACOSX) #define DEFAULT_KEY_SNAP KSYM_Control_L -#define DEFAULT_KEY_BOMB KSYM_KP_Enter +#define DEFAULT_KEY_DROP KSYM_KP_Enter #else -#define DEFAULT_KEY_SNAP KSYM_Shift_L -#define DEFAULT_KEY_BOMB KSYM_Shift_R +#define DEFAULT_KEY_SNAP KSYM_Control_L +#define DEFAULT_KEY_DROP KSYM_Control_R #endif #define DEFAULT_KEY_OKAY KSYM_Return #define DEFAULT_KEY_CANCEL KSYM_Escape @@ -521,18 +521,13 @@ struct SetupJoystickInfo int xleft, xmiddle, xright; int yupper, ymiddle, ylower; - int snap; - int bomb; + int snap, drop; }; struct SetupKeyboardInfo { - Key left; - Key right; - Key up; - Key down; - Key snap; - Key bomb; + Key left, right, up, down; + Key snap, drop; }; struct SetupInputInfo diff --git a/src/main.h b/src/main.h index 8cd383ed..bb85b0cc 100644 --- a/src/main.h +++ b/src/main.h @@ -229,6 +229,10 @@ #define MV_BIT_WHEN_PUSHED 10 #define MV_BIT_MAZE_RUNNER 11 #define MV_BIT_MAZE_HUNTER 12 +#define MV_BIT_PROJECTILE 13 +#define MV_BIT_TURNING_LEFT_RIGHT 14 +#define MV_BIT_TURNING_RIGHT_LEFT 15 +#define MV_BIT_TURNING_RANDOM 16 /* values for special move patterns for custom elements */ #define MV_HORIZONTAL (MV_LEFT | MV_RIGHT) @@ -245,6 +249,10 @@ #define MV_MAZE_RUNNER (1 << MV_BIT_MAZE_RUNNER) #define MV_MAZE_HUNTER (1 << MV_BIT_MAZE_HUNTER) #define MV_MAZE_RUNNER_STYLE (MV_MAZE_RUNNER | MV_MAZE_HUNTER) +#define MV_PROJECTILE (1 << MV_BIT_PROJECTILE) +#define MV_TURNING_LEFT_RIGHT (1 << MV_BIT_TURNING_LEFT_RIGHT) +#define MV_TURNING_RIGHT_LEFT (1 << MV_BIT_TURNING_RIGHT_LEFT) +#define MV_TURNING_RANDOM (1 << MV_BIT_TURNING_RANDOM) /* values for slippery property for custom elements */ #define SLIPPERY_ANY_RANDOM 0 @@ -1177,7 +1185,7 @@ struct PlayerInfo { boolean present; /* player present in level playfield */ boolean connected; /* player connected (locally or via network) */ - boolean active; /* player (present && connected) */ + boolean active; /* player present and connected */ int index_nr, client_nr, element_nr; @@ -1236,6 +1244,8 @@ struct PlayerInfo unsigned long actual_frame_counter; + int drop_delay; + int step_counter; int score; diff --git a/src/screens.c b/src/screens.c index 079745e9..c4aa62df 100644 --- a/src/screens.c +++ b/src/screens.c @@ -2395,7 +2395,7 @@ static void drawPlayerSetupInputInfo(int player_nr) { &custom_key.up, "Joystick Up" }, { &custom_key.down, "Joystick Down" }, { &custom_key.snap, "Button 1" }, - { &custom_key.bomb, "Button 2" } + { &custom_key.drop, "Button 2" } }; static char *joystick_name[MAX_PLAYERS] = { @@ -2440,7 +2440,7 @@ static void drawPlayerSetupInputInfo(int player_nr) DrawText(mSX+2*32, mSY+8*32, ":", FONT_VALUE_OLD); DrawText(mSX+2*32, mSY+9*32, ":", FONT_VALUE_OLD); DrawText(mSX+32, mSY+10*32, "Snap Field:", FONT_VALUE_OLD); - DrawText(mSX+32, mSY+12*32, "Place Bomb:", FONT_VALUE_OLD); + DrawText(mSX+32, mSY+12*32, "Drop Element:", FONT_VALUE_OLD); for (i = 0; i < 6; i++) { @@ -2586,12 +2586,12 @@ void CustomizeKeyboard(int player_nr) char *text; } customize_step[] = { - { &custom_key.left, "Move Left" }, - { &custom_key.right, "Move Right" }, - { &custom_key.up, "Move Up" }, - { &custom_key.down, "Move Down" }, - { &custom_key.snap, "Snap Field" }, - { &custom_key.bomb, "Place Bomb" } + { &custom_key.left, "Move Left" }, + { &custom_key.right, "Move Right" }, + { &custom_key.up, "Move Up" }, + { &custom_key.down, "Move Down" }, + { &custom_key.snap, "Snap Field" }, + { &custom_key.drop, "Drop Element" } }; /* read existing key bindings from player setup */ -- 2.34.1