aboutsummaryrefslogtreecommitdiff
path: root/Source/Game.c
diff options
context:
space:
mode:
authorXavier ASUS <xavi92psx@gmail.com>2018-11-29 01:29:43 +0100
committerXavier ASUS <xavi92psx@gmail.com>2018-11-29 01:29:43 +0100
commit26bfe68b0964bf5cc94da480749cc580c9c99e78 (patch)
tree843d54d6c3bc1709297929c95b778d0dfab320d4 /Source/Game.c
parent41df9924d450f04ab2d80d5a755dcbdf8bdb8271 (diff)
downloadairport-26bfe68b0964bf5cc94da480749cc580c9c99e78.tar.gz
Blue background dimensions are now limited to drawing enviroment's.
Fixed X position for "Remaining aircraft" and "Next aircraft" messages in GameGui.c
Diffstat (limited to 'Source/Game.c')
-rw-r--r--Source/Game.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/Source/Game.c b/Source/Game.c
index d208dce..54c40ce 100644
--- a/Source/Game.c
+++ b/Source/Game.c
@@ -172,7 +172,7 @@ static void GameMinimumSpawnTimeout(void);
static void GameRenderBuildingAircraft(TYPE_PLAYER* const ptrPlayer);
static void GameGetAircraftTilemap(const uint8_t i);
static bool GameWaypointCheckExisting(TYPE_PLAYER* const ptrPlayer, uint16_t temp_tile);
-static void GameDrawBackground(TYPE_PLAYER* const ptrPlayer);
+static void GameDrawBackground(void);
static DIRECTION GameGetRunwayDirection(uint16_t rwyHeader);
static DIRECTION GameGetParkingDirection(uint16_t parkingTile);
@@ -940,8 +940,7 @@ void GameGraphics(void)
// the whole screen as usual.
// Render background first.
-
- GameDrawBackground(ptrPlayer);
+ GameDrawBackground();
// Then ground tiles must be rendered.
@@ -962,8 +961,8 @@ void GameGraphics(void)
if (split_screen)
{
- //~ GfxDrawScene_NoSwap();
- //~ while (GsIsDrawing());
+ GfxDrawScene_NoSwap();
+ while (GsIsDrawing());
}
}
}
@@ -985,7 +984,7 @@ void GameGraphics(void)
if (split_screen)
{
- //~ GfxDrawScene_NoSwap();
+ GfxDrawScene_NoSwap();
}
GfxDrawScene();
@@ -1005,7 +1004,7 @@ void GameGraphics(void)
*
* *******************************************************************/
-void GameDrawBackground(TYPE_PLAYER* const ptrPlayer)
+static void GameDrawBackground(void)
{
enum
{
@@ -1026,17 +1025,13 @@ void GameDrawBackground(TYPE_PLAYER* const ptrPlayer)
BG_POLY4_B3 = 80
};
- static const GsGPoly4 BgPoly4 =
+ static GsGPoly4 BgPoly4 =
{
.x[0] = 0,
- .x[1] = X_SCREEN_RESOLUTION,
.x[2] = 0,
- .x[3] = X_SCREEN_RESOLUTION,
.y[0] = 0,
.y[1] = 0,
- .y[2] = Y_SCREEN_RESOLUTION,
- .y[3] = Y_SCREEN_RESOLUTION,
.r[0] = BG_POLY4_R0,
.g[0] = BG_POLY4_G0,
@@ -1055,6 +1050,12 @@ void GameDrawBackground(TYPE_PLAYER* const ptrPlayer)
.b[3] = BG_POLY4_B3
};
+ BgPoly4.x[1] = GfxGetDrawEnvWidth();
+ BgPoly4.x[3] = BgPoly4.x[1];
+
+ BgPoly4.y[2] = GfxGetDrawEnvHeight();
+ BgPoly4.y[3] = BgPoly4.y[2];
+
GsSortGPoly4((GsGPoly4*)&BgPoly4);
}