From 08d9fee6e4ccff113287758d71b07a0afde5592e Mon Sep 17 00:00:00 2001 From: Random <28494085+Random06457@users.noreply.github.com> Date: Wed, 13 May 2020 05:05:55 +0200 Subject: Decompile speed_meter.c and add VIEWPORT_INIT macro (#127) * Decompile speed_meter.c and add VIEWPORT_INIT macro - speed_meter.c: OK - Add VIEWPORT_INIT(viewport, by, rx, ty, lx) macro * get rid of some magic numbers * use early return instead of a big if block in SpeedMeter_DrawTimeEntries --- src/code/z_sample.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/code/z_sample.c') diff --git a/src/code/z_sample.c b/src/code/z_sample.c index 0f6f01e20..aa2bfb1bc 100644 --- a/src/code/z_sample.c +++ b/src/code/z_sample.c @@ -61,10 +61,7 @@ void Sample_SetupView(SampleContext* this) { gfxCtx = this->state.gfxCtx; View_Init(view, gfxCtx); - // clang-format off - viewport.bottomY = SCREEN_HEIGHT; viewport.rightX = SCREEN_WIDTH; - viewport.topY = 0; viewport.leftX = 0; - // clang-format on + VIEWPORT_INIT(viewport, SCREEN_HEIGHT, SCREEN_WIDTH, 0, 0); View_SetViewport(view, &viewport); func_800AA460(view, 60, 10, 12800); -- cgit v1.2.3