Minimap functionality for the game's navigation system. More...
#include <maps.h>Go to the source code of this file.
Macros | |
| #define | MINIMAP_SIZE 100 |
| Size of the minimap in pixels. | |
| #define | MINIMAP_CHUNK_SIZE 10 |
| Size of a chunk on the minimap in pixels. | |
| #define | MINIMAP_CHUNK_ROOM_SIZE 6 |
| Size of a room within a chunk on the minimap in pixels. | |
| #define | MINIMAP_CHUNK_HALLWAY_SIZE 2 |
| Size of hallways on the minimap in pixels. | |
| #define | MINIMAP_MARGIN ((MINIMAP_SIZE - (MINIMAP_CHUNK_SIZE * MAP_SIZE_CHUNK))) |
| Margin around the minimap. | |
| #define | MINIMAP_ROOM_COLOR 255, 255, 255, 255 |
| Color for regular rooms (R,G,B,A) | |
| #define | MINIMAP_ENEMY_ROOM_COLOR 255, 0, 0, 255 |
| Color for enemy rooms (R,G,B,A) | |
| #define | MINIMAP_SPECIAL_ROOM_COLOR 252, 130, 0, 255 |
| Color for special rooms (R,G,B,A) | |
| #define | MINIMAP_START_ROOM_COLOR 0, 255, 0, 255 |
| Color for the starting room (R,G,B,A) | |
| #define | MINIMAP_END_ROOM_COLOR 0, 0, 255, 255 |
| Color for the ending room (R,G,B,A) | |
| #define | MINIMAP_PLAYER_COLOR 158, 158, 158, 255 |
| Color for player indicator on minimap (R,G,B,A) | |
Functions | |
| void | Minimap_Start () |
| Initialize the minimap system. | |
| void | Minimap_Render () |
| Render the complete minimap to the screen. | |
| void | Minimap_RenderChunk (EnvironmentChunk *chunk) |
| Render a specific chunk on the minimap. | |
| RoomHallways | Minimap_GetHallways (EnvironmentChunk *chunk) |
| Get the hallways connected to a specific chunk. | |
| void | Minimap_RenderChunkRoom (EnvironmentChunk *chunk) |
| Render a room within a chunk on the minimap. | |
| void | Minimap_RenderChunkHallways (EnvironmentChunk *chunk) |
| Render hallways for a chunk on the minimap. | |
| SDL_Color | Minimap_GetRoomColor (EnvironmentChunk *chunk) |
| Determine the appropriate color for a room based on its type. | |
| Vec2 | Minimap_GetMinimapChunkPosition (EnvironmentChunk *chunk) |
| Calculate the position of a chunk on the minimap. | |
| bool | Minimap_ChunkIsVisible (EnvironmentChunk *chunk) |
| Check if a chunk should be visible on the minimap. | |
Variables | |
| SDL_Rect | minimapPosition |
| Position and size of the minimap on screen. | |
Minimap functionality for the game's navigation system.
| #define MINIMAP_CHUNK_HALLWAY_SIZE 2 |
Size of hallways on the minimap in pixels.
| #define MINIMAP_CHUNK_ROOM_SIZE 6 |
Size of a room within a chunk on the minimap in pixels.
| #define MINIMAP_CHUNK_SIZE 10 |
Size of a chunk on the minimap in pixels.
| #define MINIMAP_END_ROOM_COLOR 0, 0, 255, 255 |
Color for the ending room (R,G,B,A)
| #define MINIMAP_ENEMY_ROOM_COLOR 255, 0, 0, 255 |
Color for enemy rooms (R,G,B,A)
| #define MINIMAP_MARGIN ((MINIMAP_SIZE - (MINIMAP_CHUNK_SIZE * MAP_SIZE_CHUNK))) |
Margin around the minimap.
| #define MINIMAP_PLAYER_COLOR 158, 158, 158, 255 |
Color for player indicator on minimap (R,G,B,A)
| #define MINIMAP_ROOM_COLOR 255, 255, 255, 255 |
Color for regular rooms (R,G,B,A)
| #define MINIMAP_SIZE 100 |
Size of the minimap in pixels.
| #define MINIMAP_SPECIAL_ROOM_COLOR 252, 130, 0, 255 |
Color for special rooms (R,G,B,A)
| #define MINIMAP_START_ROOM_COLOR 0, 255, 0, 255 |
Color for the starting room (R,G,B,A)
| bool Minimap_ChunkIsVisible | ( | EnvironmentChunk * | chunk | ) |
Check if a chunk should be visible on the minimap.
| chunk | Pointer to the chunk to check |
Check if a chunk should be visible on the minimap.
A chunk is visible if it's discovered or adjacent to a discovered chunk.
| chunk | Pointer to the chunk to check |
| RoomHallways Minimap_GetHallways | ( | EnvironmentChunk * | chunk | ) |
Get the hallways connected to a specific chunk.
| chunk | Pointer to the chunk to analyze |
Get the hallways connected to a specific chunk.
Determines which hallways should be drawn on the minimap based on the visibility of adjacent chunks.
| chunk | Pointer to the chunk |
| Vec2 Minimap_GetMinimapChunkPosition | ( | EnvironmentChunk * | chunk | ) |
Calculate the position of a chunk on the minimap.
| chunk | Pointer to the chunk |
Calculate the position of a chunk on the minimap.
Calculates the screen coordinates for a chunk on the minimap.
| chunk | Pointer to the chunk |
| SDL_Color Minimap_GetRoomColor | ( | EnvironmentChunk * | chunk | ) |
Determine the appropriate color for a room based on its type.
| chunk | Pointer to the chunk containing the room |
Determine the appropriate color for a room based on its type.
Returns a color based on the room type and state, such as whether it contains enemies or is a special room type.
| chunk | Pointer to the chunk containing the room |
| void Minimap_Render | ( | ) |
Render the complete minimap to the screen.
Render the complete minimap to the screen.
Draws the background and all visible chunks on the minimap, representing the explored and visible parts of the game world.
| void Minimap_RenderChunk | ( | EnvironmentChunk * | chunk | ) |
Render a specific chunk on the minimap.
| chunk | Pointer to the environment chunk to render |
Render a specific chunk on the minimap.
Renders both the room and hallways of a chunk on the minimap if they're visible.
| chunk | Pointer to the chunk to render |
| void Minimap_RenderChunkHallways | ( | EnvironmentChunk * | chunk | ) |
Render hallways for a chunk on the minimap.
| chunk | Pointer to the chunk whose hallways should be rendered |
Render hallways for a chunk on the minimap.
Draws the hallway connections from a room to adjacent rooms in each valid direction.
| chunk | Pointer to the chunk containing the hallways |
| void Minimap_RenderChunkRoom | ( | EnvironmentChunk * | chunk | ) |
Render a room within a chunk on the minimap.
| chunk | Pointer to the chunk containing the room |
Render a room within a chunk on the minimap.
Draws a room with appropriate colors based on its type and adds a player indicator if the player is in this room.
| chunk | Pointer to the chunk containing the room |
| void Minimap_Start | ( | ) |
Initialize the minimap system.
Sets up the initial state of the minimap
Initialize the minimap system.
Sets up the minimap's position on screen and loads the player indicator texture.
|
extern |
Position and size of the minimap on screen.