[Maintenance] [th03/th04/th05] Start a new "essential macros" file

Both player/player.hpp and resident.hpp (in case of TH03's PLAYER_COUNT)
and th04/shared.hpp (in case of TH04/TH05's MAIN_STAGE_COUNT) have way
too much additional stuff that we don't want to include everywhere we
need these constants. So let's try this "no types allowed" approach
instead… maybe that'll work out for once.

Part of P0076, funded by [Anonymous] and -Tom-.
This commit is contained in:
nmlgc 2020-02-20 19:11:53 +01:00
parent ff777a099e
commit b7ea95836d
4 changed files with 15 additions and 5 deletions

6
th03/common.h Normal file
View File

@ -0,0 +1,6 @@
/* ReC98
* -----
* Common, essential macros for TH03. No types here!
*/
#define PLAYER_COUNT 2

View File

@ -1,5 +1,3 @@
#define PLAYER_COUNT 2
#define HALFHEARTS_MAX 10 #define HALFHEARTS_MAX 10
#define ROUND_START_INVINCIBILITY_FRAMES 50 #define ROUND_START_INVINCIBILITY_FRAMES 50

7
th04/common.h Normal file
View File

@ -0,0 +1,7 @@
/* ReC98
* -----
* Common, essential macros for TH04. No types here!
*/
#define MAIN_STAGE_COUNT 6
#define STAGE_EXTRA MAIN_STAGE_COUNT

View File

@ -3,6 +3,8 @@
* Types shared between TH04 and TH05 * Types shared between TH04 and TH05
*/ */
#include "th04/common.h"
/// Math /// Math
/// ---- /// ----
#include "th03/math/subpixel.hpp" #include "th03/math/subpixel.hpp"
@ -32,9 +34,6 @@ int pascal far select_for_rank(
/// Stages /// Stages
/// ------ /// ------
#define MAIN_STAGE_COUNT 6
#define STAGE_EXTRA MAIN_STAGE_COUNT
extern nearfunc_t_near stage_invalidate; extern nearfunc_t_near stage_invalidate;
extern nearfunc_t_near stage_render; extern nearfunc_t_near stage_render;
/// ------ /// ------