|
Trace Engine
A Raycaster Engine in C
|
Functions | |
| int | real_pos_to_map_pos (const trc_grid_position_t real_pos) |
| trc_world_position_t | to_world_pos (const trc_grid_position_t grid_pos) |
| trc_grid_position_t | to_grid_pos (const trc_world_position_t world_pos) |
| trc_world_position_t | map_pos_to_real_pos (const trc_world_position_t map_pos) |
| void | change_to_map (const int level_idx) |
| void | update_map_wall_at (const trc_grid_position_t position, const structures_t new_wall) |
| structures_t | get_map_wall_at (const trc_grid_position_t position) |
| structures_t | get_map_floor_at (const trc_grid_position_t position) |
| structures_t | get_map_ceiling_at (const trc_grid_position_t position) |
| int | get_map_offset_from_id (const int level_idx) |
| trc_world_position_t | get_map_size_from_id (const int level_idx) |
| trc_world_position_t | get_camera_spwan_from_id (const int level_idx) |
| void | draw_map_2D (void) |
| void change_to_map | ( | const int | level_idx | ) |
Updates the current map info to the map of the level_idx level
| void draw_map_2D | ( | void | ) |
Draw in the screen a 2D matrix of squares, white being wall and blakc being floor
| trc_world_position_t get_camera_spwan_from_id | ( | const int | level_idx | ) |
Returns the player spawn point of the level_idx level, in the form of a trc_world_position_t
| level_idx | The index of the level to get (from 0 to LEVEL_COUNT) |
| structures_t get_map_ceiling_at | ( | const trc_grid_position_t | position | ) |
Returnss the ceiling structure of the current map at the given position
| structures_t get_map_floor_at | ( | const trc_grid_position_t | position | ) |
Returnss the floor structure of the current map at the given position
| int get_map_offset_from_id | ( | const int | level_idx | ) |
Returns the level offset for the maps list, to get the map of that level
| level_idx | The index of the level to get (from 0 to LEVEL_COUNT) |
| trc_world_position_t get_map_size_from_id | ( | const int | level_idx | ) |
Returns the map size of the level_idx level, in the form of a trc_world_position_t, where x and y are the dimensions
| level_idx | The index of the level to get (from 0 to LEVEL_COUNT) |
| structures_t get_map_wall_at | ( | const trc_grid_position_t | position | ) |
Returns the wall structure of the current map at the given position
| trc_world_position_t map_pos_to_real_pos | ( | const trc_world_position_t | map_pos | ) |
Returns the windows position for the middle of the map square
| int real_pos_to_map_pos | ( | const trc_grid_position_t | real_pos | ) |
Calculates the grid position for the given grid position
| trc_grid_position_t to_grid_pos | ( | const trc_world_position_t | world_pos | ) |
Given a trc_grid_position_t (with floats) returns the corresponding cell position in the current map
| trc_world_position_t to_world_pos | ( | const trc_grid_position_t | grid_pos | ) |
Given a position in a grid (with integers) returns the trc_grid_position_t with the values pointing to the same cell in the map (in the center of the cell, to be precise)
| void update_map_wall_at | ( | const trc_grid_position_t | position, |
| const structures_t | new_wall | ||
| ) |
Replaces the wall structure of the current map at the given position with the given new_wall