From d979ac3bf3924051de8bb4154e8398083535eabb Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Mon, 11 Feb 2019 00:05:20 -0500 Subject: Document main_menu state machine, name window constants The new names for the constants (and newly named functions) give a much better understanding of what the window system is trying to do. --- src/window.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/window.c') diff --git a/src/window.c b/src/window.c index 3da529178..1daf4b5fc 100644 --- a/src/window.c +++ b/src/window.c @@ -6,7 +6,7 @@ u32 filler_03002F58; u32 filler_03002F5C; -u8 gUnknown_03002F60; +u8 gTransparentTileNumber; u32 filler_03002F64; void *gUnknown_03002F70[4]; extern u32 gUnneededFireRedVariable; @@ -106,7 +106,7 @@ bool16 InitWindows(const struct WindowTemplate *templates) } } - gUnknown_03002F60 = 0; + gTransparentTileNumber = TRANSPARENT_TILE_NUMBER; return TRUE; } @@ -359,13 +359,14 @@ void PutWindowRectTilemapOverridePalette(u8 windowId, u8 x, u8 y, u8 width, u8 h } } +// Fills a window with transparent tiles. void ClearWindowTilemap(u8 windowId) { struct Window windowLocal = gWindows[windowId]; FillBgTilemapBufferRect( windowLocal.window.bg, - gUnknown_03002F60, + gTransparentTileNumber, windowLocal.window.tilemapLeft, windowLocal.window.tilemapTop, windowLocal.window.width, @@ -451,6 +452,7 @@ void CopyToWindowPixelBuffer(u8 windowId, const void *src, u16 size, u16 tileOff LZ77UnCompWram(src, gWindows[windowId].tileData + (0x20 * tileOffset)); } +// Sets all pixels within the window to the fillValue color. void FillWindowPixelBuffer(u8 windowId, u8 fillValue) { int fillSize = gWindows[windowId].window.width * gWindows[windowId].window.height; -- cgit v1.2.3 From c96f8751cddf1a203bd5f310683ea35bf9cb8db2 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Thu, 21 Feb 2019 23:27:12 -0500 Subject: Improve window palette macros --- src/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/window.c') diff --git a/src/window.c b/src/window.c index 1daf4b5fc..94e68cae5 100644 --- a/src/window.c +++ b/src/window.c @@ -106,7 +106,7 @@ bool16 InitWindows(const struct WindowTemplate *templates) } } - gTransparentTileNumber = TRANSPARENT_TILE_NUMBER; + gTransparentTileNumber = 0; return TRUE; } -- cgit v1.2.3 From 44e92ce2596981c8d42b70922e5ae84d6b321ab1 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Fri, 22 Feb 2019 01:40:11 -0500 Subject: Give window drawing functions better names --- src/window.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/window.c') diff --git a/src/window.c b/src/window.c index 94e68cae5..fbce57743 100644 --- a/src/window.c +++ b/src/window.c @@ -6,6 +6,7 @@ u32 filler_03002F58; u32 filler_03002F5C; +// This global is set to 0 and never changed. u8 gTransparentTileNumber; u32 filler_03002F64; void *gUnknown_03002F70[4]; -- cgit v1.2.3