implement game configuration file

this integrates https://github.com/cktan/tomlc99 into the repo as a dependency
This commit is contained in:
2024-09-30 21:13:58 -03:00
committed by veclavtalica
parent ec15d8ec4b
commit 57fe5e8946
165 changed files with 4797 additions and 92 deletions

View File

@ -8,6 +8,7 @@
#include "rendering/twn_rendering_c.h"
#include <SDL2/SDL.h>
#include <toml.h>
#include <stdbool.h>
#include <stdint.h>
@ -21,11 +22,24 @@ typedef struct EngineContext {
int argc;
char **argv;
struct Primitive2D *render_queue_2d;
/* configuration */
toml_table_t *config_table;
int64_t base_render_width;
int64_t base_render_height;
int64_t ticks_per_second;
int64_t keybind_slots;
int64_t texture_atlas_size;
int64_t font_texture_size;
int64_t font_oversampling;
TextureFilter font_filtering;
/* rendering */
Primitive2D *render_queue_2d;
MeshBatchItem *uncolored_mesh_batches;
struct TextCache text_cache;
TextCache text_cache;
TextureCache texture_cache;
/* audio */
AudioChannelItem *audio_channels;
SDL_AudioDeviceID audio_device;
int audio_stream_frequency;