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 battle message canvas: 30 columns of four tiles, each column 32 pixel rows of a word each. |
#define | CANVAS_COLUMN_WORDS 32 | |
#define | CANVAS_KEPT_ROWS 8 | the top 8 pixel rows stay put |
#define | MESSAGE_KEY_WAIT 919 | A message waiting for a button holds its countdown here, set again each tick and counted down once, so it reads below MESSAGE_KEY_WAIT_STARTED only on the wait's first tick. |
#define | MESSAGE_KEY_WAIT_STARTED 900 |
Enumerations
| Name | Description | |
|---|---|---|
enum | anonymous enum { TYPING_GOES_ON, TYPING_ENDED, TYPING_CLOSES_WINDOW } | What mnMessageType reports. |
Functions
| Name | Description | |
|---|---|---|
void | mnTextScrollCanvasUp (Sint32 step) | Scrolls the battle message canvas up by 6 pixel rows per step, below its top 8 rows, and clears the rows this uncovers. |
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 (WINDOW_TYPED) or closes it. |
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. |
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 battle message canvas: 30 columns of four tiles, each column 32 pixel rows of a word each.
Referenced by mnTextScrollCanvasUp().
Definition at line 6 of file window_typing.c.
CANVAS_COLUMN_WORDS
#define CANVAS_COLUMN_WORDS 32
Referenced by mnTextScrollCanvasUp().
Definition at line 7 of file window_typing.c.
CANVAS_KEPT_ROWS
#define CANVAS_KEPT_ROWS 8
the top 8 pixel rows stay put
Referenced by mnTextScrollCanvasUp().
Definition at line 8 of file window_typing.c.
MESSAGE_KEY_WAIT
#define MESSAGE_KEY_WAIT 919
A message waiting for a button holds its countdown here, set again each tick
and counted down once, so it reads below MESSAGE_KEY_WAIT_STARTED only on the
wait's first tick.
Referenced by mnMessageType().
Definition at line 13 of file window_typing.c.
MESSAGE_KEY_WAIT_STARTED
#define MESSAGE_KEY_WAIT_STARTED 900
Referenced by mnMessageType().
Definition at line 14 of file window_typing.c.
Enumerations in detail
anonymous enum
enum { TYPING_GOES_ON, TYPING_ENDED, TYPING_CLOSES_WINDOW }
What mnMessageType reports.
| Enumerator | Value | Description |
|---|---|---|
TYPING_GOES_ON | 0 | the text goes on next tick |
TYPING_ENDED | 8 | the text has ended; the window stays open |
TYPING_CLOSES_WINDOW | 9 | the text is dismissed: close the window |
Definition at line 38 of file window_typing.c.
Functions in detail
mnTextScrollCanvasUp
void mnTextScrollCanvasUp(Sint32 step)
Scrolls the battle message canvas up by 6 pixel rows per step, below its top 8 rows, and clears the rows this uncovers.
References Sint32, syDMAXCopy() and syWordsFill().
Referenced by mnMessageType().
Definition at line 18 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 (WINDOW_TYPED) or closes it.
References mnMessageType(), mnWindowClose(), mnWindowStepSwellEffect() and Sint32.
Referenced by mnWindowSystemUpdate().
Definition at line 48 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.
References FontGlyphs, LastTickFrames, MainRoutineStateWork, MessageSpeedDelays, MessageSpeedSteps, MessageSpeedVoiceGaps, mnGlyphDraw(), mnMessageApplyStyle(), mnTextCheckPauseSkipped(), mnTextCheckTextDismissed(), mnTextScrollCanvasUp(), mnTextStartCanvasScroll(), mnWindowDrawBorder(), mnWindowEraseBorderRect(), mnWindowFitOnScreen(), mnWindowSpritePrepareForRedraw(), PerData, PerPushLatch, Sint32, state, sySoundPlayStub() and syVRAMCacheFreeEntry().
Referenced by mnMessageUpdateAll().
Definition at line 114 of file window_typing.c.