File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -169,19 +169,17 @@ void CGame::LoadSettings()
169169 return ;
170170 GameResolution.x = ini->getValue (" width" , static_cast <int >(GameResolution.x ));
171171 GameResolution.y = ini->getValue (" height" , static_cast <int >(GameResolution.y ));
172- fullscreen = ini->getValue (" fullscreen" , static_cast < int >( fullscreen)) != 0 ;
172+ fullscreen = ini->getValue (" fullscreen" , fullscreen);
173173}
174174
175175void CGame::SaveSettings () const
176176{
177177 libsiedler2::Archiv settings;
178178 settings.push (std::make_unique<libsiedler2::ArchivItem_Ini>(" editor" ));
179- auto * ini = dynamic_cast <libsiedler2::ArchivItem_Ini*>(settings.find (" editor" ));
180- if (!ini)
181- return ;
182- ini->setValue (" width" , GameResolution.x );
183- ini->setValue (" height" , GameResolution.y );
184- ini->setValue (" fullscreen" , static_cast <int >(fullscreen));
179+ auto & ini = dynamic_cast <libsiedler2::ArchivItem_Ini&>(*settings.find (" editor" ));
180+ ini.setValue (" width" , GameResolution.x );
181+ ini.setValue (" height" , GameResolution.y );
182+ ini.setValue (" fullscreen" , static_cast <int >(fullscreen));
185183 const bfs::path settingsPath = RTTRCONFIG .ExpandPath (" <RTTR_USERDATA>/s25edit.ini" );
186184 libsiedler2::Write (settingsPath, settings);
187185}
You can’t perform that action at this time.
0 commit comments