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->SetForegroundName("");
sprintf(m_title, "%s %d.%d", GetLevelCategoryDir(m_levelCategory).c_str(), m_levelChap, m_levelRank);
sprintf(m_resume, "%s %d.%d", GetLevelCategoryDir(m_levelCategory).c_str(), m_levelChap, m_levelRank);
std::string scriptNameStr;
GetResource(RES_TEXT, RT_SCRIPT_NEW, scriptNameStr);
strcpy(m_scriptName, scriptNameStr.c_str());
m_scriptFile[0] = 0;
GetResource(RES_TEXT, RT_SCRIPT_NEW, m_scriptName);
m_scriptFile = "";
m_missionType = MISSION_NORMAL;
m_codeBattleInit = false;
@ -2890,25 +2886,25 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool 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;
}
if (line->GetCommand() == "Resume" && !resetObject)
{
strcpy(m_resume, line->GetParam("text")->AsString().c_str());
//strcpy(m_resume, line->GetParam("text")->AsString().c_str());
continue;
}
if (line->GetCommand() == "ScriptName" && !resetObject)
{
strcpy(m_scriptName, line->GetParam("text")->AsString().c_str());
m_scriptName = line->GetParam("text")->AsString();
continue;
}
if (line->GetCommand() == "ScriptFile" && !resetObject)
{
strcpy(m_scriptFile, line->GetParam("name")->AsString().c_str());
m_scriptFile = line->GetParam("name")->AsString();
continue;
}
@ -5258,22 +5254,12 @@ bool CRobotMain::GetFixScene()
}
char* CRobotMain::GetTitle()
{
return m_title;
}
char* CRobotMain::GetResume()
{
return m_resume;
}
char* CRobotMain::GetScriptName()
const std::string& CRobotMain::GetScriptName()
{
return m_scriptName;
}
char* CRobotMain::GetScriptFile()
const std::string& CRobotMain::GetScriptFile()
{
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
void CRobotMain::StartMusic()
{

View File

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

View File

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

View File

@ -288,8 +288,7 @@ bool CObjectInterface::EventProcess(const Event &event)
}
SetSelScript(m_selScript);
char text[] = "";
StartEditScript(newProgram, text);
StartEditScript(newProgram, "");
std::string res;
GetResource(RES_TEXT, RT_STUDIO_CLONED, res);
@ -729,7 +728,7 @@ bool CObjectInterface::EventFrame(const Event &event)
// 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

View File

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