Recalculate camera projection matrix after aspect ratio change

master
krzys-h 2015-08-25 16:18:01 +02:00
parent 1519145c4c
commit d4b431adaa
2 changed files with 14 additions and 2 deletions

View File

@ -399,6 +399,12 @@ void CEngine::ResetAfterDeviceChanged()
}
}
}
// Update the camera projection matrix for new aspect ratio
SetFocus(m_focus);
// Because reloading textures takes a long time
m_app->ResetTimeAfterLoading();
}
bool CEngine::ProcessEvent(const Event &event)

View File

@ -304,8 +304,14 @@ void CRobotMain::ResetAfterDeviceChanged()
m_phase == PHASE_SIMUL ||
m_phase == PHASE_WIN ||
m_phase == PHASE_LOST)
ChangeColor();
UpdateMap();
{
ChangeColor();
UpdateMap();
}
// Recreate the interface (needed if the aspect ratio changes)
m_eventQueue->AddEvent(Event(EVENT_UPDINTERFACE));
CreateShortcuts();
}