From 70cbf4bbe17a4e30116f898047c8f6834c5c85e6 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Thu, 3 Feb 2022 01:49:03 +0100 Subject: [PATCH] [Maintenance] [th03] Adopt the PlayfieldPoint subpixel type from TH02/TH04/TH05 Makes sense for this game as well, even if it can only serve documentary purpose due to it not knowing which playfield it's on. Part of P0182, funded by Lmocinemod and [Anonymous]. --- th03/main/player/player.hpp | 2 +- th03/main/player/shot.hpp | 2 +- th03/main/playfld.hpp | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/th03/main/player/player.hpp b/th03/main/player/player.hpp index 8bda2243..1de22000 100644 --- a/th03/main/player/player.hpp +++ b/th03/main/player/player.hpp @@ -30,7 +30,7 @@ extern farfunc_t_near chargeshot_render[PLAYER_COUNT]; // ------------ typedef struct { - SPPoint center; + PlayfieldPoint center; bool is_hit; uint8_t unused_1; unsigned char invincibility_time; diff --git a/th03/main/player/shot.hpp b/th03/main/player/shot.hpp index 1845ee1e..bfa370d0 100644 --- a/th03/main/player/shot.hpp +++ b/th03/main/player/shot.hpp @@ -24,7 +24,7 @@ enum shot_active_t { struct shotpair_t { char flag; char unused_1; - SPPoint topleft; + PlayfieldPoint topleft; Subpixel velocity_y; unsigned int so_pid; unsigned char so_anim; diff --git a/th03/main/playfld.hpp b/th03/main/playfld.hpp index 5faa744f..f04c2e13 100644 --- a/th03/main/playfld.hpp +++ b/th03/main/playfld.hpp @@ -19,6 +19,10 @@ #define PLAYFIELD_VRAM_W_BORDERED (PLAYFIELD_W_BORDERED / BYTE_DOTS) +// A subpixel point within one of the playfields. No conversion methods to +// screen space here, since the instance doesn't know the playfield it is on. +typedef SPPoint PlayfieldPoint; + extern screen_x_t playfield_fg_shift_x[PLAYFIELD_COUNT]; screen_x_t pascal playfield_fg_x_to_screen(Subpixel x, unsigned int pid);