1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-16 21:05:12 +00:00

Introduce OPEN_DISPS/CLOSE_DISPS macros (#360)

This commit is contained in:
Roman971 2020-08-30 01:00:17 +02:00 committed by GitHub
parent 1f1b5e39f5
commit 2a2fdf7f3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
134 changed files with 3133 additions and 3775 deletions

View file

@ -52,14 +52,13 @@ void SpeedMeter_DrawTimeEntries(SpeedMeter* this, GraphicsContext* gfxCtx) {
View view;
u32 pad2[3];
Gfx* gfx;
Gfx* dispRefs[5];
uly = this->y;
lry = this->y + 2;
Graph_OpenDisps(dispRefs, gfxCtx, "../speed_meter.c", 225);
OPEN_DISPS(gfxCtx, "../speed_meter.c", 225);
/*! @bug if gIrqMgrRetraceTime is 0, the function won't call Graph_CloseDisps */
/*! @bug if gIrqMgrRetraceTime is 0, CLOSE_DISPS will never be reached */
if (gIrqMgrRetraceTime == 0) {
return;
}
@ -76,7 +75,7 @@ void SpeedMeter_DrawTimeEntries(SpeedMeter* this, GraphicsContext* gfxCtx) {
SET_FULLSCREEN_VIEWPORT(&view);
gfx = gfxCtx->overlay.p;
gfx = oGfxCtx->overlay.p;
func_800AB9EC(&view, 0xF, &gfx);
gDPPipeSync(gfx++);
@ -98,8 +97,9 @@ void SpeedMeter_DrawTimeEntries(SpeedMeter* this, GraphicsContext* gfxCtx) {
}
gDPPipeSync(gfx++);
gfxCtx->overlay.p = gfx;
Graph_CloseDisps(dispRefs, gfxCtx, "../speed_meter.c", 276);
oGfxCtx->overlay.p = gfx;
CLOSE_DISPS(gfxCtx, "../speed_meter.c", 276);
}
void SpeedMeter_InitAllocEntry(SpeedMeterAllocEntry* this, u32 maxval, u32 val, u16 backColor, u16 foreColor, u32 ulx,
@ -118,21 +118,20 @@ void SpeedMeter_DrawAllocEntry(SpeedMeterAllocEntry* this, GraphicsContext* gfxC
s32 usedOff;
View view;
Gfx* gfx;
Gfx* dispRefs[5];
if (this->maxval == 0) {
osSyncPrintf(VT_FGCOL(RED));
LOG_NUM("this->maxval", this->maxval, "../speed_meter.c", 313);
osSyncPrintf(VT_RST);
} else {
Graph_OpenDisps(dispRefs, gfxCtx, "../speed_meter.c", 318);
OPEN_DISPS(gfxCtx, "../speed_meter.c", 318);
View_Init(&view, gfxCtx);
view.flags = 0xA;
SET_FULLSCREEN_VIEWPORT(&view);
gfx = gfxCtx->overlay.p;
gfx = oGfxCtx->overlay.p;
func_800AB9EC(&view, 0xF, &gfx);
gDPPipeSync(gfx++);
@ -147,8 +146,8 @@ void SpeedMeter_DrawAllocEntry(SpeedMeterAllocEntry* this, GraphicsContext* gfxC
gDPPipeSync(gfx++);
gfxCtx->overlay.p = gfx;
Graph_CloseDisps(dispRefs, gfxCtx, "../speed_meter.c", 339);
oGfxCtx->overlay.p = gfx;
CLOSE_DISPS(gfxCtx, "../speed_meter.c", 339);
}
}