Skip to Content
The Alchemy Project

src/window/window_typing.c

The per-tick message update: typing text and running its control codes. More…

Included by window.c.

Macros

NameDescription
#defineCANVAS_COLUMNS 30The battle message canvas: 30 columns of four tiles, each column 32 pixel rows of a word each.
#defineCANVAS_COLUMN_WORDS 32
#defineCANVAS_KEPT_ROWS 8the top 8 pixel rows stay put
#defineMESSAGE_KEY_WAIT 919A 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.
#defineMESSAGE_KEY_WAIT_STARTED 900

Enumerations

NameDescription
enumanonymous enum { TYPING_GOES_ON, TYPING_ENDED, TYPING_CLOSES_WINDOW }What mnMessageType reports.

Functions

NameDescription
voidmnTextScrollCanvasUp (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.
voidmnMessageUpdateAll (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.
Sint32mnMessageType (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.

EnumeratorValueDescription
TYPING_GOES_ON0the text goes on next tick
TYPING_ENDED8the text has ended; the window stays open
TYPING_CLOSES_WINDOW9the 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.