From dbb8f6dc273858616eb914b385da9f178ad81935 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 15 Sep 2024 23:51:47 +0200 Subject: [PATCH] renamed variables --- src/game_bd/bd_cave.h | 6 ++++-- src/game_bd/bd_caveengine.c | 14 +++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/game_bd/bd_cave.h b/src/game_bd/bd_cave.h index f1ed3532..3ba7824b 100644 --- a/src/game_bd/bd_cave.h +++ b/src/game_bd/bd_cave.h @@ -328,7 +328,8 @@ typedef struct _gd_c64_random_generator // Structure holding all data belonging to a cave. // ---------------------------------------------------------------------------- -#define GD_HIGHSCORE_NUM 20 +#define GD_HIGHSCORE_NUM 20 +#define GD_PLAYER_MEM_SIZE 16 typedef struct _gd_cave { @@ -617,7 +618,8 @@ typedef struct _gd_cave boolean sweet_eaten; // player ate sweet, he's strong. prob_sweet applies, // and also able to push chasing stones int player_x, player_y; // Coordinates of player (for scrolling) - int px[16], py[16]; // coordinates of player, for chasing stone + int player_x_mem[GD_PLAYER_MEM_SIZE]; // coordinates of player, for chasing stone + int player_y_mem[GD_PLAYER_MEM_SIZE]; int key1, key2, key3; // The player is holding this number of keys of each color boolean diamond_key_collected; // Key collected, so trapped diamonds convert to diamonds boolean inbox_flash_toggle; // negated every scan. helps drawing inboxes, and making diff --git a/src/game_bd/bd_caveengine.c b/src/game_bd/bd_caveengine.c index 58c0d030..cb9967d7 100644 --- a/src/game_bd/bd_caveengine.c +++ b/src/game_bd/bd_caveengine.c @@ -2771,8 +2771,8 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, case O_CHASING_STONE: { - int px = cave->px[0]; - int py = cave->py[0]; + int px = cave->player_x_mem[0]; + int py = cave->player_y_mem[0]; boolean horizontal = gd_rand_boolean(cave->random); boolean dont_move = FALSE; int i = 3; @@ -3928,14 +3928,14 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, } // record coordinates of player for chasing stone - for (i = 0; i < ARRAY_SIZE(cave->px) - 1; i++) + for (i = 0; i < GD_PLAYER_MEM_SIZE - 1; i++) { - cave->px[i] = cave->px[i + 1]; - cave->py[i] = cave->py[i + 1]; + cave->player_x_mem[i] = cave->player_x_mem[i + 1]; + cave->player_y_mem[i] = cave->player_y_mem[i + 1]; } - cave->px[ARRAY_SIZE(cave->px) - 1] = cave->player_x; - cave->py[ARRAY_SIZE(cave->py) - 1] = cave->player_y; + cave->player_x_mem[GD_PLAYER_MEM_SIZE - 1] = cave->player_x; + cave->player_y_mem[GD_PLAYER_MEM_SIZE - 1] = cave->player_y; // SCHEDULING -- 2.34.1