summaryrefslogtreecommitdiffstats
path: root/src/object/auto/autonest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/object/auto/autonest.cpp')
-rw-r--r--src/object/auto/autonest.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/object/auto/autonest.cpp b/src/object/auto/autonest.cpp
index f3c70fb..9658e23 100644
--- a/src/object/auto/autonest.cpp
+++ b/src/object/auto/autonest.cpp
@@ -1,5 +1,6 @@
// * This file is part of the COLOBOT source code
// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
+// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
// *
// * This program is free software: you can redistribute it and/or modify
// * it under the terms of the GNU General Public License as published by
@@ -20,7 +21,7 @@
#include "object/auto/autonest.h"
#include "common/iman.h"
-#include "old/terrain.h"
+#include "graphics/engine/terrain.h"
#include "script/cmdtoken.h"
@@ -72,9 +73,9 @@ void CAutoNest::Init()
m_speed = 1.0f/4.0f;
m_time = 0.0f;
- m_lastParticule = 0.0f;
+ m_lastParticle = 0.0f;
- pos = m_object->RetPosition(0);
+ pos = m_object->GetPosition(0);
m_terrain->MoveOnFloor(pos);
m_fretPos = pos;
}
@@ -88,8 +89,8 @@ bool CAutoNest::EventProcess(const Event &event)
CAuto::EventProcess(event);
- if ( m_engine->RetPause() ) return true;
- if ( event.event != EVENT_FRAME ) return true;
+ if ( m_engine->GetPause() ) return true;
+ if ( event.type != EVENT_FRAME ) return true;
m_progress += event.rTime*m_speed;
@@ -154,10 +155,10 @@ bool CAutoNest::SearchFree(Math::Vector pos)
for ( i=0 ; i<1000000 ; i++ )
{
- pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i);
+ pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i));
if ( pObj == 0 ) break;
- type = pObj->RetType();
+ type = pObj->GetType();
if ( type == OBJECT_NEST ) continue;
j = 0;
@@ -199,15 +200,15 @@ CObject* CAutoNest::SearchFret()
for ( i=0 ; i<1000000 ; i++ )
{
- pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i);
+ pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i));
if ( pObj == 0 ) break;
- if ( !pObj->RetLock() ) continue;
+ if ( !pObj->GetLock() ) continue;
- type = pObj->RetType();
+ type = pObj->GetType();
if ( type != OBJECT_BULLET ) continue;
- oPos = pObj->RetPosition(0);
+ oPos = pObj->GetPosition(0);
if ( oPos.x == m_fretPos.x &&
oPos.z == m_fretPos.z )
{
@@ -219,9 +220,9 @@ CObject* CAutoNest::SearchFret()
}
-// Returns an error due the state of the automation.
+// Geturns an error due the state of the automation.
-Error CAutoNest::RetError()
+Error CAutoNest::GetError()
{
return ERR_OK;
}
@@ -263,11 +264,11 @@ bool CAutoNest::Read(char *line)
CAuto::Read(line);
- m_phase = (AutoNestPhase)OpInt(line, "aPhase", ANP_WAIT);
+ m_phase = static_cast< AutoNestPhase >(OpInt(line, "aPhase", ANP_WAIT));
m_progress = OpFloat(line, "aProgress", 0.0f);
m_speed = OpFloat(line, "aSpeed", 1.0f);
- m_lastParticule = 0.0f;
+ m_lastParticle = 0.0f;
return true;
}