diff options
| author | Roman971 <32455037+Roman971@users.noreply.github.com> | 2020-08-30 01:00:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-29 19:00:17 -0400 |
| commit | 2a2fdf7f3edea4b6ce575eb675e8c3a967371b7c (patch) | |
| tree | ca122e1f3122649cdadc97906b9e636f04813784 /src/code/speed_meter.c | |
| parent | 1f1b5e39f5235fcebc517fd8f932079bcd921653 (diff) | |
Introduce OPEN_DISPS/CLOSE_DISPS macros (#360)
Diffstat (limited to 'src/code/speed_meter.c')
| -rw-r--r-- | src/code/speed_meter.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/code/speed_meter.c b/src/code/speed_meter.c index 18672eb77..24b4e8d65 100644 --- a/src/code/speed_meter.c +++ b/src/code/speed_meter.c @@ -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); } } |
