From: Holger Schemel Date: Tue, 18 Feb 2020 15:02:09 +0000 (+0100) Subject: moved calling EM engine logic to corresponding source file X-Git-Tag: 4.2.0.0~102 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=1b285de069191476ea03c37904dc7184d73548f4;p=rocksndiamonds.git moved calling EM engine logic to corresponding source file --- diff --git a/src/game_em/game.c b/src/game_em/game.c index 38016ef7..48d1bfc1 100644 --- a/src/game_em/game.c +++ b/src/game_em/game.c @@ -90,16 +90,7 @@ void GameActions_EM(byte action[MAX_PLAYERS], boolean warp_mode) UpdateEngineValues(screen_x / TILEX, screen_y / TILEY, ply[0].x, ply[0].y); - if (frame == 7) - { - logic_players(); - logic_objects(); - } - - if (frame == 6) - { - logic_globals(); - } + logic(); for (i = 0; i < MAX_PLAYERS; i++) if (ply[i].joy_drop && diff --git a/src/game_em/global.h b/src/game_em/global.h index 34238421..7dfbdca9 100644 --- a/src/game_em/global.h +++ b/src/game_em/global.h @@ -19,9 +19,7 @@ void game_init_cave_buffers(void); void play_sound(int, int, int); void play_element_sound(int, int, int, int); -void logic_players(void); -void logic_objects(void); -void logic_globals(void); +void logic(void); int cleanup_em_level(unsigned char *, int, char *); void convert_em_level(unsigned char *, int); diff --git a/src/game_em/logic.c b/src/game_em/logic.c index 7774c1db..bbac90d2 100644 --- a/src/game_em/logic.c +++ b/src/game_em/logic.c @@ -7267,7 +7267,7 @@ static void handle_tile(int x, int y) } } -void logic_players(void) +static void logic_players(void) { int start_check_nr; int i; @@ -7336,7 +7336,7 @@ void logic_players(void) } } -void logic_objects(void) +static void logic_objects(void) { int x, y; @@ -7365,7 +7365,7 @@ void logic_objects(void) lev.draw = temp; } -void logic_globals(void) +static void logic_globals(void) { int x; int y; @@ -7432,3 +7432,17 @@ void logic_globals(void) for (x = lev.left; x < lev.right; x++) next[x][y] = cave[x][y]; } + +void logic(void) +{ + if (frame == 7) + { + logic_players(); + logic_objects(); + } + + if (frame == 6) + { + logic_globals(); + } +}