summaryrefslogtreecommitdiffstats
path: root/src/app
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-09-30 10:56:35 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-09-30 10:56:35 +0200
commit8ea4736a46f1a468ee214528ba539e1f505b8273 (patch)
treedb47648ae56b1cc5314afe8ee96fb81e0e276351 /src/app
parentaf4ff31b4ebcd9d42eed9ae344d29f8d95c3b7c9 (diff)
downloadcolobot-8ea4736a46f1a468ee214528ba539e1f505b8273.tar.gz
colobot-8ea4736a46f1a468ee214528ba539e1f505b8273.tar.bz2
colobot-8ea4736a46f1a468ee214528ba539e1f505b8273.zip
Font coloring; fix for resize hack
- added font coloring and changed default color to black - fixed resize hack incorrectly changing video config, but font resizing will not work for now
Diffstat (limited to 'src/app')
-rw-r--r--src/app/app.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/app/app.cpp b/src/app/app.cpp
index c703d7f..02da897 100644
--- a/src/app/app.cpp
+++ b/src/app/app.cpp
@@ -873,12 +873,13 @@ Event CApplication::ProcessSystemEvent()
{
event.type = EVENT_QUIT;
}
- else if ( m_private->currentEvent.type == SDL_VIDEORESIZE ) {
- m_deviceConfig.size.x = m_private->currentEvent.resize.w;
- m_deviceConfig.size.y = m_private->currentEvent.resize.h;
- CreateVideoSurface();
- // FIXME: dirty hack, will fail with device other than OpenGL
- dynamic_cast<Gfx::CGLDevice*>(m_device)->ResizeViewport(m_deviceConfig.size.x, m_deviceConfig.size.y);
+ else if (m_private->currentEvent.type == SDL_VIDEORESIZE)
+ {
+ Gfx::GLDeviceConfig newConfig = m_deviceConfig;
+ newConfig.size.x = m_private->currentEvent.resize.w;
+ newConfig.size.y = m_private->currentEvent.resize.h;
+ if (newConfig.size != m_deviceConfig.size)
+ ChangeVideoConfig(newConfig);
}
else if ( (m_private->currentEvent.type == SDL_KEYDOWN) ||
(m_private->currentEvent.type == SDL_KEYUP) )