Skip to content

Commit e1034f7

Browse files
committed
Fixed double display setup.
1 parent 17b06aa commit e1034f7

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

src/Engine/CrossPlatform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ std::string getLocale()
696696
* @param ev SDL event.
697697
* @return Is quitting necessary?
698698
*/
699-
bool CrossPlatform::isQuitShortcut(const SDL_Event &ev)
699+
bool isQuitShortcut(const SDL_Event &ev)
700700
{
701701
#ifdef _WIN32
702702
// Alt + F4

src/Engine/Game.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,12 @@ void Game::run()
224224
}
225225
break;
226226
case SDL_VIDEORESIZE:
227-
Options::setInt("displayWidth", _event.resize.w);
228-
Options::setInt("displayHeight", _event.resize.h);
229-
_screen->setResolution(_event.resize.w, _event.resize.h);
227+
if (Options::getBool("allowResize"))
228+
{
229+
Options::setInt("displayWidth", _event.resize.w);
230+
Options::setInt("displayHeight", _event.resize.h);
231+
_screen->setResolution(_event.resize.w, _event.resize.h);
232+
}
230233
break;
231234
case SDL_MOUSEMOTION:
232235
case SDL_MOUSEBUTTONDOWN:

src/Savegame/SavedGame.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -597,14 +597,17 @@ void SavedGame::setTime(GameTime time)
597597
*/
598598
int SavedGame::getId(const std::string &name)
599599
{
600-
int id = _ids[name];
601-
_ids[name]++;
602-
if (id == 0)
600+
std::map<std::string, int>::iterator i = _ids.find(name);
601+
if (i != _ids.end())
603602
{
604-
_ids[name]++;
605-
id++;
603+
i->second++;
604+
return i->second;
605+
}
606+
else
607+
{
608+
_ids[name] = 2;
609+
return 1;
606610
}
607-
return id;
608611
}
609612

610613
/**

0 commit comments

Comments
 (0)