From 78a032a6d955a22a092f6f72c1046f92976f5437 Mon Sep 17 00:00:00 2001 From: Trevor Boddy Date: Wed, 17 Aug 2022 09:05:08 -0400 Subject: [PATCH] bit of refactoring from the airport --- src/foreground.h | 20 ++++++++++++-------- src/start.h | 12 +++++++----- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/foreground.h b/src/foreground.h index 95b68b4..2753e82 100644 --- a/src/foreground.h +++ b/src/foreground.h @@ -52,15 +52,19 @@ static void spawnObstacle(bool top){ obstacles[i].size.y = FIX16(32); obstacles[i].startX = OBS_X; if(top){ - VDP_drawImageEx(BG_B, &rock1lt, TILE_ATTR_FULL(PAL2, 1, 0, 0, FG_I + 32), OBS_X, OBS_CEIL_Y - 2, 0, DMA); - VDP_drawImageEx(BG_B, &rock1t, TILE_ATTR_FULL(PAL2, 1, 0, 0, FG_I + 48), OBS_X + 2, OBS_CEIL_Y, 0, DMA); - VDP_drawImageEx(BG_B, &rock1rt, TILE_ATTR_FULL(PAL2, 1, 0, 0, FG_I + 64), OBS_X + 2 + 4, OBS_CEIL_Y - 2, 0, DMA); - VDP_drawImageEx(BG_B, &rock1b, TILE_ATTR_FULL(PAL2, 1, 0, 0, FG_I + 80), OBS_X + 2, OBS_CEIL_Y - 4, 0, DMA); + for(u8 j = 0; j < 4; j++){ + VDP_drawImageEx(BG_B, + j == 0 ? &rock1lt : (j == 1 ? &rock1t : (j == 2 ? &rock1rt : &rock1b)), + TILE_ATTR_FULL(PAL2, 1, 0, 0, FG_I + (j == 0 ? 32 : (j == 1 ? 48 : (j == 2 ? 64 : 80)))), + OBS_X + (j == 1 || j == 3 ? 2 : (j == 2 ? 6 : 0)), + OBS_CEIL_Y - (j == 0 || j == 2 ? 2 : (j == 3 ? 4 : 0)), + 0, DMA_QUEUE); + } } else { - VDP_drawImageEx(BG_B, &rock1l, TILE_ATTR_FULL(PAL2, 1, 0, 0, FG_I + 32 + 80), OBS_X, OBS_FLOOR_Y, 0, DMA); - VDP_drawImageEx(BG_B, &rock1, TILE_ATTR_FULL(PAL2, 1, 0, 0, FG_I + 48 + 80), OBS_X + 2, OBS_FLOOR_Y, 0, DMA); - VDP_drawImageEx(BG_B, &rock1r, TILE_ATTR_FULL(PAL2, 1, 0, 0, FG_I + 64 + 80), OBS_X + 2 + 4, OBS_FLOOR_Y, 0, DMA); - VDP_drawImageEx(BG_B, &rock1b, TILE_ATTR_FULL(PAL2, 1, 0, 0, FG_I + 80), OBS_X + 2, OBS_FLOOR_Y + 4, 0, DMA); + VDP_drawImageEx(BG_B, &rock1l, TILE_ATTR_FULL(PAL2, 1, 0, 0, FG_I + 32 + 80), OBS_X, OBS_FLOOR_Y, 0, DMA_QUEUE); + VDP_drawImageEx(BG_B, &rock1, TILE_ATTR_FULL(PAL2, 1, 0, 0, FG_I + 48 + 80), OBS_X + 2, OBS_FLOOR_Y, 0, DMA_QUEUE); + VDP_drawImageEx(BG_B, &rock1r, TILE_ATTR_FULL(PAL2, 1, 0, 0, FG_I + 64 + 80), OBS_X + 2 + 4, OBS_FLOOR_Y, 0, DMA_QUEUE); + VDP_drawImageEx(BG_B, &rock1b, TILE_ATTR_FULL(PAL2, 1, 0, 0, FG_I + 80), OBS_X + 2, OBS_FLOOR_Y + 4, 0, DMA_QUEUE); } } } diff --git a/src/start.h b/src/start.h index 4497daa..e0576cc 100644 --- a/src/start.h +++ b/src/start.h @@ -58,12 +58,14 @@ void loadStart(){ VDP_setScreenWidth256(); currentStartMenu = 0; VDP_loadTileSet(startBg1.tileset, START_I, DMA); - drawStartBg(); - drawStartLogo(); - drawStartMenu(); - VDP_drawText("VER 0.1", 1, 26); - // loadGameFromStart(); + // drawStartBg(); + // drawStartLogo(); + // drawStartMenu(); + // VDP_drawText("VER 0.1", 1, 26); + + loadGameFromStart(); + } void updateStart(){