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/examples/Origin/sms.c
2017-02-23 18:10:27 +01:00

45 lines
No EOL
1.2 KiB
C

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdarg.h>
#include <string.h>
#include "inc/sms.h"
static J2DTextBox textbox;
int OnUpdate(MarDirector* director) {
int (*GameUpdate)(MarDirector* director) = GetObjectFunction(director, Director_GameUpdate);
//Update
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);
J2DGrafContext_Setup2D((J2DGrafContext*)graphics); //Run replaced branch
J2DScreen_Draw((J2DScreen*)&textbox, 0, 0, (J2DGrafContext*)graphics, 0x81);
//GXSetScissor(0, 0, 0x0280, 0x01c0);
}
void OnSetup(MarDirector* director)
{
JUTRect rect;
MarDirector_SetupObjects(director); //Run replaced branch
JUTRect_Set(&rect, 0, 0, 512, 512);
//textbox = (J2DTextBox*)malloc(sizeof(J2DTextBox));
J2DTextBox_Create(&textbox, 0, &rect, GameFont, GameStrTable, 2, 0);
char* info;
info = (char*)malloc(128);
J2DTextBox_SetString(&textbox, info);
}