[Maintenance] [th05] Use master.hpp for the character selection menu

6149 LoC with the original master.h, vs. 2524 LoC *and* additional
semantic sugar with master.hpp. Nice!

(Yes, *semantic* sugar.)

Part of P0124, funded by [Anonymous] and Blue Bolt.
This commit is contained in:
nmlgc 2020-10-24 19:30:47 +02:00
parent 30462cc64f
commit 3ee848f456
2 changed files with 19 additions and 8 deletions

View File

@ -176,7 +176,9 @@ void MASTER_RET grcg_off(void);
void MASTER_RET grcg_round_boxfill(
int x1, int y1, int x2, int y2, unsigned r
);
void MASTER_RET grcg_byteboxfill_x(int x1, int y1, int x2, int y2);
void MASTER_RET grcg_byteboxfill_x(
vram_x_t left, vram_y_t top, vram_x_t right, vram_y_t bottom
);
// Circles
void MASTER_RET grcg_circle(int x, int y, unsigned r);
@ -289,6 +291,11 @@ void MASTER_RET vsync_end(void);
/// Inlined extensions
/// ------------------
#define grcg_boxfill_8(left, top, right, bottom) \
grcg_byteboxfill_x( \
((left) / BYTE_DOTS), top, ((right) / BYTE_DOTS), bottom \
)
#define palette_entry_rgb_show(fn) \
palette_entry_rgb(fn); \
palette_show();

View File

@ -6,7 +6,11 @@
#pragma codeseg op_01_TEXT
extern "C" {
#include "ReC98.h"
#include <dos.h>
#include "platform.h"
#include "pc98.h"
#include "planar.h"
#include "master.hpp"
#include "th01/ranks.h"
#include "th02/hardware/frmdelay.h"
#include "th04/formats/cdg.h"
@ -112,16 +116,16 @@ void pascal near pic_put(bool16 darkened)
// Drop shadow
grcg_setcolor(GC_RMW, 1);
grcg_byteboxfill_x(
((pic_raised_left + PIC_W) / BYTE_DOTS),
grcg_boxfill_8(
(pic_raised_left + PIC_W),
pic_top,
((pic_left + PIC_W - 1) / BYTE_DOTS),
(pic_left + PIC_W - 1),
(pic_raised_top + PIC_H - 1)
);
grcg_byteboxfill_x(
(pic_left / BYTE_DOTS),
grcg_boxfill_8(
pic_left,
(pic_raised_top + PIC_H),
((pic_left + PIC_W - 1) / BYTE_DOTS),
(pic_left + PIC_W - 1),
(pic_top + PIC_H - 1)
);
grcg_off();