diff --git a/Bin/DLL/DebugCameraVertex.cso b/Bin/DLL/DebugCameraVertex.cso index db8c9bce..b48c3e7c 100644 Binary files a/Bin/DLL/DebugCameraVertex.cso and b/Bin/DLL/DebugCameraVertex.cso differ diff --git a/Bin/DLL/DebugPixel.cso b/Bin/DLL/DebugPixel.cso index 8f2b274b..b70d1712 100644 Binary files a/Bin/DLL/DebugPixel.cso and b/Bin/DLL/DebugPixel.cso differ diff --git a/Bin/DLL/DebugVertex.cso b/Bin/DLL/DebugVertex.cso index eb211e78..a9c67dc0 100644 Binary files a/Bin/DLL/DebugVertex.cso and b/Bin/DLL/DebugVertex.cso differ diff --git a/Bin/DLL/GameLogic_x86D.exp b/Bin/DLL/GameLogic_x86D.exp new file mode 100644 index 00000000..514d3dda Binary files /dev/null and b/Bin/DLL/GameLogic_x86D.exp differ diff --git a/Bin/DLL/GameLogic_x86D.ilk b/Bin/DLL/GameLogic_x86D.ilk new file mode 100644 index 00000000..88495735 Binary files /dev/null and b/Bin/DLL/GameLogic_x86D.ilk differ diff --git a/Bin/DLL/GameLogic_x86D.pdb b/Bin/DLL/GameLogic_x86D.pdb new file mode 100644 index 00000000..10666b03 Binary files /dev/null and b/Bin/DLL/GameLogic_x86D.pdb differ diff --git a/Bin/DLL/GamePhysics_x86D.dll b/Bin/DLL/GamePhysics_x86D.dll new file mode 100644 index 00000000..c370baa9 Binary files /dev/null and b/Bin/DLL/GamePhysics_x86D.dll differ diff --git a/Bin/DLL/GamePhysics_x86D.exp b/Bin/DLL/GamePhysics_x86D.exp new file mode 100644 index 00000000..81042824 Binary files /dev/null and b/Bin/DLL/GamePhysics_x86D.exp differ diff --git a/Bin/DLL/GamePhysics_x86D.ilk b/Bin/DLL/GamePhysics_x86D.ilk new file mode 100644 index 00000000..a7dbf2d7 Binary files /dev/null and b/Bin/DLL/GamePhysics_x86D.ilk differ diff --git a/Bin/DLL/GamePhysics_x86D.pdb b/Bin/DLL/GamePhysics_x86D.pdb new file mode 100644 index 00000000..f844c684 Binary files /dev/null and b/Bin/DLL/GamePhysics_x86D.pdb differ diff --git a/Bin/DLL/OysterGraphics_x86D.dll b/Bin/DLL/OysterGraphics_x86D.dll index ce514407..aca6d2ba 100644 Binary files a/Bin/DLL/OysterGraphics_x86D.dll and b/Bin/DLL/OysterGraphics_x86D.dll differ diff --git a/Bin/DLL/OysterGraphics_x86D.exp b/Bin/DLL/OysterGraphics_x86D.exp index 3679e007..efbd9ddd 100644 Binary files a/Bin/DLL/OysterGraphics_x86D.exp and b/Bin/DLL/OysterGraphics_x86D.exp differ diff --git a/Bin/DLL/OysterGraphics_x86D.ilk b/Bin/DLL/OysterGraphics_x86D.ilk index 8e111f12..f9a6a29e 100644 Binary files a/Bin/DLL/OysterGraphics_x86D.ilk and b/Bin/DLL/OysterGraphics_x86D.ilk differ diff --git a/Bin/DLL/OysterGraphics_x86D.pdb b/Bin/DLL/OysterGraphics_x86D.pdb index 2b032b64..6b7abac0 100644 Binary files a/Bin/DLL/OysterGraphics_x86D.pdb and b/Bin/DLL/OysterGraphics_x86D.pdb differ diff --git a/Bin/DLL/PixelGatherData.cso b/Bin/DLL/PixelGatherData.cso index 3ff8c1e0..fce9a8bd 100644 Binary files a/Bin/DLL/PixelGatherData.cso and b/Bin/DLL/PixelGatherData.cso differ diff --git a/Bin/DLL/VertexGatherData.cso b/Bin/DLL/VertexGatherData.cso index 45dd4a63..daf1087b 100644 Binary files a/Bin/DLL/VertexGatherData.cso and b/Bin/DLL/VertexGatherData.cso differ diff --git a/Code/GameLogic/CollisionManager.cpp b/Code/GameLogic/CollisionManager.cpp index cc5b75e2..253056cc 100644 --- a/Code/GameLogic/CollisionManager.cpp +++ b/Code/GameLogic/CollisionManager.cpp @@ -1,49 +1,82 @@ #include "CollisionManager.h" -using namespace GameLogic; -CollisionManager::CollisionManager(void) + +namespace GameLogic { - refManager = new RefManager(); -} - -CollisionManager::~CollisionManager(void) -{ - SAFE_DELETE(refManager); -} - -void CollisionManager::ColisionEvent(Oyster::Physics::ICustomBody &obj1, Oyster::Physics::ICustomBody &obj2) -{ - Object *realObj1 = refManager->GetMap(obj1); - Object *realObj2 = refManager->GetMap(obj2); - - - switch(realObj1->GetType()) + namespace CollisionManager { - case Object::OBJECT_TYPE_PLAYER: - if (realObj2->GetType() == Object::OBJECT_TYPE_BOX ) + + + + void ColisionEvent(Oyster::Physics::ICustomBody &obj1, Oyster::Physics::ICustomBody &obj2) { - PlayerVBox(*((Player*)realObj1),*((DynamicObject*)realObj2)); + + + //Object *realObj1 = refManager.GetMap(obj1); + //Object *realObj2 = refManager.GetMap(obj2); + // + //switch(realObj1->GetType()) + //{ + //case Object::OBJECT_TYPE_PLAYER: + + // if (realObj2->GetType() == Object::OBJECT_TYPE_BOX ) + // { + //CollisionManager::PlayerVBox(*((Player*)realObj1),*((DynamicObject*)realObj2)); + // } + + // break; + //case Object::OBJECT_TYPE_BOX: + + // if (realObj2->GetType() == Object::OBJECT_TYPE_PLAYER) + // { + // CollisionManager::PlayerVBox(*((Player*)realObj2),*((DynamicObject*)realObj1)); + // } + + // break; + //} + } - - - break; - case Object::OBJECT_TYPE_BOX: - - if (realObj2->GetType() == Object::OBJECT_TYPE_PLAYER) + void PlayerCollision(Oyster::Physics::ICustomBody &rigidBodyPlayer,Oyster::Physics::ICustomBody &obj) { - PlayerVBox(*((Player*)realObj2),*((DynamicObject*)realObj1)); - } + Player *player = ((Player*)GameLogic::RefManager::getInstance()->GetMap(rigidBodyPlayer)); + Object *realObj = GameLogic::RefManager::getInstance()->GetMap(obj); - break; + switch (realObj->GetType()) + { + case Object::OBJECT_TYPE_BOX: + PlayerVBox(*player,(*(DynamicObject*) realObj)); + break; + case Object::OBJECT_TYPE_PLAYER: + + break; + } + + //spela ljud? ta skada? etc etc + } + + void PlayerVBox(Player &player, DynamicObject &box) + { + //spela ljud? ta skada? etc etc + } + + void BoxCollision(Oyster::Physics::ICustomBody &rigidBodyBox, Oyster::Physics::ICustomBody &obj) + { + DynamicObject *box = ((DynamicObject*)GameLogic::RefManager::getInstance()->GetMap(rigidBodyBox)); + Object *realObj = GameLogic::RefManager::getInstance()->GetMap(obj); + + switch (realObj->GetType()) + { + case Object::OBJECT_TYPE_BOX: + + break; + case Object::OBJECT_TYPE_PLAYER: + PlayerVBox(*(Player*)realObj,*box); + break; + } + } } - -} - -void CollisionManager::PlayerVBox(Player &player, DynamicObject &box) -{ - //spela ljud? ta skada? etc etc } \ No newline at end of file diff --git a/Code/GameLogic/CollisionManager.h b/Code/GameLogic/CollisionManager.h index 8bbc06c7..878d6f25 100644 --- a/Code/GameLogic/CollisionManager.h +++ b/Code/GameLogic/CollisionManager.h @@ -10,20 +10,16 @@ namespace GameLogic { - class CollisionManager + namespace CollisionManager { + void PlayerCollision(Oyster::Physics::ICustomBody &rigidBodyPlayer,Oyster::Physics::ICustomBody &obj); + void BoxCollision(Oyster::Physics::ICustomBody &rigidBodyBox, Oyster::Physics::ICustomBody &obj); - public: - CollisionManager(void); - ~CollisionManager(void); - private: - void ColisionEvent(Oyster::Physics::ICustomBody &obj1, Oyster::Physics::ICustomBody &obj2); - void PlayerVBox(Player &player, DynamicObject &box); - - private: - RefManager *refManager; + void PlayerVBox(Player &player, DynamicObject &box); + void BoxVBox(DynamicObject &box1, DynamicObject &box2); + }; } diff --git a/Code/GameLogic/DynamicObject.cpp b/Code/GameLogic/DynamicObject.cpp index 303f9e7d..ec175f59 100644 --- a/Code/GameLogic/DynamicObject.cpp +++ b/Code/GameLogic/DynamicObject.cpp @@ -14,3 +14,8 @@ DynamicObject::DynamicObject(void) DynamicObject::~DynamicObject(void) { } + +void DynamicObject::Update() +{ + //updatera objectet +} \ No newline at end of file diff --git a/Code/GameLogic/DynamicObject.h b/Code/GameLogic/DynamicObject.h index 5aa47d97..2d6ffdc8 100644 --- a/Code/GameLogic/DynamicObject.h +++ b/Code/GameLogic/DynamicObject.h @@ -1,3 +1,8 @@ +////////////////////////////////////////////////// +//Created by Erik and Linda of the GameLogic team +////////////////////////////////////////////////// + + #ifndef DYNAMICOBJECT_H #define DYNAMICOBJECT_H @@ -14,6 +19,8 @@ namespace GameLogic DynamicObject(void); ~DynamicObject(void); + void Update(); + }; } diff --git a/Code/GameLogic/Game.cpp b/Code/GameLogic/Game.cpp index 5b3af050..6d6d367d 100644 --- a/Code/GameLogic/Game.cpp +++ b/Code/GameLogic/Game.cpp @@ -31,7 +31,5 @@ void Game::Update(keyInput keyPressed) } void Game::Render() { - Oyster::Graphics::Model::Model* model_Arr; - model_Arr = player->Render(); - Oyster::Graphics::API::RenderScene(model_Arr, 1); + player->Render(); } \ No newline at end of file diff --git a/Code/GameLogic/GameMode.h b/Code/GameLogic/GameMode.h index 0187f4b7..42273946 100644 --- a/Code/GameLogic/GameMode.h +++ b/Code/GameLogic/GameMode.h @@ -1,3 +1,8 @@ +////////////////////////////////////////////////// +//Created by Erik and Linda of the GameLogic team +////////////////////////////////////////////////// + + #ifndef GAMEMODE_H #define GAMEMODE_H diff --git a/Code/GameLogic/IGame.h b/Code/GameLogic/IGame.h index 582eac90..ce46b7d8 100644 --- a/Code/GameLogic/IGame.h +++ b/Code/GameLogic/IGame.h @@ -1,4 +1,6 @@ -// Game Logic interface +////////////////////////////////////////////////// +//Created by Erik and Linda of the GameLogic team +////////////////////////////////////////////////// #ifndef IGAME_H #define IGAME_H diff --git a/Code/GameLogic/Level.h b/Code/GameLogic/Level.h index 6cfa50ee..b43f193d 100644 --- a/Code/GameLogic/Level.h +++ b/Code/GameLogic/Level.h @@ -1,3 +1,8 @@ +////////////////////////////////////////////////// +//Created by Erik and Linda of the GameLogic team +////////////////////////////////////////////////// + + #ifndef LEVEL_H #define LEVEL_H diff --git a/Code/GameLogic/Object.cpp b/Code/GameLogic/Object.cpp index 53af4c22..a83d1fb6 100644 --- a/Code/GameLogic/Object.cpp +++ b/Code/GameLogic/Object.cpp @@ -1,5 +1,7 @@ #include "Object.h" #include "OysterMath.h" +#include "DllInterfaces\GFXAPI.h" +#include "CollisionManager.h" using namespace GameLogic; @@ -8,60 +10,40 @@ using namespace Oyster::Math; using namespace Oyster::Graphics::Model; using namespace Utility::DynamicMemory; +using namespace Oyster::Physics; Object::Object(void) { + model = new Model(); model = Oyster::Graphics::API::CreateModel(L"bth.obj"); - /*struct float4 - { - float x,y,z,w; - }; + ICustomBody* temp = rigidBody = API::Instance().CreateSimpleRigidBody().Release(); - float4 mesh[] = - { - {-1.0f,1.0f,0.0f,1.0f}, - {1.0f,1.0f,0.0f,1.0f}, - {1.0f,-1.0f,0.0f,1.0f}, - }; + rigidBody->SetCenter(Float3(50,0,0)); + rigidBody->SetMass_KeepMomentum(30); + rigidBody->SetSize(Float3(2,2,2)); + rigidBody->SetSubscription(true); + rigidBody->SetMomentOfInertiaTensor_KeepMomentum(Float4x4(MomentOfInertia::CreateCuboidMatrix(30, 2, 2, 2))); - Oyster::Graphics::Buffer::BUFFER_INIT_DESC desc; - desc.ElementSize= sizeof(float4); - desc.NumElements = 3; - desc.InitData=mesh; - desc.Type = Oyster::Graphics::Buffer::BUFFER_TYPE::VERTEX_BUFFER; - desc.Usage = Oyster::Graphics::Buffer::BUFFER_USAGE::BUFFER_USAGE_IMMUTABLE; - Oyster::Graphics::Buffer *b = new Oyster::Graphics::Buffer(); - b->Init(desc); + GameLogic::RefManager::getInstance()->AddMapping(*rigidBody, *this); - ModelInfo* modelInfo = new ModelInfo(); - modelInfo->Vertices = *b; - - modelInfo->Indexed = false; - modelInfo->VertexCount = 3; - - - Float4x4 matrix = Float4x4::identity; - - model->World = &matrix; - model->info = modelInfo; - model->Visible = true;*/ } Object::~Object(void) { - //SAFE_DELETE(model->info); - Oyster::Graphics::API::DeleteModel(model); + Oyster::Graphics::API::DeleteModel(model); + } -Model* Object::Render() + +void Object::Render() { - //model->info->Vertices.Apply(0); this->rigidBody->GetOrientation(model->WorldMatrix); - return model; + Oyster::Graphics::API::RenderScene(model, 1); + } Object::OBJECT_TYPE Object::GetType() diff --git a/Code/GameLogic/Object.h b/Code/GameLogic/Object.h index 426fae82..be2f77a6 100644 --- a/Code/GameLogic/Object.h +++ b/Code/GameLogic/Object.h @@ -1,3 +1,8 @@ +////////////////////////////////////////////////// +//Created by Erik and Linda of the GameLogic team +////////////////////////////////////////////////// + + #ifndef OBJECT_H #define OBJECT_H @@ -8,6 +13,7 @@ #include "Utilities.h" + namespace GameLogic { class Object @@ -22,7 +28,7 @@ namespace GameLogic OBJECT_TYPE_BOX, }; - Oyster::Graphics::Model::Model* Render(); + void Render(); OBJECT_TYPE GetType(); @@ -33,8 +39,9 @@ namespace GameLogic //either a model pointer or an ID to an arraypos filled with models that are to be rendered //rigidBody - Oyster::Physics::ICustomBody* rigidBody; - Oyster::Graphics::Model::Model* model; + Oyster::Physics::ICustomBody *rigidBody; + Oyster::Graphics::Model::Model *model; + }; } diff --git a/Code/GameLogic/Player.cpp b/Code/GameLogic/Player.cpp index f507e581..3a9ae029 100644 --- a/Code/GameLogic/Player.cpp +++ b/Code/GameLogic/Player.cpp @@ -13,16 +13,6 @@ Player::Player(void) :Object() { life = 100; - - Oyster::Physics::ICustomBody* temp = rigidBody = API::Instance().CreateSimpleRigidBody().Release(); - - rigidBody->SetCenter(Oyster::Math::Float3(50,0,0)); - rigidBody->SetMass_KeepMomentum(30); - rigidBody->SetSize(Oyster::Math::Float3(2,2,2)); - rigidBody->SetSubscription(true); - rigidBody->SetMomentOfInertiaTensor_KeepMomentum(Oyster::Math::Float4x4( Oyster::Physics::MomentOfInertia::CreateCuboidMatrix(30, 2, 2, 2))); - - //API::Instance().AddObject(temp); } diff --git a/Code/GameLogic/Player.h b/Code/GameLogic/Player.h index 0e6f39b5..7726fed4 100644 --- a/Code/GameLogic/Player.h +++ b/Code/GameLogic/Player.h @@ -1,3 +1,8 @@ +////////////////////////////////////////////////// +//Created by Erik and Linda of the GameLogic team +////////////////////////////////////////////////// + + #ifndef PLAYER_H #define PLAYER_H diff --git a/Code/GameLogic/RefManager.cpp b/Code/GameLogic/RefManager.cpp index 022ec6bb..a119898c 100644 --- a/Code/GameLogic/RefManager.cpp +++ b/Code/GameLogic/RefManager.cpp @@ -4,6 +4,8 @@ using namespace GameLogic; typedef std::pair mapData; +RefManager* RefManager::instance = 0; + RefManager::RefManager(void) { } @@ -13,6 +15,25 @@ RefManager::~RefManager(void) { } +void RefManager::Release() +{ + if (instance) + { + delete instance; + instance = NULL; + } + +} + +RefManager* RefManager::getInstance( ) +{ + if (!instance) + { + instance = new RefManager(); + }; + return instance; +} + Object* RefManager::GetMap(Oyster::Physics::ICustomBody &body) { return mapper[&body]; diff --git a/Code/GameLogic/RefManager.h b/Code/GameLogic/RefManager.h index 1aa51dc8..b5fd91d2 100644 --- a/Code/GameLogic/RefManager.h +++ b/Code/GameLogic/RefManager.h @@ -1,3 +1,8 @@ +////////////////////////////////////////////////// +//Created by Erik and Linda of the GameLogic team +////////////////////////////////////////////////// + + #ifndef REFMANAGER_H #define REFMANAGER_H @@ -14,13 +19,19 @@ namespace GameLogic RefManager(void); ~RefManager(void); + static RefManager* getInstance( ); + void Release(); + + Object* GetMap(Oyster::Physics::ICustomBody &body); //returns the object of an rigidBody, mainly used for CollisionHandler void AddMapping(Oyster::Physics::ICustomBody &body, Object &obj); //adds a mapping with body as key and the object as a value private: + static RefManager* instance; std::map mapper; //mapper points a rigidBody to an actual game object + }; } #endif \ No newline at end of file diff --git a/Code/GameLogic/StaticObject.h b/Code/GameLogic/StaticObject.h index 8637e460..07d23311 100644 --- a/Code/GameLogic/StaticObject.h +++ b/Code/GameLogic/StaticObject.h @@ -1,3 +1,8 @@ +////////////////////////////////////////////////// +//Created by Erik and Linda of the GameLogic team +////////////////////////////////////////////////// + + #ifndef STATICOBJECT_H #define STATICOBJECT_H diff --git a/Code/GameLogic/Weapon.h b/Code/GameLogic/Weapon.h index 72a335d4..e8d37a15 100644 --- a/Code/GameLogic/Weapon.h +++ b/Code/GameLogic/Weapon.h @@ -1,3 +1,8 @@ +////////////////////////////////////////////////// +//Created by Erik and Linda of the GameLogic team +////////////////////////////////////////////////// + + #ifndef WEAPON_H #define WEAPON_H diff --git a/Code/OysterGraphics/OysterGraphics.vcxproj b/Code/OysterGraphics/OysterGraphics.vcxproj index 0f640874..09f743b7 100644 --- a/Code/OysterGraphics/OysterGraphics.vcxproj +++ b/Code/OysterGraphics/OysterGraphics.vcxproj @@ -149,7 +149,6 @@ - @@ -226,6 +225,8 @@ + + diff --git a/Code/OysterGraphics/OysterGraphics.vcxproj.filters b/Code/OysterGraphics/OysterGraphics.vcxproj.filters index 7a556a5f..3bb4036f 100644 --- a/Code/OysterGraphics/OysterGraphics.vcxproj.filters +++ b/Code/OysterGraphics/OysterGraphics.vcxproj.filters @@ -1,102 +1,40 @@  - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - -<<<<<<< HEAD - -======= - ->>>>>>> origin/Graphics - Source Files - - - Source Files - -<<<<<<< HEAD - -======= - - Source Files - - - Source Files - - - Source Files - - ->>>>>>> origin/Graphics - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file