Replace NUM_TEXT_PRINTERS with WINDOWS_MAX

This commit is contained in:
GriffinR 2023-03-31 14:57:51 -04:00
parent 8d67bebd51
commit 57396026b2
5 changed files with 6 additions and 8 deletions

View File

@ -36,7 +36,7 @@ static u32 GetGlyphWidth_Narrow(u16, bool32);
static u32 GetGlyphWidth_SmallNarrow(u16, bool32); static u32 GetGlyphWidth_SmallNarrow(u16, bool32);
static EWRAM_DATA struct TextPrinter sTempTextPrinter = {0}; static EWRAM_DATA struct TextPrinter sTempTextPrinter = {0};
static EWRAM_DATA struct TextPrinter sTextPrinters[NUM_TEXT_PRINTERS] = {0}; static EWRAM_DATA struct TextPrinter sTextPrinters[WINDOWS_MAX] = {0};
static u16 sFontHalfRowLookupTable[0x51]; static u16 sFontHalfRowLookupTable[0x51];
static u16 sLastTextBgColor; static u16 sLastTextBgColor;
@ -244,7 +244,7 @@ static void SetFontsPointer(const struct FontInfo *fonts)
void DeactivateAllTextPrinters(void) void DeactivateAllTextPrinters(void)
{ {
int printer; int printer;
for (printer = 0; printer < NUM_TEXT_PRINTERS; ++printer) for (printer = 0; printer < WINDOWS_MAX; ++printer)
sTextPrinters[printer].active = FALSE; sTextPrinters[printer].active = FALSE;
} }
@ -322,7 +322,7 @@ void RunTextPrinters(void)
if (!gDisableTextPrinters) if (!gDisableTextPrinters)
{ {
for (i = 0; i < NUM_TEXT_PRINTERS; ++i) for (i = 0; i < WINDOWS_MAX; ++i)
{ {
if (sTextPrinters[i].active) if (sTextPrinters[i].active)
{ {

View File

@ -3,8 +3,6 @@
#include "characters.h" #include "characters.h"
#define NUM_TEXT_PRINTERS 32
// Given as a text speed when all the text should be // Given as a text speed when all the text should be
// loaded at once but not copied to vram yet. // loaded at once but not copied to vram yet.
#define TEXT_SKIP_DRAW 0xFF #define TEXT_SKIP_DRAW 0xFF

View File

@ -9,8 +9,6 @@ u8 gTransparentTileNumber;
void *gWindowBgTilemapBuffers[NUM_BACKGROUNDS]; void *gWindowBgTilemapBuffers[NUM_BACKGROUNDS];
extern u32 gWindowTileAutoAllocEnabled; extern u32 gWindowTileAutoAllocEnabled;
#define WINDOWS_MAX 32
EWRAM_DATA struct Window gWindows[WINDOWS_MAX] = {0}; EWRAM_DATA struct Window gWindows[WINDOWS_MAX] = {0};
EWRAM_DATA static struct Window* sWindowPtr = NULL; EWRAM_DATA static struct Window* sWindowPtr = NULL;
EWRAM_DATA static u16 sWindowSize = 0; EWRAM_DATA static u16 sWindowSize = 0;

View File

@ -1,6 +1,8 @@
#ifndef GUARD_WINDOW_H #ifndef GUARD_WINDOW_H
#define GUARD_WINDOW_H #define GUARD_WINDOW_H
#define WINDOWS_MAX 32
#define PIXEL_FILL(num) ((num) | ((num) << 4)) #define PIXEL_FILL(num) ((num) | ((num) << 4))
enum { enum {

View File

@ -5503,7 +5503,7 @@ static void ContestBG_FillBoxWithTile(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 wi
static bool32 Contest_RunTextPrinters(void) static bool32 Contest_RunTextPrinters(void)
{ {
RunTextPrinters(); RunTextPrinters();
return IsTextPrinterActive(4); return IsTextPrinterActive(WIN_GENERAL_TEXT);
} }
static void Contest_SetBgCopyFlags(u32 flagIndex) static void Contest_SetBgCopyFlags(u32 flagIndex)