void Crunch_Option(const char *group, const char *key, const char *val, const char *filename, int linenum) { if (!stricmp(group, "profiles")) { if (!stricmp(key, "fast")) crnlib_speed[PROFILE_FAST] = (crn_dxt_quality)OptionEnum(val, crnlib_speedOption, crnlib_speed[PROFILE_REGULAR], TOOL_CRUNCH.name); else if (!stricmp(key, "regular")) crnlib_speed[PROFILE_REGULAR] = (crn_dxt_quality)OptionEnum(val, crnlib_speedOption, crnlib_speed[PROFILE_REGULAR], TOOL_CRUNCH.name); else if (!stricmp(key, "best")) crnlib_speed[PROFILE_BEST] = (crn_dxt_quality)OptionEnum(val, crnlib_speedOption, crnlib_speed[PROFILE_REGULAR], TOOL_CRUNCH.name); else Warning("%s:%i: unknown key '%s'", filename, linenum, key); return; } if (!stricmp(group, "options")) { if (!stricmp(key, "dxt_compressor")) { if (!stricmp(val, "crn")) crnlib_compressor_type = cCRNDXTCompressorCRN; else if (!stricmp(val, "crnf")) crnlib_compressor_type = cCRNDXTCompressorCRNF; else if (!stricmp(val, "ryg")) crnlib_compressor_type = cCRNDXTCompressorRYG; else crnlib_compressor_type = cCRNDXTCompressorCRN; } else Warning("%s:%i: unknown key '%s'", filename, linenum, key); return; } Warning("%s:%i: unknown group '%s'", filename, linenum, group); }
int OptionEnum(const char *name, OptionList *num) { return OptionEnum(name, num, 0, NULL); }
int OptionEnum(const char *name, OptionList *num, int def_value = 0) { return OptionEnum(name, num, def_value, NULL); }