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

Method GetOrSetInt

PanzerChasm/settings.cpp:268–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266}
267
268int Settings::GetOrSetInt( const char* const name, const int default_value )
269{
270 const auto it= map_.find( SettingsStringContainer(name) );
271 if ( it != map_.cend() )
272 {
273 int val;
274 if( StrToInt( it->second.data(), &val ) )
275 return val;
276 }
277
278 map_[ SettingsStringContainer(name) ]= std::to_string( default_value );
279 return default_value;
280}
281
282float Settings::GetOrSetFloat( const char* const name, const float default_value )
283{

Callers 5

PlayerSetupMenuMethod · 0.80
DrawMethod · 0.80
VideoMenuMethod · 0.80
LoopMethod · 0.80
MapDrawerGLMethod · 0.80

Calls 2

StrToIntFunction · 0.85

Tested by

no test coverage detected