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

Function Options_GetInt

src/Options.c:116–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116int Options_GetInt(const char* key, int min, int max, int defValue) {
117 cc_string str;
118 int value;
119 if (!Options_UNSAFE_Get(key, &str)) return defValue;
120 if (!Convert_ParseInt(&str, &value)) return defValue;
121
122 Math_Clamp(value, min, max);
123 return value;
124}
125
126cc_bool Options_GetBool(const char* key, cc_bool defValue) {
127 cc_string str;

Callers 11

GetOnscreenButtonsFunction · 0.85
GetOnscreenHAlignsFunction · 0.85
OnInitFunction · 0.85
LoadOptionsFunction · 0.85
OnInitFunction · 0.85
Sounds_InitFunction · 0.85
Music_InitFunction · 0.85
OnInitFunction · 0.85
LoadOptionsFunction · 0.85
Game_SetupFunction · 0.85
GameVersion_LoadFunction · 0.85

Calls 2

Options_UNSAFE_GetFunction · 0.85
Convert_ParseIntFunction · 0.85

Tested by

no test coverage detected