mirror of https://github.com/nmlgc/ReC98.git
[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:
parent
5303c37de2
commit
9a8e0fc0fd
14
master.hpp
14
master.hpp
|
@ -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
11
pc98.h
|
@ -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;
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue