summaryrefslogtreecommitdiffstats
path: root/src/object
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2014-10-07 22:15:40 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2014-10-07 22:15:40 +0200
commit5274acd624c3a5ad60592cee2ebc869b10a96fda (patch)
tree04836157b8c3aa9553d5e67e8ed248220ff1661a /src/object
parent3ef2f976df56817d2a23d4fe88a1917798beaacd (diff)
parent2770ee8927cb91419b1918f46228435026790cf6 (diff)
downloadcolobot-5274acd624c3a5ad60592cee2ebc869b10a96fda.tar.gz
colobot-5274acd624c3a5ad60592cee2ebc869b10a96fda.tar.bz2
colobot-5274acd624c3a5ad60592cee2ebc869b10a96fda.zip
Merge with dev
Diffstat (limited to 'src/object')
-rw-r--r--src/object/brain.cpp173
-rw-r--r--src/object/brain.h3
-rw-r--r--src/object/robotmain.cpp257
-rw-r--r--src/object/robotmain.h1
4 files changed, 84 insertions, 350 deletions
diff --git a/src/object/brain.cpp b/src/object/brain.cpp
index 4bd8742..01f20f9 100644
--- a/src/object/brain.cpp
+++ b/src/object/brain.cpp
@@ -812,11 +812,23 @@ void CBrain::StopProgram()
void CBrain::StopTask()
{
- if ( m_primaryTask != 0 )
+ if (m_primaryTask != nullptr)
{
m_primaryTask->Abort();
delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
+ m_primaryTask = nullptr;
+ }
+}
+
+// Stops the current secondary task.
+
+void CBrain::StopSecondaryTask()
+{
+ if (m_secondaryTask != nullptr)
+ {
+ m_secondaryTask->Abort();
+ delete m_secondaryTask; // stops the current secondary task
+ m_secondaryTask = nullptr;
}
}
@@ -900,16 +912,10 @@ void CBrain::StopEditScript(bool bCancel)
Error CBrain::StartTaskTake()
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskTake();
+ Error err = m_primaryTask->StartTaskTake();
UpdateInterface();
return err;
}
@@ -918,16 +924,10 @@ Error CBrain::StartTaskTake()
Error CBrain::StartTaskManip(TaskManipOrder order, TaskManipArm arm)
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskManip(order, arm);
+ Error err = m_primaryTask->StartTaskManip(order, arm);
UpdateInterface();
return err;
}
@@ -936,16 +936,10 @@ Error CBrain::StartTaskManip(TaskManipOrder order, TaskManipArm arm)
Error CBrain::StartTaskFlag(TaskFlagOrder order, int rank)
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskFlag(order, rank);
+ Error err = m_primaryTask->StartTaskFlag(order, rank);
UpdateInterface();
return err;
}
@@ -954,16 +948,10 @@ Error CBrain::StartTaskFlag(TaskFlagOrder order, int rank)
Error CBrain::StartTaskBuild(ObjectType type)
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskBuild(type);
+ Error err = m_primaryTask->StartTaskBuild(type);
UpdateInterface();
return err;
}
@@ -972,16 +960,10 @@ Error CBrain::StartTaskBuild(ObjectType type)
Error CBrain::StartTaskSearch()
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskSearch();
+ Error err = m_primaryTask->StartTaskSearch();
UpdateInterface();
return err;
}
@@ -990,38 +972,26 @@ Error CBrain::StartTaskSearch()
Error CBrain::StartTaskTerraform()
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskTerraform();
+ Error err = m_primaryTask->StartTaskTerraform();
UpdateInterface();
return err;
}
// Change pencil.
-Error CBrain::StartTaskPen(bool bDown, int color)
+Error CBrain::StartTaskPen(bool down, int color)
{
- Error err;
-
m_physics->SetMotorSpeedX(0.0f);
m_physics->SetMotorSpeedY(0.0f);
m_physics->SetMotorSpeedZ(0.0f);
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskPen(bDown, color);
+ Error err = m_primaryTask->StartTaskPen(down, color);
UpdateInterface();
return err;
}
@@ -1030,16 +1000,10 @@ Error CBrain::StartTaskPen(bool bDown, int color)
Error CBrain::StartTaskRecover()
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskRecover();
+ Error err = m_primaryTask->StartTaskRecover();
UpdateInterface();
return err;
}
@@ -1048,16 +1012,10 @@ Error CBrain::StartTaskRecover()
Error CBrain::StartTaskShield(TaskShieldMode mode)
{
- Error err;
-
- if ( m_secondaryTask != 0 )
- {
- delete m_secondaryTask; // stops the current task
- m_secondaryTask = 0;
- }
+ StopSecondaryTask();
m_secondaryTask = new CTaskManager(m_object);
- err = m_secondaryTask->StartTaskShield(mode, 1000.0f);
+ Error err = m_secondaryTask->StartTaskShield(mode, 1000.0f);
UpdateInterface();
return err;
}
@@ -1066,16 +1024,10 @@ Error CBrain::StartTaskShield(TaskShieldMode mode)
Error CBrain::StartTaskFire(float delay)
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskFire(delay);
+ Error err = m_primaryTask->StartTaskFire(delay);
UpdateInterface();
return err;
}
@@ -1084,16 +1036,10 @@ Error CBrain::StartTaskFire(float delay)
Error CBrain::StartTaskSpiderExplo()
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskSpiderExplo();
+ Error err = m_primaryTask->StartTaskSpiderExplo();
UpdateInterface();
return err;
}
@@ -1102,16 +1048,10 @@ Error CBrain::StartTaskSpiderExplo()
Error CBrain::StartTaskFireAnt(Math::Vector impact)
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskFireAnt(impact);
+ Error err = m_primaryTask->StartTaskFireAnt(impact);
UpdateInterface();
return err;
}
@@ -1120,16 +1060,10 @@ Error CBrain::StartTaskFireAnt(Math::Vector impact)
Error CBrain::StartTaskGunGoal(float dirV, float dirH)
{
- Error err;
-
- if ( m_secondaryTask != 0 )
- {
- delete m_secondaryTask; // stops the current task
- m_secondaryTask = 0;
- }
+ StopSecondaryTask();
m_secondaryTask = new CTaskManager(m_object);
- err = m_secondaryTask->StartTaskGunGoal(dirV, dirH);
+ Error err = m_secondaryTask->StartTaskGunGoal(dirV, dirH);
UpdateInterface();
return err;
}
@@ -1138,16 +1072,10 @@ Error CBrain::StartTaskGunGoal(float dirV, float dirH)
Error CBrain::StartTaskReset(Math::Vector goal, Math::Vector angle)
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskReset(goal, angle);
+ Error err = m_primaryTask->StartTaskReset(goal, angle);
UpdateInterface();
return err;
}
@@ -1156,30 +1084,29 @@ Error CBrain::StartTaskReset(Math::Vector goal, Math::Vector angle)
Error CBrain::EndedTask()
{
- Error err;
-
- if ( m_secondaryTask != 0 ) // current task?
+ if (m_secondaryTask != nullptr) // current task?
{
- err = m_secondaryTask->IsEnded();
+ Error err = m_secondaryTask->IsEnded();
if ( err != ERR_CONTINUE ) // job ended?
{
delete m_secondaryTask;
- m_secondaryTask = 0;
+ m_secondaryTask = nullptr;
UpdateInterface();
}
}
- if ( m_primaryTask != 0 ) // current task?
+ if (m_primaryTask != nullptr) // current task?
{
- err = m_primaryTask->IsEnded();
+ Error err = m_primaryTask->IsEnded();
if ( err != ERR_CONTINUE ) // job ended?
{
delete m_primaryTask;
- m_primaryTask = 0;
+ m_primaryTask = nullptr;
UpdateInterface();
}
return err;
}
+
return ERR_STOP;
}
diff --git a/src/object/brain.h b/src/object/brain.h
index a1f5da7..6b0d790 100644
--- a/src/object/brain.h
+++ b/src/object/brain.h
@@ -102,6 +102,7 @@ public:
int GetProgram();
void StopProgram();
void StopTask();
+ void StopSecondaryTask();
bool IntroduceVirus();
void SetActiveVirus(bool bActive);
@@ -128,7 +129,7 @@ public:
Error StartTaskBuild(ObjectType type);
Error StartTaskSearch();
Error StartTaskTerraform();
- Error StartTaskPen(bool bDown, int color);
+ Error StartTaskPen(bool down, int color);
Error StartTaskRecover();
Error StartTaskShield(TaskShieldMode mode);
Error StartTaskFire(float delay);
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp
index a409aa0..c274367 100644
--- a/src/object/robotmain.cpp
+++ b/src/object/robotmain.cpp
@@ -717,11 +717,11 @@ CRobotMain::CRobotMain(CApplication* app, bool loadProfile)
if (loadProfile)
{
- if (GetProfile().GetLocalProfileFloat("Edit", "FontSize", fValue)) m_fontSize = fValue;
- if (GetProfile().GetLocalProfileFloat("Edit", "WindowPosX", fValue)) m_windowPos.x = fValue;
- if (GetProfile().GetLocalProfileFloat("Edit", "WindowPosY", fValue)) m_windowPos.y = fValue;
- if (GetProfile().GetLocalProfileFloat("Edit", "WindowDimX", fValue)) m_windowDim.x = fValue;
- if (GetProfile().GetLocalProfileFloat("Edit", "WindowDimY", fValue)) m_windowDim.y = fValue;
+ if (GetProfile().GetFloatProperty("Edit", "FontSize", fValue)) m_fontSize = fValue;
+ if (GetProfile().GetFloatProperty("Edit", "WindowPosX", fValue)) m_windowPos.x = fValue;
+ if (GetProfile().GetFloatProperty("Edit", "WindowPosY", fValue)) m_windowPos.y = fValue;
+ if (GetProfile().GetFloatProperty("Edit", "WindowDimX", fValue)) m_windowDim.x = fValue;
+ if (GetProfile().GetFloatProperty("Edit", "WindowDimY", fValue)) m_windowDim.y = fValue;
}
m_IOPublic = false;
@@ -731,11 +731,11 @@ CRobotMain::CRobotMain(CApplication* app, bool loadProfile)
if (loadProfile)
{
- if (GetProfile().GetLocalProfileInt ("Edit", "IOPublic", iValue)) m_IOPublic = iValue;
- if (GetProfile().GetLocalProfileFloat("Edit", "IOPosX", fValue)) m_IOPos.x = fValue;
- if (GetProfile().GetLocalProfileFloat("Edit", "IOPosY", fValue)) m_IOPos.y = fValue;
- if (GetProfile().GetLocalProfileFloat("Edit", "IODimX", fValue)) m_IODim.x = fValue;
- if (GetProfile().GetLocalProfileFloat("Edit", "IODimY", fValue)) m_IODim.y = fValue;
+ if (GetProfile().GetIntProperty ("Edit", "IOPublic", iValue)) m_IOPublic = iValue;
+ if (GetProfile().GetFloatProperty("Edit", "IOPosX", fValue)) m_IOPos.x = fValue;
+ if (GetProfile().GetFloatProperty("Edit", "IOPosY", fValue)) m_IOPos.y = fValue;
+ if (GetProfile().GetFloatProperty("Edit", "IODimX", fValue)) m_IODim.x = fValue;
+ if (GetProfile().GetFloatProperty("Edit", "IODimY", fValue)) m_IODim.y = fValue;
}
m_short->FlushShortcuts();
@@ -753,7 +753,7 @@ CRobotMain::CRobotMain(CApplication* app, bool loadProfile)
g_unit = UNIT;
m_gamerName = "";
- if (loadProfile) GetProfile().GetLocalProfileString("Gamer", "LastName", m_gamerName);
+ if (loadProfile) GetProfile().GetStringProperty("Gamer", "LastName", m_gamerName);
SetGlobalGamerName(m_gamerName);
ReadFreeParam();
if (loadProfile) m_dialog->SetupRecall();
@@ -962,18 +962,18 @@ void CRobotMain::CreateIni()
{
m_dialog->SetupMemorize();
- GetProfile().SetLocalProfileFloat("Edit", "FontSize", m_fontSize);
- GetProfile().SetLocalProfileFloat("Edit", "WindowPosX", m_windowPos.x);
- GetProfile().SetLocalProfileFloat("Edit", "WindowPosY", m_windowPos.y);
- GetProfile().SetLocalProfileFloat("Edit", "WindowDimX", m_windowDim.x);
- GetProfile().SetLocalProfileFloat("Edit", "WindowDimY", m_windowDim.y);
- GetProfile().SetLocalProfileInt("Edit", "IOPublic", m_IOPublic);
- GetProfile().SetLocalProfileFloat("Edit", "IOPosX", m_IOPos.x);
- GetProfile().SetLocalProfileFloat("Edit", "IOPosY", m_IOPos.y);
- GetProfile().SetLocalProfileFloat("Edit", "IODimX", m_IODim.x);
- GetProfile().SetLocalProfileFloat("Edit", "IODimY", m_IODim.y);
+ GetProfile().SetFloatProperty("Edit", "FontSize", m_fontSize);
+ GetProfile().SetFloatProperty("Edit", "WindowPosX", m_windowPos.x);
+ GetProfile().SetFloatProperty("Edit", "WindowPosY", m_windowPos.y);
+ GetProfile().SetFloatProperty("Edit", "WindowDimX", m_windowDim.x);
+ GetProfile().SetFloatProperty("Edit", "WindowDimY", m_windowDim.y);
+ GetProfile().SetIntProperty("Edit", "IOPublic", m_IOPublic);
+ GetProfile().SetFloatProperty("Edit", "IOPosX", m_IOPos.x);
+ GetProfile().SetFloatProperty("Edit", "IOPosY", m_IOPos.y);
+ GetProfile().SetFloatProperty("Edit", "IODimX", m_IODim.x);
+ GetProfile().SetFloatProperty("Edit", "IODimY", m_IODim.y);
- GetProfile().SaveCurrentDirectory();
+ GetProfile().Save();
}
void CRobotMain::SetDefaultInputBindings()
@@ -2279,7 +2279,7 @@ float CRobotMain::GetGameTime()
void CRobotMain::SetFontSize(float size)
{
m_fontSize = size;
- GetProfile().SetLocalProfileFloat("Edit", "FontSize", m_fontSize);
+ GetProfile().SetFloatProperty("Edit", "FontSize", m_fontSize);
}
float CRobotMain::GetFontSize()
@@ -2291,8 +2291,8 @@ float CRobotMain::GetFontSize()
void CRobotMain::SetWindowPos(Math::Point pos)
{
m_windowPos = pos;
- GetProfile().SetLocalProfileFloat("Edit", "WindowPosX", m_windowPos.x);
- GetProfile().SetLocalProfileFloat("Edit", "WindowPosY", m_windowPos.y);
+ GetProfile().SetFloatProperty("Edit", "WindowPosX", m_windowPos.x);
+ GetProfile().SetFloatProperty("Edit", "WindowPosY", m_windowPos.y);
}
Math::Point CRobotMain::GetWindowPos()
@@ -2303,8 +2303,8 @@ Math::Point CRobotMain::GetWindowPos()
void CRobotMain::SetWindowDim(Math::Point dim)
{
m_windowDim = dim;
- GetProfile().SetLocalProfileFloat("Edit", "WindowDimX", m_windowDim.x);
- GetProfile().SetLocalProfileFloat("Edit", "WindowDimY", m_windowDim.y);
+ GetProfile().SetFloatProperty("Edit", "WindowDimX", m_windowDim.x);
+ GetProfile().SetFloatProperty("Edit", "WindowDimY", m_windowDim.y);
}
Math::Point CRobotMain::GetWindowDim()
@@ -2317,7 +2317,7 @@ Math::Point CRobotMain::GetWindowDim()
void CRobotMain::SetIOPublic(bool mode)
{
m_IOPublic = mode;
- GetProfile().SetLocalProfileInt("Edit", "IOPublic", m_IOPublic);
+ GetProfile().SetIntProperty("Edit", "IOPublic", m_IOPublic);
}
bool CRobotMain::GetIOPublic()
@@ -2328,8 +2328,8 @@ bool CRobotMain::GetIOPublic()
void CRobotMain::SetIOPos(Math::Point pos)
{
m_IOPos = pos;
- GetProfile().SetLocalProfileFloat("Edit", "IOPosX", m_IOPos.x);
- GetProfile().SetLocalProfileFloat("Edit", "IOPosY", m_IOPos.y);
+ GetProfile().SetFloatProperty("Edit", "IOPosX", m_IOPos.x);
+ GetProfile().SetFloatProperty("Edit", "IOPosY", m_IOPos.y);
}
Math::Point CRobotMain::GetIOPos()
@@ -2340,8 +2340,8 @@ Math::Point CRobotMain::GetIOPos()
void CRobotMain::SetIODim(Math::Point dim)
{
m_IODim = dim;
- GetProfile().SetLocalProfileFloat("Edit", "IODimX", m_IODim.x);
- GetProfile().SetLocalProfileFloat("Edit", "IODimY", m_IODim.y);
+ GetProfile().SetFloatProperty("Edit", "IODimX", m_IODim.x);
+ GetProfile().SetFloatProperty("Edit", "IODimY", m_IODim.y);
}
Math::Point CRobotMain::GetIODim()
@@ -3624,199 +3624,6 @@ char* SkipNum(char *p)
return p;
}
-//! Conversion of units
-void CRobotMain::Convert()
-{
- char* base = m_dialog->GetSceneName();
- int rank = m_dialog->GetSceneRank();
-
- //TODO change line to string
- char line[500];
- std::string tempLine;
-
- m_dialog->BuildSceneName(tempLine, base, rank);
- strcpy(line, tempLine.c_str());
- FILE* file = fopen(line, "r");
- if (file == NULL) return;
-
- strcpy(line+strlen(line)-4, ".new");
- FILE* fileNew = fopen(line, "w");
- if (fileNew == NULL) return;
-
- char lineNew[500];
- char s[200];
-
- while (fgets(line, 500, file) != NULL)
- {
- strcpy(lineNew, line);
-
- if (Cmd(line, "DeepView"))
- {
- char* p = strstr(line, "air=");
- if (p != 0)
- {
- float value = OpFloat(line, "air", 500.0f);
- value /= g_unit;
- p[0] = 0;
- p = SkipNum(p+4);
- strcpy(lineNew, line);
- strcat(lineNew, "air=");
- sprintf(s, "%.2f", value);
- strcat(lineNew, s);
- strcat(lineNew, " ");
- strcat(lineNew, p);
- }
- strcpy(line, lineNew);
-
- p = strstr(line, "water=");
- if (p != 0)
- {
- float value = OpFloat(line, "water", 100.0f);
- value /= g_unit;
- p[0] = 0;
- p = SkipNum(p+6);
- strcpy(lineNew, line);
- strcat(lineNew, "water=");
- sprintf(s, "%.2f", value);
- strcat(lineNew, s);
- strcat(lineNew, " ");
- strcat(lineNew, p);
- }
- strcpy(line, lineNew);
- }
-
- if (Cmd(line, "TerrainGenerate"))
- {
- char* p = strstr(line, "vision=");
- if (p != 0)
- {
- float value = OpFloat(line, "vision", 500.0f);
- value /= g_unit;
- p[0] = 0;
- p = SkipNum(p+7);
- strcpy(lineNew, line);
- strcat(lineNew, "vision=");
- sprintf(s, "%.2f", value);
- strcat(lineNew, s);
- strcat(lineNew, " ");
- strcat(lineNew, p);
- }
- }
-
- if (Cmd(line, "CreateObject") ||
- Cmd(line, "CreateSpot"))
- {
- char* p = strstr(line, "pos=");
- if (p != 0)
- {
- Math::Vector pos = OpPos(line, "pos");
- pos.x /= g_unit;
- pos.y /= g_unit;
- pos.z /= g_unit;
- p[0] = 0;
- p = SkipNum(p+4);
- p = SkipNum(p+1);
- strcpy(lineNew, line);
- strcat(lineNew, "pos=");
- sprintf(s, "%.2f", pos.x);
- strcat(lineNew, s);
- strcat(lineNew, ";");
- sprintf(s, "%.2f", pos.z);
- strcat(lineNew, s);
- strcat(lineNew, " ");
- strcat(lineNew, p);
- }
- }
-
- if (Cmd(line, "EndMissionTake") || Cmd(line, "AudioChange"))
- {
- char* p = strstr(line, "pos=");
- if (p != 0)
- {
- Math::Vector pos = OpPos(line, "pos");
- pos.x /= g_unit;
- pos.y /= g_unit;
- pos.z /= g_unit;
- p[0] = 0;
- p = SkipNum(p+4);
- p = SkipNum(p+1);
- strcpy(lineNew, line);
- strcat(lineNew, "pos=");
- sprintf(s, "%.2f", pos.x);
- strcat(lineNew, s);
- strcat(lineNew, ";");
- sprintf(s, "%.2f", pos.z);
- strcat(lineNew, s);
- strcat(lineNew, " ");
- strcat(lineNew, p);
- }
- strcpy(line, lineNew);
-
- p = strstr(line, "dist=");
- if (p != 0)
- {
- float value = OpFloat(line, "dist", 32.0f);
- value /= g_unit;
- p[0] = 0;
- p = SkipNum(p+5);
- strcpy(lineNew, line);
- strcat(lineNew, "dist=");
- sprintf(s, "%.2f", value);
- strcat(lineNew, s);
- strcat(lineNew, " ");
- strcat(lineNew, p);
- }
- strcpy(line, lineNew);
- }
-
- if (Cmd(line, "Camera"))
- {
- char* p = strstr(line, "pos=");
- if (p != 0)
- {
- Math::Vector pos = OpPos(line, "pos");
- pos.x /= g_unit;
- pos.y /= g_unit;
- pos.z /= g_unit;
- p[0] = 0;
- p = SkipNum(p+4);
- p = SkipNum(p+1);
- strcpy(lineNew, line);
- strcat(lineNew, "pos=");
- sprintf(s, "%.2f", pos.x);
- strcat(lineNew, s);
- strcat(lineNew, ";");
- sprintf(s, "%.2f", pos.z);
- strcat(lineNew, s);
- strcat(lineNew, " ");
- strcat(lineNew, p);
- }
- strcpy(line, lineNew);
-
- p = strstr(line, "h=");
- if (p != 0)
- {
- float value = OpFloat(line, "h", 32.0f);
- value /= g_unit;
- p[0] = 0;
- p = SkipNum(p+2);
- strcpy(lineNew, line);
- strcat(lineNew, "h=");
- sprintf(s, "%.2f", value);
- strcat(lineNew, s);
- strcat(lineNew, " ");
- strcat(lineNew, p);
- }
- strcpy(line, lineNew);
- }
-
- fputs(lineNew, fileNew);
- }
-
- fclose(fileNew);
- fclose(file);
-}
-
//! Load the scene for the character
void CRobotMain::ScenePerso()
{
diff --git a/src/object/robotmain.h b/src/object/robotmain.h
index 2c173fb..ab02b33 100644
--- a/src/object/robotmain.h
+++ b/src/object/robotmain.h
@@ -397,7 +397,6 @@ protected:
bool EventObject(const Event &event);
void InitEye();
- void Convert();
void CreateScene(bool soluce, bool fixScene, bool resetObject);
Math::Vector LookatPoint(Math::Vector eye, float angleH, float angleV, float length);