Make Gamestates use thisx for entry point functions (#437)

* fix colliderinit typo

* fix initchain

* reloc

* thisx

* sample

* review

* forgot sample main
This commit is contained in:
fig02
2020-10-11 21:52:50 -04:00
committed by GitHub
parent b010db7c19
commit ed719f3da0
7 changed files with 74 additions and 54 deletions
+7 -3
View File
@@ -38,12 +38,14 @@ void Sample_Draw(SampleContext* this) {
CLOSE_DISPS(gfxCtx, "../z_sample.c", 111);
}
void Sample_Main(SampleContext* this) {
void Sample_Main(GameState* thisx) {
SampleContext* this = (SampleContext*)thisx;
Sample_Draw(this);
Sample_HandleStateChange(this);
}
void Sample_Destroy(SampleContext* this) {
void Sample_Destroy(GameState* thisx) {
}
void Sample_SetupView(SampleContext* this) {
@@ -83,7 +85,9 @@ void Sample_LoadTitleStatic(SampleContext* this) {
DmaMgr_SendRequest1(this->staticSegment, _title_staticSegmentRomStart, size, "../z_sample.c", 164);
}
void Sample_Init(SampleContext* this) {
void Sample_Init(GameState* thisx) {
SampleContext* this = (SampleContext*)thisx;
this->state.main = Sample_Main;
this->state.destroy = Sample_Destroy;
R_UPDATE_RATE = 1;