MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Options_GetFloat

Function Options_GetFloat

src/Options.c:135–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135float Options_GetFloat(const char* key, float min, float max, float defValue) {
136 cc_string str;
137 float value;
138 if (!Options_UNSAFE_Get(key, &str)) return defValue;
139 if (!Convert_ParseFloat(&str, &value)) return defValue;
140
141 Math_Clamp(value, min, max);
142 return value;
143}
144
145int Options_GetEnum(const char* key, int defValue, const char* const* names, int namesCount) {
146 cc_string str;

Callers 5

OnInitFunction · 0.85
LocalPlayer_InitFunction · 0.85
LoadOptionsFunction · 0.85
OnInitFunction · 0.85
InventoryScreen_InitFunction · 0.85

Calls 2

Options_UNSAFE_GetFunction · 0.85
Convert_ParseFloatFunction · 0.85

Tested by

no test coverage detected