1
0
Fork 0
This repository has been archived on 2024-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
Super-Mario-Sunshine-C-Kit/sms.c

45 lines
1.2 KiB
C
Raw Normal View History

2016-07-08 08:58:43 +09:00
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdarg.h>
#include <string.h>
#include "sms.h"
static J2DTextBox textbox;
2016-07-08 08:58:43 +09:00
int OnUpdate(MarDirector* director) {
int (*GameUpdate)(MarDirector* director) = GetObjectFunction(director, Director_GameUpdate);
2016-07-08 08:58:43 +09:00
//Update
2016-07-08 08:58:43 +09:00
return GameUpdate(director);
}
void OnDraw2D(J2DOrthoGraph* graphics)
{
Vector mariopos = **gpMarioPos;
int state = GetMarioStatus();
snprintf(J2DTextBox_GetStringPtr(&textbox), 128, "Mario X: %f\nMario Y: %f\nMario Z: %f\nMario State: %X\nNext Stage: %d-%d",
mariopos.x, mariopos.y, mariopos.z, state, *ChangeScenario, *ChangeEpisode);
2016-07-08 08:58:43 +09:00
J2DGrafContext_Setup2D((J2DGrafContext*)graphics); //Run replaced branch
2016-07-08 08:58:43 +09:00
J2DScreen_Draw((J2DScreen*)&textbox, 0, 0, (J2DGrafContext*)graphics, 0x81);
//GXSetScissor(0, 0, 0x0280, 0x01c0);
2016-07-08 08:58:43 +09:00
}
void OnSetup(MarDirector* director)
{
JUTRect rect;
MarDirector_SetupObjects(director); //Run replaced branch
JUTRect_Set(&rect, 0, 0, 512, 512);
2016-07-08 08:58:43 +09:00
//textbox = (J2DTextBox*)malloc(sizeof(J2DTextBox));
J2DTextBox_Create(&textbox, 0, &rect, GameFont, GameStrTable, 2, 0);
char* info;
2016-07-08 08:58:43 +09:00
info = (char*)malloc(128);
J2DTextBox_SetString(&textbox, info);
2016-07-08 08:58:43 +09:00
}