102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
config_internal.h File Reference
#include <dttr_config.h>
#include <stdbool.h>
#include <stddef.h>
#include <string.h>

Go to the source code of this file.

Macros

#define CONFIG_GAMEPAD_AXIS_FIELDS(X)
#define CONFIG_GAMEPAD_DEADZONE_FIELDS(X)

Enumerations

enum  {
  CONFIG_BOOL = DTTR_CONFIG_VALUE_BOOL , CONFIG_SCALING_FIT = DTTR_CONFIG_VALUE_SCALING_FIT , CONFIG_SCALING_METHOD = DTTR_CONFIG_VALUE_SCALING_METHOD , CONFIG_GRAPHICS_API = DTTR_CONFIG_VALUE_GRAPHICS_API ,
  CONFIG_INT = DTTR_CONFIG_VALUE_INT , CONFIG_FLOAT = DTTR_CONFIG_VALUE_FLOAT , CONFIG_PRESENT_FILTER = DTTR_CONFIG_VALUE_PRESENT_FILTER , CONFIG_LOG_LEVEL = DTTR_CONFIG_VALUE_LOG_LEVEL ,
  CONFIG_MINIDUMP_TYPE = DTTR_CONFIG_VALUE_MINIDUMP_TYPE , CONFIG_STRING = DTTR_CONFIG_VALUE_STRING , CONFIG_VERTEX_PRECISION = DTTR_CONFIG_VALUE_VERTEX_PRECISION , CONFIG_GAMEPAD_AXIS = DTTR_CONFIG_VALUE_GAMEPAD_AXIS
}

Functions

static bool config_sections_match (const char *lhs, const char *rhs)
static void config_clear_button_map (int *map)
const DTTR_ConfigFieldSpecconfig_schema_find (const char *section, const char *key)
bool config_parse_bool (const char *value, bool *out_value)
bool config_parse_scaling_fit (const char *value, DTTR_ScalingMode *out_value)
bool config_parse_scaling_method (const char *value, DTTR_ScalingMethod *out_value)
bool config_parse_graphics_api (const char *value, DTTR_GraphicsApi *out_value)
bool config_parse_int (const char *value, int *out_value)
bool config_parse_float (const char *value, float *out_value)
bool config_parse_present_filter (const char *value, SDL_GPUFilter *out_value)
bool config_parse_gamepad_source (const char *value, int *out_value)
bool config_parse_game_action (const char *value, int *out_value)
bool config_parse_gamepad_axis (const char *value, int *out_value)
bool config_parse_log_level (const char *value, int *out_value)
bool config_parse_minidump_type (const char *value, DTTR_MinidumpType *out_value)
bool config_parse_string (const char *value, char *out_value, size_t out_size)
bool config_parse_vertex_precision (const char *value, DTTR_VertexPrecision *out_value)
void config_format_int (int value, char *buf, size_t buf_size)
void config_format_float (float value, char *buf, size_t buf_size)
const char * config_format_scaling_fit (DTTR_ScalingMode mode)
const char * config_format_scaling_method (DTTR_ScalingMethod method)
const char * config_format_graphics_api (DTTR_GraphicsApi api)
const char * config_format_present_filter (SDL_GPUFilter filter)
const char * config_format_log_level (int level)
const char * config_format_minidump_type (DTTR_MinidumpType type)
const char * config_format_gamepad_source (int source)
const char * config_format_game_action (int action)
const char * config_format_gamepad_axis (int axis)
const char * config_format_vertex_precision (DTTR_VertexPrecision precision)
bool config_apply_entry (DTTR_Config *config, const char *section, const char *key, const char *value)

Macro Definition Documentation

◆ CONFIG_GAMEPAD_AXIS_FIELDS

#define CONFIG_GAMEPAD_AXIS_FIELDS ( X)
Value:
X("axis_stick_x", DTTR_GAMEPAD_AXIS_IDX_STICK_X) \
X("axis_stick_y", DTTR_GAMEPAD_AXIS_IDX_STICK_Y) \
X("axis_camera_rz", DTTR_GAMEPAD_AXIS_IDX_CAMERA_RZ)
#define DTTR_GAMEPAD_AXIS_IDX_STICK_Y
Definition dttr_config.h:61
#define DTTR_GAMEPAD_AXIS_IDX_CAMERA_RZ
Definition dttr_config.h:62
#define DTTR_GAMEPAD_AXIS_IDX_STICK_X
Definition dttr_config.h:60

Definition at line 25 of file config_internal.h.

◆ CONFIG_GAMEPAD_DEADZONE_FIELDS

#define CONFIG_GAMEPAD_DEADZONE_FIELDS ( X)
Value:
X("deadzone_stick_x", DTTR_GAMEPAD_AXIS_IDX_STICK_X) \
X("deadzone_stick_y", DTTR_GAMEPAD_AXIS_IDX_STICK_Y) \
X("deadzone_camera_rz", DTTR_GAMEPAD_AXIS_IDX_CAMERA_RZ)

Definition at line 30 of file config_internal.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CONFIG_BOOL 
CONFIG_SCALING_FIT 
CONFIG_SCALING_METHOD 
CONFIG_GRAPHICS_API 
CONFIG_INT 
CONFIG_FLOAT 
CONFIG_PRESENT_FILTER 
CONFIG_LOG_LEVEL 
CONFIG_MINIDUMP_TYPE 
CONFIG_STRING 
CONFIG_VERTEX_PRECISION 
CONFIG_GAMEPAD_AXIS 

Definition at line 10 of file config_internal.h.

Function Documentation

◆ config_apply_entry()

bool config_apply_entry ( DTTR_Config * config,
const char * section,
const char * key,
const char * value )

◆ config_clear_button_map()

void config_clear_button_map ( int * map)
inlinestatic

◆ config_format_float()

void config_format_float ( float value,
char * buf,
size_t buf_size )

Definition at line 408 of file parse.c.

◆ config_format_game_action()

const char * config_format_game_action ( int action)

◆ config_format_gamepad_axis()

const char * config_format_gamepad_axis ( int axis)

◆ config_format_gamepad_source()

const char * config_format_gamepad_source ( int source)

References source.

Referenced by config_add_gamepad_buttons().

◆ config_format_graphics_api()

const char * config_format_graphics_api ( DTTR_GraphicsApi api)

◆ config_format_int()

void config_format_int ( int value,
char * buf,
size_t buf_size )

Definition at line 404 of file parse.c.

◆ config_format_log_level()

const char * config_format_log_level ( int level)

◆ config_format_minidump_type()

const char * config_format_minidump_type ( DTTR_MinidumpType type)

References type.

Referenced by config_format_field_string().

◆ config_format_present_filter()

const char * config_format_present_filter ( SDL_GPUFilter filter)

◆ config_format_scaling_fit()

const char * config_format_scaling_fit ( DTTR_ScalingMode mode)

◆ config_format_scaling_method()

const char * config_format_scaling_method ( DTTR_ScalingMethod method)

◆ config_format_vertex_precision()

const char * config_format_vertex_precision ( DTTR_VertexPrecision precision)

◆ config_parse_bool()

bool config_parse_bool ( const char * value,
bool * out_value )

Definition at line 242 of file parse.c.

◆ config_parse_float()

bool config_parse_float ( const char * value,
float * out_value )

Definition at line 369 of file parse.c.

References NULL.

◆ config_parse_game_action()

bool config_parse_game_action ( const char * value,
int * out_value )

Definition at line 322 of file parse.c.

References config_parse_choice(), and DTTR_CONFIG_CHOICES_GAME_ACTION.

Referenced by config_apply_buttons().

◆ config_parse_gamepad_axis()

bool config_parse_gamepad_axis ( const char * value,
int * out_value )

Definition at line 326 of file parse.c.

References config_parse_choice(), and DTTR_CONFIG_CHOICES_GAMEPAD_AXIS.

◆ config_parse_gamepad_source()

bool config_parse_gamepad_source ( const char * value,
int * out_value )

Definition at line 311 of file parse.c.

References CONFIG_GAMEPAD_SOURCE_TOKENS, and CONFIG_PARSE_TOKEN.

Referenced by config_apply_buttons().

◆ config_parse_graphics_api()

bool config_parse_graphics_api ( const char * value,
DTTR_GraphicsApi * out_value )

◆ config_parse_int()

bool config_parse_int ( const char * value,
int * out_value )

◆ config_parse_log_level()

bool config_parse_log_level ( const char * value,
int * out_value )

Definition at line 330 of file parse.c.

References config_parse_choice(), and DTTR_CONFIG_CHOICES_LOG_LEVEL.

◆ config_parse_minidump_type()

bool config_parse_minidump_type ( const char * value,
DTTR_MinidumpType * out_value )

Referenced by CONFIG_PARSE_CHOICE_FN().

◆ config_parse_present_filter()

bool config_parse_present_filter ( const char * value,
SDL_GPUFilter * out_value )

Referenced by CONFIG_PARSE_CHOICE_FN().

◆ config_parse_scaling_fit()

bool config_parse_scaling_fit ( const char * value,
DTTR_ScalingMode * out_value )

Referenced by CONFIG_PARSE_CHOICE_FN().

◆ config_parse_scaling_method()

bool config_parse_scaling_method ( const char * value,
DTTR_ScalingMethod * out_value )

Referenced by CONFIG_PARSE_CHOICE_FN().

◆ config_parse_string()

bool config_parse_string ( const char * value,
char * out_value,
size_t out_size )

Definition at line 386 of file parse.c.

Referenced by config_assign_string().

◆ config_parse_vertex_precision()

bool config_parse_vertex_precision ( const char * value,
DTTR_VertexPrecision * out_value )

Referenced by CONFIG_PARSE_CHOICE_FN().

◆ config_schema_find()

const DTTR_ConfigFieldSpec * config_schema_find ( const char * section,
const char * key )

◆ config_sections_match()

bool config_sections_match ( const char * lhs,
const char * rhs )
inlinestatic

Definition at line 35 of file config_internal.h.

Referenced by config_object_for_section().