2025-01-14 13:59:44 +01:00
|
|
|
#ifndef _LCR_GENERAL_H
|
|
|
|
#define _LCR_GENERAL_H
|
2023-08-03 21:12:23 +02:00
|
|
|
|
2025-01-14 13:59:44 +01:00
|
|
|
/**
|
|
|
|
General resources for all modules.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2023-09-17 13:21:19 +02:00
|
|
|
#include "settings.h"
|
|
|
|
|
2025-01-15 23:24:07 +01:00
|
|
|
// TODO: maybe move module specific constants to the modules themselves?
|
|
|
|
|
2025-01-14 13:59:44 +01:00
|
|
|
// constants (not supposed to be changed, doing so may break stuff):
|
|
|
|
|
2023-09-11 20:56:04 +02:00
|
|
|
#define LCR_EFFECTIVE_RESOLUTION_X \
|
|
|
|
(LCR_SETTING_RESOLUTION_X / LCR_SETTING_RESOLUTION_SUBDIVIDE)
|
|
|
|
|
|
|
|
#define LCR_EFFECTIVE_RESOLUTION_Y \
|
|
|
|
(LCR_SETTING_RESOLUTION_Y / LCR_SETTING_RESOLUTION_SUBDIVIDE)
|
|
|
|
|
2023-09-17 13:21:19 +02:00
|
|
|
#define LCR_FREE_CAMERA_STEP \
|
|
|
|
(LCR_SETTING_FREE_CAMERA_SPEED / LCR_SETTING_FPS)
|
|
|
|
|
2024-08-29 15:38:44 +02:00
|
|
|
#if LCR_FREE_CAMERA_STEP == 0
|
|
|
|
#define LCR_FREE_CAMERA_STEP 1
|
|
|
|
#endif
|
|
|
|
|
2023-09-17 15:42:46 +02:00
|
|
|
#define LCR_FREE_CAMERA_TURN_STEP \
|
|
|
|
(LCR_SETTING_FREE_CAMERA_TURN_SPEED / LCR_SETTING_FPS)
|
|
|
|
|
2024-07-24 20:28:57 +02:00
|
|
|
#define LCR_MAP_SIZE_BLOCKS 64
|
|
|
|
|
2024-09-05 22:51:11 +02:00
|
|
|
/** Physics FPS, i.e. the number of physics ticks per second. */
|
2024-09-20 15:22:18 +02:00
|
|
|
#define LCR_RACING_FPS 30
|
2024-09-05 22:51:11 +02:00
|
|
|
|
2025-01-15 23:24:07 +01:00
|
|
|
#define LCR_RACING_TICK_MS \
|
|
|
|
(100000 / (LCR_RACING_FPS * LCR_SETTING_TIME_MULTIPLIER))
|
2024-09-05 22:51:11 +02:00
|
|
|
|
2024-09-01 16:10:15 +02:00
|
|
|
#define LCR_ANIMATE_CAR (LCR_SETTING_CAR_ANIMATION_SUBDIVIDE != 0)
|
|
|
|
|
2023-08-03 21:12:23 +02:00
|
|
|
/** Maximum number of triangles of a block shape. */
|
2024-07-23 19:57:29 +02:00
|
|
|
#define LCR_MAP_BLOCK_SHAPE_MAX_BYTES 80
|
2023-08-03 21:12:23 +02:00
|
|
|
|
2024-12-17 00:56:51 +01:00
|
|
|
#define LCR_FONT_PIXEL_SIZE (1 + LCR_EFFECTIVE_RESOLUTION_X / 512)
|
|
|
|
|
2024-12-30 00:49:41 +01:00
|
|
|
#define LCR_RESOURCE_FILE_SEPARATOR '#'
|
|
|
|
#define LCR_RESOURCE_FILE_SEPARATOR2 ';'
|
|
|
|
|
2025-01-08 21:28:01 +01:00
|
|
|
#define LCR_MENU_MAX_ITEMS 9 // don't change
|
|
|
|
#define LCR_RESOURCE_ITEM_CHUNK (LCR_MENU_MAX_ITEMS - 1)
|
|
|
|
#define LCR_MENU_TABS 4
|
|
|
|
#define LCR_MENU_STRING_SIZE 16
|
|
|
|
|
2025-01-14 13:59:44 +01:00
|
|
|
char _LCR_hexDigit(int i)
|
|
|
|
{
|
|
|
|
return i < 10 ? '0' + i : ('a' - 10 + i);
|
|
|
|
}
|
|
|
|
|
2025-01-15 23:08:31 +01:00
|
|
|
int _LCR_hexDigitVal(char c)
|
|
|
|
{
|
|
|
|
if (c >= '0' && c <= '9')
|
|
|
|
return c - '0';
|
|
|
|
|
|
|
|
if (c >= 'a' && c <= 'f')
|
|
|
|
return c - 'a' + 10;
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2025-01-14 13:59:44 +01:00
|
|
|
#endif // guard
|