Alchemy
Loading...
Searching...
No Matches

frames.c

Go to the documentation of this file.
1/// @file
2/// Window zoom and frames, and opening and waiting on message windows.
3/// Part of window.c, the window object, compiled only through it.
4
6
7/// Scratch values for a step of a window's zoom: the scaled part of a side,
8/// the scaled duration and their ratio.
13};
14
15/// The per-frame window update: steps each window's zoom while it opens or
16/// closes, draws it in full once open, and frees its slot once closed.
18 struct UiRenderWork *state = UI_WORK;
19 struct UiWindow *work = state->windows;
20 s32 index = 0;
21 u8 dirty;
22
23loop:
24 if (work->flags != 0) {
25 // Opening: zoom out one step a frame, then draw the window in full.
26 if ((s16)work->frame != 0) {
28 work->frame = (s16)work->frame - 1;
29 } else if (work->duration != 0) {
31 }
32 } else if (work->duration != 0) {
33 // Closing: zoom in one step a frame, then erase it and free its slot.
34 if ((s16)work->frame != work->duration) {
36 (s16)work->previousWidth,
37 (s16)work->previousHeight);
39 work->frame++;
40 dirty = 1;
41 state->dirty = dirty;
42 } else {
44 (s16)work->previousWidth,
45 (s16)work->previousHeight);
46 work->output.head = NULL;
47 work->output.tailLink = NULL;
48 work->width = 0;
49 work->height = 0;
50 work->x = 0;
51 work->y = 0;
52 work->unk10 = 0;
53 work->effect = 0;
54 work->state = 0;
55 work->flags = 0;
56 work->frame = 0;
57 work->duration = 0;
58 work->previousX = 0;
59 work->previousY = 0;
60 work->previousWidth = 0;
61 work->previousHeight = 0;
62 state->dirty = 1;
63 }
64 }
65 index++;
66 work++;
67 if (index != WINDOW_COUNT)
68 goto loop;
69}
70
71/// Draws the frame of a zooming window at its size for this frame: the window
72/// grows from its centre as frame counts down to 0. With savePosition set (when
73/// closing) the drawn rectangle is remembered, for the next frame to erase.
74void UiWindow_DrawZoomFrame(void *windowArg, s32 savePosition) {
75 struct UiWindow *window = windowArg;
76 struct UiWindowInterpolationScratch scratch;
77 s32 frame;
78 s32 duration;
79 s32 remaining;
80 s32 x;
81 s32 y;
82 s32 width;
83 s32 height;
84
85 frame = (s16)window->frame;
86 duration = window->duration;
87 remaining = duration - frame;
88 scratch.scaledPart = (frame * window->width) << 16;
89 scratch.scaledDuration = duration << 17;
90 scratch.result =
92 x = (scratch.result >> 16) + window->x;
93
94 scratch.scaledPart = (remaining * window->width) << 16;
95 scratch.result =
97 width = scratch.result >> 15;
98
99 scratch.scaledPart = (frame * window->height) << 16;
100 scratch.scaledDuration = window->duration << 17;
101 scratch.result =
103 y = (scratch.result >> 16) + window->y;
104
105 scratch.scaledPart = (remaining * window->height) << 16;
106 scratch.result =
108 height = scratch.result >> 15;
109
110 UiWindow_DrawFrame(x, y, width, height);
111 if (savePosition != 0) {
112 window->previousX = x;
113 window->previousY = y;
114 window->previousWidth = width;
115 window->previousHeight = height;
116 }
117}
118
119/// Fills count halfwords at dst with value by DMA, and returns the position
120/// after them. value holds the halfword in both its halves.
121u16 *Memory_FillHalfwordsDma(u16 *dst, s32 value, s32 count) {
122 if (count > 0) {
123 Dma_Fill16(value, dst, count * 2);
124 dst += count;
125 }
126 return dst;
127}
128
129/// Draws an empty window: a frame around a filled interior, at tile (x, y) of
130/// width by height tiles. Sizes outside 2 to 30 tiles draw nothing.
131void UiWindow_DrawFrame(s32 x, s32 y, u32 width, u32 height) {
132 struct UiRenderWork *canvas = UI_WORK;
133 u16 *cursor = (u16 *)((y * 32 + x) * 2 + (u32)canvas->tilemap);
134 u32 row;
135
136 if (width <= 1 || height <= 1 || width > 30 || height > 30)
137 return;
138 UiWindow_ClearTileAttributesInRect(x, y, width, height);
139 // The top edge.
140 if (canvas->mode != 0)
141 *cursor++ = UI_TILE_FRAME_ROUND_CORNER;
142 else
143 *cursor++ = UI_TILE_FRAME_TOP_LEFT;
145 width - 2);
146 if (canvas->mode != 0)
148 else
149 *cursor++ = UI_TILE_FRAME_TOP_RIGHT;
150 cursor += 32 - width;
151 // The sides and the fill between them.
152 for (row = 1; row < height - 1; row++) {
153 *cursor++ = UI_TILE_FRAME_LEFT;
154 if (width != 2)
156 cursor, UI_TILE_PAIR(UI_TILE_WINDOW_FILL), width - 2);
157 *cursor++ = UI_TILE_FRAME_RIGHT;
158 cursor += 32 - width;
159 }
160 // The bottom edge.
161 if (canvas->mode != 0)
163 else
164 *cursor++ = UI_TILE_FRAME_BOTTOM_LEFT;
166 width - 2);
167 if (canvas->mode != 0)
169 else
171 canvas->dirty = 1;
172}
173
174/// Maps the text canvas tiles into the interior of a window at tile (x, y).
175/// With fullWidth set the canvas covers the side frame columns too.
176void UiWindow_MapTextCanvasTiles(s32 x, s32 y, u32 width, u32 height,
177 s32 fullWidth) {
178 struct UiRenderWork *canvas = UI_WORK;
179 u16 *cursor = (u16 *)((y * 32 + x) * 2 + (u32)canvas->tilemap);
180 u32 row;
181 u32 col;
182
183 if (width <= 1 || height <= 1 || width > 30 || height > 30)
184 return;
185 // Canvas tiles run down each column of the interior.
186 cursor += 32;
187 if (fullWidth == 0) {
188 for (row = 1; row < height - 1; row++) {
189 cursor++;
190 for (col = 1; col < width - 1; col++)
191 *cursor++ = UI_TILE(
192 (UI_CANVAS_FIRST_TILE - 1 + row + (col - 1) * (height - 2)) &
193 0xfff);
194 cursor++;
195 cursor += 32 - width;
196 }
197 } else {
198 for (row = 1; row < height - 1; row++) {
199 for (col = 0; col < width; col++)
200 *cursor++ = UI_TILE(
201 (UI_CANVAS_FIRST_TILE - 1 + row + col * (height - 2)) & 0xfff);
202 cursor += 32 - width;
203 }
204 }
205 canvas->dirty = 1;
206}
207
208/// Returns 1 when every message channel has finished its text (or is idle),
209/// and 0 while one is still typing.
211 struct UiChannelSlot *ch;
212 s32 i;
213
214 ch = UI_WORK->channels;
215 for (i = 0; i != 3; i++, ch++) {
216 if (ch->work != NULL && ch->work->state == 0)
217 return 0;
218 }
219 return 1;
220}
221
222/// Returns 1 when a window is fully closed (its slot free), and 0 while it is
223/// open or closing.
224s32 UiWork_IsIdle(struct UiWindow *window) {
225#if !TBS_PATCH_1
226 if (window == NULL)
227 return 1;
228#endif
229 if (window->flags == 0 && window->duration == 0)
230 return 1;
231 return 0;
232}
233
234/// Resets the text style glyphs are drawn with: colour 15, no outline, line
235/// spacing 10.
237 struct UiRenderWork *state = UI_WORK;
238
239 state->colour = 15;
240 state->lineSpacing = 10;
241 state->letterSpacing = 9;
242 state->outline = 0;
243 state->unknownAfterLineSpacing = 1;
244}
245
246/// Loads the glyph tiles, resets the text style and starts the per-frame
247/// window update (UiWork_ProcessAll).
249 struct UiRenderWork *state = UI_WORK;
250 s32 priority;
251
252 state->glyphTiles = VramCache_Load(95, 128 << 6, 0);
253 state->letterSpacing = 9;
254 state->lineSpacing = 10;
255 state->outline = 0;
256 state->colour = 15;
257 state->count = 0;
258 priority = 200;
259 priority <<= 4;
261}
262
263/// Resets the text style and starts the per-frame window update
264/// (UiWork_ProcessAll), loading the glyph tiles first when loadGlyphTiles is
265/// set.
267 struct UiRenderWork *state = UI_WORK;
268 s32 priority;
269
270 if (loadGlyphTiles != 0)
271 state->glyphTiles = VramCache_Load(95, 128 << 6, 0);
272 state->letterSpacing = 9;
273 state->lineSpacing = 10;
274 state->outline = 0;
275 state->colour = 15;
276 state->count = 0;
277 priority = 200;
278 priority <<= 4;
280}
281
282/// Closes the battle message window, if one is open.
284 struct BattleDisplayWork *display = gBattleDisplayWork;
285 struct UiWindow *window = display->window;
286
287 if (window != NULL) {
288 UiWork_Finalize(window, 1);
289 display->window = NULL;
290 }
291}
292
293/// Shows a message in the battle message window, opening the window (a
294/// full-width text canvas along the bottom of the screen) if it is not open.
296 s32 entryIndex;
297 struct UiChannelSlot *channel;
298 struct UiWindow *previousWindow;
299 struct UiWindow *messageWindow;
300 struct UiRenderWork *state;
301 struct BattleDisplayWork *control;
302
303 state = UI_WORK;
304 control = (struct BattleDisplayWork *)
306 // result starts as NULL, though it is assigned again before it is read; the
307 // same zero clears marked below
308 channel = NULL;
309 state->menuState = 2;
310 entryIndex = UiText_BuildRenderEntries(argument, 1);
311 state->menuState = 1;
312
313 if (state->entries[entryIndex] != 0) {
314 previousWindow = control->window;
315 if (previousWindow == NULL) {
316 messageWindow = UiWindow_Create(
318 control->window = messageWindow;
319 UiWindow_MapTextCanvasTiles(0, 15, 30, 6, 1);
320 control->marked = 0;
321 } else {
322 messageWindow = previousWindow;
323 }
324 if (messageWindow != NULL) {
325 channel =
326 UiText_StartBattleMessage(messageWindow, entryIndex, control->marked);
327 control->offset = (struct BattleDisplayOffset *)channel;
328 control->marked = 0;
329 if (channel == NULL) {
330 UiWork_Finalize(messageWindow, 1);
331 }
332 }
333 }
334}
335
336/// Shows a message in the battle message window and waits until it has been
337/// typed out.
340 while (UiWork_IsComplete() == 0)
341 WaitFrames(1);
342 WaitFrames(1);
343}
344
345/// Types a message into an open window from its top
346/// left. Returns the channel typing it (as an integer), or 0 when the message
347/// is empty, window is NULL or no channel is free. The result is the channel
348/// pointer encoded as a word, not a message-completion status.
349s32 UiText_OpenEntryMessage(struct UiWindow *window, s32 message) {
350 struct UiRenderWork *work = UI_WORK;
351 s32 entry;
352 s32 channel = 0;
353 /* FAKEMATCH: never read: the native frame keeps 8 bytes above the two
354 * outgoing arguments, exactly these four slots; without them the frame is 8
355 * bytes, not 16 (differ 4 in tbs-en). */
356 UNUSED u16 frameReserve[4];
357
358 work->speakerVoiceSound = 0;
359 work->speakerVoiceCountdown = 0;
360 entry = UiText_BuildRenderEntries(message, 1);
361 if (work->entries[entry] == 0)
362 return 0;
363 if (window == 0)
364 return 0;
365 channel = (s32)UiText_QueueRenderEntries(window, entry, 0, 0, 0, 1);
366 if (channel == 0)
367 return 0;
368 return channel;
369}
370
371/// Sets the effects the next message is decoded with
372/// (UiText_BuildRenderEntries): flags bit 0 (spacingBefore) makes it halting
373/// speech, a short pause before each character, broken off with an ellipsis
374/// after the first word; bit 1 (spacingAfter) puts code 222 after certain
375/// characters in English and Japanese. UiText_OpenMessageWindow clears both.
377 struct UiRenderWork *work;
378
379 work = UI_WORK;
380 if (work != NULL) {
381 if (flags & 1) {
382 work->spacingBefore = 1;
383 }
384 if (2 & flags) {
385 work->spacingAfter = 1;
386 }
387 }
388}
389
390/// Opens a window sized to a message near tile (x, y) and starts typing the
391/// message into it. packed holds the window options in its low bits (bit 0:
392/// zoom open rather than appear at once; bit 3: a text canvas; bit 4: keep the
393/// bottom edge; bit 5: keep the left edge) and the speaker's voice sound in
394/// bits 16 to 27. Returns the window, or NULL when the message is empty or no
395/// window or channel is free.
397 u32 packed) {
398 s32 entry;
399 u32 height;
400 u32 width;
401 u16 bounds[4];
402 s32 flags;
403 u16 *out;
404 struct UiWindow *window;
405 struct UiRenderWork *work;
406
407 work = UI_WORK;
408 work->speakerVoiceSound = (packed << 4) >> 20;
409 // the window starts as NULL, though it is assigned before it is read; the
410 // same zero serves the zeros below
411 window = NULL;
412 work->speakerVoiceCountdown = 0;
413 packed &= 0xffff;
414 flags = 0;
415 entry = UiText_BuildRenderEntries(message, 1);
416 if (work->entries[entry] == 0)
417 return NULL;
418 UiWindow_FitOnScreen(entry, &x, &y, &width, &height, (out = bounds), 0);
419 if (width == 0 && height == 0)
420 return NULL;
421 if (!(packed & 1))
422 flags |= UI_WINDOW_INSTANT;
423 if (packed & 8)
424 flags |= UI_WINDOW_TEXT_CANVAS;
425 if (packed & 16)
427 if (packed & 32)
428 flags |= UI_WINDOW_FIXED_X;
429 window = UiWindow_Create(x, y, width, height, flags);
430 if (window == NULL)
431 return NULL;
432 if (UiText_QueueRenderEntries(window, entry, 0, 0, out, 0) == 0) {
433 UiWork_Finalize(window, 1);
434 return NULL;
435 }
436 work->spacingBefore = 0;
437 work->spacingAfter = 0;
438 return window;
439}
440
441/// Shows a message in a window centred on the screen, waits until it is typed
442/// out and closes it. flags: bit 0 zooms the window, bit 1 sets busy while it
443/// shows, bit 2 leaves the window open, bit 3 puts it 4 tiles lower, bit 5
444/// holds the tilemap upload off afterwards, bit 6 puts it 12 tiles lower.
445/// Without bit 3 or 6 the window goes above or below the player's character,
446/// away from where it stands on screen.
448 struct UiRenderWork *state = UI_WORK;
449 s32 zoom;
450 s32 actorPosition[2] = {0, 0};
451 s32 height;
452 s32 width;
453 s32 y;
454 s32 x;
455 struct UiWindow *window = NULL;
456 s32 zero;
457
458 y = x = 0;
459 zoom = flags & 1;
460
461 if (flags & 2) {
462 state->busy = 1;
463 }
464
465 UiText_GetResourceDimensions(message, &x, &y, (u32 *)&width, (u32 *)&height);
466
467 // Centre the window across the screen, and in the top 12 rows.
468 x = (30 - width) >> 1;
469 y = (12 - height) >> 1;
470
471 if (flags & 8) {
472 y += 4;
473 } else if (flags & 0x40) {
474 y += 12;
475 } else {
476 s32 actorTileY;
477
479 actorTileY = actorPosition[1] >> 3;
480 if (actorTileY > 9) {
481 y = actorTileY - 5;
482 } else {
483 y = actorTileY + 4;
484 }
485 }
486
487 window = UiText_OpenMessageWindow(message, x, y, zoom);
488
489 if (window != NULL) {
490 while (UiWork_IsComplete() == 0) {
491 WaitFrames(1);
492 }
493
494 if (flags & 0x20) {
495 UI_WORK->menuBusy = 1;
496 }
497
498 if (!(flags & 4)) {
499 UiWork_Finalize(window, zoom);
500 while (UiWork_IsIdle(window) == 0) {
501 WaitFrames(1);
502 }
503 }
504 }
505
506 zero = 0;
507 state->busy = zero;
508 state->speakerVoiceSound = zero;
509 state->speakerVoiceCountdown = zero;
510 WaitFrames(3);
511}
512
513/// The window system's per-frame callback: windows, then message channels,
514/// then sprite animation.
519}
struct BattleDisplayWork * gBattleDisplayWork
s32 UiText_BuildRenderEntries(s32 script, s32 clear)
Decodes message script into the ring of decoded text (UiRenderWork.entries) and returns where it star...
Definition decode.c:276
#define Dma_Fill16(value, destination, size)
Fills size bytes at destination with the halfword value by DMA3, from a volatile copy of it on the st...
Definition dma.h:22
s32 Object_GetScreenPositionFar(s32 objectId, s32 *position)
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
Definition frame.c:97
void UiText_ShowPositionedMessageAndWait(s32 message, s32 flags)
Shows a message in a window centred on the screen, waits until it is typed out and closes it.
Definition frames.c:447
void UiWindow_DrawFrame(s32 x, s32 y, u32 width, u32 height)
Draws an empty window: a frame around a filled interior, at tile (x, y) of width by height tiles.
Definition frames.c:131
void UiWindow_DrawZoomFrame(void *windowArg, s32 savePosition)
Draws the frame of a zooming window at its size for this frame: the window grows from its centre as f...
Definition frames.c:74
void UiText_PrepareMessageWork(s32 argument)
Shows a message in the battle message window, opening the window (a full-width text canvas along the ...
Definition frames.c:295
void UiWork_FinalizeSharedSlot(void)
Closes the battle message window, if one is open.
Definition frames.c:283
void UiWork_ResetCounters(void)
Resets the text style glyphs are drawn with: colour 15, no outline, line spacing 10.
Definition frames.c:236
struct UiWindow * UiText_OpenMessageWindow(s32 message, s32 x, s32 y, u32 packed)
Opens a window sized to a message near tile (x, y) and starts typing the message into it.
Definition frames.c:396
s32 UiWork_IsIdle(struct UiWindow *window)
Returns 1 when a window is fully closed (its slot free), and 0 while it is open or closing.
Definition frames.c:224
void UiWork_InitCountersWithResourceAndScheduleRefresh(void)
Loads the glyph tiles, resets the text style and starts the per-frame window update (UiWork_ProcessAl...
Definition frames.c:248
void UiWork_ProcessAll(void)
The window system's per-frame callback: windows, then message channels, then sprite animation.
Definition frames.c:515
u16 * Memory_FillHalfwordsDma(u16 *dst, s32 value, s32 count)
Fills count halfwords at dst with value by DMA, and returns the position after them.
Definition frames.c:121
void UiWindow_MapTextCanvasTiles(s32 x, s32 y, u32 width, u32 height, s32 fullWidth)
Maps the text canvas tiles into the interior of a window at tile (x, y).
Definition frames.c:176
void UiWork_InitCountersAndScheduleRefresh(s32 loadGlyphTiles)
Resets the text style and starts the per-frame window update (UiWork_ProcessAll), loading the glyph t...
Definition frames.c:266
void UiText_ShowMessageAndWaitCore(s32 argument)
Shows a message in the battle message window and waits until it has been typed out.
Definition frames.c:338
void UiWork_ProcessDirectWork(void)
The per-frame window update: steps each window's zoom while it opens or closes, draws it in full once...
Definition frames.c:17
s32 UiWork_IsComplete(void)
Returns 1 when every message channel has finished its text (or is idle), and 0 while one is still typ...
Definition frames.c:210
s32 UiText_OpenEntryMessage(struct UiWindow *window, s32 message)
Types a message into an open window from its top left.
Definition frames.c:349
void UiWork_SetBusyFlags(s32 flags)
Sets the effects the next message is decoded with (UiText_BuildRenderEntries): flags bit 0 (spacingBe...
Definition frames.c:376
struct GameState gGameState
@ HEAP_SLOT_WINDOW
Definition heap_state.h:39
static s32 Iwram_RatioMulQ14(s32 divisor, s32 value)
All calls go through this layer.
Definition iwram_call.h:51
void UiWindow_FitOnScreen(s32 entryIndex, s32 *windowX, s32 *windowY, u32 *windowWidth, u32 *windowHeight, u16 *spacing, u32 flags)
Sizes a window for decoded text no and moves (*px, *py) so the window fits on the screen.
Definition measure.c:17
s32 Scheduler_AddOrUpdateCallback(SchedulerCallback callback, s32 order)
Schedules callback with order, or gives a task already running it the new order, and re-sorts the tab...
Definition scheduler.c:102
#define NULL
Definition bilibin.h:6
u8 gWindowWork[]
The battle message's text channel, as far as its offset in the window.
Definition battle_work.h:30
The battle message display: its window, its text channel and whether the next message is marked.
Definition battle_work.h:38
s32 marked
set by BATTLE_EVENT_MARK; passed to the next message
Definition battle_work.h:41
struct UiWindow * window
the message window
Definition battle_work.h:39
struct BattleDisplayOffset * offset
its text channel
Definition battle_work.h:40
s32 selectedActor
the leader: its unit and its actor
Definition game_state.h:59
struct RenderOutput ** tailLink
struct RenderOutput * head
A text channel, one of three, which types decoded text into a window a few characters a frame and run...
Definition uiwindow.h:43
struct UiWindow * work
the window typed into; NULL when free
Definition uiwindow.h:44
The window system's work: the windows' tilemap, the windows, the three text channels,...
Definition window.h:19
u8 mode
Set while Mind Read shows thoughts: round frame corners, colour 8 text with no shadow,...
Definition window.h:35
u16 speakerVoiceCountdown
characters until the next voice blip
Definition window.h:61
u8 spacingBefore
1 for halting speech: a pause before each character, broken off with an ellipsis after the first word...
Definition window.h:68
u16 tilemap[640]
the windows' BG tilemap, 32 by 20 tiles
Definition window.h:20
u16 unknownAfterLineSpacing
set to 1 with the text style; not read
Definition window.h:43
u8 dirty
The tilemap's 4-row bands to upload: bit 0 for all, bit n + 1 for band n.
Definition window.h:32
u16 entries[RENDER_ENTRY_MASK+1]
decoded text, a ring of codes
Definition window.h:46
u16 speakerVoiceSound
first of four voice blip sounds; 0 for none
Definition window.h:60
u16 count
where the next code goes in entries
Definition window.h:48
u16 colour
the current channel's, copied in to draw
Definition window.h:45
u16 letterSpacing
pixels between sprite glyphs; 9
Definition window.h:47
u16 outline
the current channel's, copied in to draw
Definition window.h:44
u8 menuState
1 from the work's setup; 2 while a battle message is decoded.
Definition window.h:39
u8 spacingAfter
1 puts code 222 after certain characters in English and Japanese (UiWork_SetBusyFlags bit 1).
Definition window.h:71
u16 glyphTiles
first sprite tile of the glyph sheet (picture 95)
Definition window.h:51
u16 lineSpacing
the current channel's, copied in to draw
Definition window.h:42
Scratch values for a step of a window's zoom: the scaled part of a side, the scaled duration and thei...
Definition frames.c:9
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
Definition uiwindow.h:11
u16 frame
The zoom's step: counts down from 7 to 0 while opening, and up from 0 to duration while closing.
Definition uiwindow.h:28
u16 previousX
tiles
Definition uiwindow.h:30
u16 y
tiles
Definition uiwindow.h:16
u16 effect
The effect a message's TEXT_WINDOW_STATE code sets.
Definition uiwindow.h:21
u16 flags
UI_WINDOW_ flags; 0 once closing or free.
Definition uiwindow.h:25
u16 unk10
1 once opened, 0 once freed; not read by name in TBS
Definition uiwindow.h:17
u16 previousHeight
tiles
Definition uiwindow.h:33
u16 state
0 while a message channel is typing into the window; 1 once its text has ended or closed the window,...
Definition uiwindow.h:24
u16 x
tiles
Definition uiwindow.h:15
u16 height
tiles
Definition uiwindow.h:14
struct RenderOutputList output
the sprites the window carries
Definition uiwindow.h:12
u16 previousY
tiles
Definition uiwindow.h:31
u16 previousWidth
tiles
Definition uiwindow.h:32
u16 width
tiles
Definition uiwindow.h:13
s16 duration
frames of the zoom under way; 0 when none
Definition uiwindow.h:29
#define WINDOW_COUNT
Definition tbs_edition.h:69
void UiWindow_ClearTileAttributesInRect(s32 x, s32 y, u32 width, u32 height)
Marks the text tiles under a tilemap rectangle (x, y, width and height in tiles) as no longer shown,...
Definition text_tiles.c:276
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
signed short s16
Definition types.h:12
unsigned short u16
Definition types.h:13
#define UNUSED
Definition types.h:22
unsigned char u8
Definition types.h:11
void UiWork_ProcessRenderChannels(void)
The per-frame message update: each message channel whose window is fully open runs its window effect ...
Definition typing.c:40
#define UI_CANVAS_FIRST_TILE
Definition window.h:47
#define UI_TILE_PAIR(entry)
Two copies of a tilemap entry, for filling a run of entries a word at a time.
Definition window.h:57
s32 UiText_GetResourceDimensions(s32 no, s32 *x, s32 *y, u32 *width, u32 *height)
#define UI_WORK
Definition window.h:267
#define UI_TILE(tile)
A tilemap entry of palette 15, the UI palette.
Definition window.h:54
#define TILE_VFLIP
Definition window.h:106
@ UI_WINDOW_TEXT_CANVAS
text is drawn into a canvas of bitmap tiles (UiWindow_MapTextCanvasTiles)
Definition window.h:31
@ UI_WINDOW_FIXED_X
when a new page resizes the window, its left edge stays put
Definition window.h:39
@ UI_WINDOW_ANCHOR_BOTTOM
when a new page resizes the window, its bottom edge stays put
Definition window.h:37
@ UI_WINDOW_INSTANT
opens and closes at once, with no zoom
Definition window.h:29
@ UI_TILE_WINDOW_FILL
Definition window.h:83
@ UI_TILE_FRAME_LEFT
Definition window.h:80
@ UI_TILE_FRAME_RIGHT
Definition window.h:81
@ UI_TILE_FRAME_BOTTOM
Definition window.h:78
@ UI_TILE_FRAME_TOP
Definition window.h:75
@ UI_TILE_FRAME_BOTTOM_LEFT
Definition window.h:77
@ UI_TILE_FRAME_ROUND_CORNER
Definition window.h:82
@ UI_TILE_FRAME_TOP_LEFT
Definition window.h:74
@ UI_TILE_FRAME_TOP_RIGHT
Definition window.h:76
@ UI_TILE_FRAME_BOTTOM_RIGHT
Definition window.h:79
#define TILE_HFLIP
The tilemap entry flip bits.
Definition window.h:105
s32 VramCache_Load(u32 no, u32 size, const void *src)
Gives cache entry no size bytes of sprite VRAM and copies src there.
Definition vram_cache.c:143
void UiWork_AnimateSpriteSlots(void)
The per-frame sprite update: moves each sprite that an open window carries by its animation mode (UI_...
Definition sprites.c:443
What every part of the window object shares: its includes, edition values, macros and the codes of de...
@ HEAP_SLOT_BATTLE_DISPLAY
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.
Definition windows.c:187
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,...
Definition windows.c:515
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.
Definition windows.c:557
void UiWindow_DrawOpened(struct UiWindow *window)
Draws a window at its full size: its frame, and for a text canvas window the canvas,...
Definition windows.c:241
void UiWork_Finalize(struct UiWindow *window, s32 instant)
Closes a window: clears its contents and remembers its last rectangle.
Definition windows.c:349
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,...
Definition windows.c:279