1
0
Fork 0

restored delted fork

This commit is contained in:
BitPatty 2017-02-23 10:07:39 +01:00
parent 646811b83c
commit 4c85e70462
2 changed files with 11 additions and 8 deletions

8
sms.c
View file

@ -6,7 +6,7 @@
#include "sms.h"
static J2DTextBox textbox;
static char* info;
int OnUpdate(MarDirector* director) {
int (*GameUpdate)(MarDirector* director) = GetObjectFunction(director, Director_GameUpdate);
@ -19,9 +19,8 @@ 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",
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);
J2DTextBox_SetString(&textbox, info);
J2DGrafContext_Setup2D((J2DGrafContext*)graphics); //Run replaced branch
@ -39,5 +38,8 @@ void OnSetup(MarDirector* director)
//textbox = (J2DTextBox*)malloc(sizeof(J2DTextBox));
J2DTextBox_Create(&textbox, 0, &rect, GameFont, GameStrTable, 2, 0);
char* info;
info = (char*)malloc(128);
J2DTextBox_SetString(&textbox, info);
}

11
sms2.c
View file

@ -13,7 +13,7 @@
/* This code is always running, and is constantly updating. */
J2DTextBox textbox;
char* info;
bool inAir;
int timesjumped;
@ -59,10 +59,7 @@ void OnDraw2D(J2DOrthoGraph* graphics)
/* Here are his states that we read.
If Mario is doing said action, the return should be 1.
*/
snprintf(info, 128, "Time x %d", time);
// now we set our string to a J2DTextBox
J2DTextBox_SetString(&textbox, info);
snprintf(J2DTextBox_GetStringPtr(&textbox), 128, "Time x %d", time);
//Run replaced branch
J2DGrafContext_Setup2D((J2DGrafContext*)graphics);
@ -93,6 +90,10 @@ void OnSetup(MarDirector* director)
//textbox = (J2DTextBox*)malloc(sizeof(J2DTextBox));
J2DTextBox_Create(&textbox, 0, &rect, GameFont, GameStrTable, 2, 0);
char* info;
info = (char*)malloc(128);
J2DTextBox_SetString(&textbox, info);
void (*TestNull)(void) = 0x80247fa4;
TestNull();