src/window/window_typing.c
The per-tick message update: typing text and running its control codes. More…
Included by window.c.
Macros
| Name | Description | |
|---|---|---|
#define | CANVAS_COLUMNS 30 | The text canvas: 30 columns of tiles, 32 words to a column. |
#define | CANVAS_COLUMN_WORDS 32 | |
#define | CANVAS_KEPT_ROWS 8 | the top pixel rows, which stay put |
#define | TEXT_SPEED MainRoutineStateWork.msgSpeed |
Enumerations
| Name | Description | |
|---|---|---|
enum | anonymous enum { MESSAGE_STEP_RUNNING, MESSAGE_STEP_ENDED, MESSAGE_STEP_CLOSE } | What mnMessageType reports. |
Functions
| Name | Description | |
|---|---|---|
void | mnTextScrollCanvasUp (Sint32 step) | Scrolls the message canvas up by 6 pixel rows per step, below its top CANVAS_KEPT_ROWS, and clears the rows this uncovers. |
Sint32 | mnMessageType (MESSAGE *msg) | Types one tick's share of a message's text: runs control codes (new line, new page, pauses, colours) and draws characters, playing the speaker's voice blips. |
void | mnWindowStepSwellEffect (MESSAGE *msg) | Steps a message window's swell (WINDOW_ANIMATION_SWELL) by a tick. |
void | mnMessageUpdateAll (void) | The per-tick message update: each message whose window is fully open runs its window animation or types more text, and on the text's end marks the window typed out (state 1) or closes it. |
void | mnTextStartCanvasScroll (MESSAGE *msg) | Starts a message scrolling its canvas up a line: 12 pixel rows, 6 a tick over two ticks (mnMessageType, mnTextScrollCanvasUp), during which the message types nothing. |
void | mnMessageApplyStyle (MESSAGE *msg) | Makes the message's text colour, style and line spacing the ones glyphs are drawn with, before it draws its next character. |
Bool | mnTextCheckPauseSkipped (MESSAGE *msg) | Ends a message's pause early: when the message waits on a sound that has finished, or while A, B, L or R is held. |
Bool | mnTextCheckTextDismissed (MESSAGE *msg) | As mnTextCheckPauseSkipped, but on a newly pressed button (the latched presses while WIN_STATE.mindRead is set). |
Description
The per-tick message update: typing text and running its control codes. Part
of window.c.
Macros in detail
CANVAS_COLUMNS
#define CANVAS_COLUMNS 30
The text canvas: 30 columns of tiles, 32 words to a column.
Referenced by mnTextScrollCanvasUp().
Definition at line 5 of file window_typing.c.
CANVAS_COLUMN_WORDS
#define CANVAS_COLUMN_WORDS 32
Referenced by mnTextScrollCanvasUp().
Definition at line 6 of file window_typing.c.
CANVAS_KEPT_ROWS
#define CANVAS_KEPT_ROWS 8
the top pixel rows, which stay put
Referenced by mnTextScrollCanvasUp().
Definition at line 7 of file window_typing.c.
TEXT_SPEED
#define TEXT_SPEED MainRoutineStateWork.msgSpeed
Referenced by mnMessageType().
Definition at line 111 of file window_typing.c.
Enumerations in detail
anonymous enum
enum { MESSAGE_STEP_RUNNING, MESSAGE_STEP_ENDED, MESSAGE_STEP_CLOSE }
What mnMessageType reports.
| Enumerator | Value | Description |
|---|---|---|
MESSAGE_STEP_RUNNING | 0 | the text goes on next tick |
MESSAGE_STEP_ENDED | 8 | the text has ended; the window stays open |
MESSAGE_STEP_CLOSE | 9 | the text is dismissed: close the window |
Definition at line 10 of file window_typing.c.
Functions in detail
mnTextScrollCanvasUp
void mnTextScrollCanvasUp(Sint32 step)
Scrolls the message canvas up by 6 pixel rows per step, below its top
CANVAS_KEPT_ROWS, and clears the rows this uncovers. A typing message calls
it with step 1 on each tick of a line scroll.
References Sint32, syDMAXCopy() and syWordsFill().
Referenced by mnMessageType().
Definition at line 20 of file window_typing.c.
mnMessageType
Sint32 mnMessageType(MESSAGE *msg)
Types one tick's share of a message's text: runs control codes (new line, new
page, pauses, colours) and draws characters, playing the speaker's voice
blips. Returns a MESSAGE_STEP_ result. The share is the message speed's
glyphs a tick (MessageSpeedSteps) outside battle, where a space or a control
code also ends it; in battle it is 8 glyphs, 13 after a tick that took two
frames and 18 after one that took three or more.
References FontGlyphs, LastTickFrames, MessageSpeedDelays, MessageSpeedHeldPageDelays, MessageSpeedSteps, MessageSpeedVoiceGaps, mnGlyphDraw(), mnMessageApplyStyle(), mnTextCheckPauseSkipped(), mnTextCheckTextDismissed(), mnTextScrollCanvasUp(), mnTextStartCanvasScroll(), mnWindowDrawBorder(), mnWindowEraseBorderRect(), mnWindowFitOnScreen(), mnWindowSpritePrepareForRedraw(), PerWork, Sint32, sySoundPlayStub() and syVRAMCacheFreeEntry().
Referenced by mnMessageUpdateAll().
Definition at lines 39 and 119 of file window_typing.c.
mnMessageUpdateAll
void mnMessageUpdateAll(void)
The per-tick message update: each message whose window is fully open runs its window animation or types more text, and on the text's end marks the window typed out (state 1) or closes it.
References mnMessageType(), mnWindowClose(), mnWindowStepSwellEffect() and Sint32.
Referenced by mnWindowSystemUpdate() and mnWindowSystemUpdateBattle().
Definition at line 45 of file window_typing.c.