remove /include/twn_config.h, move defauls to relevant headers

This commit is contained in:
veclav talica 2024-10-11 20:21:02 +03:00
parent cfc9ac9583
commit 667b599c19
12 changed files with 19 additions and 31 deletions

View File

@ -1,25 +0,0 @@
#ifndef TWN_CONFIG_H
#define TWN_CONFIG_H
/* TODO: consider if it's still necessary to keep these in one place */
#define PACKAGE_EXTENSION "btw"
#define TICKS_PER_SECOND_DEFAULT 60
#define BASE_RENDER_WIDTH_DEFAULT 640
#define BASE_RENDER_HEIGHT_DEFAULT 360
#define TEXTURE_ATLAS_SIZE_DEFAULT 2048
#define TEXTURE_ATLAS_BIT_DEPTH 32
#define TEXTURE_ATLAS_FORMAT SDL_PIXELFORMAT_RGBA32
#define KEYBIND_SLOTS_DEFAULT 3
#define AUDIO_FREQUENCY 48000
#define TEXT_FONT_TEXTURE_SIZE_DEFAULT 2048
#define TEXT_FONT_OVERSAMPLING_DEFAULT 4
#define TEXT_FONT_FILTERING_DEFAULT TEXTURE_FILTER_LINEAR
#endif

View File

@ -1,7 +1,6 @@
#ifndef TWN_INPUT_H #ifndef TWN_INPUT_H
#define TWN_INPUT_H #define TWN_INPUT_H
#include "twn_config.h"
#include "twn_types.h" #include "twn_types.h"
#include "twn_engine_api.h" #include "twn_engine_api.h"
#include "twn_control.h" #include "twn_control.h"

View File

@ -1,7 +1,6 @@
#include "twn_draw_c.h" #include "twn_draw_c.h"
#include "twn_util.h" #include "twn_util.h"
#include "twn_util_c.h" #include "twn_util_c.h"
#include "twn_config.h"
#include "twn_engine_context_c.h" #include "twn_engine_context_c.h"
#include "twn_text_c.h" #include "twn_text_c.h"

View File

@ -1,7 +1,6 @@
#include "twn_draw_c.h" #include "twn_draw_c.h"
#include "twn_draw.h" #include "twn_draw.h"
#include "twn_util.h" #include "twn_util.h"
#include "twn_config.h"
#include "twn_engine_context_c.h" #include "twn_engine_context_c.h"
#include <stb_truetype.h> #include <stb_truetype.h>

View File

@ -12,6 +12,10 @@
#define ASCII_END 128 #define ASCII_END 128
#define NUM_DISPLAY_ASCII ((ASCII_END - ASCII_START) + 1) #define NUM_DISPLAY_ASCII ((ASCII_END - ASCII_START) + 1)
#define TEXT_FONT_TEXTURE_SIZE_DEFAULT 2048
#define TEXT_FONT_OVERSAMPLING_DEFAULT 4
#define TEXT_FONT_FILTERING_DEFAULT TEXTURE_FILTER_LINEAR
typedef struct FontData { typedef struct FontData {
stbtt_packedchar char_data[NUM_DISPLAY_ASCII]; stbtt_packedchar char_data[NUM_DISPLAY_ASCII];

View File

@ -1,5 +1,4 @@
#include "twn_audio_c.h" #include "twn_audio_c.h"
#include "twn_config.h"
#include "twn_engine_context_c.h" #include "twn_engine_context_c.h"
#include "twn_util.h" #include "twn_util.h"

View File

@ -13,6 +13,9 @@
#include <stdint.h> #include <stdint.h>
#define AUDIO_FREQUENCY 48000
typedef enum AudioFileType { typedef enum AudioFileType {
AUDIO_FILE_TYPE_OGG, AUDIO_FILE_TYPE_OGG,
AUDIO_FILE_TYPE_XM, AUDIO_FILE_TYPE_XM,

View File

@ -1,5 +1,4 @@
#include "twn_camera.h" #include "twn_camera.h"
#include "twn_config.h"
#include "twn_vec.h" #include "twn_vec.h"
#include "twn_engine_context_c.h" #include "twn_engine_context_c.h"

View File

@ -7,6 +7,9 @@
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#define KEYBIND_SLOTS_DEFAULT 3
union ButtonCode { union ButtonCode {
SDL_Scancode scancode; SDL_Scancode scancode;
SDL_Keycode keycode; SDL_Keycode keycode;

View File

@ -22,6 +22,10 @@
#include <limits.h> #include <limits.h>
#define TICKS_PER_SECOND_DEFAULT 60
#define PACKAGE_EXTENSION "btw"
static int event_callback(void *userdata, SDL_Event *event) { static int event_callback(void *userdata, SDL_Event *event) {
(void)userdata; (void)userdata;

View File

@ -1,5 +1,4 @@
#include "twn_textures_c.h" #include "twn_textures_c.h"
#include "twn_config.h"
#include "twn_util.h" #include "twn_util.h"
#include "twn_util_c.h" #include "twn_util_c.h"
#include "twn_engine_context_c.h" #include "twn_engine_context_c.h"

View File

@ -11,6 +11,11 @@
#include <stdbool.h> #include <stdbool.h>
#define TEXTURE_ATLAS_SIZE_DEFAULT 2048
#define TEXTURE_ATLAS_BIT_DEPTH 32
#define TEXTURE_ATLAS_FORMAT SDL_PIXELFORMAT_RGBA32
typedef struct Texture { typedef struct Texture {
Rect srcrect; /* position in atlas */ Rect srcrect; /* position in atlas */
SDL_Surface *data; /* original image data */ SDL_Surface *data; /* original image data */