More CRobotMain cleanup

dev-time-step
krzys-h 2015-10-01 20:10:52 +02:00
parent 2c7deea6a9
commit 2111c6d177
3 changed files with 2 additions and 48 deletions

View File

@ -1431,10 +1431,8 @@ void CRobotMain::FlushDisplayInfo()
for (int i = 0; i < SATCOM_MAX; i++) for (int i = 0; i < SATCOM_MAX; i++)
{ {
m_infoFilename[i][0] = 0; m_infoFilename[i][0] = 0;
m_infoPos[i] = 0;
} }
strcpy(m_infoFilename[SATCOM_OBJECT], "objects.txt"); strcpy(m_infoFilename[SATCOM_OBJECT], "objects.txt");
m_infoIndex = 0;
} }
//! Beginning of the displaying of instructions. //! 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 = MakeUnique<Ui::CDisplayInfo>();
m_displayInfo->StartDisplayInfo(filename, index, soluce); m_displayInfo->StartDisplayInfo(filename, index, soluce);
m_displayInfo->SetPosition(0);
m_infoIndex = index;
if (index != -1)
m_displayInfo->SetPosition(m_infoPos[index]);
} }
//! End of displaying of instructions //! End of displaying of instructions
@ -1505,9 +1500,6 @@ void CRobotMain::StopDisplayInfo()
if (m_movieInfoIndex != -1) // film to read the SatCom? if (m_movieInfoIndex != -1) // film to read the SatCom?
m_movie->Start(MM_SATCOMclose, 2.0f); m_movie->Start(MM_SATCOMclose, 2.0f);
if (m_infoIndex != -1)
m_infoPos[m_infoIndex] = m_displayInfo->GetPosition();
m_displayInfo->StopDisplayInfo(); m_displayInfo->StopDisplayInfo();
m_displayInfo.reset(); m_displayInfo.reset();
@ -1531,18 +1523,6 @@ char* CRobotMain::GetDisplayInfoName(int index)
return m_infoFilename[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 //! Beginning of a dialogue during the game
void CRobotMain::StartSuspend() void CRobotMain::StartSuspend()
@ -1951,11 +1931,6 @@ CObject* CRobotMain::GetSelect()
return nullptr; return nullptr;
} }
CObject* CRobotMain::SearchObject(ObjectType type)
{
return m_objMan->FindNearest(nullptr, type);
}
//! Detects the object aimed by the mouse //! Detects the object aimed by the mouse
CObject* CRobotMain::DetectObject(Math::Point pos) 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 //! Load the scene for the character
void CRobotMain::ScenePerso() void CRobotMain::ScenePerso()
@ -5976,7 +5941,6 @@ void CRobotMain::DestroyCodeBattleInterface()
void CRobotMain::SetCodeBattleSpectatorMode(bool mode) void CRobotMain::SetCodeBattleSpectatorMode(bool mode)
{ {
// Deselect object, but keep camera attached to it // Deselect object, but keep camera attached to it
CObject* obj = DeselectAll(); CObject* obj = DeselectAll();
if (m_codeBattleSpectator) if (m_codeBattleSpectator)

View File

@ -217,8 +217,6 @@ public:
void StartDisplayInfo(const std::string& filename, int index); void StartDisplayInfo(const std::string& filename, int index);
void StopDisplayInfo(); void StopDisplayInfo();
char* GetDisplayInfoName(int index); char* GetDisplayInfoName(int index);
int GetDisplayInfoPosition(int index);
void SetDisplayInfoPosition(int index, int pos);
void StartSuspend(); void StartSuspend();
void StopSuspend(); void StopSuspend();
@ -381,7 +379,6 @@ protected:
void LevelLoadingError(const std::string& error, const std::runtime_error& exception, Phase exitPhase = PHASE_LEVEL_LIST); 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); int CreateLight(Math::Vector direction, Gfx::Color color);
void HiliteClear(); void HiliteClear();
void HiliteObject(Math::Point pos); void HiliteObject(Math::Point pos);
@ -398,7 +395,6 @@ protected:
bool DeselectObject(); bool DeselectObject();
void DeleteAllObjects(); void DeleteAllObjects();
void UpdateInfoText(); void UpdateInfoText();
CObject* SearchObject(ObjectType type);
void StartDisplayVisit(EventType event); void StartDisplayVisit(EventType event);
void FrameVisit(float rTime); void FrameVisit(float rTime);
void StopDisplayVisit(); void StopDisplayVisit();
@ -513,8 +509,6 @@ protected:
char m_infoFilename[SATCOM_MAX][100] = {}; // names of text files char m_infoFilename[SATCOM_MAX][100] = {}; // names of text files
CObject* m_infoObject = nullptr; CObject* m_infoObject = nullptr;
int m_infoIndex = 0;
int m_infoPos[SATCOM_MAX] = {};
int m_infoUsed = 0; int m_infoUsed = 0;
ActivePause* m_satcomMoviePause = nullptr; ActivePause* m_satcomMoviePause = nullptr;

View File

@ -664,10 +664,6 @@ void CDisplayInfo::ChangeIndexButton(int index)
pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW4)); pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW4));
if ( pw == nullptr ) return; if ( pw == nullptr ) return;
if ( m_index != -1 )
{
m_main->SetDisplayInfoPosition(m_index, GetPosition());
}
m_index = index; m_index = index;
edit = static_cast<Ui::CEdit*>(pw->SearchControl(EVENT_EDIT1)); edit = static_cast<Ui::CEdit*>(pw->SearchControl(EVENT_EDIT1));
@ -676,7 +672,7 @@ void CDisplayInfo::ChangeIndexButton(int index)
filename = m_main->GetDisplayInfoName(m_index); filename = m_main->GetDisplayInfoName(m_index);
edit->ReadText(filename); edit->ReadText(filename);
edit->HyperHome(std::string(filename)); edit->HyperHome(std::string(filename));
SetPosition(m_main->GetDisplayInfoPosition(m_index)); SetPosition(0);
} }
UpdateIndexButton(); UpdateIndexButton();