X-Git-Url: https://harrygodden.com/git/?p=csRadar.git;a=blobdiff_plain;f=csRadar.h;h=c54c24fbeeec886e4b557f15257defb6e17503ad;hp=95e1048599418e0c947957c04034916a43cff700;hb=HEAD;hpb=8382aed7f0cdc38bc5c58832d4a15277cf56d4be diff --git a/csRadar.h b/csRadar.h index 95e1048..c54c24f 100644 --- a/csRadar.h +++ b/csRadar.h @@ -27,7 +27,7 @@ // Drawing #ifdef CSR_EXECUTABLE #include "csr32f.h" -//#include "csrTga.h" + #include "csrTga.h" #endif #include "csrDraw.h" // Y @@ -36,19 +36,38 @@ static const u32 csr_build = 3; static const u32 csr_api_version = 1; typedef struct csr_api csr_api; +typedef struct csr_opt_str csr_opt_str; + struct csr_api { // Floating arguments from main's argv - char *strings[ 20 ]; + struct csr_opt_str + { + char *str; + + enum inferred_type + { + k_iftype_vmf, + k_iftype_visgroup, + k_iftype_classname + } + type; + } + strings[ 20 ]; + int num_strings; float padding; u32 resolution; int write_txt; - char output_path[ 512 ]; // Full path eg. /home/harry/my_map.vmf - char vmf_name[ 128 ]; // Just the base name eg. my_map + char output_path[ 512 ]; // Full path to output eg. /home/harry/output + char vmf_name[ 128 ]; // Just the base name eg. my_map + char vmf_folder[ 512 ]; // Just the folder to the map eg. /home/harry/ EMSAA sampling_mode; + float min_z; + float max_z; + // Main API interface vmf_map *map; csr_target target; @@ -56,6 +75,24 @@ struct csr_api u32 api_version; }; +void csr_filter_update_from_strings( csr_filter *filter, csr_opt_str *opt ); + +#ifdef CSR_EXECUTABLE +void csr_filter_update_from_strings( csr_filter *filter, csr_opt_str *opt ) +{ + if( opt->type == k_iftype_visgroup ) + { + filter->visgroup = opt->str; + filter->classname = NULL; + } + else + { + filter->classname = opt->str; + filter->visgroup = NULL; + } +} +#endif + #ifndef CSR_EXECUTABLE static int csr_init( csr_api *api ) {