diff --git a/th01/main/playfld.hpp b/th01/main/playfld.hpp index 441ba84e..2f2c14ff 100644 --- a/th01/main/playfld.hpp +++ b/th01/main/playfld.hpp @@ -1,20 +1,22 @@ -static const screen_x_t PLAYFIELD_LEFT = 0; -static const screen_y_t PLAYFIELD_TOP = 64; -static const screen_x_t PLAYFIELD_RIGHT = RES_X; -static const screen_y_t PLAYFIELD_BOTTOM = RES_Y; +#if (GAME == 1) + static const screen_x_t PLAYFIELD_LEFT = 0; + static const screen_y_t PLAYFIELD_TOP = 64; + static const screen_x_t PLAYFIELD_RIGHT = RES_X; + static const screen_y_t PLAYFIELD_BOTTOM = RES_Y; -static const pixel_t PLAYFIELD_W = (PLAYFIELD_RIGHT - PLAYFIELD_LEFT); -static const pixel_t PLAYFIELD_H = (PLAYFIELD_BOTTOM - PLAYFIELD_TOP); + static const pixel_t PLAYFIELD_W = (PLAYFIELD_RIGHT - PLAYFIELD_LEFT); + static const pixel_t PLAYFIELD_H = (PLAYFIELD_BOTTOM - PLAYFIELD_TOP); -static const screen_x_t PLAYFIELD_CENTER_X = ( - ((PLAYFIELD_RIGHT - PLAYFIELD_LEFT) / 2) + PLAYFIELD_LEFT -); + static const screen_x_t PLAYFIELD_CENTER_X = ( + ((PLAYFIELD_RIGHT - PLAYFIELD_LEFT) / 2) + PLAYFIELD_LEFT + ); -static const screen_y_t PLAYFIELD_CENTER_Y = ( - ((PLAYFIELD_BOTTOM - PLAYFIELD_TOP) / 2) + PLAYFIELD_TOP -); + static const screen_y_t PLAYFIELD_CENTER_Y = ( + ((PLAYFIELD_BOTTOM - PLAYFIELD_TOP) / 2) + PLAYFIELD_TOP + ); +#endif -inline pixel_t playfield_fraction_x(float fraction = 1.0f) { +static inline pixel_t playfield_fraction_x(float fraction = 1.0f) { return ((int)(PLAYFIELD_W * fraction)); } diff --git a/th02/formats/mpn_l_i.cpp b/th02/formats/mpn_l_i.cpp index f8216e5b..c85238aa 100644 --- a/th02/formats/mpn_l_i.cpp +++ b/th02/formats/mpn_l_i.cpp @@ -6,7 +6,7 @@ extern "C" { #include "pc98.h" #include "planar.h" #include "master.hpp" -#include "th02/main/playfld.h" +#include "th02/main/playfld.hpp" #include "th02/main/tile.hpp" #include "th02/formats/mpn.hpp" diff --git a/th02/main/playfld.h b/th02/main/playfld.hpp similarity index 96% rename from th02/main/playfld.h rename to th02/main/playfld.hpp index 31a6e316..00149fc6 100644 --- a/th02/main/playfld.h +++ b/th02/main/playfld.hpp @@ -23,3 +23,5 @@ // (Future games use a near function.) void far playfield_tram_wipe(void); #endif + +#include "th01/main/playfld.hpp" diff --git a/th02/main02_1.cpp b/th02/main02_1.cpp index 01c050be..d4beb26c 100644 --- a/th02/main02_1.cpp +++ b/th02/main02_1.cpp @@ -11,7 +11,7 @@ extern "C" { #include "pc98.h" #include "planar.h" #include "master.hpp" -#include "th02/main/playfld.h" +#include "th02/main/playfld.hpp" #include "th02/main/tile.hpp" #include "th02/formats/mpn.hpp" diff --git a/th04/formats/mpn_free.cpp b/th04/formats/mpn_free.cpp index 523f5069..0036c4b7 100644 --- a/th04/formats/mpn_free.cpp +++ b/th04/formats/mpn_free.cpp @@ -6,7 +6,7 @@ extern "C" { #include "pc98.h" #include "planar.h" #include "master.hpp" -#include "th04/main/playfld.h" +#include "th04/main/playfld.hpp" #include "th04/main/tile.hpp" #include "th04/formats/mpn.hpp" diff --git a/th04/formats/mpn_l_i.cpp b/th04/formats/mpn_l_i.cpp index 05c24167..7f216cf3 100644 --- a/th04/formats/mpn_l_i.cpp +++ b/th04/formats/mpn_l_i.cpp @@ -7,7 +7,7 @@ extern "C" { #include "pc98.h" #include "planar.h" #include "master.hpp" -#include "th04/main/playfld.h" +#include "th04/main/playfld.hpp" #include "th04/main/tile.hpp" #include "th04/formats/mpn.hpp" diff --git a/th04/main/hud/popup.cpp b/th04/main/hud/popup.cpp index 615b825d..39080c8f 100644 --- a/th04/main/hud/popup.cpp +++ b/th04/main/hud/popup.cpp @@ -9,7 +9,7 @@ #include "th04/hardware/grcg.h" #include "th04/math/motion.hpp" #include "th04/main/null.hpp" -#include "th04/main/playfld.h" +#include "th04/main/playfld.hpp" #include "th04/main/tile.hpp" #include "th04/main/scroll.hpp" #include "th04/main/hud/popup.hpp" diff --git a/th04/main/playfld.h b/th04/main/playfld.hpp similarity index 88% rename from th04/main/playfld.h rename to th04/main/playfld.hpp index 6b63df6c..365d1d2f 100644 --- a/th04/main/playfld.h +++ b/th04/main/playfld.hpp @@ -1,4 +1,4 @@ -#include "th02/main/playfld.h" +#include "th02/main/playfld.hpp" // Fills the playfield area on the text RAM with transparent spaces. void near playfield_tram_wipe(void); diff --git a/th04/shared.hpp b/th04/shared.hpp index 0f01538d..6f0cd350 100644 --- a/th04/shared.hpp +++ b/th04/shared.hpp @@ -24,7 +24,7 @@ #include "th04/score.h" /// ------ -#include "th04/main/playfld.h" +#include "th04/main/playfld.hpp" /// Stages /// ------ diff --git a/th05/main/boss/b4_both.cpp b/th05/main/boss/b4_both.cpp index 389d4246..813e308b 100644 --- a/th05/main/boss/b4_both.cpp +++ b/th05/main/boss/b4_both.cpp @@ -3,7 +3,6 @@ * Update code for Part 1 of the Stage 4 boss fight, against both Mai and Yuki */ -#include "th04/main/playfld.h" #include "th04/math/vector.hpp" #include "th05/sprites/main_pat.h" diff --git a/th05/main/boss/render.cpp b/th05/main/boss/render.cpp index 25c6cf63..0eb28a36 100644 --- a/th05/main/boss/render.cpp +++ b/th05/main/boss/render.cpp @@ -9,7 +9,7 @@ #include "th01/math/subpixel.hpp" #include "th04/math/vector.hpp" #include "th04/main/drawp.hpp" -#include "th04/main/playfld.h" +#include "th04/main/playfld.hpp" /// Structures /// ---------- diff --git a/th05/main/player/bombanim.cpp b/th05/main/player/bombanim.cpp index a2e1bf29..33a4e2e7 100644 --- a/th05/main/player/bombanim.cpp +++ b/th05/main/player/bombanim.cpp @@ -3,7 +3,7 @@ #include "th01/math/subpixel.hpp" #include "th04/math/vector.hpp" #include "th04/math/randring.h" -#include "th04/main/playfld.h" +#include "th04/main/playfld.hpp" #include "th04/main/frames.h" #include "th04/main/circles.hpp" #include "th05/sprites/main_pat.h" diff --git a/th05/main034.cpp b/th05/main034.cpp index 69270602..da43be43 100644 --- a/th05/main034.cpp +++ b/th05/main034.cpp @@ -9,7 +9,7 @@ extern "C" { #include "ReC98.h" #include "th01/math/subpixel.hpp" #include "th01/math/area.hpp" -#include "th04/main/playfld.h" +#include "th04/main/playfld.hpp" #include "th04/math/motion.hpp" #include "th05/main/boss/boss.hpp" #include "th05/main/boss/bx.cpp"