[colobot] 102/390: Fixed map turning gray after resizing window

Didier Raboud odyx at moszumanska.debian.org
Fri Jun 12 14:21:34 UTC 2015


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch upstream/latest
in repository colobot.

commit 97b7c0cab173bd5556c831ad60adc146911416d0
Author: krzys-h <krzys_h at interia.pl>
Date:   Mon Oct 20 21:54:52 2014 +0200

    Fixed map turning gray after resizing window
---
 src/app/app.cpp                |  1 +
 src/graphics/engine/engine.cpp |  2 +-
 src/object/robotmain.cpp       | 14 ++++++++++++++
 src/object/robotmain.h         |  2 ++
 src/ui/maindialog.cpp          |  7 -------
 5 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/src/app/app.cpp b/src/app/app.cpp
index 06e3f01..3ea0f5f 100644
--- a/src/app/app.cpp
+++ b/src/app/app.cpp
@@ -725,6 +725,7 @@ bool CApplication::ChangeVideoConfig(const Gfx::GLDeviceConfig &newConfig)
     ( static_cast<Gfx::CGLDevice*>(m_device) )->ConfigChanged(m_deviceConfig);
 
     m_engine->ResetAfterDeviceChanged();
+    m_robotMain->ResetAfterDeviceChanged();
 
     return true;
 }
diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp
index 2c412ec..db702b7 100644
--- a/src/graphics/engine/engine.cpp
+++ b/src/graphics/engine/engine.cpp
@@ -320,7 +320,7 @@ void CEngine::Destroy()
 
 void CEngine::ResetAfterDeviceChanged()
 {
-    m_size = m_app->GetVideoConfig().size;;
+    m_size = m_app->GetVideoConfig().size;
 
     m_text->FlushCache();
 
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp
index 6ca1da1..1ad3c6d 100644
--- a/src/object/robotmain.cpp
+++ b/src/object/robotmain.cpp
@@ -959,6 +959,20 @@ void CRobotMain::LoadSceneOnStart(const std::string& name, int rank)
     ChangePhase(PHASE_LOADING);
 }
 
+void CRobotMain::ResetAfterDeviceChanged()
+{
+    if(m_phase == PHASE_SETUPds ||
+       m_phase == PHASE_SETUPgs ||
+       m_phase == PHASE_SETUPps ||
+       m_phase == PHASE_SETUPcs ||
+       m_phase == PHASE_SETUPss ||
+       m_phase == PHASE_SIMUL ||
+       m_phase == PHASE_WIN ||
+       m_phase == PHASE_LOST)
+    ChangeColor();
+    UpdateMap();
+}
+
 
 //! Creates the file colobot.ini at the first time
 void CRobotMain::CreateIni()
diff --git a/src/object/robotmain.h b/src/object/robotmain.h
index a55318d..2c819cc 100644
--- a/src/object/robotmain.h
+++ b/src/object/robotmain.h
@@ -210,6 +210,8 @@ public:
     void        LoadSceneOnStart(const std::string& name, int rank);
 
     void        CreateIni();
+    
+    void        ResetAfterDeviceChanged();
 
     //! Sets the default input bindings (key and axes)
     void        SetDefaultInputBindings();
diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp
index 3857d2e..cc0c8ec 100644
--- a/src/ui/maindialog.cpp
+++ b/src/ui/maindialog.cpp
@@ -4713,13 +4713,6 @@ void CMainDialog::ChangeDisplay()
     config.size = modes[m_setupSelMode];
     config.fullScreen = bFull;
     m_app->ChangeVideoConfig(config);
-
-    
-    if ( m_bSimulSetup )
-    {
-        m_main->ChangeColor();
-        m_main->UpdateMap();
-    }
 }
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git



More information about the Pkg-games-commits mailing list