1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-21 14:31:17 +00:00

Use macros for oGfxCtx accesses (#465)

* fix colliderinit typo

* fix initchain

* reloc

* add defines

* add defines

* missed some on merge

* rename gfxCtx and add comment

* remove space
This commit is contained in:
fig02 2020-10-29 17:31:09 -04:00 committed by GitHub
parent 92bb1fb210
commit 3c5fe66dcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
195 changed files with 2236 additions and 2229 deletions

View file

@ -509,18 +509,18 @@ void Select_DrawMenu(SelectContext* this) {
OPEN_DISPS(gfxCtx, "../z_select.c", 930);
gSPSegment(oGfxCtx->polyOpa.p++, 0x00, NULL);
gSPSegment(POLY_OPA_DISP++, 0x00, NULL);
func_80095248(gfxCtx, 0, 0, 0);
SET_FULLSCREEN_VIEWPORT(&this->view);
func_800AAA50(&this->view, 0xF);
func_80094140(gfxCtx);
printer = alloca(sizeof(GfxPrint));
GfxPrint_Init(printer);
GfxPrint_Open(printer, oGfxCtx->polyOpa.p);
GfxPrint_Open(printer, POLY_OPA_DISP);
Select_PrintMenu(this, printer);
Select_PrintAgeSetting(this, printer, ((void)0, gSaveContext.linkAge));
Select_PrintCutsceneSetting(this, printer, ((void)0, gSaveContext.cutsceneIndex));
oGfxCtx->polyOpa.p = GfxPrint_Close(printer);
POLY_OPA_DISP = GfxPrint_Close(printer);
GfxPrint_Destroy(printer);
CLOSE_DISPS(gfxCtx, "../z_select.c", 966);
@ -532,16 +532,16 @@ void Select_DrawLoadingScreen(SelectContext* this) {
OPEN_DISPS(gfxCtx, "../z_select.c", 977);
gSPSegment(oGfxCtx->polyOpa.p++, 0x00, NULL);
gSPSegment(POLY_OPA_DISP++, 0x00, NULL);
func_80095248(gfxCtx, 0, 0, 0);
SET_FULLSCREEN_VIEWPORT(&this->view);
func_800AAA50(&this->view, 0xF);
func_80094140(gfxCtx);
printer = alloca(sizeof(GfxPrint));
GfxPrint_Init(printer);
GfxPrint_Open(printer, oGfxCtx->polyOpa.p);
GfxPrint_Open(printer, POLY_OPA_DISP);
Select_PrintLoadingMessage(this, printer);
oGfxCtx->polyOpa.p = GfxPrint_Close(printer);
POLY_OPA_DISP = GfxPrint_Close(printer);
GfxPrint_Destroy(printer);
CLOSE_DISPS(gfxCtx, "../z_select.c", 1006);
@ -552,7 +552,7 @@ void Select_Draw(SelectContext* this) {
OPEN_DISPS(gfxCtx, "../z_select.c", 1013);
gSPSegment(oGfxCtx->polyOpa.p++, 0x00, NULL);
gSPSegment(POLY_OPA_DISP++, 0x00, NULL);
func_80095248(gfxCtx, 0, 0, 0);
SET_FULLSCREEN_VIEWPORT(&this->view);
func_800AAA50(&this->view, 0xF);

View file

@ -86,34 +86,34 @@ void Title_Draw(TitleContext* this) {
v2.z = 1119.0837;
func_8002EABC(&v1, &v2, &v3, this->state.gfxCtx);
gSPSetLights1(oGfxCtx->polyOpa.p++, sTitleLights);
gSPSetLights1(POLY_OPA_DISP++, sTitleLights);
Title_SetupView(this, 0, 150.0, 300.0);
func_80093D18(this->state.gfxCtx);
Matrix_Translate(-53.0, -5.0, 0, MTXMODE_NEW);
Matrix_Scale(1.0, 1.0, 1.0, MTXMODE_APPLY);
Matrix_RotateRPY(0, sTitleRotY, 0, MTXMODE_APPLY);
gSPMatrix(oGfxCtx->polyOpa.p++, Matrix_NewMtx(this->state.gfxCtx, "../z_title.c", 424), G_MTX_LOAD);
gSPDisplayList(oGfxCtx->polyOpa.p++, &D_01002720);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(this->state.gfxCtx, "../z_title.c", 424), G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, &D_01002720);
func_800944C4(this->state.gfxCtx);
gDPPipeSync(oGfxCtx->polyOpa.p++);
gDPSetCycleType(oGfxCtx->polyOpa.p++, G_CYC_2CYCLE);
gDPSetRenderMode(oGfxCtx->polyOpa.p++, G_RM_XLU_SURF2, G_RM_OPA_CI | CVG_DST_WRAP);
gDPSetCombineLERP(oGfxCtx->polyOpa.p++, TEXEL1, PRIMITIVE, ENV_ALPHA, TEXEL0, 0, 0, 0, TEXEL0, PRIMITIVE,
gDPPipeSync(POLY_OPA_DISP++);
gDPSetCycleType(POLY_OPA_DISP++, G_CYC_2CYCLE);
gDPSetRenderMode(POLY_OPA_DISP++, G_RM_XLU_SURF2, G_RM_OPA_CI | CVG_DST_WRAP);
gDPSetCombineLERP(POLY_OPA_DISP++, TEXEL1, PRIMITIVE, ENV_ALPHA, TEXEL0, 0, 0, 0, TEXEL0, PRIMITIVE,
ENVIRONMENT, COMBINED, ENVIRONMENT, COMBINED, 0, PRIMITIVE, 0);
gDPSetPrimColor(oGfxCtx->polyOpa.p++, 0, 0, 170, 255, 255, 255);
gDPSetEnvColor(oGfxCtx->polyOpa.p++, 0, 0, 255, 128);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 170, 255, 255, 255);
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 255, 128);
gDPLoadMultiBlock(oGfxCtx->polyOpa.p++, &D_01001800, 0x100, 1, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0,
gDPLoadMultiBlock(POLY_OPA_DISP++, &D_01001800, 0x100, 1, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, 2, 11);
for (idx = 0, y = 94; idx < 16; idx++, y += 2) {
gDPLoadTextureBlock(oGfxCtx->polyOpa.p++, &D_01000000[0x180 * idx], G_IM_FMT_I, G_IM_SIZ_8b, 192, 2, 0,
gDPLoadTextureBlock(POLY_OPA_DISP++, &D_01000000[0x180 * idx], G_IM_FMT_I, G_IM_SIZ_8b, 192, 2, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
G_TX_NOLOD);
gDPSetTileSize(oGfxCtx->polyOpa.p++, 1, this->uls, (this->ult & 0x7F) - idx * 4, 0, 0);
gSPTextureRectangle(oGfxCtx->polyOpa.p++, 388, y << 2, 1156, (y + 2) << 2, G_TX_RENDERTILE, 0, 0, 1024, 1024);
gDPSetTileSize(POLY_OPA_DISP++, 1, this->uls, (this->ult & 0x7F) - idx * 4, 0, 0);
gSPTextureRectangle(POLY_OPA_DISP++, 388, y << 2, 1156, (y + 2) << 2, G_TX_RENDERTILE, 0, 0, 1024, 1024);
}
func_8007672C(this->state.gfxCtx, 0, 0, 0, (s16)this->coverAlpha, 2);
@ -128,18 +128,18 @@ void Title_Main(GameState* thisx) {
OPEN_DISPS(this->state.gfxCtx, "../z_title.c", 494);
gSPSegment(oGfxCtx->polyOpa.p++, 0, NULL);
gSPSegment(oGfxCtx->polyOpa.p++, 1, this->staticSegment);
gSPSegment(POLY_OPA_DISP++, 0, NULL);
gSPSegment(POLY_OPA_DISP++, 1, this->staticSegment);
func_80095248(this->state.gfxCtx, 0, 0, 0);
Title_Calc(this);
Title_Draw(this);
if (D_8012DBC0) {
Gfx* gfx = oGfxCtx->polyOpa.p;
Gfx* gfx = POLY_OPA_DISP;
s32 pad;
Title_PrintBuildInfo(&gfx);
oGfxCtx->polyOpa.p = gfx;
POLY_OPA_DISP = gfx;
}
if (this->exit) {