From 49c6dea89a293093a952b991594980b469dd835a Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 19 Feb 2006 21:39:02 +0100 Subject: [PATCH] rnd-20060219-1-src --- Makefile | 8 +- src/conftime.h | 2 +- src/engines.h | 1 + src/events.c | 15 ++- src/files.c | 17 +-- src/game.c | 53 +++++++--- src/game_em/game_em.h | 2 +- src/game_em/graphics.c | 234 ++++++++++++++++++++++++++++++++++++++++- src/libgame/system.h | 1 + src/main.h | 4 + src/screens.c | 1 + src/tools.c | 19 ++++ 12 files changed, 325 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index 4a242ed0..f98a1211 100644 --- a/Makefile +++ b/Makefile @@ -127,7 +127,13 @@ leveltest: all ./Scripts/make_enginetest.sh leveltest backup: - ./Scripts/make_backup.sh src + ./Scripts/make_backup.sh src 1 + +backup2: + ./Scripts/make_backup.sh src 2 + +backup3: + ./Scripts/make_backup.sh src 3 backup_lev: ./Scripts/make_backup.sh lev diff --git a/src/conftime.h b/src/conftime.h index 57707bdb..eaad6287 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-02-17 10:31]" +#define COMPILE_DATE_STRING "[2006-02-19 21:10]" diff --git a/src/engines.h b/src/engines.h index 54a54325..2194a7c9 100644 --- a/src/engines.h +++ b/src/engines.h @@ -25,6 +25,7 @@ extern void SetBitmaps_EM(Bitmap **); extern void UpdateEngineValues(int, int); extern void DrawAllGameValues(int, int, int, int, int); extern int getGameFrameDelay_EM(int); +extern int getCenteredPlayer_EM(); extern void PlayLevelSound_EM(int, int, int, int); extern void InitGraphicInfo_EM(void); diff --git a/src/events.c b/src/events.c index c45581e5..f9627a15 100644 --- a/src/events.c +++ b/src/events.c @@ -566,7 +566,6 @@ static void HandleKeysSpecial(Key key) void HandleKey(Key key, int key_status) { - int joy = 0; boolean anyTextGadgetActiveOrJustFinished = anyTextGadgetActive(); static struct SetupKeyboardInfo custom_key; static struct @@ -583,6 +582,8 @@ void HandleKey(Key key, int key_status) { &custom_key.snap, DEFAULT_KEY_SNAP, JOY_BUTTON_1 }, { &custom_key.drop, DEFAULT_KEY_DROP, JOY_BUTTON_2 } }; + int joy = 0; + int i; if (game_status == GAME_MODE_PLAYING) { @@ -593,7 +594,6 @@ void HandleKey(Key key, int key_status) for (pnr = 0; pnr < MAX_PLAYERS; pnr++) { - int i; byte key_action = 0; if (setup.input[pnr].use_joystick) @@ -649,8 +649,6 @@ void HandleKey(Key key, int key_status) } else { - int i; - for (i = 0; i < 6; i++) if (key == key_info[i].key_default) joy |= key_info[i].action; @@ -700,6 +698,13 @@ void HandleKey(Key key, int key_status) TapeTogglePause(TAPE_TOGGLE_MANUAL); } + if (game_status == GAME_MODE_PLAYING) + { + for (i = 0; i < MAX_PLAYERS; i++) + if (key == KSYM_1 + i) + game.centered_to_player_next = i; + } + HandleKeysSpecial(key); if (HandleGadgetsKeyInput(key)) @@ -813,6 +818,7 @@ void HandleKey(Key key, int key_status) #ifdef DEBUG case KSYM_0: +#if 0 case KSYM_1: case KSYM_2: case KSYM_3: @@ -822,6 +828,7 @@ void HandleKey(Key key, int key_status) case KSYM_7: case KSYM_8: case KSYM_9: +#endif if (key == KSYM_0) { if (GameFrameDelay == 500) diff --git a/src/files.c b/src/files.c index 0088e431..3f2d68b0 100644 --- a/src/files.c +++ b/src/files.c @@ -4923,14 +4923,15 @@ void SaveScore(int nr) #define SETUP_TOKEN_TIME_LIMIT 14 #define SETUP_TOKEN_FULLSCREEN 15 #define SETUP_TOKEN_ASK_ON_ESCAPE 16 -#define SETUP_TOKEN_GRAPHICS_SET 17 -#define SETUP_TOKEN_SOUNDS_SET 18 -#define SETUP_TOKEN_MUSIC_SET 19 -#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 20 -#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 21 -#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 22 +#define SETUP_TOKEN_QUICK_SWITCH 17 +#define SETUP_TOKEN_GRAPHICS_SET 18 +#define SETUP_TOKEN_SOUNDS_SET 19 +#define SETUP_TOKEN_MUSIC_SET 20 +#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 21 +#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 22 +#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 23 -#define NUM_GLOBAL_SETUP_TOKENS 23 +#define NUM_GLOBAL_SETUP_TOKENS 24 /* editor setup */ #define SETUP_TOKEN_EDITOR_EL_BOULDERDASH 0 @@ -5033,6 +5034,7 @@ static struct TokenInfo global_setup_tokens[] = { TYPE_SWITCH, &si.time_limit, "time_limit" }, { TYPE_SWITCH, &si.fullscreen, "fullscreen" }, { TYPE_SWITCH, &si.ask_on_escape, "ask_on_escape" }, + { TYPE_SWITCH, &si.quick_switch, "quick_player_switch" }, { TYPE_STRING, &si.graphics_set, "graphics_set" }, { TYPE_STRING, &si.sounds_set, "sounds_set" }, { TYPE_STRING, &si.music_set, "music_set" }, @@ -5153,6 +5155,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->time_limit = TRUE; si->fullscreen = FALSE; si->ask_on_escape = TRUE; + si->quick_switch = FALSE; si->graphics_set = getStringCopy(GFX_CLASSIC_SUBDIR); si->sounds_set = getStringCopy(SND_CLASSIC_SUBDIR); diff --git a/src/game.c b/src/game.c index 10a8a98e..4bda5189 100644 --- a/src/game.c +++ b/src/game.c @@ -1933,6 +1933,8 @@ void InitGame() game.envelope_active = FALSE; + game.centered_to_player = game.centered_to_player_next = 0; /* player_1 */ + for (i = 0; i < NUM_BELTS; i++) { game.belt_dir[i] = MV_NONE; @@ -3095,7 +3097,7 @@ void CheckDynamite(int x, int y) Bang(x, y); } -void DrawRelocatePlayer(struct PlayerInfo *player) +void DrawRelocatePlayer(struct PlayerInfo *player, boolean quick_relocation) { boolean ffwd_delay = (tape.playing && tape.fast_forward); boolean no_delay = (tape.warp_forward); @@ -3104,19 +3106,19 @@ void DrawRelocatePlayer(struct PlayerInfo *player) int jx = player->jx; int jy = player->jy; - if (level.instant_relocation) + if (quick_relocation) { int offset = (setup.scroll_delay ? 3 : 0); if (!IN_VIS_FIELD(SCREENX(jx), SCREENY(jy))) { - scroll_x = (local_player->jx < SBX_Left + MIDPOSX ? SBX_Left : - local_player->jx > SBX_Right + MIDPOSX ? SBX_Right : - local_player->jx - MIDPOSX); + scroll_x = (player->jx < SBX_Left + MIDPOSX ? SBX_Left : + player->jx > SBX_Right + MIDPOSX ? SBX_Right : + player->jx - MIDPOSX); - scroll_y = (local_player->jy < SBY_Upper + MIDPOSY ? SBY_Upper : - local_player->jy > SBY_Lower + MIDPOSY ? SBY_Lower : - local_player->jy - MIDPOSY); + scroll_y = (player->jy < SBY_Upper + MIDPOSY ? SBY_Upper : + player->jy > SBY_Lower + MIDPOSY ? SBY_Lower : + player->jy - MIDPOSY); } else { @@ -3150,13 +3152,13 @@ void DrawRelocatePlayer(struct PlayerInfo *player) int dx = 0, dy = 0; int fx = FX, fy = FY; - scroll_xx = (local_player->jx < SBX_Left + MIDPOSX ? SBX_Left : - local_player->jx > SBX_Right + MIDPOSX ? SBX_Right : - local_player->jx - MIDPOSX); + scroll_xx = (player->jx < SBX_Left + MIDPOSX ? SBX_Left : + player->jx > SBX_Right + MIDPOSX ? SBX_Right : + player->jx - MIDPOSX); - scroll_yy = (local_player->jy < SBY_Upper + MIDPOSY ? SBY_Upper : - local_player->jy > SBY_Lower + MIDPOSY ? SBY_Lower : - local_player->jy - MIDPOSY); + scroll_yy = (player->jy < SBY_Upper + MIDPOSY ? SBY_Upper : + player->jy > SBY_Lower + MIDPOSY ? SBY_Lower : + player->jy - MIDPOSY); dx = (scroll_xx < scroll_x ? +1 : scroll_xx > scroll_x ? -1 : 0); dy = (scroll_yy < scroll_y ? +1 : scroll_yy > scroll_y ? -1 : 0); @@ -3265,7 +3267,7 @@ void RelocatePlayer(int jx, int jy, int el_player_raw) } if (player == local_player) /* only visually relocate local player */ - DrawRelocatePlayer(player); + DrawRelocatePlayer(player, level.instant_relocation); TestIfPlayerTouchesBadThing(jx, jy); TestIfPlayerTouchesCustomElement(jx, jy); @@ -8807,6 +8809,18 @@ void GameActions() InitPlayfieldScanModeVars(); + if (ScreenMovPos == 0) /* screen currently aligned at tile position */ + { + if (game.centered_to_player != game.centered_to_player_next) + { + struct PlayerInfo *player = &stored_player[game.centered_to_player_next]; + + DrawRelocatePlayer(player, setup.quick_switch); + + game.centered_to_player = game.centered_to_player_next; + } + } + #if USE_ONE_MORE_CHANGE_PER_FRAME if (game.engine_version >= VERSION_IDENT(3,2,0,7)) { @@ -9635,8 +9649,10 @@ boolean MovePlayerOneStep(struct PlayerInfo *player, #endif } +#if 0 if (!options.network && !AllPlayersInSight(player, new_jx, new_jy)) return MP_NO_ACTION; +#endif #if !USE_FIXED_DONT_RUN_INTO element = MovingOrBlocked2ElementIfNotLeaving(new_jx, new_jy); @@ -9779,8 +9795,13 @@ boolean MovePlayer(struct PlayerInfo *player, int dx, int dy) jx = player->jx; jy = player->jy; +#if 1 + if (moved & MP_MOVING && !ScreenMovPos && + player->index_nr == game.centered_to_player) +#else if (moved & MP_MOVING && !ScreenMovPos && (player == local_player || !options.network)) +#endif { int old_scroll_x = scroll_x, old_scroll_y = scroll_y; int offset = (setup.scroll_delay ? 3 : 0); @@ -9835,12 +9856,14 @@ boolean MovePlayer(struct PlayerInfo *player, int dx, int dy) if (scroll_x != old_scroll_x || scroll_y != old_scroll_y) { +#if 0 if (!options.network && !AllPlayersInVisibleScreen()) { scroll_x = old_scroll_x; scroll_y = old_scroll_y; } else +#endif { ScrollScreen(player, SCROLL_INIT); ScrollLevel(old_scroll_x - scroll_x, old_scroll_y - scroll_y); diff --git a/src/game_em/game_em.h b/src/game_em/game_em.h index d6a962c1..84fcfee6 100644 --- a/src/game_em/game_em.h +++ b/src/game_em/game_em.h @@ -44,7 +44,7 @@ extern void setLevelInfoToDefaults_EM(); extern boolean LoadNativeLevel_EM(char *); extern void BlitScreenToBitmap_EM(Bitmap *); -extern void RedrawPlayfield_EM(); +extern void RedrawPlayfield_EM(boolean); extern void DrawGameDoorValues_EM(); #endif /* GAME_EM_H */ diff --git a/src/game_em/graphics.c b/src/game_em/graphics.c index 236b8289..90f43f71 100644 --- a/src/game_em/graphics.c +++ b/src/game_em/graphics.c @@ -45,6 +45,7 @@ static int crumbled_state[MAX_BUF_YSIZE][MAX_BUF_XSIZE]; static boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE]; +static int centered_to_player; /* copy the entire screen to the window at the scroll position * @@ -106,7 +107,9 @@ void blitscreen(void) boolean scrolling = (screen_x % TILEX != 0 || screen_y % TILEY != 0); int x, y; +#if 0 SyncDisplay(); +#endif if (redraw_tiles > REDRAWTILES_THRESHOLD || scrolling || scrolling_last) { @@ -160,6 +163,15 @@ static void DrawLevelField_EM(int x, int y, int sx, int sy, int width = g->width; int height = g->height; +#if 1 + int left = screen_x / TILEX; + int top = screen_y / TILEY; + + if (x < left || x >= left + MAX_BUF_XSIZE || + y < top || y >= top + MAX_BUF_YSIZE) + return; +#endif + if (draw_masked) { if (width > 0 && height > 0) @@ -188,6 +200,15 @@ static void DrawLevelFieldCrumbled_EM(int x, int y, int sx, int sy, struct GraphicInfo_EM *g = &graphic_info_em_object[tile][frame]; int i; +#if 1 + int left = screen_x / TILEX; + int top = screen_y / TILEY; + + if (x < left || x >= left + MAX_BUF_XSIZE || + y < top || y >= top + MAX_BUF_YSIZE) + return; +#endif + if (crm == 0) /* no crumbled edges for this tile */ return; @@ -242,6 +263,15 @@ static void DrawLevelPlayer_EM(int x1, int y1, int player_nr, int anim, int src_x = g->src_x, src_y = g->src_y; int dst_x, dst_y; +#if 1 + if (x1 < screen_x - TILEX || x1 >= screen_x + MAX_BUF_XSIZE * TILEX || + y1 < screen_y - TILEY || y1 >= screen_y + MAX_BUF_YSIZE * TILEY) + return; + + x1 %= MAX_BUF_XSIZE * TILEX; + y1 %= MAX_BUF_YSIZE * TILEY; +#endif + if (draw_masked) { /* draw the player to current location */ @@ -398,10 +428,12 @@ static void blitplayer(struct PLAYER *ply) /* only diggable elements can be crumbled in the classic EM engine */ boolean player_is_digging = (new_crm != 0); +#if 0 x1 %= MAX_BUF_XSIZE * TILEX; y1 %= MAX_BUF_YSIZE * TILEY; x2 %= MAX_BUF_XSIZE * TILEX; y2 %= MAX_BUF_YSIZE * TILEY; +#endif if (player_is_digging) { @@ -446,7 +478,13 @@ void game_initscreen(void) int x,y; int dynamite_state = ply[0].dynamite; /* !!! ONLY PLAYER 1 !!! */ int all_keys_state = ply[0].keys | ply[1].keys | ply[2].keys | ply[3].keys; +#if 1 + int player_nr = getCenteredPlayer_EM(); +#else int player_nr = 0; /* !!! FIX THIS (CENTERED TO PLAYER 1) !!! */ +#endif + + centered_to_player = player_nr; frame = 6; #if 1 @@ -475,12 +513,200 @@ void game_initscreen(void) #endif } -void RedrawPlayfield_EM() +#if 0 +void DrawRelocatePlayer(struct PlayerInfo *player, boolean quick_relocation) { + boolean ffwd_delay = (tape.playing && tape.fast_forward); + boolean no_delay = (tape.warp_forward); + int frame_delay_value = (ffwd_delay ? FfwdFrameDelay : GameFrameDelay); + int wait_delay_value = (no_delay ? 0 : frame_delay_value); + int jx = player->jx; + int jy = player->jy; + + if (quick_relocation) + { + int offset = (setup.scroll_delay ? 3 : 0); + + if (!IN_VIS_FIELD(SCREENX(jx), SCREENY(jy))) + { + scroll_x = (player->jx < SBX_Left + MIDPOSX ? SBX_Left : + player->jx > SBX_Right + MIDPOSX ? SBX_Right : + player->jx - MIDPOSX); + + scroll_y = (player->jy < SBY_Upper + MIDPOSY ? SBY_Upper : + player->jy > SBY_Lower + MIDPOSY ? SBY_Lower : + player->jy - MIDPOSY); + } + else + { + if ((player->MovDir == MV_LEFT && scroll_x > jx - MIDPOSX + offset) || + (player->MovDir == MV_RIGHT && scroll_x < jx - MIDPOSX - offset)) + scroll_x = jx - MIDPOSX + (scroll_x < jx-MIDPOSX ? -offset : +offset); + + if ((player->MovDir == MV_UP && scroll_y > jy - MIDPOSY + offset) || + (player->MovDir == MV_DOWN && scroll_y < jy - MIDPOSY - offset)) + scroll_y = jy - MIDPOSY + (scroll_y < jy-MIDPOSY ? -offset : +offset); + + /* don't scroll over playfield boundaries */ + if (scroll_x < SBX_Left || scroll_x > SBX_Right) + scroll_x = (scroll_x < SBX_Left ? SBX_Left : SBX_Right); + + /* don't scroll over playfield boundaries */ + if (scroll_y < SBY_Upper || scroll_y > SBY_Lower) + scroll_y = (scroll_y < SBY_Upper ? SBY_Upper : SBY_Lower); + } + + RedrawPlayfield(TRUE, 0,0,0,0); + } + else + { + int scroll_xx = -999, scroll_yy = -999; + + ScrollScreen(NULL, SCROLL_GO_ON); /* scroll last frame to full tile */ + + while (scroll_xx != scroll_x || scroll_yy != scroll_y) + { + int dx = 0, dy = 0; + int fx = FX, fy = FY; + + scroll_xx = (player->jx < SBX_Left + MIDPOSX ? SBX_Left : + player->jx > SBX_Right + MIDPOSX ? SBX_Right : + player->jx - MIDPOSX); + + scroll_yy = (player->jy < SBY_Upper + MIDPOSY ? SBY_Upper : + player->jy > SBY_Lower + MIDPOSY ? SBY_Lower : + player->jy - MIDPOSY); + + dx = (scroll_xx < scroll_x ? +1 : scroll_xx > scroll_x ? -1 : 0); + dy = (scroll_yy < scroll_y ? +1 : scroll_yy > scroll_y ? -1 : 0); + + if (dx == 0 && dy == 0) /* no scrolling needed at all */ + break; + + scroll_x -= dx; + scroll_y -= dy; + + fx += dx * TILEX / 2; + fy += dy * TILEY / 2; + + ScrollLevel(dx, dy); + DrawAllPlayers(); + + /* scroll in two steps of half tile size to make things smoother */ + BlitBitmap(drawto_field, window, fx, fy, SXSIZE, SYSIZE, SX, SY); + FlushDisplay(); + Delay(wait_delay_value); + + /* scroll second step to align at full tile size */ + BackToFront(); + Delay(wait_delay_value); + } + + DrawPlayer(player); + BackToFront(); + Delay(wait_delay_value); + } +} +#endif + +void RedrawPlayfield_EM(boolean force_redraw) +{ +#if 1 + int player_nr = getCenteredPlayer_EM(); + boolean draw_new_player_location = FALSE; + boolean quick_relocation = setup.quick_switch; +#else int player_nr = 0; /* !!! FIX THIS (CENTERED TO PLAYER 1) !!! */ +#endif int sx = PLAYER_SCREEN_X(player_nr); int sy = PLAYER_SCREEN_Y(player_nr); - int i; + int i, x, y; + +#if 1 + boolean scrolling = (screen_x % TILEX != 0 || screen_y % TILEY != 0); + + if (!scrolling) /* screen currently aligned at tile position */ + { + if (player_nr != centered_to_player) + { + centered_to_player = player_nr; + + draw_new_player_location = TRUE; + force_redraw = TRUE; + } + } +#endif + + if (draw_new_player_location && !quick_relocation) + { +#if 1 + unsigned long game_frame_delay_value = getGameFrameDelay_EM(20); +#else + unsigned long game_frame_delay_value = getGameFrameDelay_EM(25); +#endif + int wait_delay_value = game_frame_delay_value; + int screen_xx = -999, screen_yy = -999; + + while (screen_xx != screen_x || screen_yy != screen_y) + { + int screen_xx = VALID_SCREEN_X(PLAYER_SCREEN_X(player_nr)); + int screen_yy = VALID_SCREEN_Y(PLAYER_SCREEN_Y(player_nr)); + int dx = (screen_xx < screen_x ? +1 : screen_xx > screen_x ? -1 : 0); + int dy = (screen_yy < screen_y ? +1 : screen_yy > screen_y ? -1 : 0); + int dxx = 0, dyy = 0; + + if (dx == 0 && dy == 0) /* no scrolling needed at all */ + break; + + screen_x -= dx * TILEX; + screen_y -= dy * TILEY; + + dxx += dx * TILEX / 2; + dyy += dy * TILEY / 2; + + /* scroll in two steps of half tile size to make things smoother */ + screen_x += dxx; + screen_y += dyy; + + animscreen(); + + for (i = 0; i < MAX_PLAYERS; i++) + blitplayer(&ply[i]); + + blitscreen(); + FlushDisplay(); + Delay(wait_delay_value); + + /* scroll second step to align at full tile size */ + screen_x -= dxx; + screen_y -= dyy; + + SyncDisplay(); + + animscreen(); + + for (i = 0; i < MAX_PLAYERS; i++) + blitplayer(&ply[i]); + + blitscreen(); + FlushDisplay(); + Delay(wait_delay_value); + } + } + +#if 1 + if (force_redraw) + { + for (y = 0; y < MAX_BUF_YSIZE; y++) + { + for (x = 0; x < MAX_BUF_XSIZE; x++) + { + screentiles[y][x] = -1; + crumbled_state[y][x] = 0; + } + } + } +#endif #if 1 @@ -514,6 +740,8 @@ void RedrawPlayfield_EM() for (i = 0; i < MAX_PLAYERS; i++) blitplayer(&ply[i]); + SyncDisplay(); + blitscreen(); FlushDisplay(); @@ -521,7 +749,7 @@ void RedrawPlayfield_EM() void game_animscreen(void) { - RedrawPlayfield_EM(); + RedrawPlayfield_EM(FALSE); } void DrawGameDoorValues_EM() diff --git a/src/libgame/system.h b/src/libgame/system.h index 8c575f12..a0108a28 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -684,6 +684,7 @@ struct SetupInfo boolean time_limit; boolean fullscreen; boolean ask_on_escape; + boolean quick_switch; char *graphics_set; char *sounds_set; diff --git a/src/main.h b/src/main.h index f4bfad08..8ae10491 100644 --- a/src/main.h +++ b/src/main.h @@ -2079,6 +2079,10 @@ struct GameInfo /* values for special game initialization control */ boolean restart_level; + + /* values for special game control */ + int centered_to_player; + int centered_to_player_next; }; struct GlobalInfo diff --git a/src/screens.c b/src/screens.c index 1b3de852..bf212d76 100644 --- a/src/screens.c +++ b/src/screens.c @@ -2047,6 +2047,7 @@ static struct TokenInfo setup_info_game[] = { TYPE_SWITCH, &setup.skip_levels, "Skip Levels:" }, { TYPE_SWITCH, &setup.time_limit, "Timelimit:" }, { TYPE_SWITCH, &setup.autorecord, "Auto-Record:" }, + { TYPE_SWITCH, &setup.quick_switch, "Quick Switch:" }, { TYPE_EMPTY, NULL, "" }, { TYPE_LEAVE_MENU, execSetupMain, "Back" }, diff --git a/src/tools.c b/src/tools.c index a17057c8..de8e9df3 100644 --- a/src/tools.c +++ b/src/tools.c @@ -127,7 +127,11 @@ void RedrawPlayfield(boolean force_redraw, int x, int y, int width, int height) if (game_status == GAME_MODE_PLAYING && level.game_engine_type == GAME_ENGINE_TYPE_EM) { +#if 1 + RedrawPlayfield_EM(force_redraw); +#else BlitScreenToBitmap_EM(backbuffer); +#endif } else if (game_status == GAME_MODE_PLAYING && !game.envelope_active) { @@ -1827,6 +1831,13 @@ void DrawPlayer(struct PlayerInfo *player) int last_player_frame = player->Frame; int frame = 0; +#if 1 + /* GfxElement[][] is set to the element the player is digging or collecting; + remove also for off-screen player if the player is not moving anymore */ + if (IN_LEV_FIELD(jx, jy) && !player_is_moving) + GfxElement[jx][jy] = EL_UNDEFINED; +#endif + if (!player->active || !IN_SCR_FIELD(SCREENX(last_jx), SCREENY(last_jy))) return; @@ -5118,6 +5129,14 @@ int getGameFrameDelay_EM(int native_em_game_frame_delay) return game_frame_delay_value; } +int getCenteredPlayer_EM() +{ + if (game.centered_to_player != game.centered_to_player_next) + game.centered_to_player = game.centered_to_player_next; + + return game.centered_to_player; +} + unsigned int InitRND(long seed) { if (level.game_engine_type == GAME_ENGINE_TYPE_EM) -- 2.34.1