coastline 0.0.4
Loading...
Searching...
No Matches
MenuFont Class Reference

Menu text with a 1024-byte internal buffer, glyph metrics, drawing style, and text-entry state. More...

#include <menufont.h>

Public Member Functions

 MenuFont ()
 Initialise empty text, style one, zero dimensions and position, and an inactive caret.
virtual ~MenuFont ()
 Destroy embedded text and state without releasing external resources.
virtual void MeasureText ()
 Recalculate primary-font width and raise height to the tallest recognised glyph if needed.
virtual void MeasureTextAltFont ()
 Recalculate alternate-font width and raise height without resetting prior height.
virtual void DrawMenuItemText (float x, float y)
 Draw primary-font text at supplied coordinates, with optional centring and caret rendering.
virtual void DrawText ()
 Draw primary-font text at the stored position, applying centring and an enabled caret.
virtual signed char HandleTextInput ()
 Process pending character and key input, including network-setup sound shortcuts.
virtual long double ComputeCenteredX ()
 Centre measured text between configured left and right bounds and store the horizontal position.
virtual void DrawTextAltFont ()
 Draw alternate-font text at the stored position, applying centring and an enabled caret.
const char * GetText () const
void SetText (const char *text)
 Copy terminated text without checking capacity or measuring the result.
void AppendText (const char *text)
 Append terminated text without checking capacity or measuring the result.
void CopyTextPrefix (const char *text, size_t size)
 Copy a text prefix with strncpy() semantics, including zero padding after a source terminator.
void SetNumber (int value)
 Replace text with a terminated signed decimal integer without measuring the result.
unsigned GetFlags () const
unsigned SetFlags (unsigned value)
 Store text flags without measuring or drawing.
unsigned char SetStyle (unsigned char value)
 Store a drawing style without changing font measurements.
unsigned char GetStyle () const
short GetWidth () const
short SetWidth (short value)
 Store width without measuring text or updating bounds.
short GetHeight () const
short SetHeight (short value)
 Store height without measuring text or updating bounds.
float SetX (float value)
 Store horizontal position without updating bounds.
float GetX () const
float GetY () const
float SetY (float value)
 Store vertical position without updating bounds.
float SetZ (float value)
 Store the legacy depth field without changing device state; text drawing does not read it.
short SetInputMaxWidth (short value)
 Store the width threshold used before accepting an input character.
int GetDrawCaret () const
int SetDrawCaret (int value)
 Store caret state without resetting its shared blink timer.
LONG GetBoundsLeft () const
const RECT & GetBounds () const
LONG SetBoundsLeft (LONG value)
 Store the left bound without updating position or dimensions.
LONG GetBoundsTop () const
LONG SetBoundsTop (LONG value)
 Store the top bound without updating position or dimensions.
LONG GetBoundsRight () const
LONG SetBoundsRight (LONG value)
 Store the right bound without updating position or dimensions.
LONG SetBoundsBottom (LONG value)
 Store the bottom bound without updating position or dimensions.
unsigned GetItemData () const
unsigned SetItemData (unsigned value)
 Store application-specific item data without interpreting it.

Detailed Description

Menu text with a 1024-byte internal buffer, glyph metrics, drawing style, and text-entry state.

Direct setters do not validate values or synchronise position, bounds, and measured dimensions. Callers must preserve string termination and configure bounds before alignment or bounds queries.

Constructor & Destructor Documentation

◆ MenuFont()

MenuFont::MenuFont ( )

Initialise empty text, style one, zero dimensions and position, and an inactive caret.

Bounds and application item data require assignment before queries.

Ghidra address:
BRD3D: 0x1005b050
Ghidra address:
BRGlide: 0x10053e70

◆ ~MenuFont()

virtual MenuFont::~MenuFont ( )
virtual

Destroy embedded text and state without releasing external resources.

Ghidra address:
BRD3D: 0x1005b0c0
Ghidra address:
BRGlide: 0x10053ee0

Member Function Documentation

◆ MeasureText()

virtual void MenuFont::MeasureText ( )
virtual

Recalculate primary-font width and raise height to the tallest recognised glyph if needed.

Existing height is not reset; invalid character bytes end measurement.

Ghidra address:
BRD3D: 0x1005b0d0
Ghidra address:
BRGlide: 0x10053ef0

◆ MeasureTextAltFont()

virtual void MenuFont::MeasureTextAltFont ( )
virtual

Recalculate alternate-font width and raise height without resetting prior height.

Native measurement subtracts four pixels per glyph; alternate drawing subtracts six.

Ghidra address:
BRD3D: 0x1005b160
Ghidra address:
BRGlide: 0x10053f80

◆ DrawMenuItemText()

virtual void MenuFont::DrawMenuItemText ( float x,
float y )
virtual

Draw primary-font text at supplied coordinates, with optional centring and caret rendering.

Parameters
xThe horizontal menu-pixel coordinate, replaced by centring when flag one is set.
yThe vertical menu-pixel coordinate.
Ghidra address:
BRD3D: 0x1005b390
Ghidra address:
BRGlide: 0x100541b0

◆ DrawText()

virtual void MenuFont::DrawText ( )
virtual

Draw primary-font text at the stored position, applying centring and an enabled caret.

Ghidra address:
BRD3D: 0x1005b2b0
Ghidra address:
BRGlide: 0x100540d0

◆ HandleTextInput()

virtual signed char MenuFont::HandleTextInput ( )
virtual

Process pending character and key input, including network-setup sound shortcuts.

The text buffer must be terminated and have capacity for any accepted character.

Returns
-1 for cancellation, zero for accepted nonempty text, or one to continue editing.
Ghidra address:
BRD3D: 0x1005b570
Ghidra address:
BRGlide: 0x10054390

◆ ComputeCenteredX()

virtual long double MenuFont::ComputeCenteredX ( )
virtual

Centre measured text between configured left and right bounds and store the horizontal position.

Returns
The computed horizontal menu-pixel coordinate before storage rounding to float.
Ghidra address:
BRD3D: 0x1005b200
Ghidra address:
BRGlide: 0x10054020

◆ DrawTextAltFont()

virtual void MenuFont::DrawTextAltFont ( )
virtual

Draw alternate-font text at the stored position, applying centring and an enabled caret.

Ghidra address:
BRD3D: 0x1005b460
Ghidra address:
BRGlide: 0x10054280

◆ GetText()

const char * MenuFont::GetText ( ) const
inline
Returns
Borrowed internal text, valid until text mutation or object destruction.

◆ SetText()

void MenuFont::SetText ( const char * text)
inline

Copy terminated text without checking capacity or measuring the result.

Parameters
textA non-null string of at most 1023 bytes, copied during the call.

◆ AppendText()

void MenuFont::AppendText ( const char * text)
inline

Append terminated text without checking capacity or measuring the result.

Parameters
textA non-null string whose appended result, including its terminator, fits 1024 bytes.

◆ CopyTextPrefix()

void MenuFont::CopyTextPrefix ( const char * text,
size_t size )
inline

Copy a text prefix with strncpy() semantics, including zero padding after a source terminator.

A source at least size bytes long does not produce a terminator; callers must terminate it.

Parameters
textA non-null source with readable bytes through its terminator or size bytes.
sizeThe destination byte count, at most 1024.

◆ SetNumber()

void MenuFont::SetNumber ( int value)
inline

Replace text with a terminated signed decimal integer without measuring the result.

Parameters
valueThe integer to format.

◆ GetFlags()

unsigned MenuFont::GetFlags ( ) const
inline
Returns
The stored text flag bits, including bit zero for centring.

◆ SetFlags()

unsigned MenuFont::SetFlags ( unsigned value)
inline

Store text flags without measuring or drawing.

Parameters
valueThe flag bits, including bit zero for centring.
Returns
The stored flag bits.

◆ SetStyle()

unsigned char MenuFont::SetStyle ( unsigned char value)
inline

Store a drawing style without changing font measurements.

Parameters
valueThe atlas style, normally zero, one, two, three, or four.
Returns
The stored style.

◆ GetStyle()

unsigned char MenuFont::GetStyle ( ) const
inline
Returns
The stored drawing style.

◆ GetWidth()

short MenuFont::GetWidth ( ) const
inline
Returns
The stored text width in menu pixels.

◆ SetWidth()

short MenuFont::SetWidth ( short value)
inline

Store width without measuring text or updating bounds.

Parameters
valueThe width in menu pixels.
Returns
The stored width.

◆ GetHeight()

short MenuFont::GetHeight ( ) const
inline
Returns
The stored text height in menu pixels.

◆ SetHeight()

short MenuFont::SetHeight ( short value)
inline

Store height without measuring text or updating bounds.

Parameters
valueThe height in menu pixels; zero permits later measurement to shrink prior height.
Returns
The stored height.

◆ SetX()

float MenuFont::SetX ( float value)
inline

Store horizontal position without updating bounds.

Parameters
valueThe horizontal menu-pixel coordinate.
Returns
The stored coordinate.

◆ GetX()

float MenuFont::GetX ( ) const
inline
Returns
The stored horizontal position in menu pixels.

◆ GetY()

float MenuFont::GetY ( ) const
inline
Returns
The stored vertical position in menu pixels.

◆ SetY()

float MenuFont::SetY ( float value)
inline

Store vertical position without updating bounds.

Parameters
valueThe vertical menu-pixel coordinate.
Returns
The stored coordinate.

◆ SetZ()

float MenuFont::SetZ ( float value)
inline

Store the legacy depth field without changing device state; text drawing does not read it.

Parameters
valueThe floating-point depth value, stored without validation.
Returns
The stored depth.

◆ SetInputMaxWidth()

short MenuFont::SetInputMaxWidth ( short value)
inline

Store the width threshold used before accepting an input character.

Parameters
valueThe threshold in menu pixels; the next character can extend text past the threshold.
Returns
The stored threshold.

◆ GetDrawCaret()

int MenuFont::GetDrawCaret ( ) const
inline
Returns
The stored caret marker, with nonzero enabling caret drawing.

◆ SetDrawCaret()

int MenuFont::SetDrawCaret ( int value)
inline

Store caret state without resetting its shared blink timer.

Parameters
valueThe marker, with nonzero enabling caret drawing.
Returns
The stored marker.

◆ GetBoundsLeft()

LONG MenuFont::GetBoundsLeft ( ) const
inline
Returns
The stored left menu-pixel bound; bounds must be initialised first.

◆ GetBounds()

const RECT & MenuFont::GetBounds ( ) const
inline
Returns
A borrowed reference to bounds storage, valid until destruction and changed by setters.

◆ SetBoundsLeft()

LONG MenuFont::SetBoundsLeft ( LONG value)
inline

Store the left bound without updating position or dimensions.

Parameters
valueThe left menu-pixel coordinate.
Returns
The stored coordinate.

◆ GetBoundsTop()

LONG MenuFont::GetBoundsTop ( ) const
inline
Returns
The stored top menu-pixel bound; bounds must be initialised first.

◆ SetBoundsTop()

LONG MenuFont::SetBoundsTop ( LONG value)
inline

Store the top bound without updating position or dimensions.

Parameters
valueThe top menu-pixel coordinate.
Returns
The stored coordinate.

◆ GetBoundsRight()

LONG MenuFont::GetBoundsRight ( ) const
inline
Returns
The stored right menu-pixel bound; bounds must be initialised first.

◆ SetBoundsRight()

LONG MenuFont::SetBoundsRight ( LONG value)
inline

Store the right bound without updating position or dimensions.

Parameters
valueThe right menu-pixel coordinate.
Returns
The stored coordinate.

◆ SetBoundsBottom()

LONG MenuFont::SetBoundsBottom ( LONG value)
inline

Store the bottom bound without updating position or dimensions.

Parameters
valueThe bottom menu-pixel coordinate.
Returns
The stored coordinate.

◆ GetItemData()

unsigned MenuFont::GetItemData ( ) const
inline
Returns
The stored application item data, initialised by callers before querying.

◆ SetItemData()

unsigned MenuFont::SetItemData ( unsigned value)
inline

Store application-specific item data without interpreting it.

Parameters
valueThe unsigned application value.
Returns
The stored value.

The documentation for this class was generated from the following file: