The render output pool, opening and closing windows, starting messages. More...
Go to the source code of this file.
Functions | |
| struct RenderOutput * | RenderOutput_AcquireFree (void) |
| Takes the first render output from the free list, or returns NULL when every output is in use. | |
| void | RenderOutput_ReleaseFree (struct RenderOutput *out) |
| Returns a render output to the end of the free list. | |
| void | RenderOutput_InitFreeList (void) |
| Links all 64 render outputs of the pool into the free list. | |
| void | UiWork_InitializeWithResourceCounters (void) |
| Sets up the window system for the field (and the other screens outside battle): allocates and clears the work block, blanks the tilemap, frees every render output and starts the two per-frame callbacks, the tilemap upload and the window update. | |
| void | UiWork_Initialize (s32 loadGlyphTiles) |
| Sets up the window system for battle, as UiWork_InitializeWithResourceCounters does for the field, and marks the work block as in battle (menuState 1). | |
| void | UiWork_UploadDirtyBlocks (void) |
| The per-frame tilemap upload: copies each 256-byte band of the tilemap (four tile rows) marked in the dirty bits to VRAM. | |
| void | UiWindow_EraseBorderRect (s32 x, s32 y, u32 width, u32 height) |
| Erases a window's rectangle of the tilemap (x, y, width and height in tiles), clamped to the screen. | |
| void | UiWindow_DrawOpened (struct UiWindow *window) |
| Draws a window at its full size: its frame, and for a text canvas window the canvas, filled with colour 4 under a frame when the window is framed and transparent otherwise. | |
| struct UiWindow * | UiWindow_Create (s32 x, s32 y, s32 width, s32 height, s32 attrs) |
| Opens a window at tile (x, y) of width by height tiles in the first free window slot, and returns it, or NULL when all slots are in use. | |
| void | UiWindow_WaitZoom (struct UiWindow *window) |
| Waits until a zooming window has finished opening or closing. | |
| void | UiWork_Finalize (struct UiWindow *window, s32 instant) |
| Closes a window: clears its contents and remembers its last rectangle. | |
| void | RenderOutput_PrepareForRedraw (struct UiWindow *window) |
| Clears a window's contents: redraws its empty frame and releases the render outputs it carries. | |
| void | RenderOutput_RedrawSavedRect (struct UiWindow *window) |
| Redraws a window's empty frame at its current rectangle. | |
| void | RenderOutput_ClearList (void *outputs) |
| Releases every render output in a list and empties it. | |
| void | UiWindow_ClearInteriorTiles (const struct UiWindow *window, u32 left, u32 top, u32 right, u32 bottom) |
| Clears an area of a window's interior to the window fill. | |
| UNUSED void | RenderOutputList_UpdateTail (struct RenderOutputList *list) |
| Points a list's tail link back at its last output, after the list has been edited by hand. | |
| void | RenderOutput_AppendToList (struct RenderOutputList *list, struct RenderOutput *node) |
| Adds a render output to the end of a list; NULL lists are ignored. | |
| void | RenderOutput_Release (struct RenderOutput *entry) |
| Frees a render output: returns it to the free list, releases its resource, and for a kind-2 output frees its palette slot too. | |
| struct UiChannelSlot * | UiText_QueueRenderEntries (struct UiWindow *window, s32 entry, s32 x, s32 y, u16 *spacing, s32 flags) |
| Starts a free message channel typing the decoded text that begins at entry into window, with the pen at pixel (x, y). | |
| struct UiChannelSlot * | UiText_StartBattleMessage (struct UiWindow *window, s32 entry, s32 keepPosition) |
| Starts a channel typing the decoded text at entry into the battle message window. | |
| s32 | Ui_ClearVramBlock (void) |
| Clears the text canvas to transparent. | |
| s32 | Ui_FillVramBlockPattern (void) |
| Fills the text canvas with the window background colour (4). | |
| void | UiWork_ResetFreeChannel (void) |
| Resets the pen and text style of the first idle message channel, clearing the canvas when the channel still has a window. | |
| void | UiText_ApplyChannelStyle (struct UiChannelSlot *channel) |
| Copies the channel's text colour, outline and line spacing into the shared glyph renderer before that channel draws its next character. | |
| void | UiText_StartCanvasScroll (struct UiChannelSlot *channel) |
| Starts a channel scrolling its canvas up a line, over two frames. | |
The render output pool, opening and closing windows, starting messages.
Part of window.c, the window object, compiled only through it.
Definition in file windows.c.
| struct RenderOutput * RenderOutput_AcquireFree | ( | void | ) |
Takes the first render output from the free list, or returns NULL when every output is in use.
Definition at line 9 of file windows.c.
Referenced by DjinnMenu_ShowChangePreview(), RenderOutput_AcquireFree(), RenderOutput_Create(), UiText_DrawGlyph(), and UiWindow_PutGlyph().
| void RenderOutput_ReleaseFree | ( | struct RenderOutput * | out | ) |
Returns a render output to the end of the free list.
An output from outside the work block's pool is ignored.
Definition at line 25 of file windows.c.
Referenced by RenderOutput_Release(), and RenderOutput_ReleaseFree().
| void RenderOutput_InitFreeList | ( | void | ) |
Links all 64 render outputs of the pool into the free list.
Definition at line 39 of file windows.c.
Referenced by RenderOutput_InitFreeList(), UiWork_Initialize(), and UiWork_InitializeWithResourceCounters().
| void UiWork_InitializeWithResourceCounters | ( | void | ) |
Sets up the window system for the field (and the other screens outside battle): allocates and clears the work block, blanks the tilemap, frees every render output and starts the two per-frame callbacks, the tilemap upload and the window update.
Definition at line 63 of file windows.c.
Referenced by UiWork_InitializeWithResourceCounters().
| void UiWork_Initialize | ( | s32 | loadGlyphTiles | ) |
Sets up the window system for battle, as UiWork_InitializeWithResourceCounters does for the field, and marks the work block as in battle (menuState 1).
loadGlyphTiles is set only when the Djinn tutorial flag is set: it loads the glyph tiles the tutorial's messages use.
Definition at line 99 of file windows.c.
Referenced by UiWork_Initialize().
| void UiWork_UploadDirtyBlocks | ( | void | ) |
The per-frame tilemap upload: copies each 256-byte band of the tilemap (four tile rows) marked in the dirty bits to VRAM.
Bit 0 marks the whole tilemap, bits 1 to 5 one band each. Nothing is copied while menuBusy holds the upload off.
Definition at line 158 of file windows.c.
Referenced by UiWork_Initialize(), UiWork_InitializeWithResourceCounters(), and UiWork_UploadDirtyBlocks().
Erases a window's rectangle of the tilemap (x, y, width and height in tiles), clamped to the screen.
In battle the rows below row 16 take tile 0x7f instead of the blank tile.
Definition at line 187 of file windows.c.
Referenced by PartyStatusDraw(), UiWindow_EraseBorderRect(), UiWindow_StepSwellEffect(), UiWork_Finalize(), UiWork_ProcessDirectWork(), and UiWork_StepChannelScript().
| void UiWindow_DrawOpened | ( | struct UiWindow * | window | ) |
Draws a window at its full size: its frame, and for a text canvas window the canvas, filled with colour 4 under a frame when the window is framed and transparent otherwise.
Definition at line 241 of file windows.c.
Referenced by UiWindow_Create(), UiWindow_DrawOpened(), and UiWork_ProcessDirectWork().
Opens a window at tile (x, y) of width by height tiles in the first free window slot, and returns it, or NULL when all slots are in use.
attrs takes the UI_WINDOW_ flags. Unless it is UI_WINDOW_INSTANT the window zooms open over eight frames, and this waits until it is fully open.
Definition at line 279 of file windows.c.
Referenced by Battle_CollectPartyCommands(), Battle_SelectAbility(), BattleMenu_RunActionSelection(), BattleTarget_RunSelection(), Debug_SelectAbilityPair(), DebugMenu_BrowseEntryGlyphs(), DebugMenu_BrowseIcons(), Djinn_ShowJoinedMessage(), DjinnMenu_ShowChangePreview(), ItemLevel_RunLevelEditor(), ItemLevel_SelectAbility(), ItemLevel_SelectItem(), ItemLevel_ShowGlyphCaptions(), ItemList_SelectEntry(), KalayTolbiDocks_TalkToTicketSeller(), Link_CreateCountdownLabelWindow(), Menu_CenterResourceEntries(), Menu_LayoutResourceEntries(), Menu_OpenSelectionWindow(), Menu_RunCommandRow(), Menu_RunSelection(), Menu_RunSelectionWithCursorObject(), Menu_RunWorkspaceOptions(), Menu_SelectResourceLayout(), NameEntry_EditOwnerName(), OptionMenu_Open(), Party_ShowJoinedMessage(), Party_ShowPairJoinedMessage(), PartyTalkMenu_Choose(), Sanctum_ChooseRestartOption(), SaveMenu_Run(), SaveMenu_SelectSlot(), SummonMenu_SelectSummon(), SystemMenu_Open(), TolbiSpring_RunSpringGame(), Ui_RunOwnerStatusScreen(), UiText_OpenMessageWindow(), UiText_PrepareMessageWork(), UiText_ShowCenteredMessage(), UiText_ShowLocalizedMessageAndWait(), UiTimedNotice_Create(), UiWindow_Create(), UiWindow_CreateWithLayoutBounds(), and UiWindow_CreateWithSideObject().
| void UiWindow_WaitZoom | ( | struct UiWindow * | window | ) |
Waits until a zooming window has finished opening or closing.
Definition at line 338 of file windows.c.
Referenced by UiWindow_Create(), and UiWindow_WaitZoom().
Closes a window: clears its contents and remembers its last rectangle.
With instant set the window is erased and its slot freed at once; otherwise it zooms closed over four frames first. Does nothing for NULL.
Definition at line 349 of file windows.c.
Referenced by Battle_CollectPartyCommands(), Battle_SelectAbility(), BattleMenu_RunActionSelection(), BattleTarget_RunSelection(), Debug_SelectAbilityPair(), DebugMenu_BrowseEntryGlyphs(), DebugMenu_BrowseIcons(), Djinn_ShowJoinedMessage(), DjinnMenu_ShowChangePreview(), ItemLevel_RunLevelEditor(), ItemLevel_SelectAbility(), ItemLevel_SelectItem(), ItemList_SelectEntry(), KalayTolbiDocks_TalkToTicketSeller(), LinkLobby_ChooseDebugPartyPreset(), LinkLobby_EnterBattle(), LinkLobby_SaveBattleResults(), LinkLobby_SaveMonsterBattleResults(), Menu_EndResourceSelection(), Menu_OpenSelectionWindow(), Menu_ReleaseSelectionWorkspace(), Menu_RunCommandRow(), Menu_RunSelection(), Menu_RunSelectionWithCursorObject(), Menu_RunWorkspaceOptions(), Menu_RunWorkspaceSelectionLoop(), Menu_SelectResourceLayout(), NameEntry_EditOwnerName(), Party_ShowJoinedMessage(), Party_ShowPairJoinedMessage(), PartyStatus_Close(), PartyTalkMenu_Choose(), Resource_ResetOwnerEntries(), Sanctum_ChooseRestartOption(), SaveMenu_Run(), SaveMenu_SelectSlot(), SummonMenu_SelectSummon(), TolbiSpring_RunSpringGame(), Ui_RunOwnerStatusScreen(), UiText_OpenMessageWindow(), UiText_PrepareMessageWork(), UiText_ShowCenteredMessage(), UiText_ShowLocalizedMessageAndWait(), UiText_ShowPositionedMessageAndWait(), UiTimedNotice_CloseIfActive(), UiTimedNotice_Tick(), UiWork_DrainPending(), UiWork_Finalize(), UiWork_FinalizeEntityMatchingLocalizedId(), UiWork_FinalizePendingCore(), UiWork_FinalizeSharedSlot(), and UiWork_ProcessRenderChannels().
| void RenderOutput_PrepareForRedraw | ( | struct UiWindow * | window | ) |
Clears a window's contents: redraws its empty frame and releases the render outputs it carries.
A text canvas window is left alone.
Definition at line 392 of file windows.c.
Referenced by DebugMenu_BrowseEntryGlyphs(), LinkLobby_ChooseDebugPartyPreset(), Menu_DrawFlagBitTable(), Menu_DrawModeIndicator(), Menu_DrawSelectionRow(), Menu_OpenSelectionWindow(), Menu_RunCommandRow(), Menu_RunResourceSelectionLoop(), Menu_SelectResource(), Menu_SelectResourceLayout(), NameEntry_EditOwnerName(), RenderOutput_PrepareForRedraw(), SaveMenu_DrawFileSummary(), SaveMenu_Run(), UiWork_Finalize(), and UiWork_StepChannelScript().
| void RenderOutput_RedrawSavedRect | ( | struct UiWindow * | window | ) |
Redraws a window's empty frame at its current rectangle.
Definition at line 400 of file windows.c.
Referenced by Battle_SelectAbility(), BattleMenu_RunActionSelection(), Debug_SelectAbilityPair(), ItemLevel_RunLevelEditor(), ItemLevel_SelectAbility(), ItemLevel_SelectItem(), ItemList_SelectEntry(), PartyStatusDraw(), RenderOutput_PrepareForRedraw(), RenderOutput_RedrawSavedRect(), SaveMenu_SelectSlot(), SummonMenu_SelectSummon(), and Ui_RunOwnerStatusScreen().
| void RenderOutput_ClearList | ( | void * | outputs | ) |
Releases every render output in a list and empties it.
outputs is the list, or a window (whose output list comes first); NULL is ignored.
Definition at line 406 of file windows.c.
Referenced by Battle_SelectAbility(), Menu_RunWorkspaceOptions(), RenderOutput_ClearList(), and RenderOutput_PrepareForRedraw().
| void UiWindow_ClearInteriorTiles | ( | const struct UiWindow * | window, |
| u32 | left, | ||
| u32 | top, | ||
| u32 | right, | ||
| u32 | bottom ) |
Clears an area of a window's interior to the window fill.
left, top, right and bottom are pixels inside the window, and the area covers every tile they touch.
Definition at line 428 of file windows.c.
Referenced by Menu_DrawModeLabel(), Menu_RunWorkspaceOptions(), and UiWindow_ClearInteriorTiles().
| UNUSED void RenderOutputList_UpdateTail | ( | struct RenderOutputList * | list | ) |
Points a list's tail link back at its last output, after the list has been edited by hand.
Nothing calls it.
Definition at line 466 of file windows.c.
Referenced by RenderOutputList_UpdateTail().
| void RenderOutput_AppendToList | ( | struct RenderOutputList * | list, |
| struct RenderOutput * | node ) |
Adds a render output to the end of a list; NULL lists are ignored.
Definition at line 478 of file windows.c.
Referenced by DjinnMenu_ShowChangePreview(), RenderOutput_AppendToList(), RenderOutput_Create(), UiText_DrawGlyph(), and UiWindow_PutGlyph().
| void RenderOutput_Release | ( | struct RenderOutput * | entry | ) |
Frees a render output: returns it to the free list, releases its resource, and for a kind-2 output frees its palette slot too.
Definition at line 496 of file windows.c.
Referenced by RenderOutput_ClearList(), and RenderOutput_Release().
| struct UiChannelSlot * UiText_QueueRenderEntries | ( | struct UiWindow * | window, |
| s32 | entry, | ||
| s32 | x, | ||
| s32 | y, | ||
| u16 * | spacing, | ||
| s32 | flags ) |
Starts a free message channel typing the decoded text that begins at entry into window, with the pen at pixel (x, y).
spacing gives each of four lines an extra gap between characters (or none for NULL); flags is kept with the channel (nonzero keeps the window's size from page to page). Returns the channel, or NULL when all three are busy.
Definition at line 515 of file windows.c.
Referenced by UiText_OpenEntryMessage(), UiText_OpenMessageWindow(), UiText_QueueRenderEntries(), and UiText_ShowCenteredMessage().
| struct UiChannelSlot * UiText_StartBattleMessage | ( | struct UiWindow * | window, |
| s32 | entry, | ||
| s32 | keepPosition ) |
Starts a channel typing the decoded text at entry into the battle message window.
A channel that already serves a finished window continues below its last line (scrolling up once both lines are used) unless keepPosition is set. Returns the channel, or NULL when all three are busy.
Definition at line 557 of file windows.c.
Referenced by UiText_PrepareMessageWork(), and UiText_StartBattleMessage().
| s32 Ui_ClearVramBlock | ( | void | ) |
Clears the text canvas to transparent.
Definition at line 614 of file windows.c.
Referenced by BattleTarget_RunSelection(), Ui_ClearVramBlock(), and UiWork_ResetFreeChannel().
| s32 Ui_FillVramBlockPattern | ( | void | ) |
Fills the text canvas with the window background colour (4).
Definition at line 619 of file windows.c.
Referenced by Battle_CollectPartyCommands(), Battle_SelectAbility(), BattleMenu_RunActionSelection(), ItemList_SelectEntry(), SummonMenu_SelectSummon(), Ui_FillVramBlockPattern(), Ui_RunOwnerStatusScreen(), and UiText_ShowLocalizedMessageAndWait().
| void UiWork_ResetFreeChannel | ( | void | ) |
Resets the pen and text style of the first idle message channel, clearing the canvas when the channel still has a window.
Definition at line 626 of file windows.c.
Referenced by UiWork_ResetFreeChannel().
| void UiText_ApplyChannelStyle | ( | struct UiChannelSlot * | channel | ) |
Copies the channel's text colour, outline and line spacing into the shared glyph renderer before that channel draws its next character.
Definition at line 652 of file windows.c.
Referenced by UiText_ApplyChannelStyle(), and UiWork_StepChannelScript().
| void UiText_StartCanvasScroll | ( | struct UiChannelSlot * | channel | ) |
Starts a channel scrolling its canvas up a line, over two frames.
Definition at line 661 of file windows.c.
Referenced by UiText_StartBattleMessage(), UiText_StartCanvasScroll(), and UiWork_StepChannelScript().