Alchemy
Loading...
Searching...
No Matches

decode.c File Reference

The message decoder: articles, names and numbers written out. More...

Go to the source code of this file.

Data Structures

struct  ArticleTable
 The article written before a name of each article class. More...

Macros

#define ARTICLE_KINDS   8
#define ARTICLE_KIND_MASK   7
#define ENTRY_NARROW_GAP   TEXT_PAUSE_SHORT
 What halting speech (UiWork_SetBusyFlags) puts between characters.
#define ENTRY_WIDE_GAP   TEXT_VOICED_MARK

Enumerations

enum  {
  MSG_END = 0 , MSG_PAGE_BREAK = 1 , MSG_END_WAIT = 2 , MSG_LINE_BREAK = 3 ,
  MSG_TEXT_COLOR = 8 , MSG_TEXT_EFFECT = 9 , MSG_LOCALIZED_WORD = 13 , MSG_PROTAGONIST_NAME = 16 ,
  MSG_ACTOR_NAME = 17 , MSG_ARGUMENT_ACTOR_NAME = 18 , MSG_ARGUMENT_CLASS_NAME = 19 , MSG_ARGUMENT_ITEM_NAME = 20 ,
  MSG_ARGUMENT_ABILITY_NAME = 21 , MSG_ARGUMENT_SIGNED_NUMBER = 22 , MSG_ARGUMENT_LOCATION_NAME = 23 , MSG_EM_DASH = 24 ,
  MSG_PLURAL_SUFFIX = 25 , MSG_BUTTON_ICON = 26 , MSG_POSSESSIVE_SUFFIX = 27 , MSG_ARTICLE_CLASS = 29 ,
  MSG_END_NOW = 30
}
 The control codes of a message as stored (the PO catalogs' names), which UiText_BuildRenderEntries expands into decoded text. More...

Functions

u32 UiText_AppendArticleName (s32 mode, u16 *name, u32 writePosition, u16 *entries, s32 articleForm, s32 plural, s32 *suffix)
 The English form: form 1 (or 3 with a single item) takes "a" or "an" (by the name's first letter unless its class says otherwise), and form 2 (or 3 with several) adds the plural "s" or "es".
s32 UiText_BuildRenderEntries (s32 script, s32 clear)
 Decodes message script into the ring of decoded text (UiRenderWork.entries) and returns where it starts; script -1 returns the last message's start again.

Detailed Description

The message decoder: articles, names and numbers written out.

Part of window.c, the window object, compiled only through it.

Definition in file decode.c.

Macro Definition Documentation

◆ ARTICLE_KINDS

#define ARTICLE_KINDS   8

Definition at line 15 of file decode.c.

◆ ARTICLE_KIND_MASK

#define ARTICLE_KIND_MASK   7

Definition at line 16 of file decode.c.

◆ ENTRY_NARROW_GAP

#define ENTRY_NARROW_GAP   TEXT_PAUSE_SHORT

What halting speech (UiWork_SetBusyFlags) puts between characters.

Definition at line 246 of file decode.c.

Referenced by UiText_BuildRenderEntries().

◆ ENTRY_WIDE_GAP

#define ENTRY_WIDE_GAP   TEXT_VOICED_MARK

Definition at line 247 of file decode.c.

Referenced by UiText_BuildRenderEntries().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

The control codes of a message as stored (the PO catalogs' names), which UiText_BuildRenderEntries expands into decoded text.

Enumerator
MSG_END 
MSG_PAGE_BREAK 
MSG_END_WAIT 
MSG_LINE_BREAK 
MSG_TEXT_COLOR 
MSG_TEXT_EFFECT 
MSG_LOCALIZED_WORD 

German: a counted noun; Italian: a gender ending; Spanish and French: the plural suffix.

MSG_PROTAGONIST_NAME 
MSG_ACTOR_NAME 
MSG_ARGUMENT_ACTOR_NAME 
MSG_ARGUMENT_CLASS_NAME 
MSG_ARGUMENT_ITEM_NAME 
MSG_ARGUMENT_ABILITY_NAME 
MSG_ARGUMENT_SIGNED_NUMBER 
MSG_ARGUMENT_LOCATION_NAME 
MSG_EM_DASH 
MSG_PLURAL_SUFFIX 

English: the plural suffix; German, Spanish, French and Italian: the item's possessive.

MSG_BUTTON_ICON 
MSG_POSSESSIVE_SUFFIX 
MSG_ARTICLE_CLASS 
MSG_END_NOW 

Definition at line 217 of file decode.c.

Function Documentation

◆ UiText_AppendArticleName()

u32 UiText_AppendArticleName ( s32 mode,
u16 * name,
u32 writePosition,
u16 * entries,
s32 articleForm,
s32 plural,
s32 * suffix )

The English form: form 1 (or 3 with a single item) takes "a" or "an" (by the name's first letter unless its class says otherwise), and form 2 (or 3 with several) adds the plural "s" or "es".

The write position wraps in the decoded-text ring; language grammar remains separate.

Definition at line 140 of file decode.c.

Referenced by UiText_AppendArticleName(), and UiText_BuildRenderEntries().

◆ UiText_BuildRenderEntries()

s32 UiText_BuildRenderEntries ( s32 script,
s32 clear )

Decodes message script into the ring of decoded text (UiRenderWork.entries) and returns where it starts; script -1 returns the last message's start again.

Argument codes take their values from the argument table (UiWork_PushValueSlot), and clear empties the table afterwards. Names, numbers and articles are written out; style codes are kept with their operands for the message channel to run. script -1 reuses messageStart; clear consumes argument slots after decoding.

Definition at line 276 of file decode.c.

Referenced by UiText_BuildRenderEntries(), UiText_BuildRenderEntriesMode1(), UiText_CopyMessageString(), UiText_DrawCharacterAtOffset(), UiText_DrawResource(), UiText_MeasureResourceEntries(), UiText_OpenEntryMessage(), UiText_OpenMessageWindow(), UiText_PrepareMessageWork(), and UiText_ShowCenteredMessage().