[colobot] 32/377: More CRobotMain cleanup

Didier Raboud odyx at moszumanska.debian.org
Wed Mar 30 13:33:55 UTC 2016


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

odyx pushed a commit to branch debian/master
in repository colobot.

commit 2111c6d1772d638a6d5fdaba6d1d9a59f4a5e868
Author: krzys-h <krzys_h at interia.pl>
Date:   Thu Oct 1 20:10:52 2015 +0200

    More CRobotMain cleanup
---
 src/level/robotmain.cpp | 38 +-------------------------------------
 src/level/robotmain.h   |  6 ------
 src/ui/displayinfo.cpp  |  6 +-----
 3 files changed, 2 insertions(+), 48 deletions(-)

diff --git a/src/level/robotmain.cpp b/src/level/robotmain.cpp
index 0fd4439..3d25495 100644
--- a/src/level/robotmain.cpp
+++ b/src/level/robotmain.cpp
@@ -1431,10 +1431,8 @@ void CRobotMain::FlushDisplayInfo()
     for (int i = 0; i < SATCOM_MAX; i++)
     {
         m_infoFilename[i][0] = 0;
-        m_infoPos[i] = 0;
     }
     strcpy(m_infoFilename[SATCOM_OBJECT], "objects.txt");
-    m_infoIndex = 0;
 }
 
 //! Beginning of the displaying of instructions.
@@ -1491,10 +1489,7 @@ void CRobotMain::StartDisplayInfo(const std::string& filename, int index)
 
     m_displayInfo = MakeUnique<Ui::CDisplayInfo>();
     m_displayInfo->StartDisplayInfo(filename, index, soluce);
-
-    m_infoIndex = index;
-    if (index != -1)
-        m_displayInfo->SetPosition(m_infoPos[index]);
+    m_displayInfo->SetPosition(0);
 }
 
 //! End of displaying of instructions
@@ -1505,9 +1500,6 @@ void CRobotMain::StopDisplayInfo()
     if (m_movieInfoIndex != -1)  // film to read the SatCom?
         m_movie->Start(MM_SATCOMclose, 2.0f);
 
-    if (m_infoIndex != -1)
-        m_infoPos[m_infoIndex] = m_displayInfo->GetPosition();
-
     m_displayInfo->StopDisplayInfo();
 
     m_displayInfo.reset();
@@ -1531,18 +1523,6 @@ char* CRobotMain::GetDisplayInfoName(int index)
     return m_infoFilename[index];
 }
 
-//! Returns the name of the text display
-int CRobotMain::GetDisplayInfoPosition(int index)
-{
-    return m_infoPos[index];
-}
-
-//! Returns the name of the text display
-void CRobotMain::SetDisplayInfoPosition(int index, int pos)
-{
-    m_infoPos[index] = pos;
-}
-
 
 //! Beginning of a dialogue during the game
 void CRobotMain::StartSuspend()
@@ -1951,11 +1931,6 @@ CObject* CRobotMain::GetSelect()
     return nullptr;
 }
 
-CObject* CRobotMain::SearchObject(ObjectType type)
-{
-    return m_objMan->FindNearest(nullptr, type);
-}
-
 //! Detects the object aimed by the mouse
 CObject* CRobotMain::DetectObject(Math::Point pos)
 {
@@ -2718,16 +2693,6 @@ bool CRobotMain::EventObject(const Event &event)
 }
 
 
-//! Calculates the point of arrival of the camera
-Math::Vector CRobotMain::LookatPoint(Math::Vector eye, float angleH, float angleV,
-                                  float length)
-{
-    Math::Vector lookat = eye;
-    lookat.z += length;
-
-    RotatePoint(eye, angleH, angleV, lookat);
-    return lookat;
-}
 
 //! Load the scene for the character
 void CRobotMain::ScenePerso()
@@ -5976,7 +5941,6 @@ void CRobotMain::DestroyCodeBattleInterface()
 
 void CRobotMain::SetCodeBattleSpectatorMode(bool mode)
 {
-
     // Deselect object, but keep camera attached to it
     CObject* obj = DeselectAll();
     if (m_codeBattleSpectator)
diff --git a/src/level/robotmain.h b/src/level/robotmain.h
index 5baf78d..3544ed3 100644
--- a/src/level/robotmain.h
+++ b/src/level/robotmain.h
@@ -217,8 +217,6 @@ public:
     void        StartDisplayInfo(const std::string& filename, int index);
     void        StopDisplayInfo();
     char*       GetDisplayInfoName(int index);
-    int         GetDisplayInfoPosition(int index);
-    void        SetDisplayInfoPosition(int index, int pos);
 
     void        StartSuspend();
     void        StopSuspend();
@@ -381,7 +379,6 @@ protected:
 
     void        LevelLoadingError(const std::string& error, const std::runtime_error& exception, Phase exitPhase = PHASE_LEVEL_LIST);
 
-    Math::Vector LookatPoint(Math::Vector eye, float angleH, float angleV, float length);
     int         CreateLight(Math::Vector direction, Gfx::Color color);
     void        HiliteClear();
     void        HiliteObject(Math::Point pos);
@@ -398,7 +395,6 @@ protected:
     bool        DeselectObject();
     void        DeleteAllObjects();
     void        UpdateInfoText();
-    CObject*    SearchObject(ObjectType type);
     void        StartDisplayVisit(EventType event);
     void        FrameVisit(float rTime);
     void        StopDisplayVisit();
@@ -513,8 +509,6 @@ protected:
 
     char            m_infoFilename[SATCOM_MAX][100] = {}; // names of text files
     CObject*        m_infoObject = nullptr;
-    int             m_infoIndex = 0;
-    int             m_infoPos[SATCOM_MAX] = {};
     int             m_infoUsed = 0;
     ActivePause*    m_satcomMoviePause = nullptr;
 
diff --git a/src/ui/displayinfo.cpp b/src/ui/displayinfo.cpp
index 6df5e9e..6e28d74 100644
--- a/src/ui/displayinfo.cpp
+++ b/src/ui/displayinfo.cpp
@@ -664,10 +664,6 @@ void CDisplayInfo::ChangeIndexButton(int index)
     pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW4));
     if ( pw == nullptr )  return;
 
-    if ( m_index != -1 )
-    {
-        m_main->SetDisplayInfoPosition(m_index, GetPosition());
-    }
     m_index = index;
 
     edit = static_cast<Ui::CEdit*>(pw->SearchControl(EVENT_EDIT1));
@@ -676,7 +672,7 @@ void CDisplayInfo::ChangeIndexButton(int index)
         filename = m_main->GetDisplayInfoName(m_index);
         edit->ReadText(filename);
         edit->HyperHome(std::string(filename));
-        SetPosition(m_main->GetDisplayInfoPosition(m_index));
+        SetPosition(0);
     }
 
     UpdateIndexButton();

-- 
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