[Maintenance] Move the point structures into `pc98.h`

Unfortunately, it's still premature to start a separate header file for
display-space coordinates like I'm doing with Shuusou Gyoku. What does
make sense, though, is moving the display-space vector types next to
the display-space scalar types in `pc98.h`. This makes much more sense
than keeping them in `master.hpp` just because master.lib also has a
Point type. Would have thought that this lets us remove more than two
`master.hpp` inclusions, though…

Part of P0240, funded by JonathKane.
This commit is contained in:
nmlgc 2023-05-18 11:00:28 +02:00
parent 5303c37de2
commit 9a8e0fc0fd
4 changed files with 12 additions and 15 deletions

View File

@ -11,23 +11,11 @@
/// Types
/// -----
// A version of master.lib's Point without the constructor, even in C++
struct point_t {
int x, y;
};
#ifdef PC98_H
struct screen_point_t {
screen_x_t x;
screen_y_t y;
};
#if defined(__cplusplus)
#if (defined(PC98_H) && defined(__cplusplus))
// master.lib palettes use twice the bits per RGB component for more
// toning precision
typedef RGB<uint8_t, 256> RGB8;
typedef Palette<RGB8> Palette8;
#endif
#endif
/// -----

11
pc98.h
View File

@ -13,6 +13,11 @@
typedef int pixel_t;
typedef unsigned int upixel_t;
// A version of master.lib's Point without the constructor, even in C++
struct point_t {
pixel_t x, y;
};
// VRAM widths and object-space coordinates
typedef int vram_byte_amount_t;
typedef int vram_word_amount_t;
@ -36,6 +41,12 @@ typedef unsigned int uscreen_x_t;
typedef int screen_y_t;
typedef unsigned int uscreen_y_t;
// Display-space point.
struct screen_point_t {
screen_x_t x;
screen_y_t y;
};
// VRAM X coordinate, ranging from 0 to (RES_X / BYTE_DOTS).
typedef int vram_x_t;

View File

@ -2,7 +2,6 @@
#include <stddef.h>
#include "platform.h"
#include "master.hpp"
#include "th01/rank.h"
#include "th03/common.h"
#include "th03/score.h"

View File

@ -2,7 +2,6 @@
#include "platform.h"
#include "pc98.h"
#include "master.hpp"
#include "th01/math/subpixel.hpp"
#include "th04/math/motion.hpp"
#include "th04/main/playfld.hpp"