Removed some unused functions from CRobotMain

dev-time-step
krzys-h 2015-10-01 19:37:31 +02:00
parent b5e98dd6e9
commit 2c7deea6a9
5 changed files with 18 additions and 54 deletions

View File

@ -2842,12 +2842,8 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
m_engine->SetSecondTexture(""); m_engine->SetSecondTexture("");
m_engine->SetForegroundName(""); m_engine->SetForegroundName("");
sprintf(m_title, "%s %d.%d", GetLevelCategoryDir(m_levelCategory).c_str(), m_levelChap, m_levelRank); GetResource(RES_TEXT, RT_SCRIPT_NEW, m_scriptName);
sprintf(m_resume, "%s %d.%d", GetLevelCategoryDir(m_levelCategory).c_str(), m_levelChap, m_levelRank); m_scriptFile = "";
std::string scriptNameStr;
GetResource(RES_TEXT, RT_SCRIPT_NEW, scriptNameStr);
strcpy(m_scriptName, scriptNameStr.c_str());
m_scriptFile[0] = 0;
m_missionType = MISSION_NORMAL; m_missionType = MISSION_NORMAL;
m_codeBattleInit = false; m_codeBattleInit = false;
@ -2890,25 +2886,25 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
{ {
if (line->GetCommand() == "Title" && !resetObject) if (line->GetCommand() == "Title" && !resetObject)
{ {
strcpy(m_title, line->GetParam("text")->AsString().c_str()); //strcpy(m_title, line->GetParam("text")->AsString().c_str());
continue; continue;
} }
if (line->GetCommand() == "Resume" && !resetObject) if (line->GetCommand() == "Resume" && !resetObject)
{ {
strcpy(m_resume, line->GetParam("text")->AsString().c_str()); //strcpy(m_resume, line->GetParam("text")->AsString().c_str());
continue; continue;
} }
if (line->GetCommand() == "ScriptName" && !resetObject) if (line->GetCommand() == "ScriptName" && !resetObject)
{ {
strcpy(m_scriptName, line->GetParam("text")->AsString().c_str()); m_scriptName = line->GetParam("text")->AsString();
continue; continue;
} }
if (line->GetCommand() == "ScriptFile" && !resetObject) if (line->GetCommand() == "ScriptFile" && !resetObject)
{ {
strcpy(m_scriptFile, line->GetParam("name")->AsString().c_str()); m_scriptFile = line->GetParam("name")->AsString();
continue; continue;
} }
@ -5258,22 +5254,12 @@ bool CRobotMain::GetFixScene()
} }
char* CRobotMain::GetTitle() const std::string& CRobotMain::GetScriptName()
{
return m_title;
}
char* CRobotMain::GetResume()
{
return m_resume;
}
char* CRobotMain::GetScriptName()
{ {
return m_scriptName; return m_scriptName;
} }
char* CRobotMain::GetScriptFile() const std::string& CRobotMain::GetScriptFile()
{ {
return m_scriptFile; return m_scriptFile;
} }
@ -5516,18 +5502,6 @@ bool CRobotMain::GetFriendAim()
} }
//! Management of the precision of drawing the ground
void CRobotMain::SetTracePrecision(float factor)
{
m_engine->SetTracePrecision(factor);
}
float CRobotMain::GetTracePrecision()
{
return m_engine->GetTracePrecision();
}
//! Starts music with a mission //! Starts music with a mission
void CRobotMain::StartMusic() void CRobotMain::StartMusic()
{ {

View File

@ -186,9 +186,6 @@ public:
void SetFriendAim(bool friendAim); void SetFriendAim(bool friendAim);
bool GetFriendAim(); bool GetFriendAim();
void SetTracePrecision(float factor);
float GetTracePrecision();
void SetSpeed(float speed); void SetSpeed(float speed);
float GetSpeed(); float GetSpeed();
@ -228,10 +225,8 @@ public:
float GetGameTime(); float GetGameTime();
char* GetTitle(); const std::string& GetScriptName();
char* GetResume(); const std::string& GetScriptFile();
char* GetScriptName();
char* GetScriptFile();
bool GetTrainerPilot(); bool GetTrainerPilot();
bool GetFixScene(); bool GetFixScene();
bool GetShowSoluce(); bool GetShowSoluce();
@ -523,10 +518,8 @@ protected:
int m_infoUsed = 0; int m_infoUsed = 0;
ActivePause* m_satcomMoviePause = nullptr; ActivePause* m_satcomMoviePause = nullptr;
char m_title[100] = {}; std::string m_scriptName = "";
char m_resume[500] = {}; std::string m_scriptFile = "";
char m_scriptName[100] = {};
char m_scriptFile[100] = {};
int m_endingWinRank = 0; int m_endingWinRank = 0;
int m_endingLostRank = 0; int m_endingLostRank = 0;
bool m_winTerminate = false; bool m_winTerminate = false;

View File

@ -848,7 +848,6 @@ void CScript::New(Ui::CEdit* edit, const char* name)
char text[100]; char text[100];
char script[500]; char script[500];
char buffer[500]; char buffer[500];
char *sf;
int cursor1, cursor2, len, i, j; int cursor1, cursor2, len, i, j;
std::string resStr; std::string resStr;
@ -883,12 +882,11 @@ void CScript::New(Ui::CEdit* edit, const char* name)
edit->ShowSelect(); edit->ShowSelect();
m_interface->SetFocus(edit); m_interface->SetFocus(edit);
sf = m_main->GetScriptFile(); std::string sf = m_main->GetScriptFile();
if ( sf[0] != 0 ) // Load an empty program specific? if ( !sf.empty() ) // Load an empty program specific?
{ {
std::string filename = sf;
CInputStream stream; CInputStream stream;
stream.open(filename); stream.open(sf);
if (stream.is_open()) if (stream.is_open())
{ {

View File

@ -288,8 +288,7 @@ bool CObjectInterface::EventProcess(const Event &event)
} }
SetSelScript(m_selScript); SetSelScript(m_selScript);
char text[] = ""; StartEditScript(newProgram, "");
StartEditScript(newProgram, text);
std::string res; std::string res;
GetResource(RES_TEXT, RT_STUDIO_CLONED, res); GetResource(RES_TEXT, RT_STUDIO_CLONED, res);
@ -729,7 +728,7 @@ bool CObjectInterface::EventFrame(const Event &event)
// Start editing a program. // Start editing a program.
void CObjectInterface::StartEditScript(Program* program, char* name) void CObjectInterface::StartEditScript(Program* program, std::string name)
{ {
CreateInterface(false); // removes the control buttons CreateInterface(false); // removes the control buttons

View File

@ -64,7 +64,7 @@ public:
protected: protected:
bool EventFrame(const Event &event); bool EventFrame(const Event &event);
void StartEditScript(Program* program, char* name); void StartEditScript(Program* program, std::string name);
void StopEditScript(bool bCancel); void StopEditScript(bool bCancel);
void GroundFlat(); void GroundFlat();