From be8b7537b5e570569fc5a1e51b956e3b9e3b68e0 Mon Sep 17 00:00:00 2001 From: Erik Persson Date: Tue, 18 Feb 2014 13:47:40 +0100 Subject: [PATCH] GL - merging --- Code/Game/GameLogic/CollisionManager.cpp | 6 +++--- Code/Game/GameLogic/Game_LevelData.cpp | 4 +++- Code/Game/GameLogic/Game_PlayerData.cpp | 2 -- Code/Game/GameLogic/Level.cpp | 14 +++++++------- Code/Game/GameLogic/LevelLoader/ParseFunctions.cpp | 2 +- Code/Game/GameLogic/Player.cpp | 4 ++-- .../GamePhysics/Implementation/SimpleRigidBody.cpp | 4 ++-- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Code/Game/GameLogic/CollisionManager.cpp b/Code/Game/GameLogic/CollisionManager.cpp index 0b817975..5d1a95ec 100644 --- a/Code/Game/GameLogic/CollisionManager.cpp +++ b/Code/Game/GameLogic/CollisionManager.cpp @@ -170,12 +170,12 @@ using namespace GameLogic; void PlayerVLethalObject(Player &player, Object &obj, Oyster::Math::Float kineticEnergyLoss, Oyster::Math::Float ExtraDamage) { - int damageDone = 0; - int forceThreashHold = 200000; + Oyster::Math::Float damageDone = 0; + Oyster::Math::Float forceThreashHold = 200000; if(kineticEnergyLoss > forceThreashHold) //should only take damage if the force is high enough { - damageDone = (int)(kineticEnergyLoss * 0.10f); + damageDone = (kineticEnergyLoss * 0.10f); damageDone += ExtraDamage; //player.DamageLife(damageDone); } diff --git a/Code/Game/GameLogic/Game_LevelData.cpp b/Code/Game/GameLogic/Game_LevelData.cpp index 80220d5f..e82a3834 100644 --- a/Code/Game/GameLogic/Game_LevelData.cpp +++ b/Code/Game/GameLogic/Game_LevelData.cpp @@ -54,8 +54,10 @@ IObjectData* Game::LevelData::GetObjectAt(int ID) const void Game::LevelData::GetAllDynamicObjects(Utility::DynamicMemory::DynamicArray& mem) const { - for(int i = 0; i < level->dynamicObjects.Size(); i++) + + for(int i = 0; i < (int)level->dynamicObjects.Size(); i++) { mem[i] = level->dynamicObjects[i]; } + } \ No newline at end of file diff --git a/Code/Game/GameLogic/Game_PlayerData.cpp b/Code/Game/GameLogic/Game_PlayerData.cpp index 1b725b02..e7a77bbd 100644 --- a/Code/Game/GameLogic/Game_PlayerData.cpp +++ b/Code/Game/GameLogic/Game_PlayerData.cpp @@ -27,9 +27,7 @@ Game::PlayerData::PlayerData() } Game::PlayerData::PlayerData(int playerID,int teamID) { - Oyster::Physics::ICustomBody* rigidBody; this->player = new Player(); - } Game::PlayerData::~PlayerData() { diff --git a/Code/Game/GameLogic/Level.cpp b/Code/Game/GameLogic/Level.cpp index 030f0eca..4d3cf703 100644 --- a/Code/Game/GameLogic/Level.cpp +++ b/Code/Game/GameLogic/Level.cpp @@ -63,9 +63,9 @@ Object* Level::createGameObj(ObjectHeader* obj, ICustomBody* rigidBody) break; case ObjectSpecialType_RedExplosiveBox: { - int dmg = 50; + Oyster::Math::Float dmg = 50; Oyster::Math::Float force = 50; - int radie = 50; + Oyster::Math::Float radie = 50; gameObj = new ExplosiveCrate(rigidBody, (ObjectSpecialType)obj->specialTypeID, objID++, dmg, force, radie); } break; @@ -353,7 +353,7 @@ void Level::InitiateLevel(float radius) int offset = 0; for(int i =0; i< nrOfBoxex; i ++) { - rigidBody_TestBox = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(0, 605 + i*5, 10), 5, 0.5f, 0.8f, 0.6f); + rigidBody_TestBox = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0.0f, 0.0f, 0.0f, 1.0f), Oyster::Math::Float3(0.0f, 605.0f + i*5.0f, 10.0f), 5.0f, 0.5f, 0.8f, 0.6f); this->dynamicObjects.Push(new DynamicObject(rigidBody_TestBox, Object::DefaultCollisionAfter, ObjectSpecialType_StandardBox, idCount++)); } @@ -385,16 +385,16 @@ void Level::InitiateLevel(float radius) }*/ // add crystal - ICustomBody* rigidBody_Crystal = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(10, 605, 0), 5, 0.5f, 0.8f, 0.6f); + ICustomBody* rigidBody_Crystal = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0.0f, 0.0f, 0.0f, 1.0f), Oyster::Math::Float3(10.0f, 605.0f, 0.0f), 5.0f, 0.5f, 0.8f, 0.6f); this->dynamicObjects.Push(new DynamicObject(rigidBody_Crystal, Object::DefaultCollisionAfter, ObjectSpecialType_StandardBox, idCount++)); // add house - ICustomBody* rigidBody_House =API::Instance().AddCollisionBox(Oyster::Math::Float3(20, 20, 20), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(-50, 590, 0), 0, 0.5f, 0.8f, 0.6f); + ICustomBody* rigidBody_House =API::Instance().AddCollisionBox(Oyster::Math::Float3(20.0f, 20.0f, 20.0f), Oyster::Math::Float4(0.0f, 0.0f, 0.0f, 1.0f), Oyster::Math::Float3(-50.0f, 590.0f, 0.0f), 0.0f, 0.5f, 0.8f, 0.6f); this->staticObjects.Push(new StaticObject(rigidBody_House, Object::DefaultCollisionAfter, ObjectSpecialType_Generic, idCount++)); // add jumppad - ICustomBody* rigidBody_Jumppad = API::Instance().AddCollisionBox(Oyster::Math::Float3(1, 1, 1), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(4, 600.3, 0), 5, 0.5f, 0.8f, 0.6f); + ICustomBody* rigidBody_Jumppad = API::Instance().AddCollisionBox(Oyster::Math::Float3(1.0f, 1.0f, 1.0f), Oyster::Math::Float4(0.0f, 0.0f, 0.0f, 1.0f), Oyster::Math::Float3(4.0f, 600.3f, 0.0f), 5.0f, 0.5f, 0.8f, 0.6f); this->staticObjects.Push(new JumpPad(rigidBody_Jumppad, ObjectSpecialType_JumpPad,idCount++ ,Oyster::Math::Float3(0,2000,0))); } @@ -419,7 +419,7 @@ int Level::getNrOfDynamicObj() } Object* Level::GetObj( int ID) const { - for (int i = 0; i < this->dynamicObjects.Size(); i++) + for (int i = 0; i < (int)this->dynamicObjects.Size(); i++) { if(this->dynamicObjects[i]->GetID() == ID) return this->dynamicObjects[i]; diff --git a/Code/Game/GameLogic/LevelLoader/ParseFunctions.cpp b/Code/Game/GameLogic/LevelLoader/ParseFunctions.cpp index 826a52be..dfee72a7 100644 --- a/Code/Game/GameLogic/LevelLoader/ParseFunctions.cpp +++ b/Code/Game/GameLogic/LevelLoader/ParseFunctions.cpp @@ -119,7 +119,7 @@ namespace GameLogic int temp; - for(int i = 0; i < tempSize; i++) + for(int i = 0; i < (int)tempSize; i++) { memcpy(&temp, &buffer[start], 4); start += 4; diff --git a/Code/Game/GameLogic/Player.cpp b/Code/Game/GameLogic/Player.cpp index 79f34245..80969b29 100644 --- a/Code/Game/GameLogic/Player.cpp +++ b/Code/Game/GameLogic/Player.cpp @@ -90,7 +90,7 @@ void Player::BeginFrame() forwardDir.Normalize(); rightDir.Normalize(); Oyster::Math::Float3 walkDirection = Oyster::Math::Float3(0.0, 0.0, 0.0); - Oyster::Math::Float walkSpeed = this->moveSpeed*0.2; + Oyster::Math::Float walkSpeed = this->moveSpeed*0.2f; if (key_forward > 0.001) { @@ -122,7 +122,7 @@ void Player::BeginFrame() if (key_forward <= 0.001 && key_backward <= 0.001 && key_strafeRight <= 0.001 && key_strafeLeft <= 0.001 && key_jump <= 0.001 && this->rigidBody->GetLambda() < 0.7f) { /* Dampen when on the ground and not being moved by the player */ - linearVelocity *= 0.2; + linearVelocity *= 0.2f; this->rigidBody->SetLinearVelocity (linearVelocity); } else diff --git a/Code/Physics/GamePhysics/Implementation/SimpleRigidBody.cpp b/Code/Physics/GamePhysics/Implementation/SimpleRigidBody.cpp index f7cf6cce..4cdb282d 100644 --- a/Code/Physics/GamePhysics/Implementation/SimpleRigidBody.cpp +++ b/Code/Physics/GamePhysics/Implementation/SimpleRigidBody.cpp @@ -300,11 +300,11 @@ Float4x4 SimpleRigidBody::GetView( const ::Oyster::Math::Float3 &offset ) const Float3 SimpleRigidBody::GetGravity() const { - return this->rigidBody->getGravity(); + return (Float3)this->rigidBody->getGravity(); } Float3 SimpleRigidBody::GetLinearVelocity() const { - return this->rigidBody->getLinearVelocity(); + return (Float3)this->rigidBody->getLinearVelocity(); }