This commit is contained in:
DorfDork 2026-06-29 12:44:24 +10:00 committed by GitHub
commit 7334d11788
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 7 deletions

View file

@ -63,8 +63,7 @@ const LevelScript level_intro_mario_head_regular[] = {
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_STAR, /*time*/ 20, /*color*/ 0x00, 0x00, 0x00),
SLEEP(/*frames*/ 20),
CALL_LOOP(/*arg*/ 1, /*func*/ lvl_intro_update),
// JUMP_IF(/*op*/ OP_EQ, /*arg*/ 100, script_intro_L1),
JUMP_IF(/*op*/ OP_EQ, /*arg*/ 100, script_intro_L4),
JUMP_IF(/*op*/ OP_EQ, /*arg*/ 100, script_intro_L1),
JUMP_IF(/*op*/ OP_EQ, /*arg*/ 101, script_intro_L2),
JUMP(script_intro_L4),
};
@ -89,8 +88,7 @@ const LevelScript level_intro_mario_head_dizzy[] = {
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_STAR, /*time*/ 20, /*color*/ 0x00, 0x00, 0x00),
SLEEP(/*frames*/ 20),
CALL_LOOP(/*arg*/ 2, /*func*/ lvl_intro_update),
// JUMP_IF(/*op*/ OP_EQ, /*arg*/ 100, script_intro_L1),
JUMP_IF(/*op*/ OP_EQ, /*arg*/ 100, script_intro_L4),
JUMP_IF(/*op*/ OP_EQ, /*arg*/ 100, script_intro_L1),
JUMP_IF(/*op*/ OP_EQ, /*arg*/ 101, script_intro_L2),
JUMP(script_intro_L4),
};

View file

@ -24,6 +24,7 @@ struct TextLabel {
* Stores the text to be rendered on screen
* and how they are to be rendered.
*/
static struct TextLabel sTextLabelStorage[256];
struct TextLabel *sTextLabels[256];
s16 sTextLabelsCount = 0;
@ -178,9 +179,10 @@ void print_text_fmt_int(s32 x, s32 y, const char *str, s32 n) {
s32 srcIndex = 0;
// Don't continue if there is no memory to do so.
if ((sTextLabels[sTextLabelsCount] = growing_pool_alloc(gDisplayListHeap, sizeof(struct TextLabel))) == NULL) {
if (sTextLabelsCount >= 256) {
return;
}
sTextLabels[sTextLabelsCount] = &sTextLabelStorage[sTextLabelsCount];
sTextLabels[sTextLabelsCount]->x = x;
sTextLabels[sTextLabelsCount]->y = y;
@ -228,9 +230,10 @@ void print_text(s32 x, s32 y, const char *str) {
s32 srcIndex = 0;
// Don't continue if there is no memory to do so.
if ((sTextLabels[sTextLabelsCount] = growing_pool_alloc(gDisplayListHeap, sizeof(struct TextLabel))) == NULL) {
if (sTextLabelsCount >= 256) {
return;
}
sTextLabels[sTextLabelsCount] = &sTextLabelStorage[sTextLabelsCount];
sTextLabels[sTextLabelsCount]->x = x;
sTextLabels[sTextLabelsCount]->y = y;
@ -260,9 +263,10 @@ void print_text_centered(s32 x, s32 y, const char *str) {
s32 srcIndex = 0;
// Don't continue if there is no memory to do so.
if ((sTextLabels[sTextLabelsCount] = growing_pool_alloc(gDisplayListHeap, sizeof(struct TextLabel))) == NULL) {
if (sTextLabelsCount >= 256) {
return;
}
sTextLabels[sTextLabelsCount] = &sTextLabelStorage[sTextLabelsCount];
c = str[srcIndex];