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++)
{
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)

View File

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

View File

@ -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();