Implements the minimap display system. More...
Functions | |
| void | Minimap_Start () |
| [Start] Initializes the minimap system | |
| void | Minimap_Render () |
| [Render] Renders the minimap to the screen | |
| void | Minimap_RenderChunk (EnvironmentChunk *chunk) |
| [Render] Renders a specific chunk on the minimap | |
| void | Minimap_RenderChunkRoom (EnvironmentChunk *chunk) |
| [Render] Renders a room on the minimap | |
| void | Minimap_RenderChunkHallways (EnvironmentChunk *chunk) |
| [Render] Renders hallways for a chunk on the minimap | |
| SDL_Color | Minimap_GetRoomColor (EnvironmentChunk *chunk) |
| [Utility] Determines the color of a room on the minimap | |
| Vec2 | Minimap_GetMinimapChunkPosition (EnvironmentChunk *chunk) |
| [Utility] Converts chunk position to minimap screen position | |
| RoomHallways | Minimap_GetHallways (EnvironmentChunk *chunk) |
| [Utility] Gets the visible hallway connections for a chunk | |
| bool | Minimap_ChunkIsVisible (EnvironmentChunk *chunk) |
| [Utility] Determines if a chunk should be visible on the minimap | |
Variables | |
| SDL_Rect | minimapPosition = {0, 0, 0, 0} |
| Position and size of the minimap on screen. | |
| SDL_Texture * | playerIndicator = NULL |
Implements the minimap display system.
Provides a visual representation of the map layout, player position, and discovered areas during gameplay.
| bool Minimap_ChunkIsVisible | ( | EnvironmentChunk * | chunk | ) |
[Utility] Determines if a chunk should be visible on the minimap
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 | ) |
[Utility] Gets the visible hallway connections for a chunk
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 | ) |
[Utility] Converts chunk position to minimap screen position
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 | ) |
[Utility] Determines the color of a room on the minimap
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] Renders the 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] Renders a specific chunk on the minimap
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] Renders hallways for a chunk on the minimap
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] Renders a room on the minimap
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 | ( | ) |
[Start] Initializes the minimap system
Initialize the minimap system.
Sets up the minimap's position on screen and loads the player indicator texture.
| SDL_Rect minimapPosition = {0, 0, 0, 0} |
Position and size of the minimap on screen.
| SDL_Texture* playerIndicator = NULL |