![]() |
Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
|
#include <ultra64.h>
#include "sm64.h"
#include "game.h"
#include "mario.h"
#include "memory.h"
#include "save_file.h"
#include "main.h"
#include "engine/surface_collision.h"
#include "geo_misc.h"
#include "segment2.h"
#include "print.h"
Data Structures | |
struct | TextLabel |
This file handles printing and formatting the colorful text that appears when printing things such as "PRESS START". More... | |
Functions | |
s32 | int_pow (s32 n, s32 exponent) |
Returns n to the exponent power, only for non-negative powers. More... | |
void | format_integer (s32 n, s32 base, char *dest, s32 *totalLength, u8 width, s8 zeroPad) |
Formats an integer n for print by fitting it to width, prefixing with a negative, and converting the base. More... | |
void | parse_width_field (const char *str, s32 *srcIndex, u8 *width, s8 *zeroPad) |
Determines the width of the number for printing, writing to 'width'. More... | |
void | print_text_fmt_int (s32 x, s32 y, const char *str, s32 n) |
Takes a number, finds the intended base, formats the number, and prints it at the given X & Y coordinates. More... | |
void | print_text (s32 x, s32 y, const char *str) |
Prints text in the colorful lettering at given X, Y coordinates. More... | |
void | print_text_centered (s32 x, s32 y, const char *str) |
Prints text in the colorful lettering centered at given X, Y coordinates. More... | |
s8 | char_to_glyph_index (char c) |
Converts a char into the proper colorful glyph for the char. More... | |
void | add_glyph_texture (s8 glyphIndex) |
Adds an individual glyph to be rendered. More... | |
void | clip_to_bounds (s32 *x, s32 *y) |
Clips textrect into the boundaries defined. More... | |
void | render_textrect (s32 x, s32 y, s32 pos) |
Renders the glyph that's set at the given position. More... | |
void | render_text_labels (void) |
Renders the text in sTextLabels on screen at the proper locations by iterating a for loop. More... | |
Variables | |
struct TextLabel * | sTextLabels [52] |
Stores the text to be rendered on screen and how they are to be rendered. More... | |
s16 | sTextLabelsCount = 0 |
Formats an integer n for print by fitting it to width, prefixing with a negative, and converting the base.
Determines the width of the number for printing, writing to 'width'.
Additionally, this determines if a number should be zero-padded, writing to 'zeroPad'.
Prints text in the colorful lettering at given X, Y coordinates.
Prints text in the colorful lettering centered at given X, Y coordinates.
Takes a number, finds the intended base, formats the number, and prints it at the given X & Y coordinates.
Warning: this fails on too large numbers, because format_integer has bugs related to overflow. For romhacks, prefer sprintf + print_text.
Renders the text in sTextLabels on screen at the proper locations by iterating a for loop.
Stores the text to be rendered on screen and how they are to be rendered.
s16 sTextLabelsCount = 0 |