From b094335404446183954eb1ccaba33f5f4888eacf Mon Sep 17 00:00:00 2001 From: XaviDCR92 Date: Tue, 2 Jan 2018 06:43:54 +0100 Subject: * Aircraft.c: taxiing speed has been doubled. * Game.c: GameRenderLevel() renamed to GameRenderTerrain(). * Game.c: GameRenderTerrainPrecalculations() has been created to perform some calculations which are stored in tables to be then looked up by GameRenderTerrain(). This should save us some calculation time during rendering process. * Camera.c: added new CameraApplyCoordinatesToCartesianPos() prototype. * GameGui.c: AircraftDataGPoly4 RGB data is now only calculated on startup. --- Source/GameStructures.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'Source/GameStructures.h') diff --git a/Source/GameStructures.h b/Source/GameStructures.h index 115255f..17fee7a 100644 --- a/Source/GameStructures.h +++ b/Source/GameStructures.h @@ -9,6 +9,7 @@ #define GAME_MAX_CHARACTERS 8 #define GAME_MAX_PARKING 32 #define GAME_MAX_RWY_LENGTH 16 +#define GAME_MAX_MAP_SIZE 0x400 #define CHEAT_ARRAY_SIZE 16 #define AIRCRAFT_MAX_TARGETS 48 #define PLAYER_MAX_WAYPOINTS AIRCRAFT_MAX_TARGETS @@ -78,6 +79,15 @@ typedef struct t_cartpos short y; }TYPE_CARTESIAN_POS; +typedef struct t_tileData +{ + bool ShowTile; + TYPE_CARTESIAN_POS CartPos; + unsigned char r; + unsigned char g; + unsigned char b; +}TYPE_TILE_DATA; + typedef struct t_flightData { FL_DIR FlightDirection[GAME_MAX_AIRCRAFT]; @@ -192,14 +202,20 @@ typedef struct uint8_t UnboardingSequenceIdx; // Show passengers left uint8_t PassengersLeftSelectedAircraft; + // Lookup tables defined on GameRenderTerrainPrecalculations() to be later used on + // GameRenderTerrain(). + TYPE_TILE_DATA TileData[GAME_MAX_MAP_SIZE]; + // Player camera instance. + TYPE_CAMERA Camera; + // Array of tiles which will change their RGB values when displayed under certain player states. + uint16_t RwyArray[GAME_MAX_RWY_LENGTH]; + // Pad callbacks. bool (*PadKeyPressed_Callback)(unsigned short); bool (*PadKeyReleased_Callback)(unsigned short); bool (*PadKeySinglePress_Callback)(unsigned short); bool (*PadDirectionKeyPressed_Callback)(void); unsigned short (*PadLastKeySinglePressed_Callback)(void); - TYPE_CAMERA Camera; - uint16_t RwyArray[GAME_MAX_RWY_LENGTH]; }TYPE_PLAYER; typedef enum t_fontflags -- cgit v1.2.3