Compare commits
5 Commits
26cc567b7f
...
b17c521dfd
Author | SHA1 | Date |
---|---|---|
|
b17c521dfd | |
|
d9b69aa09d | |
|
d660b4e5a5 | |
|
4ede1abcc1 | |
|
716393e9f4 |
|
@ -93,8 +93,9 @@ Texture2D* add_texture_rres(Assets_t* assets, const char* name, const char* file
|
||||||
Texture2D* out_tex = NULL;
|
Texture2D* out_tex = NULL;
|
||||||
if (chunk.info.baseSize > 0)
|
if (chunk.info.baseSize > 0)
|
||||||
{
|
{
|
||||||
|
uint32_t sz = chunk.info.baseSize - sizeof(int) - (chunk.data.propCount*sizeof(int));
|
||||||
//Expect RAW type of png extension
|
//Expect RAW type of png extension
|
||||||
Image image = LoadImageFromMemory(GetFileExtension(filename), chunk.data.raw, chunk.info.baseSize);
|
Image image = LoadImageFromMemory(GetFileExtension(filename), chunk.data.raw, sz);
|
||||||
Texture2D tex = LoadTextureFromImage(image);
|
Texture2D tex = LoadTextureFromImage(image);
|
||||||
UnloadImage(image);
|
UnloadImage(image);
|
||||||
|
|
||||||
|
@ -108,6 +109,32 @@ Texture2D* add_texture_rres(Assets_t* assets, const char* name, const char* file
|
||||||
return out_tex;
|
return out_tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Sound* add_sound_rres(Assets_t* assets, const char* name, const char* filename, const RresFileInfo_t* rres_file)
|
||||||
|
{
|
||||||
|
uint8_t snd_idx = n_loaded[2];
|
||||||
|
assert(snd_idx < MAX_SOUNDS);
|
||||||
|
|
||||||
|
int res_id = rresGetResourceId(rres_file->dir, filename);
|
||||||
|
rresResourceChunk chunk = rresLoadResourceChunk(rres_file->fname, res_id);
|
||||||
|
|
||||||
|
Sound* out_snd = NULL;
|
||||||
|
if (chunk.info.baseSize > 0)
|
||||||
|
{
|
||||||
|
uint32_t sz = chunk.info.baseSize - sizeof(int) - (chunk.data.propCount*sizeof(int));
|
||||||
|
Wave wave = LoadWaveFromMemory(GetFileExtension(filename), chunk.data.raw, sz);
|
||||||
|
Sound snd = LoadSoundFromWave(wave);
|
||||||
|
UnloadWave(wave);
|
||||||
|
|
||||||
|
sfx[snd_idx].sound = snd;
|
||||||
|
strncpy(sfx[snd_idx].name, name, MAX_NAME_LEN);
|
||||||
|
sc_map_put_s64(&assets->m_sounds, sfx[snd_idx].name, snd_idx);
|
||||||
|
n_loaded[2]++;
|
||||||
|
out_snd = &sfx[snd_idx].sound;
|
||||||
|
}
|
||||||
|
rresUnloadResourceChunk(chunk);
|
||||||
|
return out_snd;
|
||||||
|
}
|
||||||
|
|
||||||
Sprite_t* add_sprite(Assets_t* assets, const char* name, Texture2D* texture)
|
Sprite_t* add_sprite(Assets_t* assets, const char* name, Texture2D* texture)
|
||||||
{
|
{
|
||||||
uint8_t spr_idx = n_loaded[1];
|
uint8_t spr_idx = n_loaded[1];
|
||||||
|
@ -183,7 +210,7 @@ LevelPack_t* add_level_pack(Assets_t* assets, const char* name, const char* path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static LevelPack_t* add_level_pack_zst(Assets_t* assets, const char* name, FILE* file)
|
static LevelPack_t* add_level_pack_zst(Assets_t* assets, const char* name, const uint8_t* zst_buffer, uint32_t len)
|
||||||
{
|
{
|
||||||
LevelPackData_t* pack_info = levelpacks + n_loaded[4];
|
LevelPackData_t* pack_info = levelpacks + n_loaded[4];
|
||||||
size_t read = 0;
|
size_t read = 0;
|
||||||
|
@ -197,8 +224,14 @@ static LevelPack_t* add_level_pack_zst(Assets_t* assets, const char* name, FILE*
|
||||||
if (input.pos == input.size)
|
if (input.pos == input.size)
|
||||||
{
|
{
|
||||||
puts("Read more");
|
puts("Read more");
|
||||||
read = fread(level_decompressor.in_buffer, 1, DECOMPRESSOR_INBUF_LEN, file);
|
|
||||||
|
read = (len < DECOMPRESSOR_INBUF_LEN) ? len : DECOMPRESSOR_INBUF_LEN;
|
||||||
|
memcpy(level_decompressor.in_buffer, zst_buffer, read);
|
||||||
|
zst_buffer += read;
|
||||||
|
len -= read;
|
||||||
|
|
||||||
if (read == 0) break;
|
if (read == 0) break;
|
||||||
|
|
||||||
input.size = read;
|
input.size = read;
|
||||||
input.pos = 0;
|
input.pos = 0;
|
||||||
}
|
}
|
||||||
|
@ -234,7 +267,11 @@ static LevelPack_t* add_level_pack_zst(Assets_t* assets, const char* name, FILE*
|
||||||
{
|
{
|
||||||
if (input.pos == input.size)
|
if (input.pos == input.size)
|
||||||
{
|
{
|
||||||
read = fread(level_decompressor.in_buffer, 1, DECOMPRESSOR_INBUF_LEN, file);
|
read = (len < DECOMPRESSOR_INBUF_LEN) ? len : DECOMPRESSOR_INBUF_LEN;
|
||||||
|
memcpy(level_decompressor.in_buffer, zst_buffer, read);
|
||||||
|
zst_buffer += read;
|
||||||
|
len -= read;
|
||||||
|
|
||||||
if (read == 0) break;
|
if (read == 0) break;
|
||||||
input.size = read;
|
input.size = read;
|
||||||
input.pos = 0;
|
input.pos = 0;
|
||||||
|
@ -273,7 +310,11 @@ static LevelPack_t* add_level_pack_zst(Assets_t* assets, const char* name, FILE*
|
||||||
{
|
{
|
||||||
if (input.pos == input.size)
|
if (input.pos == input.size)
|
||||||
{
|
{
|
||||||
read = fread(level_decompressor.in_buffer, 1, DECOMPRESSOR_INBUF_LEN, file);
|
read = (len < DECOMPRESSOR_INBUF_LEN) ? len : DECOMPRESSOR_INBUF_LEN;
|
||||||
|
memcpy(level_decompressor.in_buffer, zst_buffer, read);
|
||||||
|
zst_buffer += read;
|
||||||
|
len -= read;
|
||||||
|
|
||||||
if (read == 0) break;
|
if (read == 0) break;
|
||||||
input.size = read;
|
input.size = read;
|
||||||
input.pos = 0;
|
input.pos = 0;
|
||||||
|
@ -322,9 +363,22 @@ LevelPack_t* uncompress_level_pack(Assets_t* assets, const char* name, const cha
|
||||||
FILE* file = fopen(path, "rb");
|
FILE* file = fopen(path, "rb");
|
||||||
if (file == NULL) return NULL;
|
if (file == NULL) return NULL;
|
||||||
|
|
||||||
LevelPack_t* pack = add_level_pack_zst(assets, name, file);
|
fseek(file, 0L, SEEK_END);
|
||||||
|
uint32_t sz = ftell(file);
|
||||||
|
|
||||||
|
rewind(file);
|
||||||
|
uint8_t* zst_buffer = malloc(sz);
|
||||||
|
if (zst_buffer == NULL)
|
||||||
|
{
|
||||||
|
fclose(file);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
fread(zst_buffer, 1, sz, file);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|
||||||
|
LevelPack_t* pack = add_level_pack_zst(assets, name, zst_buffer, sz);
|
||||||
|
free(zst_buffer);
|
||||||
|
|
||||||
return pack;
|
return pack;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -337,9 +391,8 @@ LevelPack_t* add_level_pack_rres(Assets_t* assets, const char* name, const char*
|
||||||
LevelPack_t* pack = NULL;
|
LevelPack_t* pack = NULL;
|
||||||
if (chunk.info.baseSize > 0 && strcmp(".lpk", (const char*)(chunk.data.props + 1)) == 0)
|
if (chunk.info.baseSize > 0 && strcmp(".lpk", (const char*)(chunk.data.props + 1)) == 0)
|
||||||
{
|
{
|
||||||
FILE* f_in = fmemopen(chunk.data.raw, chunk.info.baseSize, "rb");
|
uint32_t sz = chunk.info.baseSize - sizeof(int) - (chunk.data.propCount*sizeof(int));
|
||||||
pack = add_level_pack_zst(assets, name, f_in);
|
pack = add_level_pack_zst(assets, name, chunk.data.raw, sz);
|
||||||
fclose(f_in);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,6 +57,7 @@ LevelPack_t* uncompress_level_pack(Assets_t* assets, const char* name, const cha
|
||||||
// Rres version
|
// Rres version
|
||||||
Texture2D* add_texture_rres(Assets_t* assets, const char* name, const char* filename, const RresFileInfo_t* rres_file);
|
Texture2D* add_texture_rres(Assets_t* assets, const char* name, const char* filename, const RresFileInfo_t* rres_file);
|
||||||
LevelPack_t* add_level_pack_rres(Assets_t* assets, const char* name, const char* filename, const RresFileInfo_t* rres_file);
|
LevelPack_t* add_level_pack_rres(Assets_t* assets, const char* name, const char* filename, const RresFileInfo_t* rres_file);
|
||||||
|
Sound* add_sound_rres(Assets_t* assets, const char* name, const char* filename, const RresFileInfo_t* rres_file);
|
||||||
|
|
||||||
Sprite_t* add_sprite(Assets_t* assets, const char* name, Texture2D* texture);
|
Sprite_t* add_sprite(Assets_t* assets, const char* name, Texture2D* texture);
|
||||||
EmitterConfig_t* add_emitter_conf(Assets_t* assets, const char* name);
|
EmitterConfig_t* add_emitter_conf(Assets_t* assets, const char* name);
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
void init_engine(GameEngine_t* engine)
|
void init_engine(GameEngine_t* engine)
|
||||||
{
|
{
|
||||||
|
InitAudioDevice();
|
||||||
sc_queue_init(&engine->key_buffer);
|
sc_queue_init(&engine->key_buffer);
|
||||||
engine->sfx_list.n_sfx = N_SFX;
|
engine->sfx_list.n_sfx = N_SFX;
|
||||||
memset(engine->sfx_list.sfx, 0, engine->sfx_list.n_sfx * sizeof(SFX_t));
|
memset(engine->sfx_list.sfx, 0, engine->sfx_list.n_sfx * sizeof(SFX_t));
|
||||||
|
@ -15,6 +16,7 @@ void deinit_engine(GameEngine_t* engine)
|
||||||
term_assets(&engine->assets);
|
term_assets(&engine->assets);
|
||||||
free_memory_pools();
|
free_memory_pools();
|
||||||
sc_queue_term(&engine->key_buffer);
|
sc_queue_term(&engine->key_buffer);
|
||||||
|
CloseAudioDevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
void process_inputs(GameEngine_t* engine, Scene_t* scene)
|
void process_inputs(GameEngine_t* engine, Scene_t* scene)
|
||||||
|
|
|
@ -20,6 +20,7 @@ void init_particle_system(ParticleSystem_t* system)
|
||||||
void play_particle_emitter(ParticleSystem_t* system, const ParticleEmitter_t* in_emitter)
|
void play_particle_emitter(ParticleSystem_t* system, const ParticleEmitter_t* in_emitter)
|
||||||
{
|
{
|
||||||
if (in_emitter == NULL) return;
|
if (in_emitter == NULL) return;
|
||||||
|
if (in_emitter->config == NULL) return;
|
||||||
|
|
||||||
if (sc_queue_empty(&system->free_list)) return;
|
if (sc_queue_empty(&system->free_list)) return;
|
||||||
uint32_t idx = sc_queue_del_first(&system->free_list);
|
uint32_t idx = sc_queue_del_first(&system->free_list);
|
||||||
|
|
11
main.c
11
main.c
|
@ -28,7 +28,7 @@ int main(void)
|
||||||
InitWindow(screenWidth, screenHeight, "raylib");
|
InitWindow(screenWidth, screenHeight, "raylib");
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
load_from_infofile("res/assets_debug.info", &engine.assets);
|
load_from_infofile("res/assets.info.raw", &engine.assets);
|
||||||
init_player_creation("res/player_spr.info", &engine.assets);
|
init_player_creation("res/player_spr.info", &engine.assets);
|
||||||
#else
|
#else
|
||||||
load_from_rres("res/myresources.rres", &engine.assets);
|
load_from_rres("res/myresources.rres", &engine.assets);
|
||||||
|
@ -36,6 +36,12 @@ int main(void)
|
||||||
#endif
|
#endif
|
||||||
init_item_creation(&engine.assets);
|
init_item_creation(&engine.assets);
|
||||||
|
|
||||||
|
load_sfx(&engine, "snd_jump", PLAYER_JMP_SFX);
|
||||||
|
load_sfx(&engine, "snd_land", PLAYER_LAND_SFX);
|
||||||
|
load_sfx(&engine, "snd_wdrop", WATER_IN_SFX);
|
||||||
|
load_sfx(&engine, "snd_bland", BOULDER_LAND_SFX);
|
||||||
|
load_sfx(&engine, "snd_bubble", BUBBLE_SFX);
|
||||||
|
|
||||||
LevelScene_t sandbox_scene;
|
LevelScene_t sandbox_scene;
|
||||||
sandbox_scene.scene.engine = &engine;
|
sandbox_scene.scene.engine = &engine;
|
||||||
init_sandbox_scene(&sandbox_scene);
|
init_sandbox_scene(&sandbox_scene);
|
||||||
|
@ -82,6 +88,7 @@ int main(void)
|
||||||
update_entity_manager(&curr_scene->ent_manager);
|
update_entity_manager(&curr_scene->ent_manager);
|
||||||
// This is needed to advance time delta
|
// This is needed to advance time delta
|
||||||
render_scene(curr_scene);
|
render_scene(curr_scene);
|
||||||
|
update_sfx_list(&engine);
|
||||||
|
|
||||||
if (curr_scene->state != SCENE_PLAYING)
|
if (curr_scene->state != SCENE_PLAYING)
|
||||||
{
|
{
|
||||||
|
@ -92,6 +99,6 @@ int main(void)
|
||||||
free_sandbox_scene(&sandbox_scene);
|
free_sandbox_scene(&sandbox_scene);
|
||||||
free_game_scene(&level_scene);
|
free_game_scene(&level_scene);
|
||||||
free_menu_scene(&menu_scene);
|
free_menu_scene(&menu_scene);
|
||||||
CloseWindow();
|
|
||||||
deinit_engine(&engine);
|
deinit_engine(&engine);
|
||||||
|
CloseWindow();
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,6 +230,7 @@ typedef enum AssetInfoType
|
||||||
TEXTURE_INFO,
|
TEXTURE_INFO,
|
||||||
SPRITE_INFO,
|
SPRITE_INFO,
|
||||||
LEVELPACK_INFO,
|
LEVELPACK_INFO,
|
||||||
|
SOUND_INFO,
|
||||||
INVALID_INFO
|
INVALID_INFO
|
||||||
}AssetInfoType_t;
|
}AssetInfoType_t;
|
||||||
|
|
||||||
|
@ -250,7 +251,7 @@ int main(void)
|
||||||
.reserved = 0 // <reserved>
|
.reserved = 0 // <reserved>
|
||||||
};
|
};
|
||||||
|
|
||||||
#define STARTING_CHUNKS 8
|
#define STARTING_CHUNKS 64
|
||||||
// Central Directory
|
// Central Directory
|
||||||
rresCentralDir central = {
|
rresCentralDir central = {
|
||||||
.count = 0,
|
.count = 0,
|
||||||
|
@ -307,6 +308,10 @@ int main(void)
|
||||||
{
|
{
|
||||||
info_type = LEVELPACK_INFO;
|
info_type = LEVELPACK_INFO;
|
||||||
}
|
}
|
||||||
|
else if (strcmp(tmp, "Sound") == 0)
|
||||||
|
{
|
||||||
|
info_type = SOUND_INFO;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
info_type = INVALID_INFO;
|
info_type = INVALID_INFO;
|
||||||
|
@ -337,6 +342,21 @@ int main(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SOUND_INFO:
|
||||||
|
{
|
||||||
|
// ---- OGG Sound
|
||||||
|
if (
|
||||||
|
addRawData(
|
||||||
|
&header, info_str,
|
||||||
|
rresFile, ".ogg",
|
||||||
|
central.entries + central.count
|
||||||
|
)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
central.count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case LEVELPACK_INFO:
|
case LEVELPACK_INFO:
|
||||||
{
|
{
|
||||||
// ---- Compressed Level Data
|
// ---- Compressed Level Data
|
||||||
|
|
|
@ -32,7 +32,6 @@ int main(void)
|
||||||
{
|
{
|
||||||
InitWindow(1280, 640, "raylib");
|
InitWindow(1280, 640, "raylib");
|
||||||
SetTargetFPS(60);
|
SetTargetFPS(60);
|
||||||
InitAudioDevice();
|
|
||||||
init_engine(&engine);
|
init_engine(&engine);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
|
|
@ -57,6 +57,21 @@ static bool parse_emitter_info(char* emitter_info_str, EmitterConfig_t* conf)
|
||||||
return data_count == 8;
|
return data_count == 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline AssetInfoType_t get_asset_type(const char* str)
|
||||||
|
{
|
||||||
|
if (strcmp(str, "Texture") == 0) return TEXTURE_INFO;
|
||||||
|
|
||||||
|
if (strcmp(str, "Sprite") == 0) return SPRITE_INFO;
|
||||||
|
|
||||||
|
if (strcmp(str, "Sound") == 0) return SOUND_INFO;
|
||||||
|
|
||||||
|
if (strcmp(str, "Emitter") == 0) return EMITTER_INFO;
|
||||||
|
|
||||||
|
if (strcmp(str, "LevelPack") == 0) return LEVELPACK_INFO;
|
||||||
|
|
||||||
|
return INVALID_INFO;
|
||||||
|
}
|
||||||
|
|
||||||
bool load_from_rres(const char* file, Assets_t* assets)
|
bool load_from_rres(const char* file, Assets_t* assets)
|
||||||
{
|
{
|
||||||
RresFileInfo_t rres_file;
|
RresFileInfo_t rres_file;
|
||||||
|
@ -91,22 +106,7 @@ bool load_from_rres(const char* file, Assets_t* assets)
|
||||||
if (tmp[0] == '-')
|
if (tmp[0] == '-')
|
||||||
{
|
{
|
||||||
tmp++;
|
tmp++;
|
||||||
if (strcmp(tmp, "Texture") == 0)
|
info_type = get_asset_type(tmp);
|
||||||
{
|
|
||||||
info_type = TEXTURE_INFO;
|
|
||||||
}
|
|
||||||
else if (strcmp(tmp, "Sprite") == 0)
|
|
||||||
{
|
|
||||||
info_type = SPRITE_INFO;
|
|
||||||
}
|
|
||||||
else if (strcmp(tmp, "LevelPack") == 0)
|
|
||||||
{
|
|
||||||
info_type = LEVELPACK_INFO;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
info_type = INVALID_INFO;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -141,6 +141,16 @@ bool load_from_rres(const char* file, Assets_t* assets)
|
||||||
printf("Added level pack %s as %s\n", info_str, name);
|
printf("Added level pack %s as %s\n", info_str, name);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SOUND_INFO:
|
||||||
|
{
|
||||||
|
if (add_sound_rres(assets, name, info_str, &rres_file) == NULL)
|
||||||
|
{
|
||||||
|
printf("Unable to add sound at line %lu\n", line_num);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
printf("Added sound %s as %s\n", info_str, name);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case SPRITE_INFO:
|
case SPRITE_INFO:
|
||||||
{
|
{
|
||||||
SpriteInfo_t spr_info = {0};
|
SpriteInfo_t spr_info = {0};
|
||||||
|
@ -164,6 +174,19 @@ bool load_from_rres(const char* file, Assets_t* assets)
|
||||||
spr->speed = spr_info.speed;
|
spr->speed = spr_info.speed;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case EMITTER_INFO:
|
||||||
|
{
|
||||||
|
EmitterConfig_t parsed_conf;
|
||||||
|
if (!parse_emitter_info(info_str, &parsed_conf))
|
||||||
|
{
|
||||||
|
printf("Parse error for emitter %s", name);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
EmitterConfig_t* conf = add_emitter_conf(assets, name);
|
||||||
|
*conf = parsed_conf;
|
||||||
|
printf("Added Emitter %s\n", name);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -201,30 +224,7 @@ bool load_from_infofile(const char* file, Assets_t* assets)
|
||||||
if (tmp[0] == '-')
|
if (tmp[0] == '-')
|
||||||
{
|
{
|
||||||
tmp++;
|
tmp++;
|
||||||
if (strcmp(tmp, "Texture") == 0)
|
info_type = get_asset_type(tmp);
|
||||||
{
|
|
||||||
info_type = TEXTURE_INFO;
|
|
||||||
}
|
|
||||||
else if (strcmp(tmp, "Sprite") == 0)
|
|
||||||
{
|
|
||||||
info_type = SPRITE_INFO;
|
|
||||||
}
|
|
||||||
else if (strcmp(tmp, "Sound") == 0)
|
|
||||||
{
|
|
||||||
info_type = SOUND_INFO;
|
|
||||||
}
|
|
||||||
else if (strcmp(tmp, "Emitter") == 0)
|
|
||||||
{
|
|
||||||
info_type = EMITTER_INFO;
|
|
||||||
}
|
|
||||||
else if (strcmp(tmp, "LevelPack") == 0)
|
|
||||||
{
|
|
||||||
info_type = LEVELPACK_INFO;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
info_type = INVALID_INFO;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,6 +28,17 @@ static void level_scene_render_func(Scene_t* scene)
|
||||||
WHITE
|
WHITE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Entity_t* p_ent;
|
||||||
|
sc_map_foreach_value(&scene->ent_manager.entities_map[PLAYER_ENT_TAG], p_ent)
|
||||||
|
{
|
||||||
|
CAirTimer_t* p_air = get_component(p_ent, CAIRTIMER_T);
|
||||||
|
Vector2 air_pos = {data->game_rec.x + data->game_rec.width - 16, data->game_rec.y + data->game_rec.height - 16};
|
||||||
|
for (uint8_t i = 0; i < p_air->curr_count; i++)
|
||||||
|
{
|
||||||
|
DrawCircleV(air_pos, 16, BLUE);
|
||||||
|
air_pos.x -= 32;
|
||||||
|
}
|
||||||
|
}
|
||||||
// For DEBUG
|
// For DEBUG
|
||||||
const int gui_x = data->game_rec.x + data->game_rec.width + 10;
|
const int gui_x = data->game_rec.x + data->game_rec.width + 10;
|
||||||
//sprintf(buffer, "Spawn Entity: %s", get_spawn_selection_string(current_spawn_selection));
|
//sprintf(buffer, "Spawn Entity: %s", get_spawn_selection_string(current_spawn_selection));
|
||||||
|
|
Loading…
Reference in New Issue