Cub3D
 
Loading...
Searching...
No Matches
Macros Functions

Macros used in the project. More...

Macros

#define PI   3.141592653589793238462643383279502884197169399375105820974944592307
 PI approximation.
 
#define MINIMAP_DEFAULT_VALUE   true
 Enable Minimap by default and can be toggled with the 'M' key.
 
#define FIELD_OF_VIEW_DEFAULT_VALUE   true
 Enable Field of View by default and can be toggled with the 'F' key.
 
#define COLLISION_DEFAULT_VALUE   true
 Enable Collision by default and can be toggled with the 'C' key.
 
#define ENABLE_FILTERS   true
 Enable Filters features.
 
#define MOUSE_SENSITIVITY_FACTOR   0.001f
 Value used to define the sensitivity of the mouse. This value is multiplied by the delta mouse x to get the turn amount. A higher value will make the mouse more sensitive and will turn faster. Anything higher or lower than 0.001f will be strange.
 
#define MOVEMENT_SPEED_TURNING   0.015f
 Value used to define the turning speed of the player. This value is multiplied by the input to get the turn amount. A higher value will make the player turn faster.
 
#define MOVEMENT_SPEED_FWD_BWD   0.025f
 Value used to define the movement speed of the player in forward or backward. This value is multiplied by the input to get the amount. A higher value will make the player walk faster.
 
#define MOVEMENT_SPEED_LEFT_RIGHT   0.015f
 Value used to define the movement speed of the player when moving left or right. This value is multiplied by the input to get the amount. A higher value will make the player walk faster.
 
#define MINIMAP_PLAYER_COLOR   0xffffff00
 
#define MINIMAP_PLAYER_LINE_SIGHT_COLOR   0xffffff00
 
#define MINIMAP_PLAYER_CONE_SIGHT_COLOR   0xffffaaaa
 
#define MINIMAP_FLOOR_COLOR   0xff000000
 
#define MINIMAP_WALL_COLOR   0xffffffff
 
#define MINIMAP_KEY_COLOR   0xffffff00
 
#define MINIMAP_DOOR_COLOR   0xff0000ff
 
#define MINIMAP_NUM_TILES_X   15
 Number of tiles on X axis.
 
#define MINIMAP_NUM_TILES_Y   15
 Number of tiles on Y axis.
 
#define MINIMAP_TILE_SIZE   16
 
#define MINIMAP_TILES_X   15
 
#define MINIMAP_TILES_Y   15
 
#define MINIMAP_PLAYER_SIZE   4
 
#define MINIMAP_LINE_OF_SIGHT_FACTOR   2
 
#define DEBUG_PRINT_KEYCODE   0
 Enable to print key presses.
 
#define DEBUG_PRINT_FPS   0
 Enable if you want to see the FPS.
 
#define DEBUG_FPS_REFRESH   0
 Enable to keep the FPS counter on a single line.
 
#define DEBUG_PRINT_TEXTURE_SWAP   0
 Enable printing of message to indicate texture swapping.
 
#define DEBUG_PRINT_TEXTURE_ALTERED   0
 Enable printing message when a texture is altered with filters.
 
#define CROSS_APPLY_SETTINGS   0
 Enable if closing the settings window should behave as 'Enter'.
 
#define ESCAPE_APPLY_SETTINGS   0
 Enable pressing Esc in the settings menu should behave as 'Enter'.
 

Detailed Description

Macros used in the project.

Macro Definition Documentation

◆ COLLISION_DEFAULT_VALUE

#define COLLISION_DEFAULT_VALUE   true

Enable Collision by default and can be toggled with the 'C' key.

◆ CROSS_APPLY_SETTINGS

#define CROSS_APPLY_SETTINGS   0

Enable if closing the settings window should behave as 'Enter'.

◆ DEBUG_FPS_REFRESH

#define DEBUG_FPS_REFRESH   0

Enable to keep the FPS counter on a single line.

Warning
if you use it with any of the other DEBUG, the output is undefined

◆ DEBUG_PRINT_FPS

#define DEBUG_PRINT_FPS   0

Enable if you want to see the FPS.

◆ DEBUG_PRINT_KEYCODE

#define DEBUG_PRINT_KEYCODE   0

Enable to print key presses.

◆ DEBUG_PRINT_TEXTURE_ALTERED

#define DEBUG_PRINT_TEXTURE_ALTERED   0

Enable printing message when a texture is altered with filters.

◆ DEBUG_PRINT_TEXTURE_SWAP

#define DEBUG_PRINT_TEXTURE_SWAP   0

Enable printing of message to indicate texture swapping.

◆ ENABLE_FILTERS

#define ENABLE_FILTERS   true

Enable Filters features.

◆ ESCAPE_APPLY_SETTINGS

#define ESCAPE_APPLY_SETTINGS   0

Enable pressing Esc in the settings menu should behave as 'Enter'.

◆ FIELD_OF_VIEW_DEFAULT_VALUE

#define FIELD_OF_VIEW_DEFAULT_VALUE   true

Enable Field of View by default and can be toggled with the 'F' key.

◆ MINIMAP_DEFAULT_VALUE

#define MINIMAP_DEFAULT_VALUE   true

Enable Minimap by default and can be toggled with the 'M' key.

◆ MINIMAP_DOOR_COLOR

#define MINIMAP_DOOR_COLOR   0xff0000ff

◆ MINIMAP_FLOOR_COLOR

#define MINIMAP_FLOOR_COLOR   0xff000000

◆ MINIMAP_KEY_COLOR

#define MINIMAP_KEY_COLOR   0xffffff00

◆ MINIMAP_LINE_OF_SIGHT_FACTOR

#define MINIMAP_LINE_OF_SIGHT_FACTOR   2

◆ MINIMAP_NUM_TILES_X

#define MINIMAP_NUM_TILES_X   15

Number of tiles on X axis.

◆ MINIMAP_NUM_TILES_Y

#define MINIMAP_NUM_TILES_Y   15

Number of tiles on Y axis.

◆ MINIMAP_PLAYER_COLOR

#define MINIMAP_PLAYER_COLOR   0xffffff00

◆ MINIMAP_PLAYER_CONE_SIGHT_COLOR

#define MINIMAP_PLAYER_CONE_SIGHT_COLOR   0xffffaaaa

◆ MINIMAP_PLAYER_LINE_SIGHT_COLOR

#define MINIMAP_PLAYER_LINE_SIGHT_COLOR   0xffffff00

◆ MINIMAP_PLAYER_SIZE

#define MINIMAP_PLAYER_SIZE   4

◆ MINIMAP_TILE_SIZE

#define MINIMAP_TILE_SIZE   16

◆ MINIMAP_TILES_X

#define MINIMAP_TILES_X   15

◆ MINIMAP_TILES_Y

#define MINIMAP_TILES_Y   15

◆ MINIMAP_WALL_COLOR

#define MINIMAP_WALL_COLOR   0xffffffff

◆ MOUSE_SENSITIVITY_FACTOR

#define MOUSE_SENSITIVITY_FACTOR   0.001f

Value used to define the sensitivity of the mouse. This value is multiplied by the delta mouse x to get the turn amount. A higher value will make the mouse more sensitive and will turn faster. Anything higher or lower than 0.001f will be strange.

◆ MOVEMENT_SPEED_FWD_BWD

#define MOVEMENT_SPEED_FWD_BWD   0.025f

Value used to define the movement speed of the player in forward or backward. This value is multiplied by the input to get the amount. A higher value will make the player walk faster.

◆ MOVEMENT_SPEED_LEFT_RIGHT

#define MOVEMENT_SPEED_LEFT_RIGHT   0.015f

Value used to define the movement speed of the player when moving left or right. This value is multiplied by the input to get the amount. A higher value will make the player walk faster.

◆ MOVEMENT_SPEED_TURNING

#define MOVEMENT_SPEED_TURNING   0.015f

Value used to define the turning speed of the player. This value is multiplied by the input to get the turn amount. A higher value will make the player turn faster.

◆ PI

#define PI   3.141592653589793238462643383279502884197169399375105820974944592307

PI approximation.