move and combine option macro headers from public interface

This commit is contained in:
veclavtalica 2025-02-20 13:01:02 +03:00
parent d90bf4cbe2
commit 6bd3afe9b2
7 changed files with 15 additions and 24 deletions

View File

@ -2,7 +2,6 @@
#define TWN_AUDIO_H #define TWN_AUDIO_H
#include "twn_engine_api.h" #include "twn_engine_api.h"
#include "twn_option.h"
#include <stdbool.h> #include <stdbool.h>
@ -23,6 +22,8 @@ TWN_API void audio_parameter(const char *channel, const char *parameter, float v
#ifndef TWN_NOT_C #ifndef TWN_NOT_C
#include "src/twn_option_c.h"
typedef struct PlayAudioArgs { typedef struct PlayAudioArgs {
char *path; char *path;

View File

@ -1,8 +0,0 @@
#ifndef TWN_CONCATENATE_H
#define TWN_CONCATENATE_H
#define m_concatenate(p_a, p_b) m_concatenate_(p_a, p_b)
#define m_concatenate_(p_a, p_b) m_concatenate__(p_a, p_b)
#define m_concatenate__(p_a, p_b) p_a##p_b
#endif

View File

@ -2,7 +2,6 @@
#define TWN_DRAW_H #define TWN_DRAW_H
#include "twn_types.h" #include "twn_types.h"
#include "twn_option.h"
#include "twn_engine_api.h" #include "twn_engine_api.h"
#include <stdbool.h> #include <stdbool.h>
@ -118,6 +117,8 @@ TWN_API void draw_model(const char *model,
#ifndef TWN_NOT_C #ifndef TWN_NOT_C
#include "src/twn_option_c.h"
typedef struct DrawSpriteArgs { typedef struct DrawSpriteArgs {
char const *texture; char const *texture;
Rect rect; Rect rect;

View File

@ -1,9 +0,0 @@
#ifndef TWN_VARARGCOUNT_H
#define TWN_VARARGCOUNT_H
#define m_narg(...) m_narg_(__VA_ARGS__, m_rseq_n_())
#define m_narg_(...) m_arg_n_(__VA_ARGS__)
#define m_arg_n_(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, N, ...) N
#define m_rseq_n_() 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
#endif

View File

@ -6,7 +6,7 @@
#include "twn_textures_c.h" #include "twn_textures_c.h"
#include "twn_types_c.h" #include "twn_types_c.h"
#include "twn_text_c.h" #include "twn_text_c.h"
#include "twn_option.h" #include "twn_option_c.h"
#include "twn_deferred_commands.h" #include "twn_deferred_commands.h"
#include <SDL2/SDL.h> #include <SDL2/SDL.h>

View File

@ -4,7 +4,7 @@
#include "twn_util.h" #include "twn_util.h"
#include "twn_util_c.h" #include "twn_util_c.h"
#include "twn_textures_c.h" #include "twn_textures_c.h"
#include "twn_option.h" #include "twn_option_c.h"
#include <stb_ds.h> #include <stb_ds.h>

View File

@ -1,11 +1,17 @@
#ifndef TWN_OPTION_H #ifndef TWN_OPTION_H
#define TWN_OPTION_H #define TWN_OPTION_H
#include "twn_concatenate.h"
#include "twn_varargcount.h"
#include <stdbool.h> #include <stdbool.h>
#define m_narg(...) m_narg_(__VA_ARGS__, m_rseq_n_())
#define m_narg_(...) m_arg_n_(__VA_ARGS__)
#define m_arg_n_(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, N, ...) N
#define m_rseq_n_() 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
#define m_concatenate(p_a, p_b) m_concatenate_(p_a, p_b)
#define m_concatenate_(p_a, p_b) m_concatenate__(p_a, p_b)
#define m_concatenate__(p_a, p_b) p_a##p_b
/* usage example: /* usage example:
* *
* struct result { * struct result {