MCPcopy Create free account
hub / github.com/Panzerschrek/Chasm-Reverse / GetOrSetFloat

Method GetOrSetFloat

PanzerChasm/settings.cpp:282–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282float Settings::GetOrSetFloat( const char* const name, const float default_value )
283{
284 const auto it= map_.find( SettingsStringContainer(name) );
285 if ( it != map_.cend() )
286 {
287 float val;
288 if( StrToFloat( it->second.data(), &val ) )
289 return val;
290 }
291
292 map_[ SettingsStringContainer(name) ]= FloatToStr( default_value );
293 return default_value;
294}
295
296bool Settings::GetOrSetBool( const char* const name, const bool default_value )
297{

Callers 3

OptionsMenuMethod · 0.80
UpdateParamsMethod · 0.80
ControllerRotateMethod · 0.80

Calls 3

StrToFloatFunction · 0.85
FloatToStrFunction · 0.85

Tested by

no test coverage detected