diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2013-03-30 15:01:00 +0100 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2013-03-30 15:23:05 +0100 |
commit | e218dcfdf2c58f8841e7ebd220527d08e870a6d5 (patch) | |
tree | a567db04a8a51e2db87f80e259faf222a7d4becd /src/object/task/taskshield.cpp | |
parent | bfc701e286259d9a7aa2ff8240704eab2ba3a237 (diff) | |
parent | e607fed265070be8c518d4302d8b76f738421fb3 (diff) | |
download | colobot-e218dcfdf2c58f8841e7ebd220527d08e870a6d5.tar.gz colobot-e218dcfdf2c58f8841e7ebd220527d08e870a6d5.tar.bz2 colobot-e218dcfdf2c58f8841e7ebd220527d08e870a6d5.zip |
Merge branch 'dev'
Merging content from dev
Diffstat (limited to 'src/object/task/taskshield.cpp')
-rw-r--r-- | src/object/task/taskshield.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/object/task/taskshield.cpp b/src/object/task/taskshield.cpp index 93afd62..929dd5c 100644 --- a/src/object/task/taskshield.cpp +++ b/src/object/task/taskshield.cpp @@ -14,16 +14,19 @@ // * You should have received a copy of the GNU General Public License // * along with this program. If not, see http://www.gnu.org/licenses/. -// taskshield.cpp #include "object/task/taskshield.h" #include "common/iman.h" + #include "graphics/core/light.h" #include "graphics/engine/particle.h" #include "graphics/engine/lightman.h" + #include "math/geometry.h" + #include "object/brain.h" + #include "physics/physics.h" #include <string.h> @@ -34,8 +37,7 @@ const float ENERGY_TIME = 20.0f; // maximum duration if full battery // Object's constructor. -CTaskShield::CTaskShield(CInstanceManager* iMan, CObject* object) - : CTask(iMan, object) +CTaskShield::CTaskShield(CObject* object) : CTask(object) { m_rankSphere = -1; m_soundChannel = -1; @@ -486,15 +488,10 @@ bool CTaskShield::CreateLight(Math::Vector pos) memset(&light, 0, sizeof(light)); light.type = Gfx::LIGHT_SPOT; - light.diffuse.r = 0.0f; - light.diffuse.g = 1.0f; - light.diffuse.b = 2.0f; - light.position.x = pos.x; - light.position.y = pos.y; - light.position.z = pos.z; - light.direction.x = 0.0f; - light.direction.y = -1.0f; // against the bottom - light.direction.z = 0.0f; + light.ambient = Gfx::Color(0.0f, 0.0f, 0.0f); + light.diffuse = Gfx::Color(0.0f, 1.0f, 2.0f); + light.position = pos; + light.direction = Math::Vector(0.0f, -1.0f, 0.0f); // against the bottom light.spotIntensity = 128; light.attenuation0 = 1.0f; light.attenuation1 = 0.0f; @@ -521,9 +518,11 @@ void CTaskShield::IncreaseShield() float dist, shield; int i; + CInstanceManager* iMan = CInstanceManager::GetInstancePointer(); + for ( i=0 ; i<1000000 ; i++ ) { - pObj = static_cast<CObject*>(m_iMan->SearchInstance(CLASS_OBJECT, i)); + pObj = static_cast<CObject*>(iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; type = pObj->GetType(); |