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
miluaces 646811b83c Updated library and linker with more functions
Added tools to patch Start.dol
Added more examples
2016-09-25 11:50:37 -07:00

43 lines
No EOL
1.2 KiB
C

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdarg.h>
#include <string.h>
#include "sms.h"
static J2DTextBox textbox;
static char* info;
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(info, 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);
J2DTextBox_SetString(&textbox, info);
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);
info = (char*)malloc(128);
}