From d26100734623f37063206b9b144c2a29fd71d414 Mon Sep 17 00:00:00 2001 From: quou Date: Wed, 1 Jan 2025 18:43:31 +1100 Subject: material system --- cfg/cfgparse.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'cfg/cfgparse.h') diff --git a/cfg/cfgparse.h b/cfg/cfgparse.h index 4865b48..a585de6 100644 --- a/cfg/cfgparse.h +++ b/cfg/cfgparse.h @@ -5,6 +5,7 @@ typedef enum { cfg_type_int, + cfg_type_float, cfg_type_string, cfg_type_data, cfg_type_none @@ -19,6 +20,7 @@ typedef struct cfg_Prop { char name[28]; cfg_Type type; union { + float flt; int num; cfg_Data data; char* str; @@ -53,10 +55,25 @@ int find_int_default( const char* name, int def ); +float find_float_default( + const cfg_Object* obj, + const char* name, + float def +); +float find_num_default( + const cfg_Object* obj, + const char* name, + float def +); const char* find_string_default( const cfg_Object* obj, const char* name, const char* def ); +unsigned find_colour_default( + const cfg_Object* obj, + const char* name, + const char* def +); #endif -- cgit v1.2.3-54-g00ecf