Add module names
This commit is contained in:
parent
0bbbc26f2a
commit
eb640d27a1
7 changed files with 73 additions and 6 deletions
6
assets.h
6
assets.h
|
@ -23,6 +23,12 @@
|
||||||
#include "general.h"
|
#include "general.h"
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
|
|
||||||
|
#ifdef LCR_MODULE_NAME
|
||||||
|
#undef LCR_MODULE_NAME
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define LCR_MODULE_NAME "asset"
|
||||||
|
|
||||||
static const char *LCR_texts[] =
|
static const char *LCR_texts[] =
|
||||||
{
|
{
|
||||||
#define LCR_TEXTS_VERSION 0
|
#define LCR_TEXTS_VERSION 0
|
||||||
|
|
6
audio.h
6
audio.h
|
@ -12,6 +12,12 @@
|
||||||
are generated procedurally.
|
are generated procedurally.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef LCR_MODULE_NAME
|
||||||
|
#undef LCR_MODULE_NAME
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define LCR_MODULE_NAME "audio"
|
||||||
|
|
||||||
#define LCR_SOUND_NONE 0
|
#define LCR_SOUND_NONE 0
|
||||||
#define LCR_SOUND_CLICK 1
|
#define LCR_SOUND_CLICK 1
|
||||||
#define LCR_SOUND_CRASH_SMALL 2
|
#define LCR_SOUND_CRASH_SMALL 2
|
||||||
|
|
18
game.h
18
game.h
|
@ -203,6 +203,8 @@ uint8_t LCR_gameGetNextAudioSample(void);
|
||||||
#define LCR_LOG1_NUM(x) ;
|
#define LCR_LOG1_NUM(x) ;
|
||||||
#define LCR_LOG2_NUM(x) ;
|
#define LCR_LOG2_NUM(x) ;
|
||||||
|
|
||||||
|
#define LCR_MODULE_NAME "game"
|
||||||
|
|
||||||
#if LCR_SETTING_LOG_LEVEL > 0
|
#if LCR_SETTING_LOG_LEVEL > 0
|
||||||
|
|
||||||
void _LCR_logNum(uint32_t n)
|
void _LCR_logNum(uint32_t n)
|
||||||
|
@ -223,19 +225,19 @@ void _LCR_logNum(uint32_t n)
|
||||||
|
|
||||||
#undef LCR_LOG0
|
#undef LCR_LOG0
|
||||||
#undef LCR_LOG0_NUM
|
#undef LCR_LOG0_NUM
|
||||||
#define LCR_LOG0(s) LCR_log(s);
|
#define LCR_LOG0(s) LCR_log("[" LCR_MODULE_NAME "] " s);
|
||||||
#define LCR_LOG0_NUM(x) _LCR_logNum(x);
|
#define LCR_LOG0_NUM(x) _LCR_logNum(x);
|
||||||
|
|
||||||
#if LCR_SETTING_LOG_LEVEL > 1
|
#if LCR_SETTING_LOG_LEVEL > 1
|
||||||
#undef LCR_LOG1
|
#undef LCR_LOG1
|
||||||
#undef LCR_LOG1_NUM
|
#undef LCR_LOG1_NUM
|
||||||
#define LCR_LOG1(s) LCR_log(s);
|
#define LCR_LOG1(s) LCR_log("[" LCR_MODULE_NAME "] " s);
|
||||||
#define LCR_LOG1_NUM(x) _LCR_logNum(x);
|
#define LCR_LOG1_NUM(x) _LCR_logNum(x);
|
||||||
|
|
||||||
#if LCR_SETTING_LOG_LEVEL > 2
|
#if LCR_SETTING_LOG_LEVEL > 2
|
||||||
#undef LCR_LOG2
|
#undef LCR_LOG2
|
||||||
#undef LCR_LOG2_NUM
|
#undef LCR_LOG2_NUM
|
||||||
#define LCR_LOG2(s) LCR_log(s);
|
#define LCR_LOG2(s) LCR_log("[" LCR_MODULE_NAME "] " s);
|
||||||
#define LCR_LOG2_NUM(x) _LCR_logNum(x);
|
#define LCR_LOG2_NUM(x) _LCR_logNum(x);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -285,6 +287,12 @@ static inline void LCR_gameDrawPixelXYSafe(unsigned int x, unsigned int y,
|
||||||
#include "assets.h"
|
#include "assets.h"
|
||||||
#include "renderer.h"
|
#include "renderer.h"
|
||||||
|
|
||||||
|
#ifdef LCR_MODULE_NAME
|
||||||
|
#undef LCR_MODULE_NAME
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define LCR_MODULE_NAME "game"
|
||||||
|
|
||||||
#define LCR_MENU_MAX_ITEMS 9 // don't change
|
#define LCR_MENU_MAX_ITEMS 9 // don't change
|
||||||
#define LCR_DATA_ITEM_CHUNK (LCR_MENU_MAX_ITEMS - 1)
|
#define LCR_DATA_ITEM_CHUNK (LCR_MENU_MAX_ITEMS - 1)
|
||||||
#define LCR_MENU_TABS 4
|
#define LCR_MENU_TABS 4
|
||||||
|
@ -470,7 +478,8 @@ static inline void LCR_gameDrawPixelXYSafe(unsigned int x, unsigned int y,
|
||||||
|
|
||||||
void LCR_gameSetState(uint8_t state)
|
void LCR_gameSetState(uint8_t state)
|
||||||
{
|
{
|
||||||
LCR_LOG1("changing state");
|
LCR_LOG1("changing state to:");
|
||||||
|
LCR_LOG1_NUM(state);
|
||||||
LCR_game.statePrev = LCR_game.state;
|
LCR_game.statePrev = LCR_game.state;
|
||||||
LCR_game.state = state;
|
LCR_game.state = state;
|
||||||
LCR_game.stateStartTime = LCR_game.time;
|
LCR_game.stateStartTime = LCR_game.time;
|
||||||
|
@ -1848,4 +1857,5 @@ uint8_t LCR_gameGetNextAudioSample(void)
|
||||||
return LCR_audioGetNextSample();
|
return LCR_audioGetNextSample();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef LCR_MODULE_NAME
|
||||||
#endif // guard
|
#endif // guard
|
||||||
|
|
27
general.h
27
general.h
|
@ -11,6 +11,32 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
|
#define _LCR_MODULE_NAME "general"
|
||||||
|
|
||||||
|
#ifndef LCR_LOG0
|
||||||
|
#define LCR_LOG0(s) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef LCR_LOG1
|
||||||
|
#define LCR_LOG1(s) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef LCR_LOG2
|
||||||
|
#define LCR_LOG2(s) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef LCR_LOG0_NUM
|
||||||
|
#define LCR_LOG0_NUM(x) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef LCR_LOG1
|
||||||
|
#define LCR_LOG1_NUM(x) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef LCR_LOG2
|
||||||
|
#define LCR_LOG2_NUM(x) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
// constants (not supposed to be changed, doing so may break stuff):
|
// constants (not supposed to be changed, doing so may break stuff):
|
||||||
|
|
||||||
#define LCR_EFFECTIVE_RESOLUTION_X \
|
#define LCR_EFFECTIVE_RESOLUTION_X \
|
||||||
|
@ -95,4 +121,5 @@ char _LCR_triangleWinding(int x0, int y0, int x1, int y1, int x2, int y2)
|
||||||
return x0 != 0 ? (x0 > 0 ? 1 : -1) : 0;
|
return x0 != 0 ? (x0 > 0 ? 1 : -1) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef _LCR_MODULE_NAME
|
||||||
#endif // guard
|
#endif // guard
|
||||||
|
|
6
map.h
6
map.h
|
@ -59,6 +59,12 @@
|
||||||
|
|
||||||
#include "general.h"
|
#include "general.h"
|
||||||
|
|
||||||
|
#ifdef LCR_MODULE_NAME
|
||||||
|
#undef LCR_MODULE_NAME
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define LCR_MODULE_NAME "map"
|
||||||
|
|
||||||
#define LCR_MAP_NAME_MAX_LEN 15 /**< Maximum map name length (without
|
#define LCR_MAP_NAME_MAX_LEN 15 /**< Maximum map name length (without
|
||||||
terminating zero. */
|
terminating zero. */
|
||||||
#define LCR_BLOCK_START_CHAR ':'
|
#define LCR_BLOCK_START_CHAR ':'
|
||||||
|
|
6
racing.h
6
racing.h
|
@ -75,6 +75,12 @@ typedef int32_t LCR_GameUnit; ///< abstract game unit
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include "tinyphysicsengine.h"
|
#include "tinyphysicsengine.h"
|
||||||
|
|
||||||
|
#ifdef LCR_MODULE_NAME
|
||||||
|
#undef LCR_MODULE_NAME
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define LCR_MODULE_NAME "race"
|
||||||
|
|
||||||
#define LCR_GRAVITY (LCR_PHYSICS_UNIT / 160)
|
#define LCR_GRAVITY (LCR_PHYSICS_UNIT / 160)
|
||||||
#define LCR_FAN_FORCE 4
|
#define LCR_FAN_FORCE 4
|
||||||
#define LCR_FAN_FORCE_DECREASE 6
|
#define LCR_FAN_FORCE_DECREASE 6
|
||||||
|
|
|
@ -46,6 +46,12 @@
|
||||||
#define S3L_NEAR (10 * (S3L_F / 16)) // too low value will cause overflows
|
#define S3L_NEAR (10 * (S3L_F / 16)) // too low value will cause overflows
|
||||||
#include "small3dlib.h"
|
#include "small3dlib.h"
|
||||||
|
|
||||||
|
#ifdef LCR_MODULE_NAME
|
||||||
|
#undef LCR_MODULE_NAME
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define LCR_MODULE_NAME "rend"
|
||||||
|
|
||||||
/// Renderer specific unit, length of one map square.
|
/// Renderer specific unit, length of one map square.
|
||||||
#define LCR_RENDERER_UNIT (S3L_F)
|
#define LCR_RENDERER_UNIT (S3L_F)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue