From 804c5df7a9ad6d03bfe3d9f44a6c722a273389cc Mon Sep 17 00:00:00 2001 From: Linda Andersson Date: Tue, 3 Dec 2013 11:47:04 +0100 Subject: [PATCH 01/19] GL uppdate game test progam for physics --- Code/GameLogic/CollisionManager.cpp | 17 ++++++++++------- Code/GameLogic/CollisionManager.h | 5 +++-- Code/GameLogic/DynamicObject.cpp | 6 ++++-- Code/GameLogic/DynamicObject.h | 2 +- Code/GameLogic/Game.cpp | 11 ++++++++++- Code/GameLogic/Game.h | 1 + Code/GameLogic/Object.cpp | 7 ++++--- Code/GameLogic/Object.h | 2 +- Code/GameLogic/Player.cpp | 8 ++++++-- Code/GameLogic/Player.h | 2 +- Code/GameLogic/RefManager.cpp | 6 +++--- Code/GameLogic/RefManager.h | 6 +++--- Code/GameLogic/StaticObject.cpp | 3 ++- Code/GameLogic/StaticObject.h | 2 +- Code/GameLogic/Weapon.cpp | 3 ++- Code/GameLogic/Weapon.h | 2 +- 16 files changed, 53 insertions(+), 30 deletions(-) diff --git a/Code/GameLogic/CollisionManager.cpp b/Code/GameLogic/CollisionManager.cpp index f7868b79..52eaa4f3 100644 --- a/Code/GameLogic/CollisionManager.cpp +++ b/Code/GameLogic/CollisionManager.cpp @@ -1,6 +1,6 @@ #include "CollisionManager.h" - +using namespace Oyster; namespace GameLogic { @@ -8,10 +8,10 @@ namespace GameLogic namespace CollisionManager { - void PlayerCollision(Oyster::Physics::ICustomBody &rigidBodyPlayer,Oyster::Physics::ICustomBody &obj) + Physics::ICustomBody::SubscriptMessage PlayerCollision(const Oyster::Physics::ICustomBody *rigidBodyPlayer, const Oyster::Physics::ICustomBody *obj) { - Player *player = ((Player*)GameLogic::RefManager::getInstance()->GetMap(rigidBodyPlayer)); - Object *realObj = GameLogic::RefManager::getInstance()->GetMap(obj); + Player *player = ((Player*)GameLogic::RefManager::getInstance()->GetMap(*rigidBodyPlayer)); + Object *realObj = GameLogic::RefManager::getInstance()->GetMap(*obj); switch (realObj->GetType()) { @@ -24,6 +24,7 @@ namespace GameLogic } //spela ljud? ta skada? etc etc + return Physics::ICustomBody::SubscriptMessage_none; } void PlayerVBox(Player &player, DynamicObject &box) @@ -31,10 +32,10 @@ namespace GameLogic //spela ljud? ta skada? etc etc } - void BoxCollision(Oyster::Physics::ICustomBody &rigidBodyBox, Oyster::Physics::ICustomBody &obj) + Physics::ICustomBody::SubscriptMessage BoxCollision(const Oyster::Physics::ICustomBody *rigidBodyBox, const Oyster::Physics::ICustomBody *obj) { - DynamicObject *box = ((DynamicObject*)GameLogic::RefManager::getInstance()->GetMap(rigidBodyBox)); - Object *realObj = GameLogic::RefManager::getInstance()->GetMap(obj); + DynamicObject *box = ((DynamicObject*)GameLogic::RefManager::getInstance()->GetMap(*rigidBodyBox)); + Object *realObj = GameLogic::RefManager::getInstance()->GetMap(*obj); switch (realObj->GetType()) { @@ -45,6 +46,8 @@ namespace GameLogic PlayerVBox(*(Player*)realObj,*box); break; } + + return Physics::ICustomBody::SubscriptMessage_none; } } } \ No newline at end of file diff --git a/Code/GameLogic/CollisionManager.h b/Code/GameLogic/CollisionManager.h index a650f595..f88404cc 100644 --- a/Code/GameLogic/CollisionManager.h +++ b/Code/GameLogic/CollisionManager.h @@ -13,8 +13,9 @@ namespace GameLogic namespace CollisionManager { //these are the main collision functions - void PlayerCollision(Oyster::Physics::ICustomBody &rigidBodyPlayer,Oyster::Physics::ICustomBody &obj); - void BoxCollision(Oyster::Physics::ICustomBody &rigidBodyBox, Oyster::Physics::ICustomBody &obj); + //typedef SubscriptMessage (*EventAction_Collision)( const ICustomBody *proto, const ICustomBody *deuter ); + Oyster::Physics::ICustomBody::SubscriptMessage PlayerCollision(const Oyster::Physics::ICustomBody *rigidBodyPlayer, const Oyster::Physics::ICustomBody *obj); + Oyster::Physics::ICustomBody::SubscriptMessage BoxCollision(const Oyster::Physics::ICustomBody *rigidBodyBox, const Oyster::Physics::ICustomBody *obj); //these are the specific collision case functions void PlayerVBox(Player &player, DynamicObject &box); diff --git a/Code/GameLogic/DynamicObject.cpp b/Code/GameLogic/DynamicObject.cpp index 14e0518d..3c7cfe21 100644 --- a/Code/GameLogic/DynamicObject.cpp +++ b/Code/GameLogic/DynamicObject.cpp @@ -1,12 +1,14 @@ #include "DynamicObject.h" +#include "CollisionManager.h" using namespace GameLogic; using namespace Oyster::Physics; using namespace Utility::DynamicMemory; -DynamicObject::DynamicObject(void) - :Object() +DynamicObject::DynamicObject(std::wstring objFile) + :Object(objFile) { + rigidBody->SetSubscription(CollisionManager::BoxCollision); } diff --git a/Code/GameLogic/DynamicObject.h b/Code/GameLogic/DynamicObject.h index 2d6ffdc8..7daf7345 100644 --- a/Code/GameLogic/DynamicObject.h +++ b/Code/GameLogic/DynamicObject.h @@ -16,7 +16,7 @@ namespace GameLogic { public: - DynamicObject(void); + DynamicObject(std::wstring objFile); ~DynamicObject(void); void Update(); diff --git a/Code/GameLogic/Game.cpp b/Code/GameLogic/Game.cpp index b4095130..7e54fcee 100644 --- a/Code/GameLogic/Game.cpp +++ b/Code/GameLogic/Game.cpp @@ -1,4 +1,5 @@ #include "Game.h" + using namespace GameLogic; Game::Game(void) @@ -26,7 +27,13 @@ Game::~Game(void) void Game::Init() { - player = new Player(); + //Oyster::Physics::API::SetSubscription("remove object"); + + player = new Player(L"worldDummy"); + + box = new DynamicObject(L"crate"); + //poi + //box = new physcTestObj("box"); camera = new Camera(); } void Game::StartGame() @@ -60,9 +67,11 @@ void Game::Update(keyInput keyPressed, float pitch, float yaw) camera->Walk(0.1); } camera->UpdateViewMatrix(); + //poi Oyster::Physics::API::Update(); } void Game::Render() { Oyster::Graphics::API::NewFrame(camera->View(), camera->Proj()); player->Render(); + box->Render(); } \ No newline at end of file diff --git a/Code/GameLogic/Game.h b/Code/GameLogic/Game.h index 0a8a031a..b3ac07c3 100644 --- a/Code/GameLogic/Game.h +++ b/Code/GameLogic/Game.h @@ -21,6 +21,7 @@ namespace GameLogic private: Level* level; + DynamicObject* box; Player* player; Camera* camera; }; diff --git a/Code/GameLogic/Object.cpp b/Code/GameLogic/Object.cpp index 33679058..a1f03da3 100644 --- a/Code/GameLogic/Object.cpp +++ b/Code/GameLogic/Object.cpp @@ -12,15 +12,16 @@ using namespace Oyster::Graphics::Model; using namespace Utility::DynamicMemory; using namespace Oyster::Physics; -Object::Object(void) +Object::Object(std::wstring objFile) { - model = new Model(); - model = Oyster::Graphics::API::CreateModel(L"orca"); + //model = new Model(); + model = Oyster::Graphics::API::CreateModel(objFile); API::SimpleBodyDescription sbDesc; //sbDesc.centerPosition = + //poi ICustomBody* temp = rigidBody = API::Instance().CreateRigidBody(sbDesc).Release(); GameLogic::RefManager::getInstance()->AddMapping(*rigidBody, *this); diff --git a/Code/GameLogic/Object.h b/Code/GameLogic/Object.h index 767edb1f..1c1c2830 100644 --- a/Code/GameLogic/Object.h +++ b/Code/GameLogic/Object.h @@ -25,7 +25,7 @@ namespace GameLogic OBJECT_TYPE_PLAYER, OBJECT_TYPE_BOX, }; - Object(void); + Object(std::wstring objFile ); virtual ~Object(void); void Render(); diff --git a/Code/GameLogic/Player.cpp b/Code/GameLogic/Player.cpp index 93a83506..a7b80805 100644 --- a/Code/GameLogic/Player.cpp +++ b/Code/GameLogic/Player.cpp @@ -1,13 +1,15 @@ #include "Player.h" #include "OysterMath.h" +#include "CollisionManager.h" using namespace GameLogic; using namespace Oyster::Physics; -Player::Player(void) - :Object() +Player::Player(std::wstring objFile) + :Object( objFile ) { life = 100; + rigidBody->SetSubscription(CollisionManager::PlayerCollision); } Player::~Player(void) { @@ -16,6 +18,7 @@ Player::~Player(void) void Player::Update(keyInput keyPressed) { + if(keyPressed != keyInput_none) { Move(keyPressed); @@ -24,6 +27,7 @@ void Player::Update(keyInput keyPressed) void Player::Move(keyInput keyPressed) { + if(keyPressed == keyInput_A) { Oyster::Math::Float3 pos = this->rigidBody->GetCenter(); diff --git a/Code/GameLogic/Player.h b/Code/GameLogic/Player.h index 7c4045e3..a15319b3 100644 --- a/Code/GameLogic/Player.h +++ b/Code/GameLogic/Player.h @@ -17,7 +17,7 @@ namespace GameLogic { public: - Player(void); + Player(std::wstring objFile); ~Player(void); /******************************************************** diff --git a/Code/GameLogic/RefManager.cpp b/Code/GameLogic/RefManager.cpp index a119898c..cb3d099f 100644 --- a/Code/GameLogic/RefManager.cpp +++ b/Code/GameLogic/RefManager.cpp @@ -2,7 +2,7 @@ using namespace GameLogic; -typedef std::pair mapData; +typedef std::pair mapData; RefManager* RefManager::instance = 0; @@ -34,12 +34,12 @@ RefManager* RefManager::getInstance( ) return instance; } -Object* RefManager::GetMap(Oyster::Physics::ICustomBody &body) +Object* RefManager::GetMap(const Oyster::Physics::ICustomBody &body) { return mapper[&body]; } -void RefManager::AddMapping(Oyster::Physics::ICustomBody &body, Object &obj) +void RefManager::AddMapping( const Oyster::Physics::ICustomBody &body, Object &obj) { mapper.insert(mapData(&body,&obj)); } diff --git a/Code/GameLogic/RefManager.h b/Code/GameLogic/RefManager.h index b5fd91d2..a184e220 100644 --- a/Code/GameLogic/RefManager.h +++ b/Code/GameLogic/RefManager.h @@ -23,13 +23,13 @@ namespace GameLogic 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 + Object* GetMap(const Oyster::Physics::ICustomBody &body); //returns the object of an rigidBody, mainly used for CollisionHandler + void AddMapping(const 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 + std::map mapper; //mapper points a rigidBody to an actual game object }; diff --git a/Code/GameLogic/StaticObject.cpp b/Code/GameLogic/StaticObject.cpp index 855ef645..da30a54e 100644 --- a/Code/GameLogic/StaticObject.cpp +++ b/Code/GameLogic/StaticObject.cpp @@ -2,7 +2,8 @@ using namespace GameLogic; -StaticObject::StaticObject(void) +StaticObject::StaticObject(std::wstring objFile) + :Object(objFile) { } diff --git a/Code/GameLogic/StaticObject.h b/Code/GameLogic/StaticObject.h index 07d23311..73ed30f1 100644 --- a/Code/GameLogic/StaticObject.h +++ b/Code/GameLogic/StaticObject.h @@ -15,7 +15,7 @@ namespace GameLogic { public: - StaticObject(void); + StaticObject(std::wstring objFile); ~StaticObject(void); }; diff --git a/Code/GameLogic/Weapon.cpp b/Code/GameLogic/Weapon.cpp index 2cbd4e71..1bbc5618 100644 --- a/Code/GameLogic/Weapon.cpp +++ b/Code/GameLogic/Weapon.cpp @@ -2,7 +2,8 @@ using namespace GameLogic; -Weapon::Weapon(void) +Weapon::Weapon(std::wstring objFile) + :Object(objFile) { } diff --git a/Code/GameLogic/Weapon.h b/Code/GameLogic/Weapon.h index e8d37a15..dcac1d02 100644 --- a/Code/GameLogic/Weapon.h +++ b/Code/GameLogic/Weapon.h @@ -15,7 +15,7 @@ namespace GameLogic { public: - Weapon(void); + Weapon(std::wstring objFile); ~Weapon(void); private: From a852e8eab4b4c320905843270377c96f5b090d05 Mon Sep 17 00:00:00 2001 From: dean11 Date: Tue, 3 Dec 2013 12:07:37 +0100 Subject: [PATCH 02/19] Created the game modules --- Bin/Content/Models/PLACEHOLDER | 0 Bin/Content/Shaders/DebugCameraVertex.cso | Bin 0 -> 2628 bytes Bin/Content/Shaders/DebugPixel.cso | Bin 0 -> 488 bytes Bin/Content/Shaders/DebugVertex.cso | Bin 0 -> 540 bytes Bin/Content/Shaders/LightPass.cso | Bin 0 -> 336 bytes Bin/Content/Shaders/PixelGatherData.cso | Bin 0 -> 820 bytes Bin/Content/Shaders/TextureDebug.cso | Bin 0 -> 760 bytes Bin/Content/Shaders/VertexGatherData.cso | Bin 0 -> 2852 bytes Bin/Content/Textures/PLACEHOLDER | 0 Bin/DLL/LightPass.cso | Bin 12124 -> 0 bytes Code/DanBias.sln | 287 ++++++++++-------- Code/Game/DanBiasGame/DLLMain.cpp | 8 + .../DanBiasGame/DanBiasGame.vcxproj | 41 +-- .../{ => Game}/DanBiasGame/DanBiasMaincpp.cpp | 0 Code/Game/DanBiasGame/Include/DanBiasGame.h | 37 +++ .../DanBiasLauncher/DanBiasLauncher.vcxproj | 179 +++++++++++ Code/Game/DanBiasLauncher/Launcher.cpp | 38 +++ Code/Game/DanBiasServer/DLLMain.cpp | 8 + Code/Game/DanBiasServer/DanBiasServer.vcxproj | 169 +++++++++++ .../Game/DanBiasServer/DanBiasServer_Impl.cpp | 39 +++ .../DanBiasServer/Include/DanBiasServer.h | 38 +++ Code/{ => Game}/GameLogic/Camera.cpp | 0 Code/{ => Game}/GameLogic/Camera.h | 0 .../{ => Game}/GameLogic/CollisionManager.cpp | 0 Code/{ => Game}/GameLogic/CollisionManager.h | 0 Code/{ => Game}/GameLogic/DynamicObject.cpp | 0 Code/{ => Game}/GameLogic/DynamicObject.h | 0 Code/{ => Game}/GameLogic/Game.cpp | 0 Code/{ => Game}/GameLogic/Game.h | 0 Code/{ => Game}/GameLogic/GameLogic.vcxproj | 19 +- Code/{ => Game}/GameLogic/GameMode.cpp | 0 Code/{ => Game}/GameLogic/GameMode.h | 0 Code/{ => Game}/GameLogic/IGame.cpp | 0 Code/{ => Game}/GameLogic/IGame.h | 0 Code/{ => Game}/GameLogic/Level.cpp | 0 Code/{ => Game}/GameLogic/Level.h | 0 Code/{ => Game}/GameLogic/Object.cpp | 0 Code/{ => Game}/GameLogic/Object.h | 0 Code/{ => Game}/GameLogic/Player.cpp | 0 Code/{ => Game}/GameLogic/Player.h | 0 Code/{ => Game}/GameLogic/RefManager.cpp | 0 Code/{ => Game}/GameLogic/RefManager.h | 0 Code/{ => Game}/GameLogic/StaticObject.cpp | 0 Code/{ => Game}/GameLogic/StaticObject.h | 0 Code/{ => Game}/GameLogic/TestGLMain.cpp | 0 Code/{ => Game}/GameLogic/Weapon.cpp | 0 Code/{ => Game}/GameLogic/Weapon.h | 0 Code/GameLogic/GameLogic.vcxproj.filters | 96 ------ Code/OysterGraphics/DllInterfaces/GFXAPI.h | 1 - Code/OysterPhysics3D/OysterPhysics3D.vcxproj | 8 +- 50 files changed, 705 insertions(+), 263 deletions(-) create mode 100644 Bin/Content/Models/PLACEHOLDER create mode 100644 Bin/Content/Shaders/DebugCameraVertex.cso create mode 100644 Bin/Content/Shaders/DebugPixel.cso create mode 100644 Bin/Content/Shaders/DebugVertex.cso create mode 100644 Bin/Content/Shaders/LightPass.cso create mode 100644 Bin/Content/Shaders/PixelGatherData.cso create mode 100644 Bin/Content/Shaders/TextureDebug.cso create mode 100644 Bin/Content/Shaders/VertexGatherData.cso create mode 100644 Bin/Content/Textures/PLACEHOLDER delete mode 100644 Bin/DLL/LightPass.cso create mode 100644 Code/Game/DanBiasGame/DLLMain.cpp rename Code/{ => Game}/DanBiasGame/DanBiasGame.vcxproj (88%) rename Code/{ => Game}/DanBiasGame/DanBiasMaincpp.cpp (100%) create mode 100644 Code/Game/DanBiasGame/Include/DanBiasGame.h create mode 100644 Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj create mode 100644 Code/Game/DanBiasLauncher/Launcher.cpp create mode 100644 Code/Game/DanBiasServer/DLLMain.cpp create mode 100644 Code/Game/DanBiasServer/DanBiasServer.vcxproj create mode 100644 Code/Game/DanBiasServer/DanBiasServer_Impl.cpp create mode 100644 Code/Game/DanBiasServer/Include/DanBiasServer.h rename Code/{ => Game}/GameLogic/Camera.cpp (100%) rename Code/{ => Game}/GameLogic/Camera.h (100%) rename Code/{ => Game}/GameLogic/CollisionManager.cpp (100%) rename Code/{ => Game}/GameLogic/CollisionManager.h (100%) rename Code/{ => Game}/GameLogic/DynamicObject.cpp (100%) rename Code/{ => Game}/GameLogic/DynamicObject.h (100%) rename Code/{ => Game}/GameLogic/Game.cpp (100%) rename Code/{ => Game}/GameLogic/Game.h (100%) rename Code/{ => Game}/GameLogic/GameLogic.vcxproj (92%) rename Code/{ => Game}/GameLogic/GameMode.cpp (100%) rename Code/{ => Game}/GameLogic/GameMode.h (100%) rename Code/{ => Game}/GameLogic/IGame.cpp (100%) rename Code/{ => Game}/GameLogic/IGame.h (100%) rename Code/{ => Game}/GameLogic/Level.cpp (100%) rename Code/{ => Game}/GameLogic/Level.h (100%) rename Code/{ => Game}/GameLogic/Object.cpp (100%) rename Code/{ => Game}/GameLogic/Object.h (100%) rename Code/{ => Game}/GameLogic/Player.cpp (100%) rename Code/{ => Game}/GameLogic/Player.h (100%) rename Code/{ => Game}/GameLogic/RefManager.cpp (100%) rename Code/{ => Game}/GameLogic/RefManager.h (100%) rename Code/{ => Game}/GameLogic/StaticObject.cpp (100%) rename Code/{ => Game}/GameLogic/StaticObject.h (100%) rename Code/{ => Game}/GameLogic/TestGLMain.cpp (100%) rename Code/{ => Game}/GameLogic/Weapon.cpp (100%) rename Code/{ => Game}/GameLogic/Weapon.h (100%) delete mode 100644 Code/GameLogic/GameLogic.vcxproj.filters diff --git a/Bin/Content/Models/PLACEHOLDER b/Bin/Content/Models/PLACEHOLDER new file mode 100644 index 00000000..e69de29b diff --git a/Bin/Content/Shaders/DebugCameraVertex.cso b/Bin/Content/Shaders/DebugCameraVertex.cso new file mode 100644 index 0000000000000000000000000000000000000000..d9e567be113914c6b913012b85586ef11a19629f GIT binary patch literal 2628 zcmb7FL2FZ46h80eC9kQ$iZB}ye2Xq-Hl;=>Er_Hx&9u-oC23=Y0Z|*Z5>0tia5ckQ z=*ESU#r%LW425akxSFj$!OeinF0$xa#AW06-FMIPDjACxPVc$reCM3++;d-3-Mq1| zf8qC?e~SOsOaDcG{drt}?TJWrT%>?~7BcWfx}nH1WVR^s3Nqh&GWR#^6!A}nTi7d9 zWfFg{S(y~i=ptj#xcD~^B(Tdv>?MTdMG}#TeyV$km+5}uLq{AcOe6&v>;apDANWC% zlZ`$4fJyT31xQbyZ+rsZ0J+4^!4^9HobexI{s8_l#~&E~(D+#|4?pX9sK**Svj%d5 z&md77^Llddg^js985$dN6>Kiw=Hi*T(BK~WGr4GEE+4sE8*}-{MH_R4Cf7!P+;Zo+ z2wg<_=-1?;?ToP<7#r%CIQmPlD<|d*Wh3i_eT5>tb7SMZ@;*a3K<%_XXTp04Y%e^s z7u*Lpq;a&dmjJ!EHue&r7uQBTl%c6(=X#`lfc6`K4;T|ezeou-GY7VH1b*hNcoH6g zM}IgJX)RToBvcVkA_UzM32HAR;TnVJ87=`#ZX;2A?i{pKFGHtK?IsoS(%AO%2o}?bD5pHmWsx(AQ9EM`Nrb-^e>TlA3d?VI z|3yTo;ZgerHU#G59}%HnV3j9(Ql7*pAD1UFYIk`WJZjUgJYB5I^E9l>)5R)J-na5} zYq&g#8O77!!IOUF>0(`;r(s>5E*3n;I8(lb_7Cao$b}dR>W-^l?J!HhzD3TEv7>P0 zx_`muv^bcudK#;FnFoAA)-!$D-rM=ChIymPpL@Y_XD)kB**n(vwLhN5^UN5X4RxIj zYwHZ$*_c}PyL8`>!P|T~8yD-&<}|E3o3F4%{hpQk$BECqfU?Yp!7hVitOqqNtW z{Xaol44b*v^XYyaBW|tFukRw}B82^Mkq<=|`}&@xc}|OIRu^kaNKQ^W5boq5!O4(= zIuH4U=MjsXD4lQk=wIu^wfN5C4wZUutJ9UkL*`_yJxBu4#axW}0I5K9y|qdOJLBHj z^D*{{71!S0?mR`A!yKj&WVZ?~aqm&*-tKnqi5!+#XhiJIUfkW1`u4rJ_iOL|ZuDdG zr)X)VwGy=+-r4HJ(L(R>&UP2d+|-rnsk!p>^wi~J!-c#&l&hOCrCi5j*XsCK5gS%1$5iwA#1-mrmvYuTNy%LzMsk literal 0 HcmV?d00001 diff --git a/Bin/Content/Shaders/DebugPixel.cso b/Bin/Content/Shaders/DebugPixel.cso new file mode 100644 index 0000000000000000000000000000000000000000..32d35ff28af4f7a0157daf18cddca2dbc2812b90 GIT binary patch literal 488 zcmZ>XaB_Az!)NXFHnyQ`yKQRZJLf5k3=9k}fCL+mwgBP@Kzsp+eSl(1fOrcKJLczE z1^~rCn1Sj4e;pvD0%C(n5DS4Bf%1V246FXcQ9z2Y&+t!;=O7 z|1&TId$~sKPJ|IqIU|{~FAOK`BFqkngaKPA14j>U!v+Nic7=uF`LrQ=$Odx3} z0NQ~9(D^8mSUAXLVUdOl1-ZDofx`nX!oVN{VzU5!2DB8!_RUN#$}i4OD^bu0(p2#9 z3HDJ4&PYs2EmCmK&n?Kz0WvK0j1BZGjSLL*49$!!Oc+*s2D|%lK+Ocv{y;t`yg~i| b@fCm=2AH7?ejptj79ZjmXaB|+?>FVdywqJVci+|fx&@+k%1pb#{)Hd5)c5g7#Pxl`adZ^*g$;@ zW(*9hFut1{MBEN&ZE%QVNC{9LXfPZgvq6F&{iFbN{kZf7xwyIoph?Pr_$>eagDeHH zeKV7b@{9A+N)$ALG!;C2f_)T%GZIr$ixiyma|<$afDB7LV*@=)BLf3HLo;Iw6Nc5E z!R~%KK)oP$a{#dd5W@g7l)(=SumJyH&k#?4KZez-SNr4812O}y2gnW%i-&6i0F?$t A*Z=?k literal 0 HcmV?d00001 diff --git a/Bin/Content/Shaders/LightPass.cso b/Bin/Content/Shaders/LightPass.cso new file mode 100644 index 0000000000000000000000000000000000000000..495854bb97ae47cc78b480c3f72577900f817481 GIT binary patch literal 336 zcmZ>XaB^;_&Oe|zyZ6iL*LATTce$1_GB7X%00~wgZ34tSKs*PC*8uSqAP#bIbqfH} z$Up|fVF`9-0O|v=eKV7b@{9A+N)$ALG!;C2f_)T%GZIr$ixiyma|<$afDB7LV*@=) zBLf3HLo;Iw6Nc5E!R~$>P(wkqKN>&S!!<$yDDD7s8Av{hgMo22&{mLpVb~7H3=VM& RDS?UsDXajbo)kc=dH{`GCE)-7 literal 0 HcmV?d00001 diff --git a/Bin/Content/Shaders/PixelGatherData.cso b/Bin/Content/Shaders/PixelGatherData.cso new file mode 100644 index 0000000000000000000000000000000000000000..400255d7ceb4ec6d32cb65042e1ada232e9fec4d GIT binary patch literal 820 zcmb7CO-mb56g@N1CcA{Lr4Axe5kgu;3`lj%#2AP(c4m-lM64eeutriBUAP$h6)v-I z7YcS$x~T5D@5Z$o1y?To1MwU)qmqTtL(aT2=e~R2y?Nu*7fP4c{@TU<&#RGf)0h~$ z8#4e*rGPhFXUIR~EY06!&IE2rySZOHqA$YicI#Y5r5~SC&omhS3=9IRB@%(?BNi&3PJq{V+b*VxIOczU|eLcN}|0obw4Vg3t~RxsQ!LL1({&>iiF0 z)_N_^cgl+^eH(`KKEQv5he|IuHe1ba&7DK*y+3X()q~3srx2#h0>p^3WqL`m7 zh1|pUf3K5xaP$y=lkO+EdD3nIIh@i(JXw#xi(6U9l z*+jpgMg5Na1+Lmn=c*GzcHqoC-?{g@_s*9rttHxDAO7vfyHEdH{o;CJG3^5I?FL2| zqvQ*z(7Y#u^xw&NqaG{M7s74Z%M1b0ov)|>T$t&d0T*kgSxMst7<%pL2Y7wYYcv2K z{njhIt!IvL)0gv&Z39L&smq*Ia*EuN`dx(zC{4nHldj&_0QMCO%_|CL0~OY_)ov~Y zj5#{p%crlpIj7eO*EGzy+2mbW)Iq-%PkR4{LAgQRp!<3jjkCsKQw`{|YBq1=RinCBuAHig#_>t* zh$0q>ghR3Ua5yx#6p1dtvT{bI_`n|0*GpDOfy{Mw@=?qCIS{{-r?_-XM)76OQSz2_ zAihxg7@IrmnvpYeS`lWdl+ZLiiK3<#;(7cgEX&fkSCI8GNA^-l2hvN>>u1LGOv>cH F`~ZQ)TEqYV literal 0 HcmV?d00001 diff --git a/Bin/Content/Shaders/VertexGatherData.cso b/Bin/Content/Shaders/VertexGatherData.cso new file mode 100644 index 0000000000000000000000000000000000000000..14e821480af9c735e3f8af039ba1818bb728df90 GIT binary patch literal 2852 zcmb7GKWGzi6n>XWlP0OA2reR+p+j9tZAC0dN!lcBAWce=#tMRzCTgT@N-PLY2jb$O z9UTNSNQV}|Npuj3;2hl1yWiz{38enu<=%bo`@Q$R-=Axf%QLet zYt!=O;cMgjqj$egWnXM*A~F&Y3E+7Z*7Aw01x0?rN+FSKSR_&3n0f`ACceMz3Z8Mg zGJ@Z0wvC8p`XYnyIQZ)qB(aBvxfd{PK*SJlL@!EYI1 zS!yx{4(7C)exzp%Jj4XC7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vWawDJT)fs)`0&)!2jHeTjD)%KOVSy>+UUVwGu#n3K1^FHSsLk+(HQ3yP7V3^g8j# z2R}gP!N&0b#^7<*UssC`lB(Fl?6>`k3^fn8L#uZQ5bs^M@Hyam}9A zvn=6Ec1?zbWXR0g^9=ifaL7ScTL-4SFbLiG0a{Myl4hb3yDah_WJl|8R;gmxO7PUZ zp^-)FxQJ%>3O0P~D#bZmxsPUI-nNguS0t}2l7B$*GKz})LB;GLL=|hLM9_0IzKN6Bkyvsn_0rhNO!yHk>4{Dg$)af~?UUVI0_Om?=(4lQRSY>S) z$#x?JLmq4x4;1&md-kth*8dx(vR*}2-2=3&<(jHOxAC5`k~VV8UonSQp(MTvHarua z2Rsj~od@dKW8%#9G8G~HeH0S~x@*JQmF`(yZx56@j(PpR-o3N-<)e?!RdtAae}J)< zcChQ8?xbSJ2{~aqVVcl|Mq>85i2`-c3!Kt~r->{<8Qsvrg$%f+f&FIh)RJCY=1j}f zN%HuI!P}*6l`+IrUKZm>WM6^>!=oRt6Qx + +BOOL WINAPI DllMain( _In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID lpvReserved ) +{ + MessageBox(0, L"DanBiasGame Loaded", 0, 0); + return TRUE; +} \ No newline at end of file diff --git a/Code/DanBiasGame/DanBiasGame.vcxproj b/Code/Game/DanBiasGame/DanBiasGame.vcxproj similarity index 88% rename from Code/DanBiasGame/DanBiasGame.vcxproj rename to Code/Game/DanBiasGame/DanBiasGame.vcxproj index 88181e55..d2d48214 100644 --- a/Code/DanBiasGame/DanBiasGame.vcxproj +++ b/Code/Game/DanBiasGame/DanBiasGame.vcxproj @@ -25,26 +25,26 @@ - Application + DynamicLibrary true v110 Unicode - Application + DynamicLibrary true v110 Unicode - Application + DynamicLibrary false v110 true Unicode - Application + DynamicLibrary false v110 true @@ -68,28 +68,28 @@ true - $(SolutionDir)..\Bin\Executable\ + $(SolutionDir)..\Bin\DLL\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; true - $(SolutionDir)..\Bin\Executable\ + $(SolutionDir)..\Bin\DLL\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; false - $(SolutionDir)..\Bin\Executable\ + $(SolutionDir)..\Bin\DLL\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; false - $(SolutionDir)..\Bin\Executable\ + $(SolutionDir)..\Bin\DLL\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; @@ -100,7 +100,7 @@ Level3 Disabled - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) true $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) @@ -117,7 +117,7 @@ Level3 Disabled - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) true $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) @@ -136,7 +136,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) true $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) @@ -157,7 +157,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) true $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) @@ -171,21 +171,22 @@ - - {b1195bb9-b3a5-47f0-906c-8dea384d1520} - - + {7e3990d2-3d94-465c-b58d-64a74b3ecf9b} - - {f10cbc03-9809-4cba-95d8-327c287b18ee} + + {0ec83e64-230e-48ef-b08c-6ac9651b4f82} - - {4285bd3f-3c6c-4670-b7af-a29afef5f6a8} + + {b1195bb9-b3a5-47f0-906c-8dea384d1520} + + + + diff --git a/Code/DanBiasGame/DanBiasMaincpp.cpp b/Code/Game/DanBiasGame/DanBiasMaincpp.cpp similarity index 100% rename from Code/DanBiasGame/DanBiasMaincpp.cpp rename to Code/Game/DanBiasGame/DanBiasMaincpp.cpp diff --git a/Code/Game/DanBiasGame/Include/DanBiasGame.h b/Code/Game/DanBiasGame/Include/DanBiasGame.h new file mode 100644 index 00000000..c24fe460 --- /dev/null +++ b/Code/Game/DanBiasGame/Include/DanBiasGame.h @@ -0,0 +1,37 @@ +#ifndef DANBIASGAME_DANBIASGAME_H +#define DANBIASGAME_DANBIASGAME_H + +#if defined (DANBIAS_GAME_DLL_EXPORT) + #define DANBIAS_GAME_DLL __declspec(dllexport) +#else + #define DANBIAS_GAME_DLL __declspec(dllimport) +#endif + +namespace DanBias +{ + extern "C" + { + enum DanBiasClientReturn + { + DanBiasClientReturn_Error, + DanBiasClientReturn_Sucess, + }; + + struct DanBiasGameDesc + { + //Stuff goes here... + int port; + }; + + class DANBIAS_GAME_DLL DanBiasGame + { + public: + static DanBiasClientReturn Initiate(DanBiasGameDesc& desc); + static DanBiasClientReturn Run(); + static void Release(); + }; + + }//End Extern "C" +} //End namspace DanBias + +#endif // !DANBIASGAME_DANBIASGAME_H diff --git a/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj b/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj new file mode 100644 index 00000000..2605ece8 --- /dev/null +++ b/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj @@ -0,0 +1,179 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {8690FDDF-C5B7-4C42-A337-BD5243F29B85} + Win32Proj + DanBiasLauncher + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)..\Bin\Executable\ + $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ + $(ProjectName)_$(PlatformShortName)D + $(IncludePath) + $(OutDir)..\DLL\;$(LibraryPath); + + + true + $(SolutionDir)..\Bin\Executable\ + $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ + $(ProjectName)_$(PlatformShortName)D + $(IncludePath) + $(OutDir)..\DLL\;$(LibraryPath); + + + false + $(SolutionDir)..\Bin\Executable\ + $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ + $(ProjectName)_$(PlatformShortName) + $(IncludePath) + $(OutDir)..\DLL\;$(LibraryPath); + + + false + $(SolutionDir)..\Bin\Executable\ + $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ + $(ProjectName)_$(PlatformShortName) + $(IncludePath) + $(OutDir)..\DLL\;$(LibraryPath); + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + $(SolutionDir)Game\DanBiasServer\Include + + + Windows + true + DanBiasServer_$(PlatformShortName)D.dll;DanBiasGame_$(PlatformShortName)D.dll;%(DelayLoadDLLs) + DanBiasServer_$(PlatformShortName)D.lib;DanBiasGame_$(PlatformShortName)D.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + $(SolutionDir)Game\DanBiasServer\Include + + + Windows + true + DanBiasServer_$(PlatformShortName)D.dll;DanBiasGame_$(PlatformShortName)D.dll;%(DelayLoadDLLs) + DanBiasServer_$(PlatformShortName)D.lib;DanBiasGame_$(PlatformShortName)D.lib;%(AdditionalDependencies) + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + $(SolutionDir)Game\DanBiasServer\Include + + + Windows + true + true + true + DanBiasServer_$(PlatformShortName).dll;DanBiasGame_$(PlatformShortName).dll;%(DelayLoadDLLs) + DanBiasServer_$(PlatformShortName).lib;DanBiasGame_$(PlatformShortName).lib;%(AdditionalDependencies) + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + $(SolutionDir)Game\DanBiasServer\Include + + + Windows + true + true + true + DanBiasServer_$(PlatformShortName).dll;DanBiasGame_$(PlatformShortName).dll;%(DelayLoadDLLs) + DanBiasServer_$(PlatformShortName).lib;DanBiasGame_$(PlatformShortName).lib;%(AdditionalDependencies) + + + + + + + + + \ No newline at end of file diff --git a/Code/Game/DanBiasLauncher/Launcher.cpp b/Code/Game/DanBiasLauncher/Launcher.cpp new file mode 100644 index 00000000..b1cab1ee --- /dev/null +++ b/Code/Game/DanBiasLauncher/Launcher.cpp @@ -0,0 +1,38 @@ +///////////////////////////////////////////////// +// Launcher to launch Danbias server or client // +///////////////////////////////////////////////// +#include + +#define DANBIAS_SERVER +//#define DANBIAS_CLIENT + + +#if defined(DANBIAS_SERVER) +#include "DanBiasServer.h" +#elif defined(DANBIAS_CLIENT) +#include "DanBiasGame.h" +#endif + +int WINAPI WinMain( HINSTANCE hinst, HINSTANCE prevInst, PSTR cmdLine, int cmdShow) +{ +#if defined(DANBIAS_SERVER) + if(SetDllDirectory(L"..\\DLL") == FALSE) + { + return cmdShow; + } + // Server starter code goes here + DanBias::DanBiasServerDesc desc; + desc.port = 0; + + if( DanBias::DanBiasServer::Initiate(desc) == DanBias::DanBiasServerReturn_Sucess) + { + DanBias::DanBiasServer::Run(); + DanBias::DanBiasServer::Release(); + } +#elif defined(DANBIAS_CLIENT) + // Game client starter code goes here + return cmdShow; +#endif + + return cmdShow; +} \ No newline at end of file diff --git a/Code/Game/DanBiasServer/DLLMain.cpp b/Code/Game/DanBiasServer/DLLMain.cpp new file mode 100644 index 00000000..93409304 --- /dev/null +++ b/Code/Game/DanBiasServer/DLLMain.cpp @@ -0,0 +1,8 @@ + +#include + +BOOL WINAPI DllMain( _In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID lpvReserved ) +{ + MessageBox(0, L"DanBiasServer Loaded", 0, 0); + return TRUE; +} \ No newline at end of file diff --git a/Code/Game/DanBiasServer/DanBiasServer.vcxproj b/Code/Game/DanBiasServer/DanBiasServer.vcxproj new file mode 100644 index 00000000..139a25d1 --- /dev/null +++ b/Code/Game/DanBiasServer/DanBiasServer.vcxproj @@ -0,0 +1,169 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {52380DAA-0F4A-4D97-8E57-98DF39319CAF} + Win32Proj + DanBiasServer + + + + DynamicLibrary + true + v110 + Unicode + false + + + DynamicLibrary + true + v110 + Unicode + true + + + DynamicLibrary + false + v110 + true + Unicode + + + DynamicLibrary + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)..\Bin\DLL\ + $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ + $(ProjectName)_$(PlatformShortName)D + $(SolutionDir)..\External\Include\;$(IncludePath) + + + true + $(SolutionDir)..\Bin\DLL\ + $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ + $(ProjectName)_$(PlatformShortName)D + $(SolutionDir)..\External\Include\;$(IncludePath) + + + false + $(SolutionDir)..\Bin\DLL\ + $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ + $(ProjectName)_$(PlatformShortName) + $(SolutionDir)..\External\Include\;$(IncludePath) + + + false + $(SolutionDir)..\Bin\DLL\ + $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ + $(ProjectName)_$(PlatformShortName) + $(SolutionDir)..\External\Include\;$(IncludePath) + + + + + + Level3 + Disabled + DANBIAS_SERVER;DANBIAS_SERVER_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + + + Windows + true + + + + + + + Level3 + Disabled + DANBIAS_SERVER;DANBIAS_SERVER_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + DANBIAS_SERVER;DANBIAS_SERVER_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + DANBIAS_SERVER;DANBIAS_SERVER_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/Code/Game/DanBiasServer/DanBiasServer_Impl.cpp b/Code/Game/DanBiasServer/DanBiasServer_Impl.cpp new file mode 100644 index 00000000..4d4c753b --- /dev/null +++ b/Code/Game/DanBiasServer/DanBiasServer_Impl.cpp @@ -0,0 +1,39 @@ +#include +#include "Include\DanBiasServer.h" + +namespace DanBias +{ +#pragma region Server Data + class DanBiasServerPrivateData + { + public: + DanBiasServerPrivateData() + { + + } + ~DanBiasServerPrivateData() + { + + } + + private: + + + } data; +#pragma endregion + + + DanBiasServerReturn DanBiasServer::Initiate(DanBiasServerDesc& desc) + { + return DanBiasServerReturn_Sucess; + } + DanBiasServerReturn DanBiasServer::Run() + { + return DanBiasServerReturn_Sucess; + } + void DanBiasServer::Release() + { + + } + +} //End namspace DanBias \ No newline at end of file diff --git a/Code/Game/DanBiasServer/Include/DanBiasServer.h b/Code/Game/DanBiasServer/Include/DanBiasServer.h new file mode 100644 index 00000000..e9446e76 --- /dev/null +++ b/Code/Game/DanBiasServer/Include/DanBiasServer.h @@ -0,0 +1,38 @@ +#ifndef DANBIAS_SERVER_DANBIAS_SERVER_H +#define DANBIAS_SERVER_DANBIAS_SERVER_H + + +#if defined (DANBIAS_SERVER_DLL_EXPORT) + #define DANBIAS_SERVER_DLL __declspec(dllexport) +#else + #define DANBIAS_SERVER_DLL __declspec(dllimport) +#endif + +namespace DanBias +{ + extern "C" + { + enum DanBiasServerReturn + { + DanBiasServerReturn_Error, + DanBiasServerReturn_Sucess, + }; + + struct DanBiasServerDesc + { + //Stuff goes here... + int port; + }; + + class DANBIAS_SERVER_DLL DanBiasServer + { + public: + static DanBiasServerReturn Initiate(DanBiasServerDesc& desc); + static DanBiasServerReturn Run(); + static void Release(); + }; + + }//End Extern "C" +} //End namspace DanBias + +#endif // !DANBIAS_SERVER_DANBIAS_SERVER_H diff --git a/Code/GameLogic/Camera.cpp b/Code/Game/GameLogic/Camera.cpp similarity index 100% rename from Code/GameLogic/Camera.cpp rename to Code/Game/GameLogic/Camera.cpp diff --git a/Code/GameLogic/Camera.h b/Code/Game/GameLogic/Camera.h similarity index 100% rename from Code/GameLogic/Camera.h rename to Code/Game/GameLogic/Camera.h diff --git a/Code/GameLogic/CollisionManager.cpp b/Code/Game/GameLogic/CollisionManager.cpp similarity index 100% rename from Code/GameLogic/CollisionManager.cpp rename to Code/Game/GameLogic/CollisionManager.cpp diff --git a/Code/GameLogic/CollisionManager.h b/Code/Game/GameLogic/CollisionManager.h similarity index 100% rename from Code/GameLogic/CollisionManager.h rename to Code/Game/GameLogic/CollisionManager.h diff --git a/Code/GameLogic/DynamicObject.cpp b/Code/Game/GameLogic/DynamicObject.cpp similarity index 100% rename from Code/GameLogic/DynamicObject.cpp rename to Code/Game/GameLogic/DynamicObject.cpp diff --git a/Code/GameLogic/DynamicObject.h b/Code/Game/GameLogic/DynamicObject.h similarity index 100% rename from Code/GameLogic/DynamicObject.h rename to Code/Game/GameLogic/DynamicObject.h diff --git a/Code/GameLogic/Game.cpp b/Code/Game/GameLogic/Game.cpp similarity index 100% rename from Code/GameLogic/Game.cpp rename to Code/Game/GameLogic/Game.cpp diff --git a/Code/GameLogic/Game.h b/Code/Game/GameLogic/Game.h similarity index 100% rename from Code/GameLogic/Game.h rename to Code/Game/GameLogic/Game.h diff --git a/Code/GameLogic/GameLogic.vcxproj b/Code/Game/GameLogic/GameLogic.vcxproj similarity index 92% rename from Code/GameLogic/GameLogic.vcxproj rename to Code/Game/GameLogic/GameLogic.vcxproj index 236258d2..c22b4ef8 100644 --- a/Code/GameLogic/GameLogic.vcxproj +++ b/Code/Game/GameLogic/GameLogic.vcxproj @@ -151,27 +151,16 @@ - + {104fa3e9-94d9-4e1d-a941-28a03bc8a095} - false - true - false - false - false - - {7e3990d2-3d94-465c-b58d-64a74b3ecf9b} - - + {2ec4dded-8f75-4c86-a10b-e1e8eb29f3ee} - - {0ec83e64-230e-48ef-b08c-6ac9651b4f82} - - + {f10cbc03-9809-4cba-95d8-327c287b18ee} - + {4285bd3f-3c6c-4670-b7af-a29afef5f6a8} diff --git a/Code/GameLogic/GameMode.cpp b/Code/Game/GameLogic/GameMode.cpp similarity index 100% rename from Code/GameLogic/GameMode.cpp rename to Code/Game/GameLogic/GameMode.cpp diff --git a/Code/GameLogic/GameMode.h b/Code/Game/GameLogic/GameMode.h similarity index 100% rename from Code/GameLogic/GameMode.h rename to Code/Game/GameLogic/GameMode.h diff --git a/Code/GameLogic/IGame.cpp b/Code/Game/GameLogic/IGame.cpp similarity index 100% rename from Code/GameLogic/IGame.cpp rename to Code/Game/GameLogic/IGame.cpp diff --git a/Code/GameLogic/IGame.h b/Code/Game/GameLogic/IGame.h similarity index 100% rename from Code/GameLogic/IGame.h rename to Code/Game/GameLogic/IGame.h diff --git a/Code/GameLogic/Level.cpp b/Code/Game/GameLogic/Level.cpp similarity index 100% rename from Code/GameLogic/Level.cpp rename to Code/Game/GameLogic/Level.cpp diff --git a/Code/GameLogic/Level.h b/Code/Game/GameLogic/Level.h similarity index 100% rename from Code/GameLogic/Level.h rename to Code/Game/GameLogic/Level.h diff --git a/Code/GameLogic/Object.cpp b/Code/Game/GameLogic/Object.cpp similarity index 100% rename from Code/GameLogic/Object.cpp rename to Code/Game/GameLogic/Object.cpp diff --git a/Code/GameLogic/Object.h b/Code/Game/GameLogic/Object.h similarity index 100% rename from Code/GameLogic/Object.h rename to Code/Game/GameLogic/Object.h diff --git a/Code/GameLogic/Player.cpp b/Code/Game/GameLogic/Player.cpp similarity index 100% rename from Code/GameLogic/Player.cpp rename to Code/Game/GameLogic/Player.cpp diff --git a/Code/GameLogic/Player.h b/Code/Game/GameLogic/Player.h similarity index 100% rename from Code/GameLogic/Player.h rename to Code/Game/GameLogic/Player.h diff --git a/Code/GameLogic/RefManager.cpp b/Code/Game/GameLogic/RefManager.cpp similarity index 100% rename from Code/GameLogic/RefManager.cpp rename to Code/Game/GameLogic/RefManager.cpp diff --git a/Code/GameLogic/RefManager.h b/Code/Game/GameLogic/RefManager.h similarity index 100% rename from Code/GameLogic/RefManager.h rename to Code/Game/GameLogic/RefManager.h diff --git a/Code/GameLogic/StaticObject.cpp b/Code/Game/GameLogic/StaticObject.cpp similarity index 100% rename from Code/GameLogic/StaticObject.cpp rename to Code/Game/GameLogic/StaticObject.cpp diff --git a/Code/GameLogic/StaticObject.h b/Code/Game/GameLogic/StaticObject.h similarity index 100% rename from Code/GameLogic/StaticObject.h rename to Code/Game/GameLogic/StaticObject.h diff --git a/Code/GameLogic/TestGLMain.cpp b/Code/Game/GameLogic/TestGLMain.cpp similarity index 100% rename from Code/GameLogic/TestGLMain.cpp rename to Code/Game/GameLogic/TestGLMain.cpp diff --git a/Code/GameLogic/Weapon.cpp b/Code/Game/GameLogic/Weapon.cpp similarity index 100% rename from Code/GameLogic/Weapon.cpp rename to Code/Game/GameLogic/Weapon.cpp diff --git a/Code/GameLogic/Weapon.h b/Code/Game/GameLogic/Weapon.h similarity index 100% rename from Code/GameLogic/Weapon.h rename to Code/Game/GameLogic/Weapon.h diff --git a/Code/GameLogic/GameLogic.vcxproj.filters b/Code/GameLogic/GameLogic.vcxproj.filters deleted file mode 100644 index f2c5e978..00000000 --- a/Code/GameLogic/GameLogic.vcxproj.filters +++ /dev/null @@ -1,96 +0,0 @@ - - - - - {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 - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/Code/OysterGraphics/DllInterfaces/GFXAPI.h b/Code/OysterGraphics/DllInterfaces/GFXAPI.h index e55a435f..bd07c391 100644 --- a/Code/OysterGraphics/DllInterfaces/GFXAPI.h +++ b/Code/OysterGraphics/DllInterfaces/GFXAPI.h @@ -10,7 +10,6 @@ #define GFX_DLL_USAGE __declspec(dllimport) #endif - namespace Oyster { namespace Graphics diff --git a/Code/OysterPhysics3D/OysterPhysics3D.vcxproj b/Code/OysterPhysics3D/OysterPhysics3D.vcxproj index c36fded5..2113cccb 100644 --- a/Code/OysterPhysics3D/OysterPhysics3D.vcxproj +++ b/Code/OysterPhysics3D/OysterPhysics3D.vcxproj @@ -24,26 +24,26 @@ - StaticLibrary + DynamicLibrary true v110 MultiByte - StaticLibrary + DynamicLibrary true v110 MultiByte - StaticLibrary + DynamicLibrary false v110 true MultiByte - StaticLibrary + DynamicLibrary false v110 true From f29af8b8bd3cd2b8e92d957234cffe94e93e3b88 Mon Sep 17 00:00:00 2001 From: lanariel Date: Wed, 4 Dec 2013 09:36:43 +0100 Subject: [PATCH 03/19] Release Now Stable --- Code/GameLogic/Object.cpp | 2 +- Code/Network/NetworkDependencies/WinsockFunctions.cpp | 2 +- Code/OysterGraphics/Core/Init.cpp | 3 ++- Code/OysterGraphics/DllInterfaces/GFXAPI.cpp | 7 ++++++- Code/OysterGraphics/DllInterfaces/GFXAPI.h | 5 ++--- Code/OysterGraphics/FileLoader/ShaderLoader.cpp | 9 +++++---- Code/OysterGraphics/OysterGraphics.vcxproj | 10 ++++++++-- Code/OysterGraphics/Render/Rendering/BasicRender.cpp | 3 ++- Code/OysterGraphics/Render/Resources/Resources.cpp | 9 ++++++++- Code/Tester/MainTest.cpp | 7 ++++++- Code/Tester/Tester.vcxproj | 9 +++++---- 11 files changed, 46 insertions(+), 20 deletions(-) diff --git a/Code/GameLogic/Object.cpp b/Code/GameLogic/Object.cpp index 965af90e..33679058 100644 --- a/Code/GameLogic/Object.cpp +++ b/Code/GameLogic/Object.cpp @@ -16,7 +16,7 @@ Object::Object(void) { model = new Model(); - model = Oyster::Graphics::API::CreateModel(L"bth.obj"); + model = Oyster::Graphics::API::CreateModel(L"orca"); API::SimpleBodyDescription sbDesc; //sbDesc.centerPosition = diff --git a/Code/Network/NetworkDependencies/WinsockFunctions.cpp b/Code/Network/NetworkDependencies/WinsockFunctions.cpp index ea3c3b00..3e2e32f3 100644 --- a/Code/Network/NetworkDependencies/WinsockFunctions.cpp +++ b/Code/Network/NetworkDependencies/WinsockFunctions.cpp @@ -17,7 +17,7 @@ std::wstring GetErrorMessage(int errorCode) LPWSTR lpMessage; std::wstring retVal(L"Succesful"); - DWORD bufLen = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS , + DWORD bufLen = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS , NULL, errorCode , MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT) , diff --git a/Code/OysterGraphics/Core/Init.cpp b/Code/OysterGraphics/Core/Init.cpp index c69b80b4..548615d2 100644 --- a/Code/OysterGraphics/Core/Init.cpp +++ b/Code/OysterGraphics/Core/Init.cpp @@ -32,7 +32,8 @@ namespace Oyster log << "DirectX running in debug mode.\n"; createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG; #endif - + + createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG; D3D_FEATURE_LEVEL featureLevelsToTry[] = { diff --git a/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp b/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp index b5de4fda..86df58a2 100644 --- a/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp +++ b/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp @@ -63,7 +63,12 @@ namespace Oyster { Model::ModelInfo* info = (Model::ModelInfo*)model->info; delete model; - info->Vertices->~Buffer(); + SAFE_DELETE(info->Vertices); + if(info->Indexed) + { + SAFE_DELETE(info->Indecies); + } + delete info; } void API::Clean() diff --git a/Code/OysterGraphics/DllInterfaces/GFXAPI.h b/Code/OysterGraphics/DllInterfaces/GFXAPI.h index e55a435f..f7665ba6 100644 --- a/Code/OysterGraphics/DllInterfaces/GFXAPI.h +++ b/Code/OysterGraphics/DllInterfaces/GFXAPI.h @@ -4,13 +4,12 @@ #include "OysterMath.h" #include -#if defined GFX_DLL_EXPORT +#ifdef GFX_DLL_EXPORT #define GFX_DLL_USAGE __declspec(dllexport) #else - #define GFX_DLL_USAGE __declspec(dllimport) + #define GFX_DLL_USAGE #endif - namespace Oyster { namespace Graphics diff --git a/Code/OysterGraphics/FileLoader/ShaderLoader.cpp b/Code/OysterGraphics/FileLoader/ShaderLoader.cpp index 5a7ba9e3..05420abf 100644 --- a/Code/OysterGraphics/FileLoader/ShaderLoader.cpp +++ b/Code/OysterGraphics/FileLoader/ShaderLoader.cpp @@ -165,14 +165,16 @@ namespace Oyster data.data = new char[data.size]; memcpy(data.data,Shader->GetBufferPointer(),data.size); #else + std::ifstream stream; + stream.open(filename, std::ifstream::in | std::ifstream::binary); if(stream.good()) { stream.seekg(0, std::ios::end); - sd.size = size_t(stream.tellg()); - sd.data = new char[sd.size]; + data.size = size_t(stream.tellg()); + data.data = new char[data.size]; stream.seekg(0, std::ios::beg); - stream.read(&sd.data[0], sd.size); + stream.read(&data.data[0], data.size); stream.close(); } else @@ -180,7 +182,6 @@ namespace Oyster memset(&out,0,sizeof(out)); return; } - #endif out.loadedData = Core::ShaderManager::CreateShader(data, Core::ShaderManager::ShaderType(type)); } diff --git a/Code/OysterGraphics/OysterGraphics.vcxproj b/Code/OysterGraphics/OysterGraphics.vcxproj index c5592230..29acd43e 100644 --- a/Code/OysterGraphics/OysterGraphics.vcxproj +++ b/Code/OysterGraphics/OysterGraphics.vcxproj @@ -109,6 +109,7 @@ $(SolutionDir)..\Bin\Content\Shaders\%(Filename).cso + 5.0 @@ -124,12 +125,13 @@ $(SolutionDir)..\Bin\Content\Shaders\%(Filename).cso + 5.0 Level3 - MaxSpeed + Disabled true true true @@ -143,12 +145,14 @@ $(SolutionDir)..\Bin\Content\Shaders\%(Filename).cso + true + 5.0 Level3 - MaxSpeed + Disabled true true true @@ -162,6 +166,8 @@ $(SolutionDir)..\Bin\Content\Shaders\%(Filename).cso + true + 5.0 diff --git a/Code/OysterGraphics/Render/Rendering/BasicRender.cpp b/Code/OysterGraphics/Render/Rendering/BasicRender.cpp index 50e7f9f1..9626c954 100644 --- a/Code/OysterGraphics/Render/Rendering/BasicRender.cpp +++ b/Code/OysterGraphics/Render/Rendering/BasicRender.cpp @@ -60,7 +60,8 @@ namespace Oyster } void Basic::EndFrame() { - Core::swapChain->Present(0,0); + IDXGISwapChain* chain = Core::swapChain; + chain->Present(0,0); } } } diff --git a/Code/OysterGraphics/Render/Resources/Resources.cpp b/Code/OysterGraphics/Render/Resources/Resources.cpp index 2bda54e1..66fa4cc9 100644 --- a/Code/OysterGraphics/Render/Resources/Resources.cpp +++ b/Code/OysterGraphics/Render/Resources/Resources.cpp @@ -3,7 +3,8 @@ // /Bin/Executable/Tester -> // /Code/OysterGraphics/Shader/HLSL -const std::wstring PathFromExeToHlsl = L"..\\..\\..\\Code\\OysterGraphics\\Shader\\HLSL\\"; +const std::wstring PathFromExeToCso = L"..\\Content\\Shaders\\"; +const std::wstring PathFromExeToHlsl = L"..\\..\\Code\\OysterGraphics\\Shader\\HLSL\\"; const std::wstring VertexTransformDebug = L"TransformDebugVertex"; const std::wstring VertexDebug = L"DebugVertex"; const std::wstring PixelRed = L"DebugPixel"; @@ -42,6 +43,12 @@ namespace Oyster #else /** Load Vertex Shader with Precompiled */ + Core::ShaderManager::Init(PathFromExeToCso + L"DebugCameraVertex.cso",ShaderType::Vertex, VertexTransformDebug); + Core::ShaderManager::Init(PathFromExeToCso + L"DebugVertex.cso",ShaderType::Vertex, VertexDebug); + + /** Load Pixel Shader with Precompiled */ + Core::ShaderManager::Init(PathFromExeToCso + L"DebugPixel.cso",ShaderType::Pixel, PixelRed); + Core::ShaderManager::Init(PathFromExeToCso + L"TextureDebug.cso",ShaderType::Pixel, PixelTexture); #endif #pragma endregion diff --git a/Code/Tester/MainTest.cpp b/Code/Tester/MainTest.cpp index cbf563c6..61d5e45b 100644 --- a/Code/Tester/MainTest.cpp +++ b/Code/Tester/MainTest.cpp @@ -18,6 +18,7 @@ HINSTANCE g_hInst = NULL; HWND g_hWnd = NULL; Oyster::Graphics::Model::Model* m = NULL; +Oyster::Graphics::Model::Model* m2 = NULL; Oyster::Math::Float4x4 V; Oyster::Math::Float4x4 P; @@ -186,7 +187,9 @@ HRESULT InitDirect3D() #pragma endregion #pragma region Obj - m = Oyster::Graphics::API::CreateModel(L"orca"); + m = Oyster::Graphics::API::CreateModel(L"crate"); + m2 = Oyster::Graphics::API::CreateModel(L"crate"); + m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3::null,Oyster::Math::Float3(0,5,0),Oyster::Math::Float3::null); #pragma endregion @@ -203,6 +206,7 @@ HRESULT Update(float deltaTime) { angle += Oyster::Math::pi/30000; m->WorldMatrix = Oyster::Math3D::RotationMatrix_AxisY(angle); + m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,0,1)*-angle,Oyster::Math::Float3(0,4,0),Oyster::Math::Float3::null); return S_OK; } @@ -211,6 +215,7 @@ HRESULT Render(float deltaTime) Oyster::Graphics::API::NewFrame(V,P); Oyster::Graphics::API::RenderScene(m,1); + Oyster::Graphics::API::RenderScene(m2,1); Oyster::Graphics::API::EndFrame(); diff --git a/Code/Tester/Tester.vcxproj b/Code/Tester/Tester.vcxproj index 27fc7682..36184b93 100644 --- a/Code/Tester/Tester.vcxproj +++ b/Code/Tester/Tester.vcxproj @@ -85,7 +85,7 @@ false $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ - $(SolutionDir)..\Bin\Executable\$(ProjectName)\ + $(SolutionDir)..\Bin\Executable\ $(ProjectName)_$(PlatformShortName) C:\Program Files (x86)\Visual Leak Detector\include;$(IncludePath) C:\Program Files (x86)\Visual Leak Detector\lib\Win32;$(LibraryPath) @@ -143,9 +143,9 @@ Level3 - MaxSpeed + Disabled true - true + false WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) true ..\OysterGraphics;..\OysterMath;..\Misc;%(AdditionalIncludeDirectories) @@ -158,6 +158,7 @@ OysterGraphics_$(PlatformShortName).lib;%(AdditionalDependencies) $(SolutionDir)..\Bin\DLL;%(AdditionalLibraryDirectories) true + OysterGraphics_x86.dll; @@ -165,7 +166,7 @@ Level3 - MaxSpeed + Disabled true true WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) From ce294cd1d7f110b6f804f00ec4c403e87e6f06be Mon Sep 17 00:00:00 2001 From: lanariel Date: Wed, 4 Dec 2013 09:43:43 +0100 Subject: [PATCH 04/19] Forgot to add a folder --- Bin/Content/Shaders/DebugCameraVertex.cso | Bin 0 -> 18652 bytes Bin/Content/Shaders/DebugPixel.cso | Bin 0 -> 12252 bytes Bin/Content/Shaders/DebugVertex.cso | Bin 0 -> 12292 bytes Bin/Content/Shaders/LightPass.cso | Bin 0 -> 12124 bytes Bin/Content/Shaders/PixelGatherData.cso | Bin 0 -> 16684 bytes Bin/Content/Shaders/TextureDebug.cso | Bin 0 -> 14560 bytes Bin/Content/Shaders/VertexGatherData.cso | Bin 0 -> 20960 bytes Bin/Content/crate.obj | 233 ++++++++++++++++++++++ Bin/Content/tex_crate.png | Bin 0 -> 4532 bytes 9 files changed, 233 insertions(+) create mode 100644 Bin/Content/Shaders/DebugCameraVertex.cso create mode 100644 Bin/Content/Shaders/DebugPixel.cso create mode 100644 Bin/Content/Shaders/DebugVertex.cso create mode 100644 Bin/Content/Shaders/LightPass.cso create mode 100644 Bin/Content/Shaders/PixelGatherData.cso create mode 100644 Bin/Content/Shaders/TextureDebug.cso create mode 100644 Bin/Content/Shaders/VertexGatherData.cso create mode 100644 Bin/Content/crate.obj create mode 100644 Bin/Content/tex_crate.png diff --git a/Bin/Content/Shaders/DebugCameraVertex.cso b/Bin/Content/Shaders/DebugCameraVertex.cso new file mode 100644 index 0000000000000000000000000000000000000000..44771730de2416648549e526ef5a66b67944ffc6 GIT binary patch literal 18652 zcmeHOU2I%O6+YK?65Fv|Cv{SjxZ#qd!fB1Y{%J^!+c@#YjU^{`ZO3(yrNpr}@iyyS zYj@qa;1&a|RFwclRH#BcL?SAnlomuF2(?lwQdB`z3aUgO3JN@+K7g8pszRu$`M$Yl z))W6FDK>4=9c%X7^Ua(y=bX7SbMMS`xNm36XzB+iPj6Zoed)Qs|MX}6fniTX-rOy+ z9CRD&wuJEqbQ@{y7flS(jEX&@XS_b@K$lOQlWpC1?~TDAbf@GacRI!qV_LC72*=7gYfXJpFGSm6$ty7C{>Q|F-+8Uy@Qr5LYI)j9`}f1NWNE1>=XD*fS!QwC zb{JJJ`avC*MOY8Ky-wnq^@y_`?M6&;*xqdzMXN<+n}Zl(9OhpHM)~F1Hf9Vq{v|Mer?b0VCBg+f6XDMw$y9L&!<&(ZC zGvyk4#@f~~emy$7&ayyiA^S`llz;m1+47v@kgiDn-EaD)GJov-fm?^^isY@2^xew4 zJ~Cdt>Z4o7^^tzqej}xfjS;V{kFLDy{}+5F^;y3ez|3gr!Aw6 zZW-fh%h--BV|?pSMjKmo4I-8VMjKmK2W7XFD?2EGF9hX>%3)u$`+(H)-Xom7Cc{cV~E~z{u&Rqn4VM+ivssbhrAS ztqz5X3)h9aDTKf=cArE(K_2PmfMkEKg9x1A!+SP;Y$Jg6GH3ZUpKY?~;~Rk|t82Y;N50p^=gHGY-gW!!jYME%ELPduS>-3j(xcV)jwVw6md_Oz78rJ4uYac>jgO9{tM~P0 z(7lP|$UrPp5;rVLA(f1z$C7cQ3&2A%cyR2{A?&Z(O=!Q-Peu+$Q|U;u@?dC7ap4ys zG%}D*M#p__3bPHnFYHh6_)-`3JL=3<_9g0SFI8vueyw0Cog5oX`@NB5Ix^ldmJS*Y zTJk&LbEEIFX*$#|3-UJ%REfN_1{;lo zB7fW=ax^9K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1q4WY3d64f(fri~o)SIpr}D2Z=^4bOz<0nY>F z^FR}OQk=Qoq9UZfk7A-gcWo$N>7M1S_CTrQnAiVX-89H}X+jtF6LZi_6sUV%;FKmjOJofy=!O<9WWY5I><^DzTGNZmoN1XlNuK^9 zc)PT%3Wk^ptf1cDI3dn009OWzdxv|HDPvfRx$!emZ@2PpWl)h^u1-`e&qK4Vpw#=n z*Qury6gKBZ&6LGLrZ%rTEacdUP?`d~x;>Mz5_5S$ioTR{Lgfqc;W~;>65!!pLICzH z3{Kfju32zeOTSSXIEaCygFB88^6!E*u#JhKY#P&GN zIjjx)2yxGUn6QqpiICP2n)UgPK}S%$Lv$26sh$w)3p%gV-a~2+{s#}B|2*(K;CWzg Gdf+d4*6U9I literal 0 HcmV?d00001 diff --git a/Bin/Content/Shaders/PixelGatherData.cso b/Bin/Content/Shaders/PixelGatherData.cso new file mode 100644 index 0000000000000000000000000000000000000000..c02c7462b5042328ef68b6236621e875c146dfb5 GIT binary patch literal 16684 zcmeHOU1(g#6+SCjvLs9PO0^u-PSe3rL9SJ4S6aJ@>LmJE{cJ1kZnYa(g{AIlbtP@Q z+7);2#tOx-1PX@qp#?)r5FssnXs{Fd5Rx`fFqG1thhS(Sq3uH`G<|7tq_lY`A?o?& z-q{@~8`ULVDYowsXJ_V{nRDixnLBf5<|;ThGWt|~>wm%@oS6U9<{RyAMV@)dLqy%f zMD-jFF#nAC3WI-SzEVTfSxYn%92;L{T&HtL)NO6maXG|if_^{34ramJ#oWo<%nX`N zr_5YFw`hs3nNwnNDmEoz%gF`96r;J7)pUjdgH@06Jv3@b}cqJHg}!#qs*t7pS(hzc`wzPUjE^h@%dVsjt65<#0^K= zKhM05G}8$?aDVRs58T*t>3;SA&%N*7&-UN%wquPK%OOxn?2HrF+{0JKsm{ zZEIcYc6#7ykKgn5#q}Ayv%d9<(81pn>Vq$T^&da}dRNDBRTg<*orb^Pw-eH{-S}PN zfyP|HS}j;T!Sv!{A#Y4%a+k!TVlk6TT7fQ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hzxsu?&1)3p)Wwk=tTPvhbZSI z`@E3e+uTq%-U}LRyidn*-_UI1{lHDCZEI;~lywvFsUK}_sI-@y(=P|}a2Y{Q%%UF3 z)Ns0s>_a~t3y^c#=hQ>FAu8>vc#W%T$Gb|c)Cs*rQ&c+HpeFLPVZ32|>D$&mZGW|` zo#jmx+5!2nzh09sNNw0?qlr4&@f>4Z9;OB_=CcPlUZ<5uoA!eA{%M<))+!`v)?U&HAyz2392yQ~^{HiMZ8?S=^G z#Cr=!VF*1^lbx}|d3XLUsN&VuomW%o%8Bh!_jb}>%4y08aKP49i*$$`M@~iB?fXCc z&r|PII(spcUCdE$malO0)SEX`z4q1Ad?uH=XakGynwl*gBfzMg4M*jaA-1r%0$Z2PO kfEn|QOV#&4=_B9jt8z8C9&kP2dcgI7>jBpTpArxJ7aZP46aWAK literal 0 HcmV?d00001 diff --git a/Bin/Content/Shaders/TextureDebug.cso b/Bin/Content/Shaders/TextureDebug.cso new file mode 100644 index 0000000000000000000000000000000000000000..0dc6bcffa9d17cf2aa80d41dbe8b05fa689ed0ac GIT binary patch literal 14560 zcmeHOU2Ggz6+W|$6MN%L)=BM{CQV0aK$|pO@7iwahNN=hwG&IW*V(b%6s?r3*JFE| z_3mnB-MC6qA^}oG00of;PE40WYZh2wn=o;isq%G2b^o z+exx^By1wvnPZ*3_kQ=xx%ZyA_sqR##)(tMy0^Zw>%FUA4}9a%?~ER~^qD{IQAFh3 zPLYjBk;s3*mjS*FJ{%DF4LFtP>3tKpOMv7s3$+UiwUGN1vZ+KoPOJs2f+OI);07@1 zC2)a7KD055=$Sal(!T3pKdtPJF`M$s%zl+{RTpL(KS>sPg@%(!l- z-NorrE|1L9(e_yM>9$xb8b8?H*&%atecJKC%g{l+b>Jy5iS4?5+KPOcphLv1dSouR zAX4J&=O*x{!7dReQ;#-!dMK&&4fiDnWw_^5cQTnu$Y3%xaI{}46?1cQN%ZRgMD#I&!@)+cK`sXV67$_~`Hz=;zp7^5%(g9E(x4x@y>B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YB;0(_NL_!Ef?;Nz9+)9G8E%t|niITCpP4&=_C)Qrz8t3Y?H0W-5u z2+J(eMUT1=BMq36{D@&-m;WW$^iSI^e>u~=I1{n&_Kdx((X8?`z{EtEPQMH@W?DDX z-~Y^m+}e&<;=%UBU{Y!m_^*`GQkzco*ZL3BcEywZ5Bk6${(qo!?bUkLXXceNvzP5&E;_q~2RPiMXf&)bw$@Y?a^qx;uV)WU<`4b?mhmw$lrewgk& z)H({vH+g)+cMubVJ^!l$9t6huAr8-Tz>mXoe&DymO88sg`Bh4*aIaVjPm9nxyk9DV yhe+HW_{V>&%VPMO;dw7W>vFDH2EQEsR`?b0d3X6N;9WjZc}aN-S(KidH`W literal 0 HcmV?d00001 diff --git a/Bin/Content/crate.obj b/Bin/Content/crate.obj new file mode 100644 index 00000000..027fd2cd --- /dev/null +++ b/Bin/Content/crate.obj @@ -0,0 +1,233 @@ +# This file uses centimeters as units for non-parametric coordinates. + +mtllib crate.mtl +g default +v -0.500000 -0.500000 0.500000 +v 0.500000 -0.500000 0.500000 +v -0.500000 0.500000 0.500000 +v 0.500000 0.500000 0.500000 +v -0.500000 0.500000 -0.500000 +v 0.500000 0.500000 -0.500000 +v -0.500000 -0.500000 -0.500000 +v 0.500000 -0.500000 -0.500000 +v -0.500000 -0.500000 0.500000 +v 0.500000 -0.500000 0.500000 +v 0.500000 0.500000 0.500000 +v -0.500000 0.500000 0.500000 +v 0.500000 0.500000 -0.500000 +v -0.500000 0.500000 -0.500000 +v 0.500000 -0.500000 -0.500000 +v -0.500000 -0.500000 -0.500000 +v -0.479379 0.522314 0.479379 +v 0.479379 0.522314 0.479379 +v 0.479379 0.522314 -0.479379 +v -0.479379 0.522314 -0.479379 +v -0.470939 -0.528599 -0.470939 +v 0.470939 -0.528599 -0.470939 +v 0.470939 -0.528599 0.470939 +v -0.470939 -0.528599 0.470939 +v 0.520103 -0.460610 -0.460610 +v 0.520103 -0.460610 0.460610 +v 0.520103 0.460610 -0.460610 +v 0.520103 0.460610 0.460610 +v -0.522559 -0.464751 -0.464751 +v -0.522559 -0.464751 0.464751 +v -0.522559 0.464751 0.464751 +v -0.522559 0.464751 -0.464751 +v -0.460954 -0.460954 0.522335 +v 0.460954 -0.460954 0.522335 +v 0.460954 0.460954 0.522335 +v -0.460954 0.460954 0.522335 +v -0.466507 0.466507 -0.525017 +v 0.466507 0.466507 -0.525017 +v 0.466507 -0.466507 -0.525017 +v -0.466507 -0.466507 -0.525017 +vt 0.995838 0.004695 +vt 0.999640 -0.003712 +vt 0.003809 -0.000160 +vt -0.000796 1.000526 +vt 0.003809 0.003892 +vt 0.999640 0.995671 +vt 0.003809 0.007944 +vt 0.999640 0.999723 +vt 0.003809 1.003774 +vt 0.999640 1.003774 +vt 0.995035 0.004695 +vt 0.995035 1.000526 +vt 0.000007 0.004695 +vt 0.000007 1.000526 +vt 0.999640 0.007944 +vt -0.000796 0.004695 +vt 0.003809 0.999723 +vt 0.003809 -0.003712 +vt 0.999640 0.003892 +vt 0.003809 0.995671 +vt 0.999640 0.992119 +vt 0.999640 -0.000160 +vt 0.003809 0.992119 +vt 0.995838 1.000526 +vt 0.003809 -0.003712 +vt 0.999640 -0.003712 +vt 0.999640 0.992119 +vt 0.003809 0.992119 +vt 0.003809 -0.000160 +vt 0.999640 -0.000160 +vt 0.999640 0.995671 +vt 0.003809 0.995671 +vt 0.003809 0.003892 +vt 0.999640 0.003892 +vt 0.999640 0.999723 +vt 0.003809 0.999723 +vt 0.003809 0.007944 +vt 0.999640 0.007944 +vt 0.999640 1.003774 +vt 0.003809 1.003774 +vt -0.000796 0.004695 +vt 0.995035 0.004695 +vt 0.995035 1.000526 +vt -0.000796 1.000526 +vt 0.000007 0.004695 +vt 0.995838 0.004695 +vt 0.995838 1.000526 +vt 0.000007 1.000526 +vt 0.003809 -0.000160 +vt 0.999640 -0.000160 +vt 0.999640 0.995671 +vt 0.003809 0.995671 +vt 0.003809 0.007944 +vt 0.999640 0.007944 +vt 0.999640 1.003774 +vt 0.003809 1.003774 +vt -0.000796 0.004695 +vt 0.995035 0.004695 +vt 0.995035 1.000526 +vt -0.000796 1.000526 +vt 0.000007 0.004695 +vt 0.995838 0.004695 +vt 0.995838 1.000526 +vt 0.000007 1.000526 +vt 0.003809 -0.003712 +vt 0.999640 -0.003712 +vt 0.999640 0.992119 +vt 0.003809 0.992119 +vt 0.003809 0.003892 +vt 0.999640 0.003892 +vt 0.999640 0.999723 +vt 0.003809 0.999723 +vn -0.031209 -0.033799 0.998941 +vn 0.033799 -0.031209 0.998941 +vn -0.033799 0.031209 0.998941 +vn 0.031209 0.033799 0.998941 +vn -0.030245 0.999045 0.031527 +vn 0.031527 0.999045 0.030245 +vn -0.031527 0.999045 -0.030245 +vn 0.030245 0.999045 -0.031527 +vn -0.034614 0.037052 -0.998714 +vn 0.037051 0.034614 -0.998714 +vn -0.037051 -0.034614 -0.998714 +vn 0.034614 -0.037052 -0.998714 +vn -0.038824 -0.998397 -0.041174 +vn 0.041174 -0.998397 -0.038824 +vn -0.041174 -0.998397 0.038824 +vn 0.038824 -0.998397 0.041174 +vn 0.999134 -0.030589 0.028224 +vn 0.999134 -0.028224 -0.030589 +vn 0.999134 0.028224 0.030589 +vn 0.999134 0.030589 -0.028224 +vn -0.998933 -0.033811 -0.031470 +vn -0.998933 -0.031470 0.033811 +vn -0.998933 0.031470 -0.033811 +vn -0.998933 0.033811 0.031470 +vn 0.577350 0.577350 -0.577350 +vn 0.577350 -0.577350 -0.577350 +vn -0.577350 0.577350 -0.577350 +vn -0.577350 -0.577350 -0.577350 +vn 0.577350 -0.577350 0.577350 +vn -0.577350 -0.577350 0.577350 +vn 0.577350 0.577350 0.577350 +vn -0.577350 0.577350 0.577350 +vn -0.608285 0.469952 0.639637 +vn 0.633500 0.454555 0.626145 +vn 0.657522 0.474071 -0.585595 +vn -0.626276 0.491669 -0.605013 +vn -0.608373 -0.534484 -0.586694 +vn 0.635292 -0.520408 -0.570596 +vn 0.616200 -0.500955 0.607735 +vn -0.589957 -0.516183 0.620891 +s 1 +g meshCrate +usemtl matCrateSG +f 33/65/1 34/66/2 36/68/3 +f 36/68/3 34/66/2 35/67/4 +f 17/49/5 18/50/6 20/52/7 +f 20/52/7 18/50/6 19/51/8 +f 37/69/9 38/70/10 40/72/11 +f 40/72/11 38/70/10 39/71/12 +f 21/53/13 22/54/14 24/56/15 +f 24/56/15 22/54/14 23/55/16 +f 26/57/17 25/58/18 28/60/19 +f 28/60/19 25/58/18 27/59/20 +f 29/61/21 30/62/22 32/64/23 +f 32/64/23 30/62/22 31/63/24 +s 7 +f 1/25/25 3/28/26 2/26/27 +f 2/26/27 3/28/26 4/27/28 +f 3/29/26 5/32/29 4/30/28 +f 4/30/28 5/32/29 6/31/30 +f 5/33/29 7/36/31 6/34/30 +f 6/34/30 7/36/31 8/35/32 +f 7/37/31 1/40/25 8/38/32 +f 8/38/32 1/40/25 2/39/27 +f 2/41/27 4/44/28 8/42/32 +f 8/42/32 4/44/28 6/43/30 +f 7/45/31 5/48/29 1/46/25 +f 1/46/25 5/48/29 3/47/26 +s 1 +f 12/3/33 11/22/34 17/49/5 +f 17/49/5 11/22/34 18/50/6 +f 11/22/34 13/6/35 18/50/6 +f 18/50/6 13/6/35 19/51/8 +f 13/6/35 14/20/36 19/51/8 +f 19/51/8 14/20/36 20/52/7 +f 14/20/36 12/3/33 20/52/7 +f 20/52/7 12/3/33 17/49/5 +f 16/7/37 15/15/38 21/53/13 +f 21/53/13 15/15/38 22/54/14 +f 15/15/38 10/10/39 22/54/14 +f 22/54/14 10/10/39 23/55/16 +f 10/10/39 9/9/40 23/55/16 +f 23/55/16 9/9/40 24/56/15 +f 9/9/40 16/7/37 24/56/15 +f 24/56/15 16/7/37 21/53/13 +f 10/16/39 15/11/38 26/57/17 +f 26/57/17 15/11/38 25/58/18 +f 15/11/38 13/12/35 25/58/18 +f 25/58/18 13/12/35 27/59/20 +f 13/12/35 11/4/34 27/59/20 +f 27/59/20 11/4/34 28/60/19 +f 11/4/34 10/16/39 28/60/19 +f 28/60/19 10/16/39 26/57/17 +f 16/13/37 9/1/40 29/61/21 +f 29/61/21 9/1/40 30/62/22 +f 9/1/40 12/24/33 30/62/22 +f 30/62/22 12/24/33 31/63/24 +f 12/24/33 14/14/36 31/63/24 +f 31/63/24 14/14/36 32/64/23 +f 14/14/36 16/13/37 32/64/23 +f 32/64/23 16/13/37 29/61/21 +f 9/18/40 10/2/39 33/65/1 +f 33/65/1 10/2/39 34/66/2 +f 10/2/39 11/21/34 34/66/2 +f 34/66/2 11/21/34 35/67/4 +f 11/21/34 12/23/33 35/67/4 +f 35/67/4 12/23/33 36/68/3 +f 12/23/33 9/18/40 36/68/3 +f 36/68/3 9/18/40 33/65/1 +f 14/5/36 13/19/35 37/69/9 +f 37/69/9 13/19/35 38/70/10 +f 13/19/35 15/8/38 38/70/10 +f 38/70/10 15/8/38 39/71/12 +f 15/8/38 16/17/37 39/71/12 +f 39/71/12 16/17/37 40/72/11 +f 16/17/37 14/5/36 40/72/11 +f 40/72/11 14/5/36 37/69/9 diff --git a/Bin/Content/tex_crate.png b/Bin/Content/tex_crate.png new file mode 100644 index 0000000000000000000000000000000000000000..a7b0b1ef7cea3a30ef6ea7a9ec684f018cf02db7 GIT binary patch literal 4532 zcmaJ_XH-*Lw+&UQpn@O-4MjzSB!rsKdl3*Y3Mc{z1OZ7Q3B7kgq$AQJO++@ zz8=CFj|HQCVZd%!!YLa7kXLdepsXKb$RIT4kv&d9V6(140Az2YAYdY;57j5AVeIU+ zJ&2e)9tKEjkH^+<8v!Lnkh~k>Q~--1qd;z0M;r;^rXcW_F5-0kYa1c}`U^sStRV0o zQ>OZcAT>M@1Cjzm#jK&yP>{4ZSX@FXta0ZaHt7DxKKO{WcmxSpA{%4=>-YZ@CL!Gk7>F^3gm)%dpB|j8;IC8!gc=cpBIAijJl^ql7Y*(3WIV|Z zPXMXikph|6<81J*q`%Pm`Uo8yiHyQoV|3IN1Wx&2dwUy%l(?#jl$x5jl&mUDTwDVN zm(WzzP=&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03 +0100 Subject: [PATCH 05/19] Quick Error fix and using .png --- Code/OysterGraphics/FileLoader/ObjReader.cpp | 2 +- Code/Tester/MainTest.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/OysterGraphics/FileLoader/ObjReader.cpp b/Code/OysterGraphics/FileLoader/ObjReader.cpp index 7eb1e268..923f0747 100644 --- a/Code/OysterGraphics/FileLoader/ObjReader.cpp +++ b/Code/OysterGraphics/FileLoader/ObjReader.cpp @@ -95,7 +95,7 @@ void OBJReader::readOBJFile( std::wstring fileName ) inStream.close(); - Mat = Oyster::Resource::OysterResource::LoadResource((fileName + L".jpg").c_str(),Oyster::Graphics::Loading::LoadTexture); + Mat = Oyster::Resource::OysterResource::LoadResource((fileName + L".png").c_str(),Oyster::Graphics::Loading::LoadTexture); } Oyster::Graphics::Model::ModelInfo* OBJReader::toModel() diff --git a/Code/Tester/MainTest.cpp b/Code/Tester/MainTest.cpp index 61d5e45b..c8772c89 100644 --- a/Code/Tester/MainTest.cpp +++ b/Code/Tester/MainTest.cpp @@ -42,7 +42,7 @@ HRESULT InitDirect3D(); int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow ) { - BOOL b = SetDllDirectoryW(L"..\\..\\DLL"); + BOOL b = SetDllDirectoryW(L"..\\DLL"); typedef struct tagLOADPARMS32 { LPSTR lpEnvAddress; // address of environment strings From e658071643d3c029af2f4641ff7a93497f146664 Mon Sep 17 00:00:00 2001 From: Linda Andersson Date: Wed, 4 Dec 2013 11:32:43 +0100 Subject: [PATCH 06/19] GL- open a red window from lancher project --- Code/DanBias.sln | 32 +-- Code/Game/DanBiasGame/DLLMain.cpp | 4 +- Code/Game/DanBiasGame/DanBiasGame.vcxproj | 22 +- Code/Game/DanBiasGame/DanBiasGame_Impl.cpp | 229 ++++++++++++++++++ Code/Game/DanBiasGame/DanBiasMaincpp.cpp | 54 ++--- Code/Game/DanBiasGame/Include/DanBiasGame.h | 36 ++- .../DanBiasLauncher/DanBiasLauncher.vcxproj | 66 +++-- Code/Game/DanBiasLauncher/Launcher.cpp | 20 +- .../Game/DanBiasServer/DanBiasServer_Impl.cpp | 1 + Code/Game/GameLogic/GameLogic.vcxproj | 1 + Code/Game/GameLogic/Object.cpp | 2 +- Code/Input/L_inputClass.h | 1 - Code/OysterPhysics3D/OysterPhysics3D.vcxproj | 12 +- 13 files changed, 395 insertions(+), 85 deletions(-) create mode 100644 Code/Game/DanBiasGame/DanBiasGame_Impl.cpp diff --git a/Code/DanBias.sln b/Code/DanBias.sln index 6d11c6b9..22937dd2 100644 --- a/Code/DanBias.sln +++ b/Code/DanBias.sln @@ -52,8 +52,8 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.Build.0 = Release|x64 - {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.ActiveCfg = Release|x64 - {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.Build.0 = Release|x64 + {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.ActiveCfg = Debug|Win32 + {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.Build.0 = Debug|Win32 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.ActiveCfg = Release|x64 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.Build.0 = Release|x64 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -64,8 +64,8 @@ Global {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|x64.Build.0 = Release|x64 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.Build.0 = Release|x64 - {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.ActiveCfg = Release|x64 - {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.Build.0 = Release|x64 + {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.ActiveCfg = Debug|Win32 + {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.Build.0 = Debug|Win32 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.ActiveCfg = Release|x64 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.Build.0 = Release|x64 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -76,8 +76,8 @@ Global {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|x64.Build.0 = Release|x64 {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Mixed Platforms.Build.0 = Release|x64 - {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Win32.ActiveCfg = Release|x64 - {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Win32.Build.0 = Release|x64 + {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Win32.ActiveCfg = Debug|Win32 + {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Win32.Build.0 = Debug|Win32 {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|x64.ActiveCfg = Release|x64 {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|x64.Build.0 = Release|x64 {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -88,8 +88,8 @@ Global {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Release|x64.Build.0 = Release|x64 {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Mixed Platforms.Build.0 = Release|x64 - {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Win32.ActiveCfg = Release|x64 - {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Win32.Build.0 = Release|x64 + {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Win32.ActiveCfg = Debug|Win32 + {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Win32.Build.0 = Debug|Win32 {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|x64.ActiveCfg = Release|x64 {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|x64.Build.0 = Release|x64 {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -100,8 +100,8 @@ Global {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Release|x64.Build.0 = Release|x64 {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Mixed Platforms.Build.0 = Release|x64 - {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Win32.ActiveCfg = Release|x64 - {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Win32.Build.0 = Release|x64 + {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Win32.ActiveCfg = Debug|Win32 + {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Win32.Build.0 = Debug|Win32 {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|x64.ActiveCfg = Release|x64 {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|x64.Build.0 = Release|x64 {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -112,8 +112,8 @@ Global {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Release|x64.Build.0 = Release|x64 {7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Mixed Platforms.Build.0 = Release|x64 - {7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Win32.ActiveCfg = Release|x64 - {7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Win32.Build.0 = Release|x64 + {7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Win32.ActiveCfg = Debug|Win32 + {7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|Win32.Build.0 = Debug|Win32 {7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|x64.ActiveCfg = Release|x64 {7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Debug|x64.Build.0 = Release|x64 {7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -124,8 +124,8 @@ Global {7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|x64.Build.0 = Release|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.Build.0 = Release|x64 - {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.ActiveCfg = Release|x64 - {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.Build.0 = Release|x64 + {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.ActiveCfg = Debug|Win32 + {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.Build.0 = Debug|Win32 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.ActiveCfg = Release|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.Build.0 = Release|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -172,8 +172,8 @@ Global {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|x64.Build.0 = Release|x64 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.ActiveCfg = Release|Win32 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.Build.0 = Release|Win32 - {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.ActiveCfg = Release|Win32 - {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.Build.0 = Release|Win32 + {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.ActiveCfg = Debug|Win32 + {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.Build.0 = Debug|Win32 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|x64.ActiveCfg = Release|x64 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|x64.Build.0 = Release|x64 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Mixed Platforms.ActiveCfg = Release|Win32 diff --git a/Code/Game/DanBiasGame/DLLMain.cpp b/Code/Game/DanBiasGame/DLLMain.cpp index a4c548e1..e2d438ba 100644 --- a/Code/Game/DanBiasGame/DLLMain.cpp +++ b/Code/Game/DanBiasGame/DLLMain.cpp @@ -1,8 +1,8 @@ - +#define NOMINMAX #include BOOL WINAPI DllMain( _In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID lpvReserved ) { - MessageBox(0, L"DanBiasGame Loaded", 0, 0); + //MessageBox(0, L"DanBiasGame Loaded", 0, 0); return TRUE; } \ No newline at end of file diff --git a/Code/Game/DanBiasGame/DanBiasGame.vcxproj b/Code/Game/DanBiasGame/DanBiasGame.vcxproj index d2d48214..0b9d07d3 100644 --- a/Code/Game/DanBiasGame/DanBiasGame.vcxproj +++ b/Code/Game/DanBiasGame/DanBiasGame.vcxproj @@ -72,6 +72,7 @@ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; + $(SolutionDir)..\External\Include\;$(IncludePath) true @@ -79,6 +80,7 @@ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; + $(SolutionDir)..\External\Include\;$(IncludePath) false @@ -86,6 +88,7 @@ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; + $(SolutionDir)..\External\Include\;$(IncludePath) false @@ -93,6 +96,7 @@ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; + $(SolutionDir)..\External\Include\;$(IncludePath) @@ -100,7 +104,7 @@ Level3 Disabled - DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) true $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) @@ -108,7 +112,7 @@ Windows true OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;%(AdditionalDependencies) - OysterGraphics_$(PlatformShortName)D.dll;GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs) + OysterGraphics_$(PlatformShortName)D.dll;%(DelayLoadDLLs) @@ -117,7 +121,7 @@ Level3 Disabled - DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) true $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) @@ -125,7 +129,7 @@ Windows true OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;%(AdditionalDependencies) - OysterGraphics_$(PlatformShortName)D.dll;GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs) + OysterGraphics_$(PlatformShortName)D.dll;%(DelayLoadDLLs) @@ -136,7 +140,7 @@ MaxSpeed true true - DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) true $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) @@ -146,7 +150,7 @@ true true OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;%(AdditionalDependencies) - OysterGraphics_$(PlatformShortName)D.dll;GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs) + OysterGraphics_x86.dll;%(DelayLoadDLLs) @@ -157,7 +161,7 @@ MaxSpeed true true - DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) true $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) @@ -167,7 +171,7 @@ true true OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;%(AdditionalDependencies) - OysterGraphics_$(PlatformShortName)D.dll;GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs) + OysterGraphics_x86.dll;%(DelayLoadDLLs) @@ -182,7 +186,7 @@ - + diff --git a/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp b/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp new file mode 100644 index 00000000..09fa36b8 --- /dev/null +++ b/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp @@ -0,0 +1,229 @@ +#define NOMINMAX +#include +#include "Include\DanBiasGame.h" + +namespace DanBias +{ + __int64 DanBiasGame::cntsPerSec = 0; + __int64 DanBiasGame::prevTimeStamp = 0; + float DanBiasGame::secsPerCnt = 0; + InputClass* DanBiasGame::inputObj = NULL; + HINSTANCE DanBiasGame::g_hInst = NULL; + HWND DanBiasGame::g_hWnd = NULL; + +#pragma region Game Data + class DanBiasGamePrivateData + { + + public: + DanBiasGamePrivateData() + { + + } + ~DanBiasGamePrivateData() + { + + } + + public: + + } data; +#pragma endregion + + //-------------------------------------------------------------------------------------- + // Interface API functions + //-------------------------------------------------------------------------------------- + DanBiasClientReturn DanBiasGame::Initiate(DanBiasGameDesc& desc) + { + if( FAILED( InitWindow( desc.hinst, desc.nCmdShow ) )) + return DanBiasClientReturn_Error; + + if( FAILED( InitDirect3D() ) ) + return DanBiasClientReturn_Error; + + if( FAILED( InitGame() ) ) + return DanBiasClientReturn_Error; + + cntsPerSec = 0; + QueryPerformanceFrequency((LARGE_INTEGER*)&cntsPerSec); + secsPerCnt = 1.0f / (float)cntsPerSec; + + prevTimeStamp = 0; + QueryPerformanceCounter((LARGE_INTEGER*)&prevTimeStamp); + + return DanBiasClientReturn_Sucess; + } + + DanBiasClientReturn DanBiasGame::Run() + { + // Main message loop + MSG msg = {0}; + while(WM_QUIT != msg.message) + { + if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE) ) + { + TranslateMessage( &msg ); + DispatchMessage( &msg ); + } + else + { + __int64 currTimeStamp = 0; + QueryPerformanceCounter((LARGE_INTEGER*)&currTimeStamp); + float dt = (currTimeStamp - prevTimeStamp) * secsPerCnt; + + //render + Update(dt); + Render(dt); + + prevTimeStamp = currTimeStamp; + } + } + return DanBiasClientReturn_Sucess; + } + + void DanBiasGame::Release() + { + CleanUp(); + } + + + //-------------------------------------------------------------------------------------- + // Register class and create window + //-------------------------------------------------------------------------------------- + HRESULT DanBiasGame::InitWindow( HINSTANCE hInstance, int nCmdShow ) + { + // Register class + WNDCLASSEX wcex; + wcex.cbSize = sizeof(WNDCLASSEX); + wcex.style = CS_HREDRAW | CS_VREDRAW; + wcex.lpfnWndProc = WndProc; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + wcex.hInstance = hInstance; + wcex.hIcon = 0; + wcex.hCursor = LoadCursor(NULL, IDC_ARROW); + wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); + wcex.lpszMenuName = NULL; + wcex.lpszClassName = L"BTH_D3D_Template"; + wcex.hIconSm = 0; + if( !RegisterClassEx(&wcex) ) + return E_FAIL; + + // Adjust and create window + g_hInst = hInstance; + RECT rc = { 0, 0, 1024, 768 }; + AdjustWindowRect( &rc, WS_OVERLAPPEDWINDOW, FALSE ); + + if(!(g_hWnd = CreateWindow( + L"BTH_D3D_Template", + L"BTH - Direct3D 11.0 Template", + WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, + CW_USEDEFAULT, + rc.right - rc.left, + rc.bottom - rc.top, + NULL, + NULL, + hInstance, + NULL))) + { + return E_FAIL; + } + ShowWindow( g_hWnd, nCmdShow ); + + return S_OK; + } + + //-------------------------------------------------------------------------------------- + // Create Direct3D with Oyster Graphics + //-------------------------------------------------------------------------------------- + HRESULT DanBiasGame::InitDirect3D() + { + if(Oyster::Graphics::API::Init(g_hWnd, false, false, Oyster::Math::Float2( 1024, 768)) != Oyster::Graphics::API::Sucsess) + return E_FAIL; + return S_OK; + } + + //-------------------------------------------------------------------------------------- + // Init the input and the game + //------------------------------------------------------------------------------------- + HRESULT DanBiasGame::InitGame() + { + inputObj = new InputClass; + if(!inputObj->Initialize(g_hInst, g_hWnd, 1024, 768)) + { + MessageBox(0, L"Could not initialize the input object.", L"Error", MB_OK); + return E_FAIL; + } + + return S_OK; + } + + HRESULT DanBiasGame::Update(float deltaTime) + { + inputObj->Update(); + + return S_OK; + } + + HRESULT DanBiasGame::Render(float deltaTime) + { + int isPressed = 0; + if(inputObj->IsKeyPressed(DIK_A)) + { + isPressed = 1; + } + + Oyster::Graphics::API::NewFrame(Oyster::Math3D::Float4x4::null, Oyster::Math3D::Float4x4::null); + + wchar_t title[255]; + swprintf(title, sizeof(title), L"| Pressing A: %d | \n", (int)(isPressed)); + SetWindowText(g_hWnd, title); + + Oyster::Graphics::API::EndFrame(); + + return S_OK; + } + + HRESULT DanBiasGame::CleanUp() + { + return S_OK; + } + + //-------------------------------------------------------------------------------------- + // Called every time the application receives a message + //-------------------------------------------------------------------------------------- + LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) + { + PAINTSTRUCT ps; + HDC hdc; + + switch (message) + { + case WM_PAINT: + hdc = BeginPaint(hWnd, &ps); + EndPaint(hWnd, &ps); + break; + + case WM_DESTROY: + PostQuitMessage(0); + break; + + case WM_KEYDOWN: + + switch(wParam) + { + case VK_ESCAPE: + PostQuitMessage(0); + break; + } + break; + + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + + return 0; + } + +} //End namespace DanBias \ No newline at end of file diff --git a/Code/Game/DanBiasGame/DanBiasMaincpp.cpp b/Code/Game/DanBiasGame/DanBiasMaincpp.cpp index 23c1a119..0b7ea666 100644 --- a/Code/Game/DanBiasGame/DanBiasMaincpp.cpp +++ b/Code/Game/DanBiasGame/DanBiasMaincpp.cpp @@ -9,7 +9,7 @@ #include #include "DllInterfaces/GFXAPI.h" -#include "IGame.h" +//#include "IGame.h" #include "L_inputClass.h" @@ -28,7 +28,7 @@ HINSTANCE g_hInst = NULL; HWND g_hWnd = NULL; -GameLogic::IGame* game; +//GameLogic::IGame* game; InputClass* inputObj; @@ -205,34 +205,34 @@ HRESULT InitGame() MessageBox(0, L"Could not initialize the input object.", L"Error", MB_OK); return false; } - game = new GameLogic::IGame(); + /*game = new GameLogic::IGame(); game->Init(); game->StartGame(); - + */ return S_OK; } HRESULT Update(float deltaTime) { inputObj->Update(); - GameLogic::keyInput key = GameLogic::keyInput_none; + //GameLogic::keyInput key = GameLogic::keyInput_none; - if(inputObj->IsKeyPressed(DIK_W)) - { - key = GameLogic::keyInput_W; - } - else if(inputObj->IsKeyPressed(DIK_A)) - { - key = GameLogic::keyInput_A; - } - else if(inputObj->IsKeyPressed(DIK_S)) - { - key = GameLogic::keyInput_S; - } - else if(inputObj->IsKeyPressed(DIK_D)) - { - key = GameLogic::keyInput_D; - } + //if(inputObj->IsKeyPressed(DIK_W)) + //{ + // key = GameLogic::keyInput_W; + //} + //else if(inputObj->IsKeyPressed(DIK_A)) + //{ + // key = GameLogic::keyInput_A; + //} + //else if(inputObj->IsKeyPressed(DIK_S)) + //{ + // key = GameLogic::keyInput_S; + //} + //else if(inputObj->IsKeyPressed(DIK_D)) + //{ + // key = GameLogic::keyInput_D; + //} float pitch = 0; float yaw = 0; @@ -243,7 +243,7 @@ HRESULT Update(float deltaTime) yaw = inputObj->GetYaw(); //} - game->Update(key, pitch, yaw); + //game->Update(key, pitch, yaw); return S_OK; @@ -258,7 +258,7 @@ HRESULT Render(float deltaTime) //std::cout<<"test"; } - game->Render(); + //game->Render(); wchar_t title[255]; swprintf(title, sizeof(title), L"| Pressing A: %d | \n", (int)(isPressed)); SetWindowText(g_hWnd, title); @@ -271,11 +271,11 @@ HRESULT Render(float deltaTime) HRESULT CleanUp() { - if(game) + /*if(game) { - delete game; - game = NULL; - } + delete game; + game = NULL; + }*/ return S_OK; } //-------------------------------------------------------------------------------------- diff --git a/Code/Game/DanBiasGame/Include/DanBiasGame.h b/Code/Game/DanBiasGame/Include/DanBiasGame.h index c24fe460..d1adba92 100644 --- a/Code/Game/DanBiasGame/Include/DanBiasGame.h +++ b/Code/Game/DanBiasGame/Include/DanBiasGame.h @@ -7,10 +7,17 @@ #define DANBIAS_GAME_DLL __declspec(dllimport) #endif +#define NOMINMAX +#include + +#include "DllInterfaces/GFXAPI.h" +#include "L_inputClass.h" + namespace DanBias { extern "C" { + enum DanBiasClientReturn { DanBiasClientReturn_Error, @@ -21,17 +28,42 @@ namespace DanBias { //Stuff goes here... int port; - }; + HINSTANCE hinst; + int nCmdShow; + }; + LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); + class DANBIAS_GAME_DLL DanBiasGame { public: + //-------------------------------------------------------------------------------------- + // Interface API functions + //-------------------------------------------------------------------------------------- static DanBiasClientReturn Initiate(DanBiasGameDesc& desc); static DanBiasClientReturn Run(); static void Release(); + + private: + + static HRESULT InitWindow( HINSTANCE hInstance, int nCmdShow); + static HRESULT InitDirect3D(); + static HRESULT InitGame(); + + static HRESULT Update(float deltaTime); + static HRESULT Render(float deltaTime); + static HRESULT CleanUp(); + private: + static __int64 cntsPerSec; + static __int64 prevTimeStamp; + static float secsPerCnt; + static InputClass* inputObj; + static HINSTANCE g_hInst; + static HWND g_hWnd; }; + }//End Extern "C" -} //End namspace DanBias +} //End namespace DanBias #endif // !DANBIASGAME_DANBIASGAME_H diff --git a/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj b/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj index 2605ece8..5a4ebeb6 100644 --- a/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj +++ b/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj @@ -71,32 +71,32 @@ $(SolutionDir)..\Bin\Executable\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D - $(IncludePath) - $(OutDir)..\DLL\;$(LibraryPath); + $(SolutionDir)..\External\Include\;$(IncludePath);$(IncludePath) + $(OutDir)..\DLL\;$(LibraryPath);$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; true $(SolutionDir)..\Bin\Executable\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D - $(IncludePath) - $(OutDir)..\DLL\;$(LibraryPath); + $(SolutionDir)..\External\Include\;$(IncludePath);$(IncludePath) + $(OutDir)..\DLL\;$(LibraryPath);$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; false $(SolutionDir)..\Bin\Executable\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) - $(IncludePath) - $(OutDir)..\DLL\;$(LibraryPath); + $(SolutionDir)..\External\Include\;$(IncludePath);$(IncludePath) + $(OutDir)..\DLL\;$(LibraryPath);$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; false $(SolutionDir)..\Bin\Executable\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) - $(IncludePath) - $(OutDir)..\DLL\;$(LibraryPath); + $(SolutionDir)..\External\Include\;$(IncludePath);$(IncludePath) + $(OutDir)..\DLL\;$(LibraryPath);$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; @@ -105,13 +105,13 @@ Level3 Disabled WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - $(SolutionDir)Game\DanBiasServer\Include + $(SolutionDir)Input;$(SolutionDir)Include;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterGraphics\;$(SolutionDir)Game\DanBiasServer\Include;$(SolutionDir)Game\DanBiasGame\Include Windows true - DanBiasServer_$(PlatformShortName)D.dll;DanBiasGame_$(PlatformShortName)D.dll;%(DelayLoadDLLs) - DanBiasServer_$(PlatformShortName)D.lib;DanBiasGame_$(PlatformShortName)D.lib;%(AdditionalDependencies) + GameLogic_$(PlatformShortName)D.dll;OysterGraphics_$(PlatformShortName)D.dll;DanBiasServer_$(PlatformShortName)D.dll;DanBiasGame_$(PlatformShortName)D.dll;%(DelayLoadDLLs) + Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;DanBiasServer_$(PlatformShortName)D.lib;DanBiasGame_$(PlatformShortName)D.lib;%(AdditionalDependencies) @@ -121,13 +121,13 @@ Level3 Disabled WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - $(SolutionDir)Game\DanBiasServer\Include + $(SolutionDir)Input;$(SolutionDir)Include;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterGraphics\;$(SolutionDir)Game\DanBiasServer\Include;$(SolutionDir)Game\DanBiasGame\Include Windows true - DanBiasServer_$(PlatformShortName)D.dll;DanBiasGame_$(PlatformShortName)D.dll;%(DelayLoadDLLs) - DanBiasServer_$(PlatformShortName)D.lib;DanBiasGame_$(PlatformShortName)D.lib;%(AdditionalDependencies) + GameLogic_$(PlatformShortName)D.dll;OysterGraphics_$(PlatformShortName)D.dll;DanBiasServer_$(PlatformShortName)D.dll;DanBiasGame_$(PlatformShortName)D.dll;%(DelayLoadDLLs) + Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;DanBiasServer_$(PlatformShortName)D.lib;DanBiasGame_$(PlatformShortName)D.lib;%(AdditionalDependencies) @@ -139,15 +139,15 @@ true true WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - $(SolutionDir)Game\DanBiasServer\Include + $(SolutionDir)Input;$(SolutionDir)Include;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterGraphics\;$(SolutionDir)Game\DanBiasServer\Include;$(SolutionDir)Game\DanBiasGame\Include Windows true true true - DanBiasServer_$(PlatformShortName).dll;DanBiasGame_$(PlatformShortName).dll;%(DelayLoadDLLs) - DanBiasServer_$(PlatformShortName).lib;DanBiasGame_$(PlatformShortName).lib;%(AdditionalDependencies) + GameLogic_$(PlatformShortName).dll;OysterGraphics_$(PlatformShortName).dll;DanBiasServer_$(PlatformShortName).dll;DanBiasGame_$(PlatformShortName).dll;%(DelayLoadDLLs) + Input_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;DanBiasServer_$(PlatformShortName).lib;DanBiasGame_$(PlatformShortName).lib;%(AdditionalDependencies) @@ -159,20 +159,46 @@ true true WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - $(SolutionDir)Game\DanBiasServer\Include + $(SolutionDir)Input;$(SolutionDir)Include;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterGraphics\;$(SolutionDir)Game\DanBiasServer\Include;$(SolutionDir)Game\DanBiasGame\Include Windows true true true - DanBiasServer_$(PlatformShortName).dll;DanBiasGame_$(PlatformShortName).dll;%(DelayLoadDLLs) - DanBiasServer_$(PlatformShortName).lib;DanBiasGame_$(PlatformShortName).lib;%(AdditionalDependencies) + GameLogic_$(PlatformShortName).dll;OysterGraphics_$(PlatformShortName).dll;DanBiasServer_$(PlatformShortName).dll;DanBiasGame_$(PlatformShortName).dll;%(DelayLoadDLLs) + Input_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;DanBiasServer_$(PlatformShortName).lib;DanBiasGame_$(PlatformShortName).lib;%(AdditionalDependencies) + + + {104fa3e9-94d9-4e1d-a941-28a03bc8a095} + + + {7e3990d2-3d94-465c-b58d-64a74b3ecf9b} + + + {2ec4dded-8f75-4c86-a10b-e1e8eb29f3ee} + + + {0ec83e64-230e-48ef-b08c-6ac9651b4f82} + + + {f10cbc03-9809-4cba-95d8-327c287b18ee} + + + {2a1bc987-af42-4500-802d-89cd32fc1309} + + + {52380daa-0f4a-4d97-8e57-98df39319caf} + + + {b1195bb9-b3a5-47f0-906c-8dea384d1520} + + diff --git a/Code/Game/DanBiasLauncher/Launcher.cpp b/Code/Game/DanBiasLauncher/Launcher.cpp index b1cab1ee..dff589fc 100644 --- a/Code/Game/DanBiasLauncher/Launcher.cpp +++ b/Code/Game/DanBiasLauncher/Launcher.cpp @@ -1,10 +1,11 @@ ///////////////////////////////////////////////// // Launcher to launch Danbias server or client // ///////////////////////////////////////////////// +#define NOMINMAX #include -#define DANBIAS_SERVER -//#define DANBIAS_CLIENT +//#define DANBIAS_SERVER +#define DANBIAS_CLIENT #if defined(DANBIAS_SERVER) @@ -30,8 +31,21 @@ int WINAPI WinMain( HINSTANCE hinst, HINSTANCE prevInst, PSTR cmdLine, int cmdSh DanBias::DanBiasServer::Release(); } #elif defined(DANBIAS_CLIENT) + if(SetDllDirectory(L"..\\DLL") == FALSE) + { + return cmdShow; + } // Game client starter code goes here - return cmdShow; + DanBias::DanBiasGameDesc gameDesc; + gameDesc.port = 1; + gameDesc.hinst = hinst; + gameDesc.nCmdShow = cmdShow; + + if( DanBias::DanBiasGame::Initiate(gameDesc) == DanBias::DanBiasClientReturn_Sucess) + { + DanBias::DanBiasGame::Run(); + DanBias::DanBiasGame::Release(); + } #endif return cmdShow; diff --git a/Code/Game/DanBiasServer/DanBiasServer_Impl.cpp b/Code/Game/DanBiasServer/DanBiasServer_Impl.cpp index 4d4c753b..83450989 100644 --- a/Code/Game/DanBiasServer/DanBiasServer_Impl.cpp +++ b/Code/Game/DanBiasServer/DanBiasServer_Impl.cpp @@ -3,6 +3,7 @@ namespace DanBias { + #pragma region Server Data class DanBiasServerPrivateData { diff --git a/Code/Game/GameLogic/GameLogic.vcxproj b/Code/Game/GameLogic/GameLogic.vcxproj index c22b4ef8..8afb5bb4 100644 --- a/Code/Game/GameLogic/GameLogic.vcxproj +++ b/Code/Game/GameLogic/GameLogic.vcxproj @@ -101,6 +101,7 @@ true OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GamePhysics_$(PlatformShortName)D.lib;%(AdditionalDependencies) + GamePhysics_$(PlatformShortName)D.dll diff --git a/Code/Game/GameLogic/Object.cpp b/Code/Game/GameLogic/Object.cpp index a1f03da3..67385874 100644 --- a/Code/Game/GameLogic/Object.cpp +++ b/Code/Game/GameLogic/Object.cpp @@ -17,7 +17,7 @@ Object::Object(std::wstring objFile) //model = new Model(); model = Oyster::Graphics::API::CreateModel(objFile); - + API::SimpleBodyDescription sbDesc; //sbDesc.centerPosition = diff --git a/Code/Input/L_inputClass.h b/Code/Input/L_inputClass.h index 129024c2..08358135 100644 --- a/Code/Input/L_inputClass.h +++ b/Code/Input/L_inputClass.h @@ -7,7 +7,6 @@ #ifndef _INPUTCLASS_H_ #define _INPUTCLASS_H_ - #define DIRECTINPUT_VERSION 0x0800 #pragma comment(lib, "dinput8.lib") diff --git a/Code/OysterPhysics3D/OysterPhysics3D.vcxproj b/Code/OysterPhysics3D/OysterPhysics3D.vcxproj index 2113cccb..f24f23e4 100644 --- a/Code/OysterPhysics3D/OysterPhysics3D.vcxproj +++ b/Code/OysterPhysics3D/OysterPhysics3D.vcxproj @@ -24,26 +24,26 @@ - DynamicLibrary + StaticLibrary true v110 MultiByte - DynamicLibrary + StaticLibrary true v110 MultiByte - DynamicLibrary + StaticLibrary false v110 true MultiByte - DynamicLibrary + StaticLibrary false v110 true @@ -69,21 +69,25 @@ $(SolutionDir)..\External\Lib\$(ProjectName)\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D + .lib $(SolutionDir)..\External\Lib\$(ProjectName)\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) + .lib $(SolutionDir)..\External\Lib\$(ProjectName)\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D + .lib $(SolutionDir)..\External\Lib\$(ProjectName)\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) + .lib From 64a8089e544dd88bcd2a8a866bbf44bf899ad622 Mon Sep 17 00:00:00 2001 From: dean11 Date: Wed, 4 Dec 2013 11:37:26 +0100 Subject: [PATCH 07/19] GameLogic - Worked on server --- Bin/Content/Shaders/DebugCameraVertex.cso | Bin 2628 -> 20700 bytes Bin/Content/Shaders/DebugPixel.cso | Bin 488 -> 12252 bytes Bin/Content/Shaders/DebugVertex.cso | Bin 540 -> 12292 bytes Bin/Content/Shaders/LightPass.cso | Bin 336 -> 12124 bytes Bin/Content/Shaders/PixelGatherData.cso | Bin 820 -> 16684 bytes Bin/Content/Shaders/TextureDebug.cso | Bin 760 -> 15120 bytes Bin/Content/Shaders/VertexGatherData.cso | Bin 2852 -> 23008 bytes Code/DanBias.sln | 145 +++++++++--------- Code/Game/DanBiasGame/DanBiasGame.vcxproj | 2 +- Code/Game/DanBiasGame/DanBiasGame_Impl.cpp | 62 ++++++++ Code/Game/DanBiasLauncher/Launcher.cpp | 2 +- Code/Game/DanBiasServer/DBServer.cpp | 56 +++++++ Code/Game/DanBiasServer/DBServer.h | 27 ++++ Code/Game/DanBiasServer/DanBiasServer.vcxproj | 21 ++- .../Game/DanBiasServer/DanBiasServer_Impl.cpp | 39 ----- Code/Game/DanBiasServer/IDanBiasServer.cpp | 28 ++++ .../{DanBiasServer.h => IDanBiasServer.h} | 5 +- .../DanBiasServer/Include/ServerWrapper.h | 23 +++ Code/Game/DanBiasServer/MainLobby.h | 17 ++ Code/OysterPhysics3D/OysterPhysics3D.vcxproj | 8 +- 20 files changed, 317 insertions(+), 118 deletions(-) create mode 100644 Code/Game/DanBiasGame/DanBiasGame_Impl.cpp create mode 100644 Code/Game/DanBiasServer/DBServer.cpp create mode 100644 Code/Game/DanBiasServer/DBServer.h delete mode 100644 Code/Game/DanBiasServer/DanBiasServer_Impl.cpp create mode 100644 Code/Game/DanBiasServer/IDanBiasServer.cpp rename Code/Game/DanBiasServer/Include/{DanBiasServer.h => IDanBiasServer.h} (75%) create mode 100644 Code/Game/DanBiasServer/Include/ServerWrapper.h create mode 100644 Code/Game/DanBiasServer/MainLobby.h diff --git a/Bin/Content/Shaders/DebugCameraVertex.cso b/Bin/Content/Shaders/DebugCameraVertex.cso index d9e567be113914c6b913012b85586ef11a19629f..20c23e0c8ef50958c4ec22f68ec9407913ccbc16 100644 GIT binary patch literal 20700 zcmeHPZ)}y-8GqikKwDZYNU;NCCxBUz+W#VURg1k;$O^5rR9w11X)o=S+k3lvZ=ptX z&4P&;#<|5TW{U|QjG4n_U)W|A-Ed=zQKQBf=LfbhKlx#cz>FUjqx=2N`<&a;(o$qH z3*1A_ectDH&hwn-Jm=s0o^wiM*WInr=Zk-~{>_0GpZR_Hdw+cEzLx_LIn^mLA9N$) z#{h=%@Q@F_Sma&A9g)p#$AJ@m5|OkSQRaR2`8?o{Anu6N)e);eG>DamYY|Hj84iWy zykCe4AaC>z_ZT0Q-wYAlC8yYs! zq+?sV?%5uPL1<1XL_||(12KjL3qHusla;6Ur@eHq9S5HqEB1 z@9Aro$JXo7^YhFLr7mQjErasU{os6g&T$AACI86}jm^v-*FVs87%ocQ)sb~~@_rrZ zuO6+VpU1Bw>*3mslrqjoe0Fv8<^4L&ChzL#%lmblP2Sbf=9{J+SzlL2KaXEW*2C3} z)b|meT^)USzmBuXyE^*vejR6%cXhP+rl}+A;_B$<@$1NXxVn)t&9x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K9WU&t;`2})PsKcxQ@v;Lk&2V@MZFqKluJxI0!QpJ zr$e7?Rv>>WS^9HYDs!oMjc0DHxqCwjD|qUQK>?IUd=NBz7m6T`i@Lu*aNxsyAcL}y zMKEF#dw}!ut@`u#7sOX^T(G0p&K{dJO+$Io<_? z)X$Coobzo)LY?sasu-I&8RsYv>ZmI7g8_X4qR+200v6KJ1zVY-Tpjs706n;WFHVaV zpf2=jE>+iIjBs}l#TnQLQxGc0KlK0Sj2izbsCJ~%bFu*9y-R9R_wa33^G05|k3VY@ z;#n(*-j6I0S>T0QU_QO+`CMnY73q;H=Cv8F4KGxIsPg~S0_>hW5u)*bqG@J~0AqZ# zCgYv^6GUg`($%l=f2S@+!MKX?3S$ThIk7m*1T;9VdFK`}>aHM0HMBn{@G+N1a_iZF z;7#&Z9Mdv2=B)lQd2jr>V&n%tq>+1SoR#3W0MM6^;{4&aHZ8(h6vpAa{)a{gJA;l5 z57&Af^wW?$7Z~sU?e9`^PP5OVl$jmW97;KME;XRxFL;LxD_8Itef&>6CpGnh zb2zTzFN?77GDZOQKTN9zM!3OoMw9{I=ncSi=LF+_XreOGg{G$N=@;w2U|h*+8ceS; z_2L1X{*lvVrg_F&oDR?aO`I3}&0%c-550Shv6gW@Bd;U;)%%8oL2GXBhw#17QZH|NnJ>lnRIqCP6F&W(3LyGBB_*Fz_#6U}&%hse*t8MSGxGObi_S z4GauV7X1Iuz!2==5(Ki;0f_m4crpj031i7*TgGz5AQx9Ruzf&b7?1%mSb!RV=EzK} GtOfuvR3@ST diff --git a/Bin/Content/Shaders/DebugVertex.cso b/Bin/Content/Shaders/DebugVertex.cso index f9767fdb3fda4b15b9bf290ff3d22665645976ad..e35466e14dca7c76b79bb799b061e06a02989cce 100644 GIT binary patch literal 12292 zcmeHNOKenC7(TZTY=;)6$h!$SQAo;b9+XF^l}za{v`L{&ry>ax%P@009cDUry!ZA& z)YyeFL`jT>gv7*z1+KawE+lbNqB|ExcP?BILktTeP>gY5sNZ)Vb!=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05^|do& YuhGH0pV_00vB0M`rdqGoEn0&5Q)6UcU@&23U|<8%7C^iQh;4v^JAhb# ziGkq-5Ig4QS=Io>L70K*|NjUer2=AuNe~Nx8G-VF3=FIc4Ezfi7#i$Bsvw}j*Ipi| z9mr{5Vqo6@G@prqgTH}+;mHCP1_mJF2a2m~09vzvf#K-_kUS$qzTy9W28Lh{m!Jxu zW(Oda1LDaq7**KJ7#KJ{DNL4Pk~dHgU;t`ia1#<>0D6Z3D8t$W6=QS&3IN?=$H2fC z9O4*K0_3qwR^*nRTwuyEIfj>G@&_gbMwZDNnbZ}7TwL7(K+2JT42aDFbOg`>nT?gv Fi~x2#IamMy diff --git a/Bin/Content/Shaders/TextureDebug.cso b/Bin/Content/Shaders/TextureDebug.cso index 2cce30d6c069594e6fe47b5461000b04b794f041..51c99d225b5fc4792ca5fd1119ff5c227f339b01 100644 GIT binary patch literal 15120 zcmeHOYiwLc6+Y`nVsEm^Iu9o#AzY=VY|_MDKWJh%jgoln*p*-P+HOi$ayGly_Tu&K z>fXC?q7oFL3L&D3RP;xqf)o&-fGg1-NEM(;K`oVlDwH4m00ksar1A$fPFo&TmF4^9 z-n+eaourhutdl*~@ywhv_sp3ybLY-EGaEU2xbxmup6cm6_SmbR`|dYpW`FsecYPuf zd_ZI+(*3}nRETJmBB6GX?*StnB3FQivYGZActoiv6nc<`khT9a7ZRT|IAswZ>f9)N zMIwhskC6Ks8v-zS6<7s)4M=epLA-{vvm-WY>V_GM=$TB4i8*a$b1`!|n~ujKW6f=Q z_iB5zsFgJ=&CKcPymdlPOs7+sNi%0;zo<`JT1uNV^0{1Wh~aoF7rllK4jCgJ;l`vz`sd!R1Vm*D)zF0IhlS}In{dj&dHlm-j@`hb#oJyN% zr_Y5#kcvy8unlPqav`KEknTe|6HjF%mC4Ca)|9!qIiFOb-&Lybd}?$|99l(@Hjp)D z;%S%8`Zhe0vt|67MG%9)4ZsHAZs2|(>D4L;AX_C7(g0PU766OeSE{3C1@yvD1MED< z;B8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3j0^G21JRE+xR(*i-dpfH7&96G6=&@11S6$tz)i$kUJqlJsH`D`&8E8bnHR2#9``ub*V4bIfq_~}Yrzpj@V(`lzr@*!4(Fo>XJ6!h_TZeu8s9uP&jj%w9-Mb43j687c_)Z3 z=8Kt9CZCg1YI!!FFC- - + diff --git a/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp b/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp new file mode 100644 index 00000000..8176521b --- /dev/null +++ b/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp @@ -0,0 +1,62 @@ +#include +#include "Include\DanBiasGame.h" + +namespace DanBias +{ +#pragma region Game Data + /** + * Private server data container + */ + class DanBiasGamePrivateData + { + public: + bool initiated; + bool running; + bool released; + + public: + DanBiasGamePrivateData() + :running(0) + , initiated(0) + {} + void Release() + { + + } + } data; +#pragma endregion + + + DanBiasClientReturn DanBiasGame::Initiate(DanBiasGameDesc& desc) + { + + data.initiated = true; + return DanBiasClientReturn_Sucess; + } + DanBiasClientReturn DanBiasGame::Run() + { + if(data.running) + { + return DanBiasClientReturn_Error; + } + if(!data.released) + { + return DanBiasClientReturn_Error; + } + if(!data.initiated) + { + return DanBiasClientReturn_Error; + } + data.running = true; + while (data.running) + { + + } + return DanBiasClientReturn_Sucess; + } + void DanBiasGame::Release() + { + data.released = true; + } + +} //End namspace DanBias \ No newline at end of file diff --git a/Code/Game/DanBiasLauncher/Launcher.cpp b/Code/Game/DanBiasLauncher/Launcher.cpp index b1cab1ee..050e6b8b 100644 --- a/Code/Game/DanBiasLauncher/Launcher.cpp +++ b/Code/Game/DanBiasLauncher/Launcher.cpp @@ -8,7 +8,7 @@ #if defined(DANBIAS_SERVER) -#include "DanBiasServer.h" +#include "IDanBiasServer.h" #elif defined(DANBIAS_CLIENT) #include "DanBiasGame.h" #endif diff --git a/Code/Game/DanBiasServer/DBServer.cpp b/Code/Game/DanBiasServer/DBServer.cpp new file mode 100644 index 00000000..db81f4da --- /dev/null +++ b/Code/Game/DanBiasServer/DBServer.cpp @@ -0,0 +1,56 @@ +///////////////////////////////////////////////////////////////////// +// Created by [Dennis Andersen] [2013] +///////////////////////////////////////////////////////////////////// +#include +#include "DBServer.h" +//#include "GameLogic\?" +#include "Utilities.h" + +using namespace DanBias; + +DBServer::DBServer() + : initiated(0) + , running(0) + , released(0) +{ +} +DBServer::~DBServer() +{ + +} +DanBiasServerReturn DBServer::Create(const DanBias::DanBiasServerDesc& desc) +{ + this->initiated = true; + return DanBiasServerReturn_Sucess; +} +DanBiasServerReturn DBServer::Run() +{ + + if(this->running) + { + return DanBiasServerReturn_Error; + } + if(this->released) + { + return DanBiasServerReturn_Error; + } + if(!this->initiated) + { + return DanBiasServerReturn_Error; + } + this->running = true; + while (this->running) + { + MessageBox(0, L"What to do here...", L"TYPELESS", 0); + + this->running = false; + } + return DanBiasServerReturn_Sucess; +} +DanBiasServerReturn DBServer::Release() +{ + this->released = true; + return DanBiasServerReturn_Sucess; +} + + diff --git a/Code/Game/DanBiasServer/DBServer.h b/Code/Game/DanBiasServer/DBServer.h new file mode 100644 index 00000000..261e62d5 --- /dev/null +++ b/Code/Game/DanBiasServer/DBServer.h @@ -0,0 +1,27 @@ +///////////////////////////////////////////////////////////////////// +// Created by [Dennis Andersen] [2013] +///////////////////////////////////////////////////////////////////// +#ifndef DANBIASSERVER_DBSERVER_H +#define DANBIASSERVER_DBSERVER_H + +#include "Include\IDanBiasServer.h" + +namespace DanBias +{ + class DBServer + { + public: + DBServer(); + ~DBServer(); + + DanBiasServerReturn Create(const DanBias::DanBiasServerDesc& desc); + DanBiasServerReturn Run(); + DanBiasServerReturn Release(); + + private: + bool initiated; + bool running; + bool released; + }; +}// End namspace DanBias +#endif // !DANBIASSERVER_DBSERVER_H diff --git a/Code/Game/DanBiasServer/DanBiasServer.vcxproj b/Code/Game/DanBiasServer/DanBiasServer.vcxproj index 139a25d1..ba85aaa5 100644 --- a/Code/Game/DanBiasServer/DanBiasServer.vcxproj +++ b/Code/Game/DanBiasServer/DanBiasServer.vcxproj @@ -103,10 +103,12 @@ Level3 Disabled DANBIAS_SERVER;DANBIAS_SERVER_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + $(SolutionDir)Misc\;$(SolutionDir)Game\ Windows true + GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs) @@ -116,10 +118,12 @@ Level3 Disabled DANBIAS_SERVER;DANBIAS_SERVER_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + $(SolutionDir)Misc\;$(SolutionDir)Game\ Windows true + GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs) @@ -131,12 +135,14 @@ true true DANBIAS_SERVER;DANBIAS_SERVER_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + $(SolutionDir)Misc\;$(SolutionDir)Game\ Windows true true true + GameLogic_$(PlatformShortName).dll;%(DelayLoadDLLs) @@ -148,20 +154,31 @@ true true DANBIAS_SERVER;DANBIAS_SERVER_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + $(SolutionDir)Misc\;$(SolutionDir)Game\ Windows true true true + GameLogic_$(PlatformShortName).dll;%(DelayLoadDLLs) - + + - + + + + + + + + {2ec4dded-8f75-4c86-a10b-e1e8eb29f3ee} + diff --git a/Code/Game/DanBiasServer/DanBiasServer_Impl.cpp b/Code/Game/DanBiasServer/DanBiasServer_Impl.cpp deleted file mode 100644 index 4d4c753b..00000000 --- a/Code/Game/DanBiasServer/DanBiasServer_Impl.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include "Include\DanBiasServer.h" - -namespace DanBias -{ -#pragma region Server Data - class DanBiasServerPrivateData - { - public: - DanBiasServerPrivateData() - { - - } - ~DanBiasServerPrivateData() - { - - } - - private: - - - } data; -#pragma endregion - - - DanBiasServerReturn DanBiasServer::Initiate(DanBiasServerDesc& desc) - { - return DanBiasServerReturn_Sucess; - } - DanBiasServerReturn DanBiasServer::Run() - { - return DanBiasServerReturn_Sucess; - } - void DanBiasServer::Release() - { - - } - -} //End namspace DanBias \ No newline at end of file diff --git a/Code/Game/DanBiasServer/IDanBiasServer.cpp b/Code/Game/DanBiasServer/IDanBiasServer.cpp new file mode 100644 index 00000000..bf0b52de --- /dev/null +++ b/Code/Game/DanBiasServer/IDanBiasServer.cpp @@ -0,0 +1,28 @@ +///////////////////////////////////////////////////////////////////// +// Created by [Dennis Andersen] [2013] +///////////////////////////////////////////////////////////////////// +#include "Include\IDanBiasServer.h" +#include "DBServer.h" + +namespace DanBias +{ + +#pragma region Server Data + static DBServer server; +#pragma endregion + + + DanBiasServerReturn DanBiasServer::Initiate(DanBiasServerDesc& desc) + { + return server.Create(desc); + } + DanBiasServerReturn DanBiasServer::Run() + { + return server.Run(); + } + DanBiasServerReturn DanBiasServer::Release() + { + return server.Release(); + } + +} //End namspace DanBias \ No newline at end of file diff --git a/Code/Game/DanBiasServer/Include/DanBiasServer.h b/Code/Game/DanBiasServer/Include/IDanBiasServer.h similarity index 75% rename from Code/Game/DanBiasServer/Include/DanBiasServer.h rename to Code/Game/DanBiasServer/Include/IDanBiasServer.h index e9446e76..681ea348 100644 --- a/Code/Game/DanBiasServer/Include/DanBiasServer.h +++ b/Code/Game/DanBiasServer/Include/IDanBiasServer.h @@ -1,3 +1,6 @@ +///////////////////////////////////////////////////////////////////// +// Created by [Dennis Andersen] [2013] +///////////////////////////////////////////////////////////////////// #ifndef DANBIAS_SERVER_DANBIAS_SERVER_H #define DANBIAS_SERVER_DANBIAS_SERVER_H @@ -29,7 +32,7 @@ namespace DanBias public: static DanBiasServerReturn Initiate(DanBiasServerDesc& desc); static DanBiasServerReturn Run(); - static void Release(); + static DanBiasServerReturn Release(); }; }//End Extern "C" diff --git a/Code/Game/DanBiasServer/Include/ServerWrapper.h b/Code/Game/DanBiasServer/Include/ServerWrapper.h new file mode 100644 index 00000000..29829c17 --- /dev/null +++ b/Code/Game/DanBiasServer/Include/ServerWrapper.h @@ -0,0 +1,23 @@ +#ifndef NETWORK_SERVER_WRAPPER_H +#define NETWORK_SERVER_WRAPPER_H + + +class SingletonServer +{ +public: + + struct INIT_DESC + { + bool l; + }; + void CreateServer(/*DATA*/); + void StartServer(/*DATA*/); + void StopServer(/*DATA*/); + void TerminateServer(/*DATA*/); + + void AttachLobby(/*LOBBY*/); + void DetachLobby(/*LOBBY*/); + void KickClient(/*CLIENT*/); +}; + +#endif // !NETWORK_SERVER_WRAPPER_H diff --git a/Code/Game/DanBiasServer/MainLobby.h b/Code/Game/DanBiasServer/MainLobby.h new file mode 100644 index 00000000..5807ab9c --- /dev/null +++ b/Code/Game/DanBiasServer/MainLobby.h @@ -0,0 +1,17 @@ +#ifndef DANBIASGAME_GAMELOBBY_H +#define DANBIASGAME_GAMELOBBY_H + +#include "Include\ServerWrapper.h" + +class MainLobby :public SingletonServer +{ +public: + MainLobby(); + ~MainLobby(); + +private: + + +}; + +#endif // !DANBIASGAME_GAMELOBBY_H diff --git a/Code/OysterPhysics3D/OysterPhysics3D.vcxproj b/Code/OysterPhysics3D/OysterPhysics3D.vcxproj index 2113cccb..c36fded5 100644 --- a/Code/OysterPhysics3D/OysterPhysics3D.vcxproj +++ b/Code/OysterPhysics3D/OysterPhysics3D.vcxproj @@ -24,26 +24,26 @@ - DynamicLibrary + StaticLibrary true v110 MultiByte - DynamicLibrary + StaticLibrary true v110 MultiByte - DynamicLibrary + StaticLibrary false v110 true MultiByte - DynamicLibrary + StaticLibrary false v110 true From 1cb880a66e12f6f81f9d4ce23d925c95be802302 Mon Sep 17 00:00:00 2001 From: dean11 Date: Wed, 4 Dec 2013 15:59:44 +0100 Subject: [PATCH 08/19] GameLogic - Fixed the window class --- Code/DanBias.sln | 3 - Code/Game/DanBiasLauncher/Launcher.cpp | 4 +- Code/WindowManager/Example Usage.cpp | 41 ++++--------- Code/WindowManager/WindowManager.vcxproj | 16 +++-- .../WindowManager.vcxproj.filters | 10 ++++ Code/WindowManager/WindowShell.cpp | 21 +++---- Code/WindowManager/WindowShell.h | 59 +++++-------------- 7 files changed, 62 insertions(+), 92 deletions(-) diff --git a/Code/DanBias.sln b/Code/DanBias.sln index c5ca25f8..4b9ec79f 100644 --- a/Code/DanBias.sln +++ b/Code/DanBias.sln @@ -249,7 +249,4 @@ Global {52380DAA-0F4A-4D97-8E57-98DF39319CAF} = {20720CA7-795C-45AD-A302-9383A6DD503A} {8690FDDF-C5B7-4C42-A337-BD5243F29B85} = {20720CA7-795C-45AD-A302-9383A6DD503A} EndGlobalSection - GlobalSection(Performance) = preSolution - HasPerformanceSessions = true - EndGlobalSection EndGlobal diff --git a/Code/Game/DanBiasLauncher/Launcher.cpp b/Code/Game/DanBiasLauncher/Launcher.cpp index 0440d973..28b89485 100644 --- a/Code/Game/DanBiasLauncher/Launcher.cpp +++ b/Code/Game/DanBiasLauncher/Launcher.cpp @@ -4,8 +4,8 @@ #define NOMINMAX #include -//#define DANBIAS_SERVER -#define DANBIAS_CLIENT +#define DANBIAS_SERVER +//#define DANBIAS_CLIENT #if defined(DANBIAS_SERVER) diff --git a/Code/WindowManager/Example Usage.cpp b/Code/WindowManager/Example Usage.cpp index b9f46550..5b21c953 100644 --- a/Code/WindowManager/Example Usage.cpp +++ b/Code/WindowManager/Example Usage.cpp @@ -34,8 +34,14 @@ WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ((MINMAXINFO*)lParam)->ptMinTrackSize.y = 100; break; + case WM_KEYDOWN: + if(wParam == VK_ESCAPE) + PostQuitMessage(0); + break; + default: return DefWindowProc(hwnd, msg, wParam, lParam); + } return 0; } @@ -84,39 +90,18 @@ int WINAPI WinMain( HINSTANCE hInst, HINSTANCE prevInst, PSTR cmdLine, int cmdSh { _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); - - /******************************************** * Description of a window * *******************************************/ - WindowShell::INIT_DESC_WINDOW wDesc; - wDesc.hInstance = hInst; - wDesc.windowName = L"Glare"; - wDesc.windowPosition = Point2D(50); - wDesc.windowSize = Point2D(1024, 800); + WindowShell::WINDOW_INIT_DESC wDesc; + //wDesc.hInstance = hInst; + wDesc.windowPosition.x = 50; + wDesc.windowPosition.y = 50; + wDesc.windowSize.x = 1024; + wDesc.windowSize.x = 800; wDesc.windowProcCallback = WndProc; - - -/******************************************** - * Description of a child window * - *******************************************/ - WindowShell::INIT_DESC_CHILD_WINDOW cDesc; - cDesc.name = L"Child"; - cDesc.style = WS_EX_RIGHTSCROLLBAR; - cDesc.topLeftPos = Point2D(); - cDesc.windowProcCallback = ChildWndProc; - cDesc.windowSize = Point2D(80); - - - -/************************************************************ - * Initializing main window and several children * - ************************************************************/ WindowShell::self()->createWin(wDesc); - WindowShell::self()->createChildWin(cDesc); - WindowShell::self()->createChildWin(cDesc); - WindowShell::self()->createChildWin(cDesc); @@ -134,7 +119,7 @@ int WINAPI WinMain( HINSTANCE hInst, HINSTANCE prevInst, PSTR cmdLine, int cmdSh } else { - + } } diff --git a/Code/WindowManager/WindowManager.vcxproj b/Code/WindowManager/WindowManager.vcxproj index 1a193450..0acba3ad 100644 --- a/Code/WindowManager/WindowManager.vcxproj +++ b/Code/WindowManager/WindowManager.vcxproj @@ -24,30 +24,30 @@ - Application + StaticLibrary true v110 - MultiByte + Unicode - Application + StaticLibrary true v110 - MultiByte + Unicode StaticLibrary false v110 true - MultiByte + Unicode StaticLibrary false v110 true - MultiByte + Unicode @@ -138,6 +138,10 @@ + + + + diff --git a/Code/WindowManager/WindowManager.vcxproj.filters b/Code/WindowManager/WindowManager.vcxproj.filters index d7ef6a1a..a8263606 100644 --- a/Code/WindowManager/WindowManager.vcxproj.filters +++ b/Code/WindowManager/WindowManager.vcxproj.filters @@ -14,4 +14,14 @@ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + Source Files + + + + + Header Files + + \ No newline at end of file diff --git a/Code/WindowManager/WindowShell.cpp b/Code/WindowManager/WindowShell.cpp index 836a350c..7f8e1481 100644 --- a/Code/WindowManager/WindowShell.cpp +++ b/Code/WindowManager/WindowShell.cpp @@ -56,7 +56,7 @@ WindowShell::~WindowShell() -bool WindowShell::createWin(INIT_DESC_WINDOW &desc) +bool WindowShell::createWin(WINDOW_INIT_DESC &desc) { if(pData->hWnd) { @@ -68,14 +68,15 @@ bool WindowShell::createWin(INIT_DESC_WINDOW &desc) MessageBox(0, L"No callback function for window messages was found!" ,L"Error", 0); return false; } - if(!desc.hInstance) - { - MessageBox(0, L"No HINSTANCE was specified!" ,L"Error", 0); - return false; - } - if(desc.windowSize < 0) + if(desc.windowSize.x < 0 || desc.windowSize.y < 0) { MessageBox(0, L"Size specified for window is invalid!" ,L"Error", 0); + return false; + } + + if(!desc.hInstance) + { + desc.hInstance = GetModuleHandle(0); } @@ -87,7 +88,7 @@ bool WindowShell::createWin(INIT_DESC_WINDOW &desc) WNDCLASSEX wc; wc.cbSize = sizeof(WNDCLASSEX); wc.hIconSm = NULL; - wc.style = CS_HREDRAW | CS_VREDRAW; + wc.style = desc.windowClassStyle; wc.lpfnWndProc = desc.windowProcCallback; wc.cbClsExtra = 0; wc.cbWndExtra = 0; @@ -112,7 +113,7 @@ bool WindowShell::createWin(INIT_DESC_WINDOW &desc) pData->hWnd = CreateWindow( L"MainWindowClass" , desc.windowName.c_str(), - WS_OVERLAPPEDWINDOW, + desc.windowStyle, desc.windowPosition.x, desc.windowPosition.y, desc.windowSize.x, @@ -138,7 +139,7 @@ bool WindowShell::createWin(INIT_DESC_WINDOW &desc) return true; } -int WindowShell::createChildWin(INIT_DESC_CHILD_WINDOW &desc) +int WindowShell::createChildWin(CHILD_WINDOW_INIT_DESC &desc) { ChildWin win; diff --git a/Code/WindowManager/WindowShell.h b/Code/WindowManager/WindowShell.h index 267417be..d29a3666 100644 --- a/Code/WindowManager/WindowShell.h +++ b/Code/WindowManager/WindowShell.h @@ -5,72 +5,45 @@ #include -struct Point2D -{ - int x; - int y; - Point2D() - { - x = 0; - y = 0; - } - Point2D(int _x, int _y) - { - x = _x; - y = _y; - } - Point2D(int _p) - { - x = _p; - y = _p; - } - operator POINT() const - { - return Point2D(x, y); - } - bool operator<(int i) - { - bool a = x Date: Thu, 5 Dec 2013 11:50:39 +0100 Subject: [PATCH 09/19] made "interfaces" of most classes --- Code/Game/GameLogic/DynamicObject.cpp | 29 +++++++----- Code/Game/GameLogic/DynamicObject.h | 9 ++-- Code/Game/GameLogic/GameMode.cpp | 19 +++++++- Code/Game/GameLogic/GameMode.h | 3 +- Code/Game/GameLogic/Level.cpp | 30 +++++++++++++ Code/Game/GameLogic/Level.h | 17 +------- Code/Game/GameLogic/Player.cpp | 63 ++++++++++++--------------- Code/Game/GameLogic/Player.h | 20 +++------ Code/Game/GameLogic/StaticObject.cpp | 20 ++++++++- Code/Game/GameLogic/StaticObject.h | 9 ++-- Code/Game/GameLogic/Weapon.cpp | 19 +++++++- Code/Game/GameLogic/Weapon.h | 11 ++--- 12 files changed, 152 insertions(+), 97 deletions(-) diff --git a/Code/Game/GameLogic/DynamicObject.cpp b/Code/Game/GameLogic/DynamicObject.cpp index 3c7cfe21..8786255c 100644 --- a/Code/Game/GameLogic/DynamicObject.cpp +++ b/Code/Game/GameLogic/DynamicObject.cpp @@ -1,22 +1,29 @@ #include "DynamicObject.h" -#include "CollisionManager.h" using namespace GameLogic; -using namespace Oyster::Physics; -using namespace Utility::DynamicMemory; -DynamicObject::DynamicObject(std::wstring objFile) - :Object(objFile) +struct DynamicObject::PrivateData { - rigidBody->SetSubscription(CollisionManager::BoxCollision); + PrivateData() + { + + } + + ~PrivateData() + { + + } + +}myData; + + +DynamicObject::DynamicObject() +{ + myData = new PrivateData(); } DynamicObject::~DynamicObject(void) { -} - -void DynamicObject::Update() -{ - //update object + delete myData; } \ No newline at end of file diff --git a/Code/Game/GameLogic/DynamicObject.h b/Code/Game/GameLogic/DynamicObject.h index 7daf7345..ecf1e905 100644 --- a/Code/Game/GameLogic/DynamicObject.h +++ b/Code/Game/GameLogic/DynamicObject.h @@ -6,21 +6,22 @@ #ifndef DYNAMICOBJECT_H #define DYNAMICOBJECT_H -#include "Object.h" - namespace GameLogic { - class DynamicObject : public Object + class DynamicObject { public: - DynamicObject(std::wstring objFile); + DynamicObject(); ~DynamicObject(void); void Update(); + private: + struct PrivateData; + PrivateData *myData; }; } diff --git a/Code/Game/GameLogic/GameMode.cpp b/Code/Game/GameLogic/GameMode.cpp index 0eddb7f9..bcd87de5 100644 --- a/Code/Game/GameLogic/GameMode.cpp +++ b/Code/Game/GameLogic/GameMode.cpp @@ -3,13 +3,28 @@ using namespace GameLogic; -GameMode::GameMode(void) +struct GameMode::PrivateData { + PrivateData() + { + } + + ~PrivateData() + { + + } + +}myData; + + +GameMode::GameMode() +{ + myData = new PrivateData(); } GameMode::~GameMode(void) { - + delete myData; } diff --git a/Code/Game/GameLogic/GameMode.h b/Code/Game/GameLogic/GameMode.h index 42273946..865f07c3 100644 --- a/Code/Game/GameLogic/GameMode.h +++ b/Code/Game/GameLogic/GameMode.h @@ -15,7 +15,8 @@ namespace GameLogic GameMode(void); ~GameMode(void); private: - //variabels that control what game rules the level runs on + struct PrivateData; + PrivateData *myData; }; } diff --git a/Code/Game/GameLogic/Level.cpp b/Code/Game/GameLogic/Level.cpp index 32fbe2d5..c83056c6 100644 --- a/Code/Game/GameLogic/Level.cpp +++ b/Code/Game/GameLogic/Level.cpp @@ -1,12 +1,42 @@ #include "Level.h" +#include "StaticObject.h" +#include "DynamicObject.h" +#include "GameMode.h" using namespace GameLogic; +struct Level::PrivateData +{ + PrivateData() + { + gameMode = new GameMode(); + } + ~PrivateData() + { + if (gameMode) + { + delete gameMode; + } + } + + + StaticObject** staticObjects; + int nrOfStaticObjects; + + DynamicObject** dynamicObjects; + int nrOfDynamicObjects; + + GameMode* gameMode; + +}myData; + Level::Level(void) { + myData = new PrivateData(); } Level::~Level(void) { + delete myData; } diff --git a/Code/Game/GameLogic/Level.h b/Code/Game/GameLogic/Level.h index b43f193d..217a60e4 100644 --- a/Code/Game/GameLogic/Level.h +++ b/Code/Game/GameLogic/Level.h @@ -1,15 +1,9 @@ ////////////////////////////////////////////////// //Created by Erik and Linda of the GameLogic team ////////////////////////////////////////////////// - - #ifndef LEVEL_H #define LEVEL_H -#include "StaticObject.h" -#include "DynamicObject.h" -#include "GameMode.h" - namespace GameLogic { @@ -21,15 +15,8 @@ namespace GameLogic ~Level(void); private: - StaticObject** staticObjects; - int nrOfStaticObjects; - - DynamicObject** dynamicObjects; - int nrOfDynamicObjects; - - GameMode* gameMode; - - + struct PrivateData; + PrivateData *myData; }; diff --git a/Code/Game/GameLogic/Player.cpp b/Code/Game/GameLogic/Player.cpp index a7b80805..6c514634 100644 --- a/Code/Game/GameLogic/Player.cpp +++ b/Code/Game/GameLogic/Player.cpp @@ -1,57 +1,48 @@ #include "Player.h" #include "OysterMath.h" #include "CollisionManager.h" +#include "Weapon.h" using namespace GameLogic; using namespace Oyster::Physics; -Player::Player(std::wstring objFile) - :Object( objFile ) +struct Player::PrivateData { - life = 100; - rigidBody->SetSubscription(CollisionManager::PlayerCollision); + PrivateData() + { + weapon = new Weapon(); + } + ~PrivateData() + { + if (weapon) + { + delete weapon; + } + } + + int life; + Weapon *weapon; + +}myData; + +Player::Player() +{ + myData = new PrivateData(); + } Player::~Player(void) { - delete this->rigidBody; + delete myData; } -void Player::Update(keyInput keyPressed) +void Player::Update() { - - if(keyPressed != keyInput_none) - { - Move(keyPressed); - } + } -void Player::Move(keyInput keyPressed) +void Player::Move() { - if(keyPressed == keyInput_A) - { - Oyster::Math::Float3 pos = this->rigidBody->GetCenter(); - pos.x -= 0.1; - rigidBody->SetCenter(pos); - } - if(keyPressed == keyInput_D) - { - Oyster::Math::Float3 pos = this->rigidBody->GetCenter(); - pos.x += 0.1; - rigidBody->SetCenter(pos); - } - if(keyPressed == keyInput_S) - { - Oyster::Math::Float3 pos = this->rigidBody->GetCenter(); - pos.y -= 0.1; - rigidBody->SetCenter(pos); - } - if(keyPressed == keyInput_W) - { - Oyster::Math::Float3 pos = this->rigidBody->GetCenter(); - pos.y += 0.1; - rigidBody->SetCenter(pos); - } } void Player::Shoot() { diff --git a/Code/Game/GameLogic/Player.h b/Code/Game/GameLogic/Player.h index a15319b3..439bbcd9 100644 --- a/Code/Game/GameLogic/Player.h +++ b/Code/Game/GameLogic/Player.h @@ -1,37 +1,29 @@ ////////////////////////////////////////////////// //Created by Erik and Linda of the GameLogic team ////////////////////////////////////////////////// - - #ifndef PLAYER_H #define PLAYER_H -#include "Object.h" -#include "Weapon.h" -#include "IGame.h" - - namespace GameLogic { - class Player : public Object + class Player { public: - Player(std::wstring objFile); + Player(void); ~Player(void); /******************************************************** * Update the position of the rigid body * This will be done with physics later ********************************************************/ - void Update(keyInput keyPressed); - - void Move(keyInput keyPressed); + void Update(); + void Move(); void Shoot(); private: - int life; - Weapon *weapon; + struct PrivateData; + PrivateData *myData; }; } #endif \ No newline at end of file diff --git a/Code/Game/GameLogic/StaticObject.cpp b/Code/Game/GameLogic/StaticObject.cpp index da30a54e..c58fb83c 100644 --- a/Code/Game/GameLogic/StaticObject.cpp +++ b/Code/Game/GameLogic/StaticObject.cpp @@ -2,12 +2,28 @@ using namespace GameLogic; -StaticObject::StaticObject(std::wstring objFile) - :Object(objFile) +struct StaticObject::PrivateData { + PrivateData() + { + + } + + ~PrivateData() + { + + } + +}myData; + + +StaticObject::StaticObject() +{ + myData = new PrivateData(); } StaticObject::~StaticObject(void) { + delete myData; } diff --git a/Code/Game/GameLogic/StaticObject.h b/Code/Game/GameLogic/StaticObject.h index 73ed30f1..2f292795 100644 --- a/Code/Game/GameLogic/StaticObject.h +++ b/Code/Game/GameLogic/StaticObject.h @@ -11,13 +11,16 @@ namespace GameLogic { - class StaticObject : public Object + class StaticObject { public: - StaticObject(std::wstring objFile); + StaticObject(); ~StaticObject(void); - + + private: + struct PrivateData; + PrivateData *myData; }; } diff --git a/Code/Game/GameLogic/Weapon.cpp b/Code/Game/GameLogic/Weapon.cpp index 1bbc5618..c335ae7b 100644 --- a/Code/Game/GameLogic/Weapon.cpp +++ b/Code/Game/GameLogic/Weapon.cpp @@ -2,12 +2,27 @@ using namespace GameLogic; -Weapon::Weapon(std::wstring objFile) - :Object(objFile) +struct Weapon::PrivateData { + PrivateData() + { + + } + + ~PrivateData() + { + + } + +}myData; + +Weapon::Weapon() +{ + myData = new PrivateData(); } Weapon::~Weapon(void) { + delete myData; } diff --git a/Code/Game/GameLogic/Weapon.h b/Code/Game/GameLogic/Weapon.h index dcac1d02..527b0b73 100644 --- a/Code/Game/GameLogic/Weapon.h +++ b/Code/Game/GameLogic/Weapon.h @@ -1,25 +1,22 @@ ////////////////////////////////////////////////// //Created by Erik and Linda of the GameLogic team ////////////////////////////////////////////////// - - #ifndef WEAPON_H #define WEAPON_H -#include "Object.h" - namespace GameLogic { - class Weapon : public Object + class Weapon { public: - Weapon(std::wstring objFile); + Weapon(void); ~Weapon(void); private: - + struct PrivateData; + PrivateData *myData; }; } From fb51881fab11a89f527c808d47e8912411f54188 Mon Sep 17 00:00:00 2001 From: lanariel Date: Thu, 5 Dec 2013 14:56:34 +0100 Subject: [PATCH 10/19] Fixed Mem leaks on gpu and start on deffered pipeline --- Code/Misc/Resource/OResourceHandler.cpp | 9 ++-- Code/OysterGraphics/Core/ShaderManager.cpp | 2 +- Code/OysterGraphics/DllInterfaces/GFXAPI.cpp | 45 ++++++++++++++----- Code/OysterGraphics/DllInterfaces/GFXAPI.h | 11 +++-- .../OysterGraphics/FileLoader/GeneralLoader.h | 3 +- .../{TextureLoader.cpp => ModelLoader.cpp} | 25 +++++++++++ .../FileLoader/ShaderLoader.cpp | 2 + Code/OysterGraphics/OysterGraphics.vcxproj | 4 +- .../Render/Rendering/BasicRender.cpp | 2 + .../Render/Resources/Resources.cpp | 3 +- .../Deffered Shaders/Render/Defines.hlsli | 32 +++++++++++-- .../Deffered Shaders/Render/LightCalc.hlsli | 23 ++++++++++ .../Deffered Shaders/Render/LightPass.hlsl | 7 ++- .../Render/PosManipulation.hlsli | 21 +++++++++ Code/Tester/MainTest.cpp | 10 +++-- Code/Tester/Tester.vcxproj | 6 +-- 16 files changed, 171 insertions(+), 34 deletions(-) rename Code/OysterGraphics/FileLoader/{TextureLoader.cpp => ModelLoader.cpp} (97%) create mode 100644 Code/OysterGraphics/Shader/HLSL/Deffered Shaders/Render/LightCalc.hlsli create mode 100644 Code/OysterGraphics/Shader/HLSL/Deffered Shaders/Render/PosManipulation.hlsli diff --git a/Code/Misc/Resource/OResourceHandler.cpp b/Code/Misc/Resource/OResourceHandler.cpp index f86c434c..918ecd1d 100644 --- a/Code/Misc/Resource/OResourceHandler.cpp +++ b/Code/Misc/Resource/OResourceHandler.cpp @@ -120,11 +120,12 @@ void OysterResource::Clean() //Remove all the references while (!OResource::Release(i->second)); - const wchar_t* temp = i->second->GetResourceFilename(); + std::wstring temp = i->second->GetResourceFilename(); delete resourcePrivate.resources[temp]; - resourcePrivate.resources.erase(temp); + } + resourcePrivate.resources.clear(); } void OysterResource::ReleaseResource(const OHRESOURCE& resourceData) { @@ -133,7 +134,7 @@ void OysterResource::ReleaseResource(const OHRESOURCE& resourceData) { if(OResource::Release(t)) { - const wchar_t* temp = t->GetResourceFilename(); + std::wstring temp = t->GetResourceFilename(); delete resourcePrivate.resources[temp]; resourcePrivate.resources.erase(temp); } @@ -146,7 +147,7 @@ void OysterResource::ReleaseResource(const wchar_t filename[]) { if(OResource::Release(t)) { - const wchar_t* temp = t->GetResourceFilename(); + std::wstring temp = t->GetResourceFilename(); delete resourcePrivate.resources[temp]; resourcePrivate.resources.erase(temp); } diff --git a/Code/OysterGraphics/Core/ShaderManager.cpp b/Code/OysterGraphics/Core/ShaderManager.cpp index 94f7fd57..c4f1b38e 100644 --- a/Code/OysterGraphics/Core/ShaderManager.cpp +++ b/Code/OysterGraphics/Core/ShaderManager.cpp @@ -279,7 +279,7 @@ namespace Oyster void Core::ShaderManager::Clean() { - for(int i = 0; i < VData.size(); ++i) + for(int i = 0; i < (int)VData.size(); ++i) { delete[] VData[i].data; } diff --git a/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp b/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp index 86df58a2..fcb3481c 100644 --- a/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp +++ b/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp @@ -4,11 +4,18 @@ #include "../Render/Rendering/Render.h" #include "../FileLoader/ObjReader.h" #include "../../Misc/Resource/OysterResource.h" +#include "../FileLoader/GeneralLoader.h" namespace Oyster { namespace Graphics { + namespace + { + Math::Float4x4 View; + Math::Float4x4 Projection; + } + API::State API::Init(HWND Window, bool MSAA_Quality, bool Fullscreen, Math::Float2 resulotion) { Core::resolution = resulotion; @@ -26,16 +33,31 @@ namespace Oyster return API::Sucsess; } - void API::NewFrame(Oyster::Math::Float4x4 View, Oyster::Math::Float4x4 Projection) + void API::SetProjection(Math::Float4x4& projection) + { + Projection = projection; + } + + void API::SetView(Math::Float4x4& view) + { + View = view; + } + + void API::NewFrame() { Render::Rendering::Basic::NewFrame(View, Projection); } - void API::RenderScene(Model::Model* models, int count) + void API::RenderScene(Model::Model models[], int count) { Render::Rendering::Basic::RenderScene(models,count); } + void API::RenderModel(Model::Model& m) + { + Render::Rendering::Basic::RenderScene(&m,1); + } + void API::EndFrame() { Render::Rendering::Basic::EndFrame(); @@ -52,9 +74,7 @@ namespace Oyster m->WorldMatrix = Oyster::Math::Float4x4::identity; m->Visible = true; - OBJReader or; - or.readOBJFile(filename); - m->info = or.toModel(); + m->info = Oyster::Resource::OysterResource::LoadResource(filename.c_str(),Oyster::Graphics::Loading::LoadOBJ); return m; } @@ -63,12 +83,7 @@ namespace Oyster { Model::ModelInfo* info = (Model::ModelInfo*)model->info; delete model; - SAFE_DELETE(info->Vertices); - if(info->Indexed) - { - SAFE_DELETE(info->Indecies); - } - delete info; + Oyster::Resource::OysterResource::ReleaseResource((Oyster::Resource::OHRESOURCE)info); } void API::Clean() @@ -77,6 +92,14 @@ namespace Oyster Oyster::Resource::OysterResource::Clean(); Oyster::Graphics::Core::ShaderManager::Clean(); Oyster::Graphics::Render::Resources::Clean(); + + SAFE_RELEASE(Core::depthStencil); + SAFE_RELEASE(Core::backBufferRTV); + SAFE_RELEASE(Core::backBufferUAV); + + SAFE_RELEASE(Core::swapChain); + SAFE_RELEASE(Core::deviceContext); + SAFE_RELEASE(Core::device); } } } \ No newline at end of file diff --git a/Code/OysterGraphics/DllInterfaces/GFXAPI.h b/Code/OysterGraphics/DllInterfaces/GFXAPI.h index f7665ba6..f4c38076 100644 --- a/Code/OysterGraphics/DllInterfaces/GFXAPI.h +++ b/Code/OysterGraphics/DllInterfaces/GFXAPI.h @@ -28,9 +28,14 @@ namespace Oyster static State Init(HWND Window, bool MSAA_Quality, bool Fullscreen, Oyster::Math::Float2 StartResulotion); static void Clean(); - //! @brief from Oyster::Math Float4x4, expects corect methods - static void NewFrame(Oyster::Math::Float4x4 View, Oyster::Math::Float4x4 Projection); - static void RenderScene(Oyster::Graphics::Model::Model* models, int count); + + static void SetView(Oyster::Math::Float4x4& View); + static void SetProjection(Oyster::Math::Float4x4& Projection); + + //! @brief will internally use last values from SetView and SetProjection + static void NewFrame(); + static void RenderScene(Oyster::Graphics::Model::Model models[], int count); + static void RenderModel(Oyster::Graphics::Model::Model& model); static void EndFrame(); static Oyster::Graphics::Model::Model* CreateModel(std::wstring filename); diff --git a/Code/OysterGraphics/FileLoader/GeneralLoader.h b/Code/OysterGraphics/FileLoader/GeneralLoader.h index fcce1e02..4eab570b 100644 --- a/Code/OysterGraphics/FileLoader/GeneralLoader.h +++ b/Code/OysterGraphics/FileLoader/GeneralLoader.h @@ -27,7 +27,8 @@ namespace Oyster void UnloadShaderD(void* loadedData); void LoadShaderD(const wchar_t filename[], Oyster::Resource::CustomData& out); - void LoadShader(const wchar_t filename[], Oyster::Resource::CustomData& out, int type); + void UnloadOBJ(void* loadedData); + void LoadOBJ(const wchar_t filename[], Oyster::Resource::CustomData& out); } } } \ No newline at end of file diff --git a/Code/OysterGraphics/FileLoader/TextureLoader.cpp b/Code/OysterGraphics/FileLoader/ModelLoader.cpp similarity index 97% rename from Code/OysterGraphics/FileLoader/TextureLoader.cpp rename to Code/OysterGraphics/FileLoader/ModelLoader.cpp index 1c6ba263..0fe623a9 100644 --- a/Code/OysterGraphics/FileLoader/TextureLoader.cpp +++ b/Code/OysterGraphics/FileLoader/ModelLoader.cpp @@ -1,6 +1,7 @@ #include "GeneralLoader.h" #include "..\Core\Dx11Includes.h" #include "..\Core\Core.h" +#include "ObjReader.h" HRESULT CreateWICTextureFromFileEx( ID3D11Device* d3dDevice, ID3D11DeviceContext* d3dContext, @@ -35,6 +36,30 @@ void Oyster::Graphics::Loading::UnloadTexture(void* data) SAFE_RELEASE(srv); } +void Oyster::Graphics::Loading::LoadOBJ(const wchar_t filename[], Oyster::Resource::CustomData& out) +{ + OBJReader obj; + obj.readOBJFile(filename); + Model::ModelInfo* info; + info = obj.toModel(); + out.loadedData = info; + out.resourceUnloadFnc = Oyster::Graphics::Loading::UnloadOBJ; +} + +void Oyster::Graphics::Loading::UnloadOBJ(void* data) +{ + Model::ModelInfo* info = (Model::ModelInfo*) data; + SAFE_DELETE(info->Vertices); + if(info->Indexed) + { + SAFE_DELETE(info->Indecies); + } + for(int i =0;iMaterial.size();++i) + { + Oyster::Resource::OysterResource::ReleaseResource(info->Material[i]); + } + delete info; +} #include #include diff --git a/Code/OysterGraphics/FileLoader/ShaderLoader.cpp b/Code/OysterGraphics/FileLoader/ShaderLoader.cpp index 05420abf..b3c8a0b7 100644 --- a/Code/OysterGraphics/FileLoader/ShaderLoader.cpp +++ b/Code/OysterGraphics/FileLoader/ShaderLoader.cpp @@ -10,6 +10,8 @@ namespace Oyster { namespace Loading { + void LoadShader(const wchar_t filename[], Oyster::Resource::CustomData& out, int type); + void UnloadShaderP(void* loadedData) { ID3D11PixelShader* ps = ((ID3D11PixelShader*)loadedData); diff --git a/Code/OysterGraphics/OysterGraphics.vcxproj b/Code/OysterGraphics/OysterGraphics.vcxproj index ed998710..cd1a5670 100644 --- a/Code/OysterGraphics/OysterGraphics.vcxproj +++ b/Code/OysterGraphics/OysterGraphics.vcxproj @@ -178,7 +178,7 @@ - + @@ -270,6 +270,8 @@ + + diff --git a/Code/OysterGraphics/Render/Rendering/BasicRender.cpp b/Code/OysterGraphics/Render/Rendering/BasicRender.cpp index 9626c954..2edb318b 100644 --- a/Code/OysterGraphics/Render/Rendering/BasicRender.cpp +++ b/Code/OysterGraphics/Render/Rendering/BasicRender.cpp @@ -2,6 +2,8 @@ #include "../Resources/Resources.h" #include "../../Definitions/GraphicalDefinition.h" #include "../../Model/ModelInfo.h" +#include +#include namespace Oyster { diff --git a/Code/OysterGraphics/Render/Resources/Resources.cpp b/Code/OysterGraphics/Render/Resources/Resources.cpp index 66fa4cc9..ceef5160 100644 --- a/Code/OysterGraphics/Render/Resources/Resources.cpp +++ b/Code/OysterGraphics/Render/Resources/Resources.cpp @@ -159,10 +159,9 @@ namespace Oyster void Resources::Clean() { Resources::ModelData.~Buffer(); - Resources::VPData.~Buffer(); for(int i = 0; i < obj.CBuffers.Vertex.size(); ++i) { - //SAFE_RELEASE(obj.CBuffers.Vertex[i]); + obj.CBuffers.Vertex[i]->~Buffer(); } for(int i = 0; i < obj.CBuffers.Pixel.size(); ++i) { diff --git a/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/Render/Defines.hlsli b/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/Render/Defines.hlsli index e5a2333f..3f9fd0bf 100644 --- a/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/Render/Defines.hlsli +++ b/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/Render/Defines.hlsli @@ -1,7 +1,31 @@ +#ifndef DEFINES +#define DEFINES + struct PointLight { - float3 Pos; - float Radius; + float4 PosRadius; + float4 ColorBright; +}; - float3 Color; -} \ No newline at end of file +struct DiffSpec +{ + float3 Diffuse; + float3 Specular; +}; + +cbuffer PointLights : register(b0) +{ + PointLight pl; +} + +cbuffer LightConstants : register(b1) +{ + float4x4 InvProj; + int2 Pixels; +} + +Texture2D DiffuseGlow : register(t0); +Texture2D NormalSpec : register(t1); +Texture2D DepthTexture : register(t2); + +#endif \ No newline at end of file diff --git a/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/Render/LightCalc.hlsli b/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/Render/LightCalc.hlsli new file mode 100644 index 00000000..88234de0 --- /dev/null +++ b/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/Render/LightCalc.hlsli @@ -0,0 +1,23 @@ +#include "Defines.hlsli" + +DiffSpec LightCalc(PointLight pl, float3 pos, int2 texCoord) +{ + DiffSpec output; + float4 normalSpec = NormalSpec[texCoord]; + float3 lightVec = pl.PosRadius.xyz - pos.xyz; + float d = length(lightVec); + lightVec = lightVec/d; + + float diffFactor = max(dot(lightVec, normalSpec.xyz), 0.0f); + float3 v = reflect(-lightVec, normalSpec.xyz); + float specFactor = pow(max(dot(v,normalize(-pos)), 0.0f),normalSpec.w); + //Check att later + float att = (max(d-pl.PosRadius.w,0)/pow(pl.PosRadius.w,2)); + + //fix Ilum calcs instead of PhongBlinn + output.Diffuse = pl.ColorBright.w * att * diffFactor * pl.ColorBright.xyz; + output.Specular = pl.ColorBright.w * att * specFactor * pl.ColorBright.xyz; + if(diffFactor == 0) + output.Specular * 0; + return output; +} \ No newline at end of file diff --git a/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/Render/LightPass.hlsl b/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/Render/LightPass.hlsl index 8fdac3c8..3e544f2f 100644 --- a/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/Render/LightPass.hlsl +++ b/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/Render/LightPass.hlsl @@ -1,11 +1,16 @@ - +#include "Defines.hlsli" +#include "LightCalc.hlsli" +#include "PosManipulation.hlsli" //todo //LightCulling //Calc Diff + Spec //Calc Ambience //Write Glow + [numthreads(1, 1, 1)] void main( uint3 DTid : SV_DispatchThreadID ) { + float3 ViewPos = ToVpos(DTid.xy); + //DiffSpec LightCalc(pl, float3 pos) } \ No newline at end of file diff --git a/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/Render/PosManipulation.hlsli b/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/Render/PosManipulation.hlsli new file mode 100644 index 00000000..ab44bd38 --- /dev/null +++ b/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/Render/PosManipulation.hlsli @@ -0,0 +1,21 @@ +#include "Defines.hlsli" + +//assumes ProperfloatTexCoords +float3 ToVpos(float2 texCoord) +{ + //Get proper UV + float2 UV = float2(texCoord) / float2(Pixels); + + float4 ViewPos; + // Get the depth value for this pixel + ViewPos.z= DepthTexture[texCoord].x; + //Get X/w + ViewPos.x = UV.x * 2 - 1; + //Get Y/w + ViewPos.y = 1 - 2 * UV.y; + ViewPos.w = 1; + + //Un project + ViewPos = mul(ViewPos, InvProj); + return ViewPos.xyz / ViewPos.w; +} \ No newline at end of file diff --git a/Code/Tester/MainTest.cpp b/Code/Tester/MainTest.cpp index c8772c89..3d55a0a7 100644 --- a/Code/Tester/MainTest.cpp +++ b/Code/Tester/MainTest.cpp @@ -93,6 +93,7 @@ int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdL } Oyster::Graphics::API::DeleteModel(m); + Oyster::Graphics::API::DeleteModel(m2); Oyster::Graphics::API::Clean(); return (int) msg.wParam; } @@ -194,6 +195,8 @@ HRESULT InitDirect3D() P = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/2,1024.0f/768.0f,.1f,1000); + Oyster::Graphics::API::SetProjection(P); + P.Invert(); V = Oyster::Math3D::OrientationMatrix_LookAtDirection(Oyster::Math::Float3(0,0,-1),Oyster::Math::Float3(0,1,0),Oyster::Math::Float3(0,0,5.4f)); V = Oyster::Math3D::InverseOrientationMatrix(V); @@ -212,10 +215,11 @@ HRESULT Update(float deltaTime) HRESULT Render(float deltaTime) { - Oyster::Graphics::API::NewFrame(V,P); + Oyster::Graphics::API::SetView(V); + Oyster::Graphics::API::NewFrame(); - Oyster::Graphics::API::RenderScene(m,1); - Oyster::Graphics::API::RenderScene(m2,1); + Oyster::Graphics::API::RenderModel(*m); + Oyster::Graphics::API::RenderModel(*m2); Oyster::Graphics::API::EndFrame(); diff --git a/Code/Tester/Tester.vcxproj b/Code/Tester/Tester.vcxproj index 36184b93..80853c72 100644 --- a/Code/Tester/Tester.vcxproj +++ b/Code/Tester/Tester.vcxproj @@ -69,7 +69,7 @@ true $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ - $(SolutionDir)..\Bin\Executable\$(ProjectName)\ + $(SolutionDir)..\Bin\Executable\ $(ProjectName)_$(PlatformShortName)D C:\Program Files (x86)\Visual Leak Detector\include;$(IncludePath) C:\Program Files (x86)\Visual Leak Detector\lib\Win32;$(LibraryPath) @@ -77,7 +77,7 @@ true $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ - $(SolutionDir)..\Bin\Executable\$(ProjectName)\ + $(SolutionDir)..\Bin\Executable\ $(ProjectName)_$(PlatformShortName)D C:\Program Files (x86)\Visual Leak Detector\include;$(IncludePath) C:\Program Files (x86)\Visual Leak Detector\lib\Win64;$(LibraryPath) @@ -93,7 +93,7 @@ false $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ - $(SolutionDir)..\Bin\Executable\$(ProjectName)\ + $(SolutionDir)..\Bin\Executable\ $(ProjectName)_$(PlatformShortName) C:\Program Files (x86)\Visual Leak Detector\include;$(IncludePath) C:\Program Files (x86)\Visual Leak Detector\lib\Win64;$(LibraryPath) From b331ce1a1f23602e5ea5a6b33022a2e3b7c8f939 Mon Sep 17 00:00:00 2001 From: Linda Andersson Date: Fri, 6 Dec 2013 10:38:43 +0100 Subject: [PATCH 11/19] GL - started working with client application --- Code/Game/DanBiasGame/DanBiasGame.vcxproj | 28 +++++++--- Code/Game/DanBiasGame/DanBiasGame_Impl.cpp | 54 +++++++++++++++---- .../GameClientState/GameClientState.cpp | 12 +++++ .../GameClientState/GameClientState.h | 26 +++++++++ .../DanBiasGame/GameClientState/GameState.cpp | 30 +++++++++++ .../DanBiasGame/GameClientState/GameState.h | 18 +++++++ .../GameClientState/LobbyState.cpp | 51 ++++++++++++++++++ .../DanBiasGame/GameClientState/LobbyState.h | 19 +++++++ Code/Game/DanBiasGame/Include/DanBiasGame.h | 10 ++-- .../DanBiasLauncher/DanBiasLauncher.vcxproj | 8 +-- Code/Game/DanBiasLauncher/Launcher.cpp | 4 +- 11 files changed, 233 insertions(+), 27 deletions(-) create mode 100644 Code/Game/DanBiasGame/GameClientState/GameClientState.cpp create mode 100644 Code/Game/DanBiasGame/GameClientState/GameClientState.h create mode 100644 Code/Game/DanBiasGame/GameClientState/GameState.cpp create mode 100644 Code/Game/DanBiasGame/GameClientState/GameState.h create mode 100644 Code/Game/DanBiasGame/GameClientState/LobbyState.cpp create mode 100644 Code/Game/DanBiasGame/GameClientState/LobbyState.h diff --git a/Code/Game/DanBiasGame/DanBiasGame.vcxproj b/Code/Game/DanBiasGame/DanBiasGame.vcxproj index 0b9d07d3..5f9dee44 100644 --- a/Code/Game/DanBiasGame/DanBiasGame.vcxproj +++ b/Code/Game/DanBiasGame/DanBiasGame.vcxproj @@ -71,7 +71,7 @@ $(SolutionDir)..\Bin\DLL\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D - C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; + $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath) $(SolutionDir)..\External\Include\;$(IncludePath) @@ -79,7 +79,7 @@ $(SolutionDir)..\Bin\DLL\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D - C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; + $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath) $(SolutionDir)..\External\Include\;$(IncludePath) @@ -87,7 +87,7 @@ $(SolutionDir)..\Bin\DLL\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) - C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; + $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath) $(SolutionDir)..\External\Include\;$(IncludePath) @@ -95,7 +95,7 @@ $(SolutionDir)..\Bin\DLL\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) - C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; + $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath) $(SolutionDir)..\External\Include\;$(IncludePath) @@ -106,7 +106,7 @@ Disabled DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) true - $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) + $(SolutionDir)OysterMath;$(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) Windows @@ -123,7 +123,7 @@ Disabled DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) true - $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) + $(SolutionDir)OysterMath;$(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) Windows @@ -142,7 +142,7 @@ true DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) true - $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) + $(SolutionDir)OysterMath;$(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) Windows @@ -163,7 +163,7 @@ true DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) true - $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) + $(SolutionDir)OysterMath;$(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) Windows @@ -178,9 +178,15 @@ {7e3990d2-3d94-465c-b58d-64a74b3ecf9b} + + {2ec4dded-8f75-4c86-a10b-e1e8eb29f3ee} + {0ec83e64-230e-48ef-b08c-6ac9651b4f82} + + {f10cbc03-9809-4cba-95d8-327c287b18ee} + {b1195bb9-b3a5-47f0-906c-8dea384d1520} @@ -188,9 +194,15 @@ + + + + + + diff --git a/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp b/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp index 09fa36b8..11144244 100644 --- a/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp +++ b/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp @@ -1,6 +1,11 @@ #define NOMINMAX #include #include "Include\DanBiasGame.h" +#include "DllInterfaces/GFXAPI.h" +#include "GameClientState/GameClientState.h" +#include "GameClientState\GameState.h" +#include "GameClientState\LobbyState.h" + namespace DanBias { @@ -26,9 +31,11 @@ namespace DanBias } public: + Client::GameClientState* gameClientState; } data; #pragma endregion + DanBiasGamePrivateData* DanBiasGame::m_data = new DanBiasGamePrivateData(); //-------------------------------------------------------------------------------------- // Interface API functions @@ -41,7 +48,7 @@ namespace DanBias if( FAILED( InitDirect3D() ) ) return DanBiasClientReturn_Error; - if( FAILED( InitGame() ) ) + if( FAILED( InitInput() ) ) return DanBiasClientReturn_Error; cntsPerSec = 0; @@ -51,6 +58,10 @@ namespace DanBias prevTimeStamp = 0; QueryPerformanceCounter((LARGE_INTEGER*)&prevTimeStamp); + + // Start in lobby state + m_data->gameClientState = new Client::LobbyState(); + m_data->gameClientState->Init(); return DanBiasClientReturn_Sucess; } @@ -72,8 +83,10 @@ namespace DanBias float dt = (currTimeStamp - prevTimeStamp) * secsPerCnt; //render - Update(dt); - Render(dt); + if(Update(dt) != S_OK) + return DanBiasClientReturn_Error; + if(Render(dt) != S_OK) + return DanBiasClientReturn_Error; prevTimeStamp = currTimeStamp; } @@ -145,9 +158,9 @@ namespace DanBias } //-------------------------------------------------------------------------------------- - // Init the input and the game + // Init the input //------------------------------------------------------------------------------------- - HRESULT DanBiasGame::InitGame() + HRESULT DanBiasGame::InitInput() { inputObj = new InputClass; if(!inputObj->Initialize(g_hInst, g_hWnd, 1024, 768)) @@ -155,14 +168,32 @@ namespace DanBias MessageBox(0, L"Could not initialize the input object.", L"Error", MB_OK); return E_FAIL; } - return S_OK; } HRESULT DanBiasGame::Update(float deltaTime) { inputObj->Update(); + DanBias::Client::GameClientState::ClientState state = DanBias::Client::GameClientState::ClientState_Same; + state = m_data->gameClientState->Update(); + if(state != Client::GameClientState::ClientState_Same) + { + m_data->gameClientState->Release(); + switch (state) + { + case Client::GameClientState::ClientState_Lobby: + m_data->gameClientState = new Client::LobbyState(); + break; + case Client::GameClientState::ClientState_Game: + m_data->gameClientState = new Client::GameState(); + break; + default: + return E_FAIL; + break; + } + m_data->gameClientState->Init(); + } return S_OK; } @@ -174,13 +205,16 @@ namespace DanBias isPressed = 1; } - Oyster::Graphics::API::NewFrame(Oyster::Math3D::Float4x4::null, Oyster::Math3D::Float4x4::null); - + + //Oyster::Graphics::API::NewFrame(Oyster::Math3D::Float4x4::null, Oyster::Math3D::Float4x4::null); + wchar_t title[255]; swprintf(title, sizeof(title), L"| Pressing A: %d | \n", (int)(isPressed)); SetWindowText(g_hWnd, title); - - Oyster::Graphics::API::EndFrame(); + + m_data->gameClientState->Render(); + + //Oyster::Graphics::API::EndFrame(); return S_OK; } diff --git a/Code/Game/DanBiasGame/GameClientState/GameClientState.cpp b/Code/Game/DanBiasGame/GameClientState/GameClientState.cpp new file mode 100644 index 00000000..1fffc85e --- /dev/null +++ b/Code/Game/DanBiasGame/GameClientState/GameClientState.cpp @@ -0,0 +1,12 @@ +#include "GameClientState.h" + +using namespace DanBias::Client; + +GameClientState::GameClientState(void) +{ +} + + +GameClientState::~GameClientState(void) +{ +} diff --git a/Code/Game/DanBiasGame/GameClientState/GameClientState.h b/Code/Game/DanBiasGame/GameClientState/GameClientState.h new file mode 100644 index 00000000..879dbafc --- /dev/null +++ b/Code/Game/DanBiasGame/GameClientState/GameClientState.h @@ -0,0 +1,26 @@ +#pragma once +namespace DanBias +{ +namespace Client +{ + +class GameClientState +{ +public: + enum ClientState + { + ClientState_Lobby, + ClientState_Game, + ClientState_Same, + }; + +public: + GameClientState(void); + virtual ~GameClientState(void); + virtual bool Init() = 0; + virtual ClientState Update() = 0; + virtual bool Render() = 0; + virtual bool Release() = 0; +}; +}; +}; diff --git a/Code/Game/DanBiasGame/GameClientState/GameState.cpp b/Code/Game/DanBiasGame/GameClientState/GameState.cpp new file mode 100644 index 00000000..b6951cd0 --- /dev/null +++ b/Code/Game/DanBiasGame/GameClientState/GameState.cpp @@ -0,0 +1,30 @@ +#include "GameState.h" +#include "DllInterfaces/GFXAPI.h" +using namespace DanBias::Client; +GameState::GameState(void) +{ +} + + +GameState::~GameState(void) +{ +} +bool GameState::Init() +{ + return true; +} +GameClientState::ClientState GameState::Update() +{ + return ClientState_Same; +} +bool GameState::Render() +{ + Oyster::Graphics::API::NewFrame(Oyster::Math3D::Float4x4::null, Oyster::Math3D::Float4x4::null); + + Oyster::Graphics::API::EndFrame(); + return true; +} +bool GameState::Release() +{ + return true; +} \ No newline at end of file diff --git a/Code/Game/DanBiasGame/GameClientState/GameState.h b/Code/Game/DanBiasGame/GameClientState/GameState.h new file mode 100644 index 00000000..45011ba6 --- /dev/null +++ b/Code/Game/DanBiasGame/GameClientState/GameState.h @@ -0,0 +1,18 @@ +#pragma once +#include "GameClientState.h" +namespace DanBias +{ +namespace Client +{ +class GameState : public GameClientState +{ +public: + GameState(void); + ~GameState(void); + bool Init(); + GameClientState::ClientState Update(); + bool Render(); + bool Release(); +}; +}; +}; diff --git a/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp b/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp new file mode 100644 index 00000000..2ccba307 --- /dev/null +++ b/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp @@ -0,0 +1,51 @@ +#include "LobbyState.h" +#include "DllInterfaces/GFXAPI.h" +#include "OysterMath.h" +using namespace DanBias::Client; + +struct myData +{ + Oyster::Math3D::Float4x4 view; + Oyster::Math3D::Float4x4 proj; + Oyster::Graphics::Model::Model *model; +}data; + + +LobbyState::LobbyState(void) +{ + +} + + +LobbyState::~LobbyState(void) +{ +} +bool LobbyState::Init() +{ + data.model = Oyster::Graphics::API::CreateModel(L"crate"); + + Oyster::Math::Float3 dir = Oyster::Math::Float3(0,0,-1); + Oyster::Math::Float3 up =Oyster::Math::Float3(0,1,0); + Oyster::Math::Float3 pos = Oyster::Math::Float3(0, 0, 100); + data.view = Oyster::Math3D::ViewMatrix_LookAtDirection(dir, up, pos); + data.proj = Oyster::Math3D::ProjectionMatrix_Orthographic(1024, 768, 1, 10); + return true; +} +GameClientState::ClientState LobbyState::Update() +{ + + //if( startGame) + // return ClientState_Game; + return ClientState_Same; +} +bool LobbyState::Render() +{ + Oyster::Graphics::API::NewFrame(data.view, data.proj); + Oyster::Graphics::API::RenderScene(data.model,1); + Oyster::Graphics::API::EndFrame(); + return true; +} +bool LobbyState::Release() +{ + return true; +} \ No newline at end of file diff --git a/Code/Game/DanBiasGame/GameClientState/LobbyState.h b/Code/Game/DanBiasGame/GameClientState/LobbyState.h new file mode 100644 index 00000000..04e1ca8b --- /dev/null +++ b/Code/Game/DanBiasGame/GameClientState/LobbyState.h @@ -0,0 +1,19 @@ +#pragma once +#include "GameClientState.h" +namespace DanBias +{ + namespace Client + { + struct myData; +class LobbyState : public GameClientState +{ +private: + myData* privData; +public: + LobbyState(void); + ~LobbyState(void); + bool Init(); + ClientState Update(); + bool Render(); + bool Release(); +};};}; diff --git a/Code/Game/DanBiasGame/Include/DanBiasGame.h b/Code/Game/DanBiasGame/Include/DanBiasGame.h index d1adba92..0f9b83eb 100644 --- a/Code/Game/DanBiasGame/Include/DanBiasGame.h +++ b/Code/Game/DanBiasGame/Include/DanBiasGame.h @@ -10,9 +10,10 @@ #define NOMINMAX #include -#include "DllInterfaces/GFXAPI.h" + #include "L_inputClass.h" + namespace DanBias { extern "C" @@ -24,6 +25,8 @@ namespace DanBias DanBiasClientReturn_Sucess, }; + + struct DanBiasGameDesc { //Stuff goes here... @@ -33,7 +36,7 @@ namespace DanBias }; LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); - + class DanBiasGamePrivateData; class DANBIAS_GAME_DLL DanBiasGame { public: @@ -48,7 +51,7 @@ namespace DanBias static HRESULT InitWindow( HINSTANCE hInstance, int nCmdShow); static HRESULT InitDirect3D(); - static HRESULT InitGame(); + static HRESULT InitInput(); static HRESULT Update(float deltaTime); static HRESULT Render(float deltaTime); @@ -60,6 +63,7 @@ namespace DanBias static InputClass* inputObj; static HINSTANCE g_hInst; static HWND g_hWnd; + static DanBiasGamePrivateData* m_data; }; diff --git a/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj b/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj index 5a4ebeb6..9d4363bb 100644 --- a/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj +++ b/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj @@ -110,7 +110,7 @@ Windows true - GameLogic_$(PlatformShortName)D.dll;OysterGraphics_$(PlatformShortName)D.dll;DanBiasServer_$(PlatformShortName)D.dll;DanBiasGame_$(PlatformShortName)D.dll;%(DelayLoadDLLs) + DanBiasServer_$(PlatformShortName)D.dll;DanBiasGame_$(PlatformShortName)D.dll;%(DelayLoadDLLs) Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;DanBiasServer_$(PlatformShortName)D.lib;DanBiasGame_$(PlatformShortName)D.lib;%(AdditionalDependencies) @@ -126,7 +126,7 @@ Windows true - GameLogic_$(PlatformShortName)D.dll;OysterGraphics_$(PlatformShortName)D.dll;DanBiasServer_$(PlatformShortName)D.dll;DanBiasGame_$(PlatformShortName)D.dll;%(DelayLoadDLLs) + DanBiasServer_$(PlatformShortName)D.dll;DanBiasGame_$(PlatformShortName)D.dll;%(DelayLoadDLLs) Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;DanBiasServer_$(PlatformShortName)D.lib;DanBiasGame_$(PlatformShortName)D.lib;%(AdditionalDependencies) @@ -146,7 +146,7 @@ true true true - GameLogic_$(PlatformShortName).dll;OysterGraphics_$(PlatformShortName).dll;DanBiasServer_$(PlatformShortName).dll;DanBiasGame_$(PlatformShortName).dll;%(DelayLoadDLLs) + DanBiasServer_$(PlatformShortName).dll;DanBiasGame_$(PlatformShortName).dll;%(DelayLoadDLLs) Input_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;DanBiasServer_$(PlatformShortName).lib;DanBiasGame_$(PlatformShortName).lib;%(AdditionalDependencies) @@ -166,7 +166,7 @@ true true true - GameLogic_$(PlatformShortName).dll;OysterGraphics_$(PlatformShortName).dll;DanBiasServer_$(PlatformShortName).dll;DanBiasGame_$(PlatformShortName).dll;%(DelayLoadDLLs) + DanBiasServer_$(PlatformShortName).dll;DanBiasGame_$(PlatformShortName).dll;%(DelayLoadDLLs) Input_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;DanBiasServer_$(PlatformShortName).lib;DanBiasGame_$(PlatformShortName).lib;%(AdditionalDependencies) diff --git a/Code/Game/DanBiasLauncher/Launcher.cpp b/Code/Game/DanBiasLauncher/Launcher.cpp index 28b89485..0440d973 100644 --- a/Code/Game/DanBiasLauncher/Launcher.cpp +++ b/Code/Game/DanBiasLauncher/Launcher.cpp @@ -4,8 +4,8 @@ #define NOMINMAX #include -#define DANBIAS_SERVER -//#define DANBIAS_CLIENT +//#define DANBIAS_SERVER +#define DANBIAS_CLIENT #if defined(DANBIAS_SERVER) From 413483640527100691910a96fde8212e66962272 Mon Sep 17 00:00:00 2001 From: Linda Andersson Date: Mon, 9 Dec 2013 11:05:47 +0100 Subject: [PATCH 12/19] GL - added client objects - no memory leaks in client --- Code/Game/DanBiasGame/DanBiasGame.vcxproj | 27 +++++++----- Code/Game/DanBiasGame/DanBiasGame_Impl.cpp | 10 ++++- .../DanBiasGame/GameClientState/C_Object.cpp | 4 ++ .../DanBiasGame/GameClientState/C_Object.h | 18 ++++++++ .../DanBiasGame/GameClientState/GameState.cpp | 14 +++++-- .../GameState/C_DynamicObj.cpp | 40 ++++++++++++++++++ .../GameClientState/GameState/C_DynamicObj.h | 20 +++++++++ .../GameClientState/GameState/C_Player.cpp | 42 +++++++++++++++++++ .../GameClientState/GameState/C_Player.h | 23 ++++++++++ .../GameClientState/GameState/C_StaticObj.cpp | 42 +++++++++++++++++++ .../GameClientState/GameState/C_StaticObj.h | 21 ++++++++++ .../GameClientState/LobbyState.cpp | 22 ++++++---- .../DanBiasLauncher/DanBiasLauncher.vcxproj | 11 ++--- Code/Game/GameLogic/Game.h | 1 + Code/Game/GameLogic/GameLogic.vcxproj | 5 --- 15 files changed, 265 insertions(+), 35 deletions(-) create mode 100644 Code/Game/DanBiasGame/GameClientState/C_Object.cpp create mode 100644 Code/Game/DanBiasGame/GameClientState/C_Object.h create mode 100644 Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.cpp create mode 100644 Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.h create mode 100644 Code/Game/DanBiasGame/GameClientState/GameState/C_Player.cpp create mode 100644 Code/Game/DanBiasGame/GameClientState/GameState/C_Player.h create mode 100644 Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.cpp create mode 100644 Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.h diff --git a/Code/Game/DanBiasGame/DanBiasGame.vcxproj b/Code/Game/DanBiasGame/DanBiasGame.vcxproj index 5f9dee44..ec283376 100644 --- a/Code/Game/DanBiasGame/DanBiasGame.vcxproj +++ b/Code/Game/DanBiasGame/DanBiasGame.vcxproj @@ -106,12 +106,12 @@ Disabled DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) true - $(SolutionDir)OysterMath;$(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) + $(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) Windows true - OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;%(AdditionalDependencies) + OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;%(AdditionalDependencies) OysterGraphics_$(PlatformShortName)D.dll;%(DelayLoadDLLs) @@ -123,12 +123,12 @@ Disabled DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) true - $(SolutionDir)OysterMath;$(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) + $(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) Windows true - OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;%(AdditionalDependencies) + OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;%(AdditionalDependencies) OysterGraphics_$(PlatformShortName)D.dll;%(DelayLoadDLLs) @@ -142,14 +142,14 @@ true DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) true - $(SolutionDir)OysterMath;$(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) + $(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) Windows true true true - OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;%(AdditionalDependencies) + OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;%(AdditionalDependencies) OysterGraphics_x86.dll;%(DelayLoadDLLs) @@ -163,14 +163,14 @@ true DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) true - $(SolutionDir)OysterMath;$(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) + $(SolutionDir)OysterMath;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) Windows true true true - OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;%(AdditionalDependencies) + OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;%(AdditionalDependencies) OysterGraphics_x86.dll;%(DelayLoadDLLs) @@ -187,22 +187,27 @@ {f10cbc03-9809-4cba-95d8-327c287b18ee} - - {b1195bb9-b3a5-47f0-906c-8dea384d1520} - + + + + + + + + diff --git a/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp b/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp index 025be43f..5698cb1d 100644 --- a/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp +++ b/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp @@ -5,7 +5,7 @@ #include "GameClientState/GameClientState.h" #include "GameClientState\GameState.h" #include "GameClientState\LobbyState.h" - +#include "vld.h" namespace DanBias { @@ -180,6 +180,9 @@ namespace DanBias if(state != Client::GameClientState::ClientState_Same) { m_data->gameClientState->Release(); + delete m_data->gameClientState; + m_data->gameClientState = NULL; + switch (state) { case Client::GameClientState::ClientState_Lobby: @@ -193,6 +196,7 @@ namespace DanBias break; } m_data->gameClientState->Init(); + } return S_OK; } @@ -221,8 +225,12 @@ namespace DanBias HRESULT DanBiasGame::CleanUp() { + m_data->gameClientState->Release(); delete m_data->gameClientState; delete m_data; + delete inputObj; + + Oyster::Graphics::API::Clean(); return S_OK; } diff --git a/Code/Game/DanBiasGame/GameClientState/C_Object.cpp b/Code/Game/DanBiasGame/GameClientState/C_Object.cpp new file mode 100644 index 00000000..840e6267 --- /dev/null +++ b/Code/Game/DanBiasGame/GameClientState/C_Object.cpp @@ -0,0 +1,4 @@ +#include "C_Object.h" +using namespace DanBias::Client; + + diff --git a/Code/Game/DanBiasGame/GameClientState/C_Object.h b/Code/Game/DanBiasGame/GameClientState/C_Object.h new file mode 100644 index 00000000..0f2bdf81 --- /dev/null +++ b/Code/Game/DanBiasGame/GameClientState/C_Object.h @@ -0,0 +1,18 @@ +#pragma once +namespace DanBias +{ + namespace Client + { +class C_Object +{ +private: + +public: + + virtual void Init() = 0; + virtual void setPos() = 0; + + virtual void Render() = 0; + virtual void Release() = 0; +};};}; + diff --git a/Code/Game/DanBiasGame/GameClientState/GameState.cpp b/Code/Game/DanBiasGame/GameClientState/GameState.cpp index a1df56f8..0914f259 100644 --- a/Code/Game/DanBiasGame/GameClientState/GameState.cpp +++ b/Code/Game/DanBiasGame/GameClientState/GameState.cpp @@ -1,5 +1,6 @@ #include "GameState.h" #include "DllInterfaces/GFXAPI.h" +#include "GameState/C_Player.h" using namespace DanBias::Client; struct GameState::myData @@ -7,7 +8,7 @@ struct GameState::myData myData(){} Oyster::Math3D::Float4x4 view; Oyster::Math3D::Float4x4 proj; - Oyster::Graphics::Model::Model *model; + C_Object* player; }privData; GameState::GameState(void) @@ -17,12 +18,14 @@ GameState::GameState(void) GameState::~GameState(void) { + } bool GameState::Init() { // load models privData = new myData(); - privData->model = Oyster::Graphics::API::CreateModel(L"crate"); + privData->player = new C_Player; + privData->player->Init(); privData->proj = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/2,1024.0f/768.0f,.1f,1000); Oyster::Graphics::API::SetProjection(privData->proj); @@ -46,11 +49,16 @@ bool GameState::Render() Oyster::Graphics::API::SetView(privData->view); Oyster::Graphics::API::SetProjection( privData->proj); Oyster::Graphics::API::NewFrame(); - //Oyster::Graphics::API::RenderModel(*(privData->model)); + privData->player->Render(); Oyster::Graphics::API::EndFrame(); return true; } bool GameState::Release() { + privData->player->Release(); + delete privData->player; + privData->player = NULL; + delete privData; + privData = NULL; return true; } \ No newline at end of file diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.cpp b/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.cpp new file mode 100644 index 00000000..79d89eb9 --- /dev/null +++ b/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.cpp @@ -0,0 +1,40 @@ +#include "C_DynamicObj.h" +#include "DllInterfaces/GFXAPI.h" +using namespace DanBias::Client; +struct C_DynamicObj::myData +{ + myData(){} + Oyster::Graphics::Model::Model *model; + // light + // sound + // effect +}privData; +C_DynamicObj::C_DynamicObj(void) +{ +} + + +C_DynamicObj::~C_DynamicObj(void) +{ + +} +void C_DynamicObj::Init() +{ + // load models + privData = new myData(); + privData->model = Oyster::Graphics::API::CreateModel(L"crate"); +} +void C_DynamicObj::setPos() +{ + +} + +void C_DynamicObj::Render() +{ + Oyster::Graphics::API::RenderModel(*(privData->model)); +} +void C_DynamicObj::Release() +{ + Oyster::Graphics::API::DeleteModel(privData->model); + delete privData; +} \ No newline at end of file diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.h b/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.h new file mode 100644 index 00000000..01638550 --- /dev/null +++ b/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.h @@ -0,0 +1,20 @@ +#pragma once +namespace DanBias +{ + namespace Client + { +class C_DynamicObj +{ +private: + struct myData; + myData* privData; +public: + C_DynamicObj(void); + virtual ~C_DynamicObj(void); + void Init(); + void setPos(); + + void Render(); + void Release(); +};};}; + diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.cpp b/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.cpp new file mode 100644 index 00000000..6c0e327f --- /dev/null +++ b/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.cpp @@ -0,0 +1,42 @@ +#include "C_Player.h" +#include "DllInterfaces/GFXAPI.h" +using namespace DanBias::Client; + +struct C_Player::myData +{ + myData(){} + Oyster::Math3D::Float4x4 view; + Oyster::Math3D::Float4x4 proj; + Oyster::Graphics::Model::Model *model; +}privData; + +C_Player::C_Player(void) +{ +} + + +C_Player::~C_Player(void) +{ + +} + +void C_Player::Init() +{ + // load models + privData = new myData(); + privData->model = Oyster::Graphics::API::CreateModel(L"crate"); +} +void C_Player::setPos() +{ + +} + +void C_Player::Render() +{ + Oyster::Graphics::API::RenderModel(*(privData->model)); +} +void C_Player::Release() +{ + Oyster::Graphics::API::DeleteModel(privData->model); + delete privData; +} diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.h b/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.h new file mode 100644 index 00000000..43f12e5d --- /dev/null +++ b/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.h @@ -0,0 +1,23 @@ +#pragma once +#include "../C_Object.h" +namespace DanBias +{ + namespace Client + { +class C_Player : public C_Object +{ +private: + struct myData; + myData* privData; + //Oyster::Graphics:: LIght +public: + C_Player(void); + ~C_Player(void); + void Init(); + void setPos(); + + void Render(); + void Release(); + +};};}; + diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.cpp b/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.cpp new file mode 100644 index 00000000..d3ceaf3f --- /dev/null +++ b/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.cpp @@ -0,0 +1,42 @@ + +#include "C_StaticObj.h" +#include "DllInterfaces/GFXAPI.h" +using namespace DanBias::Client; + +struct C_StaticObj::myData +{ + myData(){} + Oyster::Graphics::Model::Model *model; + // light + // sound + // effect +}privData; +C_StaticObj::C_StaticObj(void) +{ +} + + +C_StaticObj::~C_StaticObj(void) +{ + +} +void C_StaticObj::Init() +{ + // load models + privData = new myData(); + privData->model = Oyster::Graphics::API::CreateModel(L"worldDummy"); +} +void C_StaticObj::setPos() +{ + +} + +void C_StaticObj::Render() +{ + Oyster::Graphics::API::RenderModel(*(privData->model)); +} +void C_StaticObj::Release() +{ + Oyster::Graphics::API::DeleteModel(privData->model); + delete privData; +} \ No newline at end of file diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.h b/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.h new file mode 100644 index 00000000..06be4a55 --- /dev/null +++ b/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.h @@ -0,0 +1,21 @@ +#pragma once +#include "../C_Object.h" +namespace DanBias +{ + namespace Client + { +class C_StaticObj : public C_Object +{ +private: + struct myData; + myData* privData; +public: + C_StaticObj(void); + virtual ~C_StaticObj(void); + void Init(); + void setPos(); + + void Render(); + void Release(); +};};}; + diff --git a/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp b/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp index b52e9b6d..4cd06d01 100644 --- a/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp +++ b/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp @@ -1,6 +1,8 @@ #include "LobbyState.h" #include "DllInterfaces/GFXAPI.h" #include "OysterMath.h" +#include "GameState/C_Player.h" +#include "GameState/C_StaticObj.h" using namespace DanBias::Client; struct LobbyState::myData @@ -8,7 +10,7 @@ struct LobbyState::myData myData(){} Oyster::Math3D::Float4x4 view; Oyster::Math3D::Float4x4 proj; - Oyster::Graphics::Model::Model *model; + C_Object* object; }privData; @@ -20,14 +22,14 @@ LobbyState::LobbyState(void) LobbyState::~LobbyState(void) { - Oyster::Graphics::API::DeleteModel(privData->model); - Oyster::Graphics::API::Clean(); + } bool LobbyState::Init() { // load models privData = new myData(); - privData->model = Oyster::Graphics::API::CreateModel(L"crate"); + privData->object = new C_StaticObj(); + privData->object->Init(); privData->proj = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/2,1024.0f/768.0f,.1f,1000); //privData->proj = Oyster::Math3D::ProjectionMatrix_Orthographic(1024, 768, 1, 1000); @@ -36,14 +38,12 @@ bool LobbyState::Init() privData->view = Oyster::Math3D::OrientationMatrix_LookAtDirection(Oyster::Math::Float3(0,0,-1),Oyster::Math::Float3(0,1,0),Oyster::Math::Float3(0,0,5.4f)); privData->view = Oyster::Math3D::InverseOrientationMatrix(privData->view); - - return true; } GameClientState::ClientState LobbyState::Update(float deltaTime, InputClass* KeyInput) { - if( KeyInput->IsKeyPressed(DIK_Q)) + if( KeyInput->IsKeyPressed(DIK_G)) return ClientState_Game; return ClientState_Same; } @@ -53,11 +53,17 @@ bool LobbyState::Render() Oyster::Graphics::API::SetView(privData->view); Oyster::Graphics::API::SetProjection( privData->proj); Oyster::Graphics::API::NewFrame(); - Oyster::Graphics::API::RenderModel(*(privData->model)); + // render objects + privData->object->Render(); Oyster::Graphics::API::EndFrame(); return true; } bool LobbyState::Release() { + privData->object->Release(); + delete privData->object; + privData->object = NULL; + delete privData; + privData = NULL; return true; } \ No newline at end of file diff --git a/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj b/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj index 9d4363bb..6e5f099c 100644 --- a/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj +++ b/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj @@ -111,7 +111,7 @@ Windows true DanBiasServer_$(PlatformShortName)D.dll;DanBiasGame_$(PlatformShortName)D.dll;%(DelayLoadDLLs) - Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;DanBiasServer_$(PlatformShortName)D.lib;DanBiasGame_$(PlatformShortName)D.lib;%(AdditionalDependencies) + Input_$(PlatformShortName)D.lib;DanBiasGame_$(PlatformShortName)D.lib;%(AdditionalDependencies) @@ -127,7 +127,7 @@ Windows true DanBiasServer_$(PlatformShortName)D.dll;DanBiasGame_$(PlatformShortName)D.dll;%(DelayLoadDLLs) - Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;DanBiasServer_$(PlatformShortName)D.lib;DanBiasGame_$(PlatformShortName)D.lib;%(AdditionalDependencies) + Input_$(PlatformShortName)D.lib;DanBiasGame_$(PlatformShortName)D.lib;%(AdditionalDependencies) @@ -147,7 +147,7 @@ true true DanBiasServer_$(PlatformShortName).dll;DanBiasGame_$(PlatformShortName).dll;%(DelayLoadDLLs) - Input_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;DanBiasServer_$(PlatformShortName).lib;DanBiasGame_$(PlatformShortName).lib;%(AdditionalDependencies) + Input_$(PlatformShortName).lib;DanBiasServer_$(PlatformShortName).lib;DanBiasGame_$(PlatformShortName).lib;%(AdditionalDependencies) @@ -167,7 +167,7 @@ true true DanBiasServer_$(PlatformShortName).dll;DanBiasGame_$(PlatformShortName).dll;%(DelayLoadDLLs) - Input_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;DanBiasServer_$(PlatformShortName).lib;DanBiasGame_$(PlatformShortName).lib;%(AdditionalDependencies) + Input_$(PlatformShortName).lib;DanBiasServer_$(PlatformShortName).lib;DanBiasGame_$(PlatformShortName).lib;%(AdditionalDependencies) @@ -195,9 +195,6 @@ {52380daa-0f4a-4d97-8e57-98df39319caf} - - {b1195bb9-b3a5-47f0-906c-8dea384d1520} - diff --git a/Code/Game/GameLogic/Game.h b/Code/Game/GameLogic/Game.h index b3ac07c3..708c01e3 100644 --- a/Code/Game/GameLogic/Game.h +++ b/Code/Game/GameLogic/Game.h @@ -5,6 +5,7 @@ #include "Player.h" #include "IGame.h" #include "Camera.h" +#include "DynamicObject.h" namespace GameLogic { diff --git a/Code/Game/GameLogic/GameLogic.vcxproj b/Code/Game/GameLogic/GameLogic.vcxproj index 8afb5bb4..a01328ef 100644 --- a/Code/Game/GameLogic/GameLogic.vcxproj +++ b/Code/Game/GameLogic/GameLogic.vcxproj @@ -169,9 +169,7 @@ - - @@ -183,15 +181,12 @@ - - - From fbd95a7109156483e060ad41e8204a6f588ac935 Mon Sep 17 00:00:00 2001 From: dean11 Date: Mon, 9 Dec 2013 11:57:34 +0100 Subject: [PATCH 13/19] GAMELOGIC - Added a protocol api --- Code/DanBias.sln | 41 +++-- Code/Game/GameProtocols/GameProtocols.vcxproj | 163 ++++++++++++++++++ Code/Game/GameProtocols/PlayerProtocols.h | 50 ++++++ .../GameProtocols/ProtocolIdentificationID.h | 8 + 4 files changed, 248 insertions(+), 14 deletions(-) create mode 100644 Code/Game/GameProtocols/GameProtocols.vcxproj create mode 100644 Code/Game/GameProtocols/PlayerProtocols.h create mode 100644 Code/Game/GameProtocols/ProtocolIdentificationID.h diff --git a/Code/DanBias.sln b/Code/DanBias.sln index 4b9ec79f..32915f21 100644 --- a/Code/DanBias.sln +++ b/Code/DanBias.sln @@ -40,6 +40,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DanBiasLauncher", "Game\Dan {52380DAA-0F4A-4D97-8E57-98DF39319CAF} = {52380DAA-0F4A-4D97-8E57-98DF39319CAF} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetworkAPI", "Network\NetworkAPI\NetworkAPI.vcxproj", "{460D625F-2AC9-4559-B809-0BA89CEAEDF4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameProtocols", "Game\GameProtocols\GameProtocols.vcxproj", "{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Mixed Platforms = Debug|Mixed Platforms @@ -53,7 +57,6 @@ Global {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.Build.0 = Release|x64 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.ActiveCfg = Debug|Win32 - {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.Build.0 = Debug|Win32 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.ActiveCfg = Debug|x64 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.Build.0 = Debug|x64 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -65,7 +68,6 @@ Global {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.Build.0 = Release|x64 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.ActiveCfg = Debug|Win32 - {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.Build.0 = Debug|Win32 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.ActiveCfg = Debug|x64 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.Build.0 = Debug|x64 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -77,7 +79,6 @@ Global {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Mixed Platforms.Build.0 = Release|x64 {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Win32.ActiveCfg = Debug|Win32 - {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Win32.Build.0 = Debug|Win32 {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|x64.ActiveCfg = Debug|x64 {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|x64.Build.0 = Debug|x64 {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -89,7 +90,6 @@ Global {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Mixed Platforms.Build.0 = Release|x64 {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Win32.ActiveCfg = Debug|Win32 - {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Win32.Build.0 = Debug|Win32 {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|x64.ActiveCfg = Debug|x64 {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|x64.Build.0 = Debug|x64 {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -101,7 +101,6 @@ Global {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Mixed Platforms.Build.0 = Release|x64 {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Win32.ActiveCfg = Debug|Win32 - {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Win32.Build.0 = Debug|Win32 {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|x64.ActiveCfg = Debug|x64 {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|x64.Build.0 = Debug|x64 {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -125,7 +124,6 @@ Global {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.Build.0 = Release|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.ActiveCfg = Debug|Win32 - {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.Build.0 = Debug|Win32 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.ActiveCfg = Debug|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.Build.0 = Debug|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -137,7 +135,6 @@ Global {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Mixed Platforms.Build.0 = Release|x64 {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Win32.ActiveCfg = Debug|Win32 - {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Win32.Build.0 = Debug|Win32 {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|x64.ActiveCfg = Debug|x64 {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|x64.Build.0 = Debug|x64 {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -149,7 +146,6 @@ Global {6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Mixed Platforms.Build.0 = Release|x64 {6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Win32.ActiveCfg = Debug|Win32 - {6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Win32.Build.0 = Debug|Win32 {6A066806-F43F-4B31-A4E3-57179674F460}.Debug|x64.ActiveCfg = Debug|x64 {6A066806-F43F-4B31-A4E3-57179674F460}.Debug|x64.Build.0 = Debug|x64 {6A066806-F43F-4B31-A4E3-57179674F460}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -161,7 +157,6 @@ Global {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.Build.0 = Release|x64 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Win32.ActiveCfg = Debug|Win32 - {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Win32.Build.0 = Debug|Win32 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|x64.ActiveCfg = Debug|x64 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|x64.Build.0 = Debug|x64 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -173,7 +168,6 @@ Global {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.ActiveCfg = Release|Win32 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.Build.0 = Release|Win32 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.ActiveCfg = Debug|Win32 - {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.Build.0 = Debug|Win32 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|x64.ActiveCfg = Debug|x64 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|x64.Build.0 = Debug|x64 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Mixed Platforms.ActiveCfg = Release|Win32 @@ -191,7 +185,6 @@ Global {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Win32.Build.0 = Debug|Win32 {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|x64.ActiveCfg = Debug|x64 {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|x64.Build.0 = Debug|x64 {2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Mixed Platforms.ActiveCfg = Release|Win32 @@ -203,7 +196,6 @@ Global {B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Win32.ActiveCfg = Debug|Win32 - {B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Win32.Build.0 = Debug|Win32 {B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|x64.ActiveCfg = Debug|x64 {B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|x64.Build.0 = Debug|x64 {B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Mixed Platforms.ActiveCfg = Release|Win32 @@ -215,7 +207,6 @@ Global {52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|Win32.ActiveCfg = Debug|Win32 - {52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|Win32.Build.0 = Debug|Win32 {52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|x64.ActiveCfg = Debug|x64 {52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|x64.Build.0 = Debug|x64 {52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Release|Mixed Platforms.ActiveCfg = Release|Win32 @@ -227,7 +218,6 @@ Global {8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Win32.ActiveCfg = Debug|Win32 - {8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Win32.Build.0 = Debug|Win32 {8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|x64.ActiveCfg = Debug|x64 {8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|x64.Build.0 = Debug|x64 {8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Mixed Platforms.ActiveCfg = Release|Win32 @@ -236,6 +226,27 @@ Global {8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Win32.Build.0 = Release|Win32 {8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|x64.ActiveCfg = Release|x64 {8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|x64.Build.0 = Release|x64 + {460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Win32.ActiveCfg = Debug|Win32 + {460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|x64.ActiveCfg = Debug|x64 + {460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|x64.Build.0 = Debug|x64 + {460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Mixed Platforms.Build.0 = Release|Win32 + {460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Win32.ActiveCfg = Release|Win32 + {460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Win32.Build.0 = Release|Win32 + {460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|x64.ActiveCfg = Release|x64 + {460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|x64.Build.0 = Release|x64 + {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|x64.ActiveCfg = Debug|x64 + {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|x64.Build.0 = Debug|x64 + {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Mixed Platforms.Build.0 = Release|Win32 + {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Win32.ActiveCfg = Release|Win32 + {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Win32.Build.0 = Release|Win32 + {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -244,9 +255,11 @@ Global {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8} = {C27B926E-B3EF-4990-8822-47580E43A0BE} {6A066806-F43F-4B31-A4E3-57179674F460} = {C27B926E-B3EF-4990-8822-47580E43A0BE} {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50} = {C27B926E-B3EF-4990-8822-47580E43A0BE} + {460D625F-2AC9-4559-B809-0BA89CEAEDF4} = {C27B926E-B3EF-4990-8822-47580E43A0BE} {2A1BC987-AF42-4500-802D-89CD32FC1309} = {20720CA7-795C-45AD-A302-9383A6DD503A} {B1195BB9-B3A5-47F0-906C-8DEA384D1520} = {20720CA7-795C-45AD-A302-9383A6DD503A} {52380DAA-0F4A-4D97-8E57-98DF39319CAF} = {20720CA7-795C-45AD-A302-9383A6DD503A} {8690FDDF-C5B7-4C42-A337-BD5243F29B85} = {20720CA7-795C-45AD-A302-9383A6DD503A} + {DA2AA800-ED64-4649-8B3B-E7F1E3968B78} = {20720CA7-795C-45AD-A302-9383A6DD503A} EndGlobalSection EndGlobal diff --git a/Code/Game/GameProtocols/GameProtocols.vcxproj b/Code/Game/GameProtocols/GameProtocols.vcxproj new file mode 100644 index 00000000..629ecf72 --- /dev/null +++ b/Code/Game/GameProtocols/GameProtocols.vcxproj @@ -0,0 +1,163 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {DA2AA800-ED64-4649-8B3B-E7F1E3968B78} + GameProtocols + + + + StaticLibrary + true + v110 + Unicode + + + StaticLibrary + true + v110 + Unicode + + + StaticLibrary + false + v110 + true + Unicode + + + StaticLibrary + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + $(SolutionDir)..\External\Lib\$(ProjectName)\ + $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ + $(ProjectName)_$(PlatformShortName)D + $(SolutionDir)Network\NetworkAPI\;$(IncludePath) + + + $(SolutionDir)..\External\Lib\$(ProjectName)\ + $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ + $(ProjectName)_$(PlatformShortName) + $(SolutionDir)Network\NetworkAPI\;$(IncludePath) + + + $(SolutionDir)..\External\Lib\$(ProjectName)\ + $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ + $(ProjectName)_$(PlatformShortName)D + $(SolutionDir)Network\NetworkAPI\;$(IncludePath) + + + $(SolutionDir)..\External\Lib\$(ProjectName)\ + $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ + $(ProjectName)_$(PlatformShortName) + $(SolutionDir)Network\NetworkAPI\;$(IncludePath) + + + + Level3 + Disabled + true + + + true + + + $(SolutionDir)..\Bin\DLL\;%(AdditionalLibraryDirectories) + NetworkAPI_$(PlatformShortName)D.lib;%(AdditionalDependencies) + + + + + Level3 + Disabled + true + + + true + + + $(SolutionDir)..\Bin\DLL\;%(AdditionalLibraryDirectories) + NetworkAPI_$(PlatformShortName)D.lib;%(AdditionalDependencies) + + + + + Level3 + MaxSpeed + true + true + true + + + true + true + true + + + $(SolutionDir)..\Bin\DLL\;%(AdditionalLibraryDirectories) + NetworkAPI_$(PlatformShortName).lib;%(AdditionalDependencies) + + + + + Level3 + MaxSpeed + true + true + true + + + true + true + true + + + $(SolutionDir)..\Bin\DLL\;%(AdditionalLibraryDirectories) + NetworkAPI_$(PlatformShortName).lib;%(AdditionalDependencies) + + + + + + + + + + \ No newline at end of file diff --git a/Code/Game/GameProtocols/PlayerProtocols.h b/Code/Game/GameProtocols/PlayerProtocols.h new file mode 100644 index 00000000..b091ba34 --- /dev/null +++ b/Code/Game/GameProtocols/PlayerProtocols.h @@ -0,0 +1,50 @@ +#ifndef GAMELOGIC_PLAYER_PROTOCOLS_H +#define GAMELOGIC_PLAYER_PROTOCOLS_H + +#include "CustomNetProtocol.h" +#include "ProtocolIdentificationID.h" + + + +namespace GameLogic +{ + struct Protocol_PlayerMovement :public Network::CustomProtocolObject + { + int ProtocolID; + bool bForward; + bool bBackward; + bool bTurnLeft; + bool bTurnRight; + bool bStrafeRight; + bool bStrafeLeft; + + Protocol_PlayerMovement() + { + protocol[0]->value = ProtocolID = protocol_PlayerNavigation; + + protocol[0]->type = Network::NetAttributeType_Int; + protocol[1]->type = Network::NetAttributeType_Bool; + protocol[2]->type = Network::NetAttributeType_Bool; + protocol[3]->type = Network::NetAttributeType_Bool; + protocol[4]->type = Network::NetAttributeType_Bool; + protocol[5]->type = Network::NetAttributeType_Bool; + protocol[6]->type = Network::NetAttributeType_Bool; + } + Network::CustomNetProtocol* GetProtocol() override + { + protocol[1]->value = bForward; + protocol[2]->value = bBackward; + protocol[3]->value = bTurnLeft; + protocol[4]->value = bTurnRight; + protocol[5]->value = bStrafeRight; + protocol[6]->value = bStrafeRight; + + return &protocol; + } + + private: + Network::CustomNetProtocol protocol; + }; +} + +#endif // !GAMELOGIC_PLAYER_PROTOCOLS_H diff --git a/Code/Game/GameProtocols/ProtocolIdentificationID.h b/Code/Game/GameProtocols/ProtocolIdentificationID.h new file mode 100644 index 00000000..1af8c920 --- /dev/null +++ b/Code/Game/GameProtocols/ProtocolIdentificationID.h @@ -0,0 +1,8 @@ +#ifndef GAMEPROTOCOL_PROTOCOL_DEFINITION_ID_H +#define GAMEPROTOCOL_PROTOCOL_DEFINITION_ID_H + +/* THERE CAN ABSOLUTLEY NOT BE TWO DEFINITIONS WITH THE SAME ID!! */ + +#define protocol_PlayerNavigation 0; + +#endif // !GAMEPROTOCOL_PROTOCOL_DEFINITION_ID_H From ea593743ad312603020f321d5db3889b2814545e Mon Sep 17 00:00:00 2001 From: Linda Andersson Date: Mon, 9 Dec 2013 12:01:36 +0100 Subject: [PATCH 14/19] GL - added UI object --- Code/Game/DanBiasGame/DanBiasGame.vcxproj | 2 + .../DanBiasGame/GameClientState/C_Object.h | 11 ++++- .../DanBiasGame/GameClientState/GameState.cpp | 7 ++- .../GameState/C_DynamicObj.cpp | 6 ++- .../GameClientState/GameState/C_DynamicObj.h | 5 ++- .../GameClientState/GameState/C_Player.cpp | 8 +++- .../GameClientState/GameState/C_Player.h | 2 +- .../GameClientState/GameState/C_StaticObj.cpp | 7 ++- .../GameClientState/GameState/C_StaticObj.h | 2 +- .../GameClientState/GameState/C_UIobject.cpp | 43 +++++++++++++++++++ .../GameClientState/GameState/C_UIobject.h | 20 +++++++++ .../GameClientState/LobbyState.cpp | 8 +++- .../DanBiasGame/GameClientState/LobbyState.h | 5 ++- 13 files changed, 112 insertions(+), 14 deletions(-) create mode 100644 Code/Game/DanBiasGame/GameClientState/GameState/C_UIobject.cpp create mode 100644 Code/Game/DanBiasGame/GameClientState/GameState/C_UIobject.h diff --git a/Code/Game/DanBiasGame/DanBiasGame.vcxproj b/Code/Game/DanBiasGame/DanBiasGame.vcxproj index ec283376..41093543 100644 --- a/Code/Game/DanBiasGame/DanBiasGame.vcxproj +++ b/Code/Game/DanBiasGame/DanBiasGame.vcxproj @@ -189,6 +189,7 @@ + @@ -200,6 +201,7 @@ + diff --git a/Code/Game/DanBiasGame/GameClientState/C_Object.h b/Code/Game/DanBiasGame/GameClientState/C_Object.h index 0f2bdf81..adb79f54 100644 --- a/Code/Game/DanBiasGame/GameClientState/C_Object.h +++ b/Code/Game/DanBiasGame/GameClientState/C_Object.h @@ -1,15 +1,24 @@ #pragma once +#include "DllInterfaces/GFXAPI.h" namespace DanBias { namespace Client { + + struct ModelInitData + { + std::wstring modelPath; + Oyster::Math::Float4x4 world; + bool visible; + }; + class C_Object { private: public: - virtual void Init() = 0; + virtual void Init(ModelInitData modelInit) = 0; virtual void setPos() = 0; virtual void Render() = 0; diff --git a/Code/Game/DanBiasGame/GameClientState/GameState.cpp b/Code/Game/DanBiasGame/GameClientState/GameState.cpp index 0914f259..1b5926b0 100644 --- a/Code/Game/DanBiasGame/GameClientState/GameState.cpp +++ b/Code/Game/DanBiasGame/GameClientState/GameState.cpp @@ -22,10 +22,15 @@ GameState::~GameState(void) } bool GameState::Init() { + ModelInitData modelData; + + modelData.world = Oyster::Math3D::Float4x4::identity; + modelData.visible = true; + modelData.modelPath = L"worldDummy"; // load models privData = new myData(); privData->player = new C_Player; - privData->player->Init(); + privData->player->Init(modelData); privData->proj = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/2,1024.0f/768.0f,.1f,1000); Oyster::Graphics::API::SetProjection(privData->proj); diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.cpp b/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.cpp index 79d89eb9..686bbca9 100644 --- a/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.cpp +++ b/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.cpp @@ -18,11 +18,13 @@ C_DynamicObj::~C_DynamicObj(void) { } -void C_DynamicObj::Init() +void C_DynamicObj::Init(ModelInitData modelInit) { // load models privData = new myData(); - privData->model = Oyster::Graphics::API::CreateModel(L"crate"); + privData->model = Oyster::Graphics::API::CreateModel(modelInit.modelPath); + privData->model->WorldMatrix = modelInit.world; + privData->model->Visible = modelInit.visible; } void C_DynamicObj::setPos() { diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.h b/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.h index 01638550..35a6e401 100644 --- a/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.h +++ b/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.h @@ -1,9 +1,10 @@ #pragma once +#include "../C_Object.h" namespace DanBias { namespace Client { -class C_DynamicObj +class C_DynamicObj : private C_Object { private: struct myData; @@ -11,7 +12,7 @@ private: public: C_DynamicObj(void); virtual ~C_DynamicObj(void); - void Init(); + void Init(ModelInitData modelInit); void setPos(); void Render(); diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.cpp b/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.cpp index 6c0e327f..e47d98ef 100644 --- a/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.cpp +++ b/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.cpp @@ -20,11 +20,15 @@ C_Player::~C_Player(void) } -void C_Player::Init() +void C_Player::Init(ModelInitData modelInit) { // load models privData = new myData(); - privData->model = Oyster::Graphics::API::CreateModel(L"crate"); + privData->model = Oyster::Graphics::API::CreateModel(modelInit.modelPath); + privData->model->WorldMatrix = modelInit.world; + privData->model->Visible = modelInit.visible; + + } void C_Player::setPos() { diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.h b/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.h index 43f12e5d..e9bdfa89 100644 --- a/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.h +++ b/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.h @@ -13,7 +13,7 @@ private: public: C_Player(void); ~C_Player(void); - void Init(); + void Init(ModelInitData modelInit); void setPos(); void Render(); diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.cpp b/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.cpp index d3ceaf3f..54c36c2a 100644 --- a/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.cpp +++ b/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.cpp @@ -20,11 +20,14 @@ C_StaticObj::~C_StaticObj(void) { } -void C_StaticObj::Init() +void C_StaticObj::Init(ModelInitData modelInit) { // load models privData = new myData(); - privData->model = Oyster::Graphics::API::CreateModel(L"worldDummy"); + privData->model = Oyster::Graphics::API::CreateModel(modelInit.modelPath); + privData->model->WorldMatrix = modelInit.world; + privData->model->Visible = modelInit.visible; + } void C_StaticObj::setPos() { diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.h b/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.h index 06be4a55..9da24351 100644 --- a/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.h +++ b/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.h @@ -12,7 +12,7 @@ private: public: C_StaticObj(void); virtual ~C_StaticObj(void); - void Init(); + void Init(ModelInitData modelInit); void setPos(); void Render(); diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_UIobject.cpp b/Code/Game/DanBiasGame/GameClientState/GameState/C_UIobject.cpp new file mode 100644 index 00000000..b07ec6fa --- /dev/null +++ b/Code/Game/DanBiasGame/GameClientState/GameState/C_UIobject.cpp @@ -0,0 +1,43 @@ +#include "C_UIobject.h" +#include "DllInterfaces/GFXAPI.h" +using namespace DanBias::Client; + +struct C_UIobject::myData +{ + myData(){} + Oyster::Math3D::Float4x4 view; + Oyster::Math3D::Float4x4 proj; + Oyster::Graphics::Model::Model *model; +}privData; + +C_UIobject::C_UIobject(void) +{ +} + + +C_UIobject::~C_UIobject(void) +{ +} +void C_UIobject::Init(ModelInitData modelInit) +{ + // load models + privData = new myData(); + privData->model = Oyster::Graphics::API::CreateModel(modelInit.modelPath); + privData->model->WorldMatrix = modelInit.world; + privData->model->Visible = modelInit.visible; + +} +void C_UIobject::setPos() +{ + +} + +void C_UIobject::Render() +{ + Oyster::Graphics::API::RenderModel(*(privData->model)); +} +void C_UIobject::Release() +{ + Oyster::Graphics::API::DeleteModel(privData->model); + delete privData; +} \ No newline at end of file diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_UIobject.h b/Code/Game/DanBiasGame/GameClientState/GameState/C_UIobject.h new file mode 100644 index 00000000..6052a414 --- /dev/null +++ b/Code/Game/DanBiasGame/GameClientState/GameState/C_UIobject.h @@ -0,0 +1,20 @@ +#pragma once +#include "../C_Object.h" +namespace DanBias +{ + namespace Client + { + class C_UIobject : public C_Object + { + private: + struct myData; + myData* privData; + public: + C_UIobject(void); + virtual ~C_UIobject(void); + void Init(ModelInitData modelInit); + void setPos(); + + void Render(); + void Release(); + };};}; \ No newline at end of file diff --git a/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp b/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp index 4cd06d01..5e956176 100644 --- a/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp +++ b/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp @@ -26,10 +26,16 @@ LobbyState::~LobbyState(void) } bool LobbyState::Init() { + ModelInitData modelData; + + modelData.world = Oyster::Math3D::Float4x4::identity; + modelData.visible = true; + modelData.modelPath = L"crate"; // load models privData = new myData(); privData->object = new C_StaticObj(); - privData->object->Init(); + + privData->object->Init(modelData); privData->proj = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/2,1024.0f/768.0f,.1f,1000); //privData->proj = Oyster::Math3D::ProjectionMatrix_Orthographic(1024, 768, 1, 1000); diff --git a/Code/Game/DanBiasGame/GameClientState/LobbyState.h b/Code/Game/DanBiasGame/GameClientState/LobbyState.h index 8002238e..cba06547 100644 --- a/Code/Game/DanBiasGame/GameClientState/LobbyState.h +++ b/Code/Game/DanBiasGame/GameClientState/LobbyState.h @@ -1,4 +1,6 @@ -#pragma once +#ifndef DANBIAS_CLIENT_GAMECLIENTSTATE_H +#define DANBIAS_CLIENT_GAMECLIENTSTATE_H + #include "GameClientState.h" namespace DanBias { @@ -18,3 +20,4 @@ public: bool Render(); bool Release(); };};}; +#endif // ! DANBIAS_CLIENT_GAMECLIENTSTATE_H From 97e0b1298aaaf4c1a6c06864d5e7e69c09c08996 Mon Sep 17 00:00:00 2001 From: Erik Persson Date: Tue, 10 Dec 2013 09:57:05 +0100 Subject: [PATCH 15/19] added functionallity to player and weapon, started on the weapon design. --- Code/Game/GameLogic/AttatchmentMassDriver.cpp | 38 +++++++++ Code/Game/GameLogic/AttatchmentMassDriver.h | 25 ++++++ Code/Game/GameLogic/AttatchmentSocket.cpp | 34 ++++++++ Code/Game/GameLogic/AttatchmentSocket.h | 20 +++++ Code/Game/GameLogic/GameLogic.vcxproj | 11 ++- Code/Game/GameLogic/GameLogicStates.h | 41 ++++++++++ Code/Game/GameLogic/IAttatchment.cpp | 29 +++++++ Code/Game/GameLogic/IAttatchment.h | 25 ++++++ Code/Game/GameLogic/Player.cpp | 81 ++++++++++++++++++- Code/Game/GameLogic/Player.h | 19 +++-- Code/Game/GameLogic/Weapon.cpp | 43 +++++++++- Code/Game/GameLogic/Weapon.h | 13 ++- 12 files changed, 363 insertions(+), 16 deletions(-) create mode 100644 Code/Game/GameLogic/AttatchmentMassDriver.cpp create mode 100644 Code/Game/GameLogic/AttatchmentMassDriver.h create mode 100644 Code/Game/GameLogic/AttatchmentSocket.cpp create mode 100644 Code/Game/GameLogic/AttatchmentSocket.h create mode 100644 Code/Game/GameLogic/GameLogicStates.h create mode 100644 Code/Game/GameLogic/IAttatchment.cpp create mode 100644 Code/Game/GameLogic/IAttatchment.h diff --git a/Code/Game/GameLogic/AttatchmentMassDriver.cpp b/Code/Game/GameLogic/AttatchmentMassDriver.cpp new file mode 100644 index 00000000..fcee6afb --- /dev/null +++ b/Code/Game/GameLogic/AttatchmentMassDriver.cpp @@ -0,0 +1,38 @@ +#include "AttatchmentMassDriver.h" + +using namespace GameLogic; + +struct AttatchmentMassDriver::PrivateData +{ + PrivateData() + { + + } + + ~PrivateData() + { + + } + +}myData; + + +AttatchmentMassDriver::AttatchmentMassDriver(void) +{ +} + + +AttatchmentMassDriver::~AttatchmentMassDriver(void) +{ +} + + +void AttatchmentMassDriver::ForcePush(const GameLogic::WEAPON_FIRE &fireInput) +{ + +} + +void AttatchmentMassDriver::UseAttatchment(const GameLogic::WEAPON_FIRE &fireInput) +{ + +} diff --git a/Code/Game/GameLogic/AttatchmentMassDriver.h b/Code/Game/GameLogic/AttatchmentMassDriver.h new file mode 100644 index 00000000..bc95c327 --- /dev/null +++ b/Code/Game/GameLogic/AttatchmentMassDriver.h @@ -0,0 +1,25 @@ +#ifndef ATTATCHMENTMASSDRIVER_H +#define ATTATCHMENTMASSDRIVER_H +#include "IAttatchment.h" +namespace GameLogic +{ + + class AttatchmentMassDriver : public IAttatchment + { + public: + AttatchmentMassDriver(void); + ~AttatchmentMassDriver(void); + + + void UseAttatchment(const WEAPON_FIRE &fireInput); + + private: + void ForcePush(const WEAPON_FIRE &fireInput); + + private: + struct PrivateData; + PrivateData *myData; + }; +} +#endif + diff --git a/Code/Game/GameLogic/AttatchmentSocket.cpp b/Code/Game/GameLogic/AttatchmentSocket.cpp new file mode 100644 index 00000000..86e0850b --- /dev/null +++ b/Code/Game/GameLogic/AttatchmentSocket.cpp @@ -0,0 +1,34 @@ +#include "AttatchmentSocket.h" +#include "IAttatchment.h" +using namespace GameLogic; + +struct AttatchmentSocket::PrivateData +{ + PrivateData() + { + + } + + ~PrivateData() + { + + } + + IAttatchment *Attatchment; + + +}myData; + +AttatchmentSocket::AttatchmentSocket(void) +{ +} + + +AttatchmentSocket::~AttatchmentSocket(void) +{ +} + +IAttatchment* AttatchmentSocket::GetAttatchment() +{ + return myData->Attatchment; +} diff --git a/Code/Game/GameLogic/AttatchmentSocket.h b/Code/Game/GameLogic/AttatchmentSocket.h new file mode 100644 index 00000000..1067e339 --- /dev/null +++ b/Code/Game/GameLogic/AttatchmentSocket.h @@ -0,0 +1,20 @@ +#ifndef ATTATCHMENTSOCKET_H +#define ATTATCHMENTSOCKET_H +#include "IAttatchment.h" +namespace GameLogic +{ + + class AttatchmentSocket + { + public: + AttatchmentSocket(void); + ~AttatchmentSocket(void); + + IAttatchment* GetAttatchment(); + + private: + struct PrivateData; + PrivateData *myData; + }; +} +#endif \ No newline at end of file diff --git a/Code/Game/GameLogic/GameLogic.vcxproj b/Code/Game/GameLogic/GameLogic.vcxproj index 8afb5bb4..33fd6c92 100644 --- a/Code/Game/GameLogic/GameLogic.vcxproj +++ b/Code/Game/GameLogic/GameLogic.vcxproj @@ -166,12 +166,14 @@ + + - - + + @@ -180,12 +182,13 @@ + + - - + diff --git a/Code/Game/GameLogic/GameLogicStates.h b/Code/Game/GameLogic/GameLogicStates.h new file mode 100644 index 00000000..3c2b9997 --- /dev/null +++ b/Code/Game/GameLogic/GameLogicStates.h @@ -0,0 +1,41 @@ +#ifndef GAMELOGICSTATES_H +#define GAMELOGICSTATES_H + + +namespace GameLogic +{ + enum PLAYER_STATE + { + PLAYER_STATE_JUMPING = 0, + PLAYER_STATE_WALKING = 1, + PLAYER_STATE_IDLE = 2, + }; + + enum PLAYER_MOVEMENT + { + PLAYER_MOVEMENT_FORWARD = 0, + PLAYER_MOVEMENT_BACKWARD = 1, + PLAYER_MOVEMENT_LEFT = 2, + PLAYER_MOVEMENT_RIGHT = 4, + PLAYER_MOVEMENT_JUMP = 8, + }; + + enum WEAPON_FIRE + { + WEAPON_USE_PRIMARY_PRESS = 0, + WEAPON_USE_PRIMARY_RELEASE = 1, + WEAPON_USE_SECONDARY_PRESS = 2, + WEAPON_USE_SECONDARY_RELEASE = 4, + WEAPON_USE_UTILLITY_PRESS = 8, + WEAPON_USE_UTILLITY_RELEASE = 16, + }; + + enum WEAPON_STATE + { + WEAPON_STATE_FIREING = 0, + WEAPON_STATE_IDLE = 1, + WEAPON_STATE_RELOADING = 2, + }; +} + +#endif \ No newline at end of file diff --git a/Code/Game/GameLogic/IAttatchment.cpp b/Code/Game/GameLogic/IAttatchment.cpp new file mode 100644 index 00000000..c1e2a997 --- /dev/null +++ b/Code/Game/GameLogic/IAttatchment.cpp @@ -0,0 +1,29 @@ +#include "IAttatchment.h" +#include "AttatchmentSocket.h" + +using namespace GameLogic; + +struct IAttatchment::PrivateData +{ + PrivateData() + { + + } + + ~PrivateData() + { + + } + + + +}myData; + +IAttatchment::IAttatchment(void) +{ +} + + +IAttatchment::~IAttatchment(void) +{ +} diff --git a/Code/Game/GameLogic/IAttatchment.h b/Code/Game/GameLogic/IAttatchment.h new file mode 100644 index 00000000..c134026f --- /dev/null +++ b/Code/Game/GameLogic/IAttatchment.h @@ -0,0 +1,25 @@ +#ifndef IATTATCHMENT_H +#define IATTATCHMENT_H +#include "GameLogicStates.h" + +namespace GameLogic +{ + + + class IAttatchment + { + + public: + + IAttatchment(void); + ~IAttatchment(void); + + virtual void UseAttatchment(const WEAPON_FIRE &fireInput) = 0; + + private: + struct PrivateData; + PrivateData *myData; + + }; +} +#endif diff --git a/Code/Game/GameLogic/Player.cpp b/Code/Game/GameLogic/Player.cpp index 6c514634..01046143 100644 --- a/Code/Game/GameLogic/Player.cpp +++ b/Code/Game/GameLogic/Player.cpp @@ -11,7 +11,14 @@ struct Player::PrivateData PrivateData() { weapon = new Weapon(); + + life = 100; + playerState = PLAYER_STATE_IDLE; + + rigidBody->SetSubscription(CollisionManager::PlayerCollision); + } + ~PrivateData() { if (weapon) @@ -19,9 +26,12 @@ struct Player::PrivateData delete weapon; } } - + int life; Weapon *weapon; + PLAYER_STATE playerState; + + ICustomBody *rigidBody; }myData; @@ -35,16 +45,81 @@ Player::~Player(void) delete myData; } +/******************************************************** +* Updates the player(is this function needed?) +********************************************************/ + void Player::Update() { } -void Player::Move() +/******************************************************** +* Moves the player based on client input +* Uses the physics to move the player by adding a force in the chosen direction +* Uses the Jump() function if the player is to jump, this is becuase jumping requires additional logic compared to normal movement +********************************************************/ +void Player::Move(const PLAYER_MOVEMENT &movement) +{ + switch(movement) + { + case PLAYER_MOVEMENT_FORWARD: + break; + + case PLAYER_MOVEMENT_BACKWARD: + break; + + case PLAYER_MOVEMENT_LEFT: + break; + + case PLAYER_MOVEMENT_RIGHT: + break; + + case PLAYER_MOVEMENT_JUMP: + Jump(); + break; + } +} +/******************************************************** +* Uses the players weapon based on user input +********************************************************/ +void Player::Shoot(const WEAPON_FIRE &fireInput) +{ + myData->weapon->UseWeapon(fireInput); +} + +/******************************************************** +* Jumps if the player is currently not in a state of jumping +* Applies a force upwards(current upwards) +********************************************************/ +void Player::Jump() { } -void Player::Shoot() + +bool Player::IsWalking() +{ + return (myData->playerState == PLAYER_STATE_WALKING); +} +bool Player::IsJumping() +{ + return (myData->playerState == PLAYER_STATE_JUMPING); +} +bool Player::IsIdle() +{ + return (myData->playerState == PLAYER_STATE_IDLE); +} + +//Oyster::Math::Float3 Player::GetPos() +//{ +// return myData->rigidBody->GetCenter(); +//} + +/******************************************************** +* Respawns the player on a new chosen position +* This resets a set of variables such as life, ammo etcetc +********************************************************/ +void Player::Respawn() { } diff --git a/Code/Game/GameLogic/Player.h b/Code/Game/GameLogic/Player.h index 439bbcd9..d4ce0a8d 100644 --- a/Code/Game/GameLogic/Player.h +++ b/Code/Game/GameLogic/Player.h @@ -3,6 +3,7 @@ ////////////////////////////////////////////////// #ifndef PLAYER_H #define PLAYER_H +#include "GameLogicStates.h" namespace GameLogic { @@ -13,14 +14,18 @@ namespace GameLogic Player(void); ~Player(void); - /******************************************************** - * Update the position of the rigid body - * This will be done with physics later - ********************************************************/ void Update(); - void Move(); - void Shoot(); - + void Move(const PLAYER_MOVEMENT &movement); + void Shoot(const WEAPON_FIRE &fireInput); + void Jump(); + + bool IsWalking(); + bool IsJumping(); + bool IsIdle(); + + //Oyster::Math::Float3 GetPos(); + void Respawn(); + private: struct PrivateData; PrivateData *myData; diff --git a/Code/Game/GameLogic/Weapon.cpp b/Code/Game/GameLogic/Weapon.cpp index c335ae7b..b7a47998 100644 --- a/Code/Game/GameLogic/Weapon.cpp +++ b/Code/Game/GameLogic/Weapon.cpp @@ -1,4 +1,6 @@ #include "Weapon.h" +#include "AttatchmentSocket.h" +#include "AttatchmentMassDriver.h" using namespace GameLogic; @@ -6,7 +8,8 @@ struct Weapon::PrivateData { PrivateData() { - + weaponState = WEAPON_STATE_IDLE; + SelectedAttatchment = new AttatchmentMassDriver(); } ~PrivateData() @@ -14,6 +17,13 @@ struct Weapon::PrivateData } + WEAPON_STATE weaponState; + + AttatchmentSocket **attatchmentSockets; + int nrOfAttatchmentSockets; + + IAttatchment *SelectedAttatchment; + }myData; Weapon::Weapon() @@ -26,3 +36,34 @@ Weapon::~Weapon(void) { delete myData; } + +/******************************************************** +* Uses the weapon based on the input given and the current state of the weapon +********************************************************/ +void Weapon::UseWeapon(const WEAPON_FIRE &fireInput) +{ + myData->SelectedAttatchment->UseAttatchment(fireInput); +} + +/******************************************************** +* Specific weapon usage implementation +********************************************************/ + +/******************************************************** +* Get functions for states +********************************************************/ +bool Weapon::IsFireing() +{ + return (myData->weaponState == WEAPON_STATE::WEAPON_STATE_FIREING); +} + +bool Weapon::IsIdle() +{ + return (myData->weaponState == WEAPON_STATE::WEAPON_STATE_IDLE); +} + +bool Weapon::IsReloading() +{ + return (myData->weaponState == WEAPON_STATE::WEAPON_STATE_RELOADING); +} + diff --git a/Code/Game/GameLogic/Weapon.h b/Code/Game/GameLogic/Weapon.h index 527b0b73..74a408e9 100644 --- a/Code/Game/GameLogic/Weapon.h +++ b/Code/Game/GameLogic/Weapon.h @@ -3,6 +3,7 @@ ////////////////////////////////////////////////// #ifndef WEAPON_H #define WEAPON_H +#include "GameLogicStates.h" namespace GameLogic { @@ -11,10 +12,20 @@ namespace GameLogic { public: + + Weapon(void); ~Weapon(void); - private: + void UseWeapon(const WEAPON_FIRE &fireInput); + + + bool IsFireing(); + bool IsIdle(); + bool IsReloading(); + + + private: struct PrivateData; PrivateData *myData; }; From 4b9f2671bf0d5d6fae430913e8ab2b6bd8ac3498 Mon Sep 17 00:00:00 2001 From: Erik Persson Date: Tue, 10 Dec 2013 11:17:25 +0100 Subject: [PATCH 16/19] updated weapon --- Code/Game/DanBiasGame/DanBiasGame.vcxproj | 9 +++----- .../DanBiasLauncher/DanBiasLauncher.vcxproj | 7 ++----- Code/Game/DanBiasLauncher/Launcher.cpp | 4 ++-- Code/Game/GameLogic/AttatchmentMassDriver.cpp | 21 ++++++++++++------- Code/Game/GameLogic/GameLogic.vcxproj | 1 - Code/Game/GameLogic/Player.cpp | 10 ++++----- Code/Game/GameLogic/Player.h | 3 ++- Code/Game/GameLogic/Weapon.cpp | 4 ++-- 8 files changed, 30 insertions(+), 29 deletions(-) diff --git a/Code/Game/DanBiasGame/DanBiasGame.vcxproj b/Code/Game/DanBiasGame/DanBiasGame.vcxproj index 0b9d07d3..255f03bf 100644 --- a/Code/Game/DanBiasGame/DanBiasGame.vcxproj +++ b/Code/Game/DanBiasGame/DanBiasGame.vcxproj @@ -71,7 +71,7 @@ $(SolutionDir)..\Bin\DLL\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D - C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; + $(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; $(SolutionDir)..\External\Include\;$(IncludePath) @@ -106,12 +106,12 @@ Disabled DANBIAS_CLIENT;DANBIAS_GAME_DLL_EXPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) true - $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) + $(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) Windows true - OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;%(AdditionalDependencies) + OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;%(AdditionalDependencies) OysterGraphics_$(PlatformShortName)D.dll;%(DelayLoadDLLs) @@ -181,9 +181,6 @@ {0ec83e64-230e-48ef-b08c-6ac9651b4f82} - - {b1195bb9-b3a5-47f0-906c-8dea384d1520} - diff --git a/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj b/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj index 5a4ebeb6..0e97666f 100644 --- a/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj +++ b/Code/Game/DanBiasLauncher/DanBiasLauncher.vcxproj @@ -110,8 +110,8 @@ Windows true - GameLogic_$(PlatformShortName)D.dll;OysterGraphics_$(PlatformShortName)D.dll;DanBiasServer_$(PlatformShortName)D.dll;DanBiasGame_$(PlatformShortName)D.dll;%(DelayLoadDLLs) - Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;DanBiasServer_$(PlatformShortName)D.lib;DanBiasGame_$(PlatformShortName)D.lib;%(AdditionalDependencies) + DanBiasServer_$(PlatformShortName)D.dll;DanBiasGame_$(PlatformShortName)D.dll;%(DelayLoadDLLs) + Input_$(PlatformShortName)D.lib;DanBiasServer_$(PlatformShortName)D.lib;DanBiasGame_$(PlatformShortName)D.lib;%(AdditionalDependencies) @@ -195,9 +195,6 @@ {52380daa-0f4a-4d97-8e57-98df39319caf} - - {b1195bb9-b3a5-47f0-906c-8dea384d1520} - diff --git a/Code/Game/DanBiasLauncher/Launcher.cpp b/Code/Game/DanBiasLauncher/Launcher.cpp index 28b89485..0440d973 100644 --- a/Code/Game/DanBiasLauncher/Launcher.cpp +++ b/Code/Game/DanBiasLauncher/Launcher.cpp @@ -4,8 +4,8 @@ #define NOMINMAX #include -#define DANBIAS_SERVER -//#define DANBIAS_CLIENT +//#define DANBIAS_SERVER +#define DANBIAS_CLIENT #if defined(DANBIAS_SERVER) diff --git a/Code/Game/GameLogic/AttatchmentMassDriver.cpp b/Code/Game/GameLogic/AttatchmentMassDriver.cpp index fcee6afb..18324149 100644 --- a/Code/Game/GameLogic/AttatchmentMassDriver.cpp +++ b/Code/Game/GameLogic/AttatchmentMassDriver.cpp @@ -26,13 +26,20 @@ AttatchmentMassDriver::~AttatchmentMassDriver(void) { } - -void AttatchmentMassDriver::ForcePush(const GameLogic::WEAPON_FIRE &fireInput) -{ - -} - +/******************************************************** +* Uses the attatchment and will from here switch case the different WEAPON_FIRE's that are to be used +********************************************************/ void AttatchmentMassDriver::UseAttatchment(const GameLogic::WEAPON_FIRE &fireInput) { - + ForcePush(fireInput); } + +/******************************************************** +* This is a specific functionallity of the weapon +********************************************************/ +void AttatchmentMassDriver::ForcePush(const GameLogic::WEAPON_FIRE &fireInput) +{ + +} + + diff --git a/Code/Game/GameLogic/GameLogic.vcxproj b/Code/Game/GameLogic/GameLogic.vcxproj index 33fd6c92..8f77f0d6 100644 --- a/Code/Game/GameLogic/GameLogic.vcxproj +++ b/Code/Game/GameLogic/GameLogic.vcxproj @@ -194,7 +194,6 @@ - diff --git a/Code/Game/GameLogic/Player.cpp b/Code/Game/GameLogic/Player.cpp index 01046143..9bc9d752 100644 --- a/Code/Game/GameLogic/Player.cpp +++ b/Code/Game/GameLogic/Player.cpp @@ -32,7 +32,7 @@ struct Player::PrivateData PLAYER_STATE playerState; ICustomBody *rigidBody; - + }myData; Player::Player() @@ -110,10 +110,10 @@ bool Player::IsIdle() return (myData->playerState == PLAYER_STATE_IDLE); } -//Oyster::Math::Float3 Player::GetPos() -//{ -// return myData->rigidBody->GetCenter(); -//} +Oyster::Math::Float3 Player::GetPos() +{ + return myData->rigidBody->GetCenter(); +} /******************************************************** * Respawns the player on a new chosen position diff --git a/Code/Game/GameLogic/Player.h b/Code/Game/GameLogic/Player.h index d4ce0a8d..20fc8de6 100644 --- a/Code/Game/GameLogic/Player.h +++ b/Code/Game/GameLogic/Player.h @@ -4,6 +4,7 @@ #ifndef PLAYER_H #define PLAYER_H #include "GameLogicStates.h" +#include "OysterMath.h" namespace GameLogic { @@ -23,7 +24,7 @@ namespace GameLogic bool IsJumping(); bool IsIdle(); - //Oyster::Math::Float3 GetPos(); + Oyster::Math::Float3 GetPos(); void Respawn(); private: diff --git a/Code/Game/GameLogic/Weapon.cpp b/Code/Game/GameLogic/Weapon.cpp index b7a47998..2a575039 100644 --- a/Code/Game/GameLogic/Weapon.cpp +++ b/Code/Game/GameLogic/Weapon.cpp @@ -14,7 +14,7 @@ struct Weapon::PrivateData ~PrivateData() { - + delete SelectedAttatchment; } WEAPON_STATE weaponState; @@ -38,7 +38,7 @@ Weapon::~Weapon(void) } /******************************************************** -* Uses the weapon based on the input given and the current state of the weapon +* Uses the weapon based on the input given and the current chosen attatchment ********************************************************/ void Weapon::UseWeapon(const WEAPON_FIRE &fireInput) { From f0181ad9f45af79d930c3f1a5df4ef64addc4b40 Mon Sep 17 00:00:00 2001 From: Linda Andersson Date: Tue, 10 Dec 2013 11:26:18 +0100 Subject: [PATCH 17/19] GL - fixed defines in headers - more structure for states --- Code/DanBias.sln | 12 +++ Code/Game/DanBiasGame/DanBiasGame.vcxproj | 16 ++-- Code/Game/DanBiasGame/DanBiasGame_Impl.cpp | 9 +- .../DanBiasGame/GameClientState/C_Object.h | 5 +- .../GameClientState/GameClientState.h | 5 +- .../DanBiasGame/GameClientState/GameState.cpp | 93 +++++++++++++++---- .../DanBiasGame/GameClientState/GameState.h | 17 +++- .../GameClientState/LobbyState.cpp | 74 ++++++++++++--- .../DanBiasGame/GameClientState/LobbyState.h | 17 +++- 9 files changed, 196 insertions(+), 52 deletions(-) diff --git a/Code/DanBias.sln b/Code/DanBias.sln index 32915f21..9ef6f418 100644 --- a/Code/DanBias.sln +++ b/Code/DanBias.sln @@ -57,6 +57,7 @@ Global {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.Build.0 = Release|x64 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.ActiveCfg = Debug|Win32 + {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.Build.0 = Debug|Win32 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.ActiveCfg = Debug|x64 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.Build.0 = Debug|x64 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -68,6 +69,7 @@ Global {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.Build.0 = Release|x64 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.ActiveCfg = Debug|Win32 + {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.Build.0 = Debug|Win32 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.ActiveCfg = Debug|x64 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.Build.0 = Debug|x64 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -79,6 +81,7 @@ Global {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Mixed Platforms.Build.0 = Release|x64 {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Win32.ActiveCfg = Debug|Win32 + {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|Win32.Build.0 = Debug|Win32 {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|x64.ActiveCfg = Debug|x64 {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Debug|x64.Build.0 = Debug|x64 {4285BD3F-3C6C-4670-B7AF-A29AFEF5F6A8}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -90,6 +93,7 @@ Global {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Mixed Platforms.Build.0 = Release|x64 {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Win32.ActiveCfg = Debug|Win32 + {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|Win32.Build.0 = Debug|Win32 {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|x64.ActiveCfg = Debug|x64 {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Debug|x64.Build.0 = Debug|x64 {34D6295A-00DD-4B1A-8258-97DA2818EC26}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -101,6 +105,7 @@ Global {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Mixed Platforms.Build.0 = Release|x64 {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Win32.ActiveCfg = Debug|Win32 + {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|Win32.Build.0 = Debug|Win32 {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|x64.ActiveCfg = Debug|x64 {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Debug|x64.Build.0 = Debug|x64 {35AEA3C0-E0A7-4E1E-88CD-514AA5A442B1}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -124,6 +129,7 @@ Global {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.Build.0 = Release|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.ActiveCfg = Debug|Win32 + {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.Build.0 = Debug|Win32 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.ActiveCfg = Debug|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.Build.0 = Debug|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Mixed Platforms.ActiveCfg = Release|x64 @@ -168,6 +174,7 @@ Global {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.ActiveCfg = Release|Win32 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.Build.0 = Release|Win32 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.ActiveCfg = Debug|Win32 + {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.Build.0 = Debug|Win32 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|x64.ActiveCfg = Debug|x64 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|x64.Build.0 = Debug|x64 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Mixed Platforms.ActiveCfg = Release|Win32 @@ -185,6 +192,7 @@ Global {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Win32.ActiveCfg = Debug|Win32 + {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Win32.Build.0 = Debug|Win32 {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|x64.ActiveCfg = Debug|x64 {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|x64.Build.0 = Debug|x64 {2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Mixed Platforms.ActiveCfg = Release|Win32 @@ -196,6 +204,7 @@ Global {B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Win32.ActiveCfg = Debug|Win32 + {B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Win32.Build.0 = Debug|Win32 {B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|x64.ActiveCfg = Debug|x64 {B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|x64.Build.0 = Debug|x64 {B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Mixed Platforms.ActiveCfg = Release|Win32 @@ -207,6 +216,7 @@ Global {52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|Win32.ActiveCfg = Debug|Win32 + {52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|Win32.Build.0 = Debug|Win32 {52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|x64.ActiveCfg = Debug|x64 {52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|x64.Build.0 = Debug|x64 {52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Release|Mixed Platforms.ActiveCfg = Release|Win32 @@ -218,6 +228,7 @@ Global {8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Win32.ActiveCfg = Debug|Win32 + {8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Win32.Build.0 = Debug|Win32 {8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|x64.ActiveCfg = Debug|x64 {8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|x64.Build.0 = Debug|x64 {8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Mixed Platforms.ActiveCfg = Release|Win32 @@ -240,6 +251,7 @@ Global {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Win32.Build.0 = Debug|Win32 {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|x64.ActiveCfg = Debug|x64 {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|x64.Build.0 = Debug|x64 {DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Mixed Platforms.ActiveCfg = Release|Win32 diff --git a/Code/Game/DanBiasGame/DanBiasGame.vcxproj b/Code/Game/DanBiasGame/DanBiasGame.vcxproj index 41093543..1784ca35 100644 --- a/Code/Game/DanBiasGame/DanBiasGame.vcxproj +++ b/Code/Game/DanBiasGame/DanBiasGame.vcxproj @@ -189,26 +189,26 @@ - + - + - - + + - - + + - - + + diff --git a/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp b/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp index 5698cb1d..535256f9 100644 --- a/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp +++ b/Code/Game/DanBiasGame/DanBiasGame_Impl.cpp @@ -32,6 +32,7 @@ namespace DanBias public: Client::GameClientState* gameClientState; + // gameClient; } data; #pragma endregion @@ -174,6 +175,7 @@ namespace DanBias HRESULT DanBiasGame::Update(float deltaTime) { inputObj->Update(); + DanBias::Client::GameClientState::ClientState state = DanBias::Client::GameClientState::ClientState_Same; state = m_data->gameClientState->Update(deltaTime, inputObj); @@ -195,7 +197,7 @@ namespace DanBias return E_FAIL; break; } - m_data->gameClientState->Init(); + m_data->gameClientState->Init(); // send game client } return S_OK; @@ -208,17 +210,12 @@ namespace DanBias { isPressed = 1; } - - - //Oyster::Graphics::API::NewFrame(Oyster::Math3D::Float4x4::null, Oyster::Math3D::Float4x4::null); wchar_t title[255]; swprintf(title, sizeof(title), L"| Pressing A: %d | \n", (int)(isPressed)); SetWindowText(g_hWnd, title); m_data->gameClientState->Render(); - - //Oyster::Graphics::API::EndFrame(); return S_OK; } diff --git a/Code/Game/DanBiasGame/GameClientState/C_Object.h b/Code/Game/DanBiasGame/GameClientState/C_Object.h index adb79f54..8bfecdb9 100644 --- a/Code/Game/DanBiasGame/GameClientState/C_Object.h +++ b/Code/Game/DanBiasGame/GameClientState/C_Object.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef DANBIAS_CLIENT_COBJECT_H +#define DANBIAS_CLIENT_COBJECT_H #include "DllInterfaces/GFXAPI.h" namespace DanBias { @@ -24,4 +25,4 @@ public: virtual void Render() = 0; virtual void Release() = 0; };};}; - +#endif diff --git a/Code/Game/DanBiasGame/GameClientState/GameClientState.h b/Code/Game/DanBiasGame/GameClientState/GameClientState.h index 3df91311..5277996d 100644 --- a/Code/Game/DanBiasGame/GameClientState/GameClientState.h +++ b/Code/Game/DanBiasGame/GameClientState/GameClientState.h @@ -1,4 +1,6 @@ -#pragma once +#ifndef DANBIAS_CLIENT_GAMECLIENTSTATE_H +#define DANBIAS_CLIENT_GAMECLIENTSTATE_H + #define NOMINMAX #include "L_inputClass.h" @@ -27,3 +29,4 @@ public: }; }; }; +#endif \ No newline at end of file diff --git a/Code/Game/DanBiasGame/GameClientState/GameState.cpp b/Code/Game/DanBiasGame/GameClientState/GameState.cpp index 1b5926b0..fb81e23a 100644 --- a/Code/Game/DanBiasGame/GameClientState/GameState.cpp +++ b/Code/Game/DanBiasGame/GameClientState/GameState.cpp @@ -1,6 +1,8 @@ #include "GameState.h" #include "DllInterfaces/GFXAPI.h" -#include "GameState/C_Player.h" +#include "Obj/C_Player.h" +#include "Obj/C_DynamicObj.h" + using namespace DanBias::Client; struct GameState::myData @@ -8,7 +10,9 @@ struct GameState::myData myData(){} Oyster::Math3D::Float4x4 view; Oyster::Math3D::Float4x4 proj; - C_Object* player; + C_Object* object[3]; + int modelCount; + gameStateState state; }privData; GameState::GameState(void) @@ -22,47 +26,100 @@ GameState::~GameState(void) } bool GameState::Init() { + // load models + privData = new myData(); + privData->state = gameStateState_loading; + privData->state = LoadGame(); + return true; +} +GameState::gameStateState GameState::LoadGame() +{ + LoadModels(L"map"); + InitCamera(Oyster::Math::Float3(0,0,5.4f)); + return gameStateState_playing; +} +bool GameState::LoadModels(std::wstring mapFile) +{ + // open file + // read file + // init models + privData->modelCount = 2; + ModelInitData modelData; modelData.world = Oyster::Math3D::Float4x4::identity; modelData.visible = true; modelData.modelPath = L"worldDummy"; // load models - privData = new myData(); - privData->player = new C_Player; - privData->player->Init(modelData); + privData->object[0] = new C_Player(); + privData->object[0]->Init(modelData); - privData->proj = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/2,1024.0f/768.0f,.1f,1000); - Oyster::Graphics::API::SetProjection(privData->proj); - - privData->view = Oyster::Math3D::OrientationMatrix_LookAtDirection(Oyster::Math::Float3(0,0,-1),Oyster::Math::Float3(0,1,0),Oyster::Math::Float3(0,0,5.4f)); - privData->view = Oyster::Math3D::InverseOrientationMatrix(privData->view); + Oyster::Math3D::Float4x4 translate = Oyster::Math3D::TranslationMatrix(Oyster::Math::Float3(2,2,2)); + modelData.world = modelData.world * translate; + modelData.modelPath = L"crate"; + privData->object[1] = new C_DynamicObj(); + privData->object[1]->Init(modelData); return true; } +bool GameState::InitCamera(Oyster::Math::Float3 startPos) +{ + privData->proj = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/2,1024.0f/768.0f,.1f,1000); + //privData->proj = Oyster::Math3D::ProjectionMatrix_Orthographic(1024, 768, 1, 1000); + Oyster::Graphics::API::SetProjection(privData->proj); + + privData->view = Oyster::Math3D::OrientationMatrix_LookAtDirection(Oyster::Math::Float3(0,0,-1),Oyster::Math::Float3(0,1,0),startPos); + privData->view = Oyster::Math3D::InverseOrientationMatrix(privData->view); + return true; +} + GameClientState::ClientState GameState::Update(float deltaTime, InputClass* KeyInput) { - if(KeyInput->IsKeyPressed(DIK_L)) + switch (privData->state) + { + case gameStateState_loading: + // load map + // wait for all players + LoadGame(); + privData->state = gameStateState_playing; + break; + case gameStateState_playing: + // read server data + // update objects + if(KeyInput->IsKeyPressed(DIK_L)) + privData->state = GameState::gameStateState_end; + break; + case gameStateState_end: return ClientState_Lobby; - + break; + default: + break; + } + // send key input to server. return ClientState_Same; } bool GameState::Render() { - Oyster::Graphics::API::SetView(privData->view); - Oyster::Graphics::API::SetProjection( privData->proj); + Oyster::Graphics::API::SetProjection(privData->proj); Oyster::Graphics::API::NewFrame(); - privData->player->Render(); + for (int i = 0; i < privData->modelCount; i++) + { + privData->object[i]->Render(); + } Oyster::Graphics::API::EndFrame(); return true; } bool GameState::Release() { - privData->player->Release(); - delete privData->player; - privData->player = NULL; + for (int i = 0; i < privData->modelCount; i++) + { + privData->object[i]->Release(); + delete privData->object[i]; + privData->object[i] = NULL; + } + delete privData; privData = NULL; return true; diff --git a/Code/Game/DanBiasGame/GameClientState/GameState.h b/Code/Game/DanBiasGame/GameClientState/GameState.h index 315dd6e8..5ae6aa49 100644 --- a/Code/Game/DanBiasGame/GameClientState/GameState.h +++ b/Code/Game/DanBiasGame/GameClientState/GameState.h @@ -1,12 +1,22 @@ -#pragma once +#ifndef DANBIAS_CLIENT_GAMESTATE_H +#define DANBIAS_CLIENT_GAMESTATE_H #include "GameClientState.h" +#include "OysterMath.h" +#include namespace DanBias { namespace Client { class GameState : public GameClientState { + enum gameStateState + { + gameStateState_loading, + gameStateState_playing, + gameStateState_end, + }; private: + struct myData; myData* privData; public: @@ -14,8 +24,13 @@ public: ~GameState(void); bool Init(); GameClientState::ClientState Update(float deltaTime, InputClass* KeyInput); + bool LoadModels(std::wstring mapFile); + bool InitCamera(Oyster::Math::Float3 startPos); + gameStateState LoadGame(); + bool Render(); bool Release(); }; }; }; +#endif \ No newline at end of file diff --git a/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp b/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp index 5e956176..b107883f 100644 --- a/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp +++ b/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp @@ -1,8 +1,10 @@ #include "LobbyState.h" #include "DllInterfaces/GFXAPI.h" #include "OysterMath.h" -#include "GameState/C_Player.h" -#include "GameState/C_StaticObj.h" +#include "Obj/C_Player.h" +#include "Obj/C_StaticObj.h" +#include "Obj/C_DynamicObj.h" + using namespace DanBias::Client; struct LobbyState::myData @@ -10,44 +12,74 @@ struct LobbyState::myData myData(){} Oyster::Math3D::Float4x4 view; Oyster::Math3D::Float4x4 proj; - C_Object* object; + C_Object* object[2]; + int modelCount; + // UI object + // game client* }privData; - LobbyState::LobbyState(void) { } - LobbyState::~LobbyState(void) { } + bool LobbyState::Init() { + privData = new myData(); + + // load models + LoadModels(L"UImodels.txt"); + InitCamera(Oyster::Math::Float3(0,0,5.4f)); + return true; +} +bool LobbyState::LoadModels(std::wstring file) +{ + // open file + // read file + // init models + privData->modelCount = 2; + ModelInitData modelData; modelData.world = Oyster::Math3D::Float4x4::identity; modelData.visible = true; modelData.modelPath = L"crate"; // load models - privData = new myData(); - privData->object = new C_StaticObj(); + privData->object[0] = new C_StaticObj(); + privData->object[0]->Init(modelData); - privData->object->Init(modelData); + Oyster::Math3D::Float4x4 translate = Oyster::Math3D::TranslationMatrix(Oyster::Math::Float3(2,2,2)); + modelData.world = modelData.world * translate; + privData->object[1] = new C_DynamicObj(); + privData->object[1]->Init(modelData); + return true; +} + +bool LobbyState::InitCamera(Oyster::Math::Float3 startPos) +{ privData->proj = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/2,1024.0f/768.0f,.1f,1000); //privData->proj = Oyster::Math3D::ProjectionMatrix_Orthographic(1024, 768, 1, 1000); Oyster::Graphics::API::SetProjection(privData->proj); - privData->view = Oyster::Math3D::OrientationMatrix_LookAtDirection(Oyster::Math::Float3(0,0,-1),Oyster::Math::Float3(0,1,0),Oyster::Math::Float3(0,0,5.4f)); + privData->view = Oyster::Math3D::OrientationMatrix_LookAtDirection(Oyster::Math::Float3(0,0,-1),Oyster::Math::Float3(0,1,0),startPos); privData->view = Oyster::Math3D::InverseOrientationMatrix(privData->view); - return true; } GameClientState::ClientState LobbyState::Update(float deltaTime, InputClass* KeyInput) { + // picking + // mouse events + // different menus + // play sounds + // update animation + // send data to server + // check data from server if( KeyInput->IsKeyPressed(DIK_G)) return ClientState_Game; @@ -58,17 +90,31 @@ bool LobbyState::Render() Oyster::Graphics::API::SetView(privData->view); Oyster::Graphics::API::SetProjection( privData->proj); + + Oyster::Graphics::API::NewFrame(); // render objects - privData->object->Render(); + for (int i = 0; i < privData->modelCount; i++) + { + privData->object[i]->Render(); + } + + // render effects + + // render lights + Oyster::Graphics::API::EndFrame(); return true; } bool LobbyState::Release() { - privData->object->Release(); - delete privData->object; - privData->object = NULL; + for (int i = 0; i < privData->modelCount; i++) + { + privData->object[i]->Release(); + delete privData->object[i]; + privData->object[i] = NULL; + } + delete privData; privData = NULL; return true; diff --git a/Code/Game/DanBiasGame/GameClientState/LobbyState.h b/Code/Game/DanBiasGame/GameClientState/LobbyState.h index cba06547..7498d448 100644 --- a/Code/Game/DanBiasGame/GameClientState/LobbyState.h +++ b/Code/Game/DanBiasGame/GameClientState/LobbyState.h @@ -1,7 +1,9 @@ -#ifndef DANBIAS_CLIENT_GAMECLIENTSTATE_H -#define DANBIAS_CLIENT_GAMECLIENTSTATE_H +#ifndef DANBIAS_CLIENT_LOBBYSTATE_H +#define DANBIAS_CLIENT_LOBBYSTATE_H #include "GameClientState.h" +#include "OysterMath.h" +#include namespace DanBias { namespace Client @@ -16,7 +18,18 @@ public: LobbyState(void); ~LobbyState(void); bool Init(); + bool LoadModels(std::wstring file); + bool InitCamera(Oyster::Math::Float3 startPos); ClientState Update(float deltaTime, InputClass* KeyInput); + // create session lobby + // join session lobby + // set name + // set rules + // set map + // ready + // chat + // kick + bool Render(); bool Release(); };};}; From 78f20e04a18033ae55e41521d2f6c1add988071e Mon Sep 17 00:00:00 2001 From: Linda Andersson Date: Tue, 10 Dec 2013 11:27:20 +0100 Subject: [PATCH 18/19] GL - moved object files to Obj --- .../GameState/C_DynamicObj.cpp | 42 ----------------- .../GameClientState/GameState/C_DynamicObj.h | 21 --------- .../GameClientState/GameState/C_Player.cpp | 46 ------------------- .../GameClientState/GameState/C_Player.h | 23 ---------- .../GameClientState/GameState/C_StaticObj.cpp | 45 ------------------ .../GameClientState/GameState/C_StaticObj.h | 21 --------- .../GameClientState/GameState/C_UIobject.cpp | 43 ----------------- .../GameClientState/GameState/C_UIobject.h | 20 -------- 8 files changed, 261 deletions(-) delete mode 100644 Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.cpp delete mode 100644 Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.h delete mode 100644 Code/Game/DanBiasGame/GameClientState/GameState/C_Player.cpp delete mode 100644 Code/Game/DanBiasGame/GameClientState/GameState/C_Player.h delete mode 100644 Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.cpp delete mode 100644 Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.h delete mode 100644 Code/Game/DanBiasGame/GameClientState/GameState/C_UIobject.cpp delete mode 100644 Code/Game/DanBiasGame/GameClientState/GameState/C_UIobject.h diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.cpp b/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.cpp deleted file mode 100644 index 686bbca9..00000000 --- a/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "C_DynamicObj.h" -#include "DllInterfaces/GFXAPI.h" -using namespace DanBias::Client; -struct C_DynamicObj::myData -{ - myData(){} - Oyster::Graphics::Model::Model *model; - // light - // sound - // effect -}privData; -C_DynamicObj::C_DynamicObj(void) -{ -} - - -C_DynamicObj::~C_DynamicObj(void) -{ - -} -void C_DynamicObj::Init(ModelInitData modelInit) -{ - // load models - privData = new myData(); - privData->model = Oyster::Graphics::API::CreateModel(modelInit.modelPath); - privData->model->WorldMatrix = modelInit.world; - privData->model->Visible = modelInit.visible; -} -void C_DynamicObj::setPos() -{ - -} - -void C_DynamicObj::Render() -{ - Oyster::Graphics::API::RenderModel(*(privData->model)); -} -void C_DynamicObj::Release() -{ - Oyster::Graphics::API::DeleteModel(privData->model); - delete privData; -} \ No newline at end of file diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.h b/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.h deleted file mode 100644 index 35a6e401..00000000 --- a/Code/Game/DanBiasGame/GameClientState/GameState/C_DynamicObj.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include "../C_Object.h" -namespace DanBias -{ - namespace Client - { -class C_DynamicObj : private C_Object -{ -private: - struct myData; - myData* privData; -public: - C_DynamicObj(void); - virtual ~C_DynamicObj(void); - void Init(ModelInitData modelInit); - void setPos(); - - void Render(); - void Release(); -};};}; - diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.cpp b/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.cpp deleted file mode 100644 index e47d98ef..00000000 --- a/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include "C_Player.h" -#include "DllInterfaces/GFXAPI.h" -using namespace DanBias::Client; - -struct C_Player::myData -{ - myData(){} - Oyster::Math3D::Float4x4 view; - Oyster::Math3D::Float4x4 proj; - Oyster::Graphics::Model::Model *model; -}privData; - -C_Player::C_Player(void) -{ -} - - -C_Player::~C_Player(void) -{ - -} - -void C_Player::Init(ModelInitData modelInit) -{ - // load models - privData = new myData(); - privData->model = Oyster::Graphics::API::CreateModel(modelInit.modelPath); - privData->model->WorldMatrix = modelInit.world; - privData->model->Visible = modelInit.visible; - - -} -void C_Player::setPos() -{ - -} - -void C_Player::Render() -{ - Oyster::Graphics::API::RenderModel(*(privData->model)); -} -void C_Player::Release() -{ - Oyster::Graphics::API::DeleteModel(privData->model); - delete privData; -} diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.h b/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.h deleted file mode 100644 index e9bdfa89..00000000 --- a/Code/Game/DanBiasGame/GameClientState/GameState/C_Player.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once -#include "../C_Object.h" -namespace DanBias -{ - namespace Client - { -class C_Player : public C_Object -{ -private: - struct myData; - myData* privData; - //Oyster::Graphics:: LIght -public: - C_Player(void); - ~C_Player(void); - void Init(ModelInitData modelInit); - void setPos(); - - void Render(); - void Release(); - -};};}; - diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.cpp b/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.cpp deleted file mode 100644 index 54c36c2a..00000000 --- a/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.cpp +++ /dev/null @@ -1,45 +0,0 @@ - -#include "C_StaticObj.h" -#include "DllInterfaces/GFXAPI.h" -using namespace DanBias::Client; - -struct C_StaticObj::myData -{ - myData(){} - Oyster::Graphics::Model::Model *model; - // light - // sound - // effect -}privData; -C_StaticObj::C_StaticObj(void) -{ -} - - -C_StaticObj::~C_StaticObj(void) -{ - -} -void C_StaticObj::Init(ModelInitData modelInit) -{ - // load models - privData = new myData(); - privData->model = Oyster::Graphics::API::CreateModel(modelInit.modelPath); - privData->model->WorldMatrix = modelInit.world; - privData->model->Visible = modelInit.visible; - -} -void C_StaticObj::setPos() -{ - -} - -void C_StaticObj::Render() -{ - Oyster::Graphics::API::RenderModel(*(privData->model)); -} -void C_StaticObj::Release() -{ - Oyster::Graphics::API::DeleteModel(privData->model); - delete privData; -} \ No newline at end of file diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.h b/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.h deleted file mode 100644 index 9da24351..00000000 --- a/Code/Game/DanBiasGame/GameClientState/GameState/C_StaticObj.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include "../C_Object.h" -namespace DanBias -{ - namespace Client - { -class C_StaticObj : public C_Object -{ -private: - struct myData; - myData* privData; -public: - C_StaticObj(void); - virtual ~C_StaticObj(void); - void Init(ModelInitData modelInit); - void setPos(); - - void Render(); - void Release(); -};};}; - diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_UIobject.cpp b/Code/Game/DanBiasGame/GameClientState/GameState/C_UIobject.cpp deleted file mode 100644 index b07ec6fa..00000000 --- a/Code/Game/DanBiasGame/GameClientState/GameState/C_UIobject.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "C_UIobject.h" -#include "DllInterfaces/GFXAPI.h" -using namespace DanBias::Client; - -struct C_UIobject::myData -{ - myData(){} - Oyster::Math3D::Float4x4 view; - Oyster::Math3D::Float4x4 proj; - Oyster::Graphics::Model::Model *model; -}privData; - -C_UIobject::C_UIobject(void) -{ -} - - -C_UIobject::~C_UIobject(void) -{ -} -void C_UIobject::Init(ModelInitData modelInit) -{ - // load models - privData = new myData(); - privData->model = Oyster::Graphics::API::CreateModel(modelInit.modelPath); - privData->model->WorldMatrix = modelInit.world; - privData->model->Visible = modelInit.visible; - -} -void C_UIobject::setPos() -{ - -} - -void C_UIobject::Render() -{ - Oyster::Graphics::API::RenderModel(*(privData->model)); -} -void C_UIobject::Release() -{ - Oyster::Graphics::API::DeleteModel(privData->model); - delete privData; -} \ No newline at end of file diff --git a/Code/Game/DanBiasGame/GameClientState/GameState/C_UIobject.h b/Code/Game/DanBiasGame/GameClientState/GameState/C_UIobject.h deleted file mode 100644 index 6052a414..00000000 --- a/Code/Game/DanBiasGame/GameClientState/GameState/C_UIobject.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once -#include "../C_Object.h" -namespace DanBias -{ - namespace Client - { - class C_UIobject : public C_Object - { - private: - struct myData; - myData* privData; - public: - C_UIobject(void); - virtual ~C_UIobject(void); - void Init(ModelInitData modelInit); - void setPos(); - - void Render(); - void Release(); - };};}; \ No newline at end of file From eb0b5ec0eec7b7415e2fea736ce3bcc6a5af7b7e Mon Sep 17 00:00:00 2001 From: dean11 Date: Tue, 10 Dec 2013 13:38:25 +0100 Subject: [PATCH 19/19] Network - Removing old gamelogic stuff before replacing them with new stuff --- Code/DanBiasGame/DanBiasGame.vcxproj | 193 -------------- Code/DanBiasGame/DanBiasMaincpp.cpp | 316 ----------------------- Code/GameLogic/Camera.cpp | 185 ------------- Code/GameLogic/Camera.h | 63 ----- Code/GameLogic/CollisionManager.cpp | 50 ---- Code/GameLogic/CollisionManager.h | 27 -- Code/GameLogic/DynamicObject.cpp | 20 -- Code/GameLogic/DynamicObject.h | 28 -- Code/GameLogic/Game.cpp | 68 ----- Code/GameLogic/Game.h | 28 -- Code/GameLogic/GameLogic.vcxproj | 210 --------------- Code/GameLogic/GameLogic.vcxproj.filters | 96 ------- Code/GameLogic/GameMode.cpp | 15 -- Code/GameLogic/GameMode.h | 22 -- Code/GameLogic/IGame.cpp | 43 --- Code/GameLogic/IGame.h | 47 ---- Code/GameLogic/Level.cpp | 12 - Code/GameLogic/Level.h | 37 --- Code/GameLogic/Object.cpp | 47 ---- Code/GameLogic/Object.h | 49 ---- Code/GameLogic/Player.cpp | 55 ---- Code/GameLogic/Player.h | 37 --- Code/GameLogic/RefManager.cpp | 47 ---- Code/GameLogic/RefManager.h | 37 --- Code/GameLogic/StaticObject.cpp | 12 - Code/GameLogic/StaticObject.h | 25 -- Code/GameLogic/TestGLMain.cpp | 304 ---------------------- Code/GameLogic/Weapon.cpp | 12 - Code/GameLogic/Weapon.h | 26 -- 29 files changed, 2111 deletions(-) delete mode 100644 Code/DanBiasGame/DanBiasGame.vcxproj delete mode 100644 Code/DanBiasGame/DanBiasMaincpp.cpp delete mode 100644 Code/GameLogic/Camera.cpp delete mode 100644 Code/GameLogic/Camera.h delete mode 100644 Code/GameLogic/CollisionManager.cpp delete mode 100644 Code/GameLogic/CollisionManager.h delete mode 100644 Code/GameLogic/DynamicObject.cpp delete mode 100644 Code/GameLogic/DynamicObject.h delete mode 100644 Code/GameLogic/Game.cpp delete mode 100644 Code/GameLogic/Game.h delete mode 100644 Code/GameLogic/GameLogic.vcxproj delete mode 100644 Code/GameLogic/GameLogic.vcxproj.filters delete mode 100644 Code/GameLogic/GameMode.cpp delete mode 100644 Code/GameLogic/GameMode.h delete mode 100644 Code/GameLogic/IGame.cpp delete mode 100644 Code/GameLogic/IGame.h delete mode 100644 Code/GameLogic/Level.cpp delete mode 100644 Code/GameLogic/Level.h delete mode 100644 Code/GameLogic/Object.cpp delete mode 100644 Code/GameLogic/Object.h delete mode 100644 Code/GameLogic/Player.cpp delete mode 100644 Code/GameLogic/Player.h delete mode 100644 Code/GameLogic/RefManager.cpp delete mode 100644 Code/GameLogic/RefManager.h delete mode 100644 Code/GameLogic/StaticObject.cpp delete mode 100644 Code/GameLogic/StaticObject.h delete mode 100644 Code/GameLogic/TestGLMain.cpp delete mode 100644 Code/GameLogic/Weapon.cpp delete mode 100644 Code/GameLogic/Weapon.h diff --git a/Code/DanBiasGame/DanBiasGame.vcxproj b/Code/DanBiasGame/DanBiasGame.vcxproj deleted file mode 100644 index 88181e55..00000000 --- a/Code/DanBiasGame/DanBiasGame.vcxproj +++ /dev/null @@ -1,193 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {2A1BC987-AF42-4500-802D-89CD32FC1309} - Win32Proj - DanBiasGame - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(SolutionDir)..\Bin\Executable\ - $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ - $(ProjectName)_$(PlatformShortName)D - C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; - - - true - $(SolutionDir)..\Bin\Executable\ - $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ - $(ProjectName)_$(PlatformShortName)D - C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; - - - false - $(SolutionDir)..\Bin\Executable\ - $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ - $(ProjectName)_$(PlatformShortName) - C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; - - - false - $(SolutionDir)..\Bin\Executable\ - $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ - $(ProjectName)_$(PlatformShortName) - C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL; - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) - - - Windows - true - OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;%(AdditionalDependencies) - OysterGraphics_$(PlatformShortName)D.dll;GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs) - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) - - - Windows - true - OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;%(AdditionalDependencies) - OysterGraphics_$(PlatformShortName)D.dll;GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs) - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) - - - Windows - true - true - true - OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;%(AdditionalDependencies) - OysterGraphics_$(PlatformShortName)D.dll;GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs) - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories) - - - Windows - true - true - true - OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;%(AdditionalDependencies) - OysterGraphics_$(PlatformShortName)D.dll;GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs) - - - - - {b1195bb9-b3a5-47f0-906c-8dea384d1520} - - - {7e3990d2-3d94-465c-b58d-64a74b3ecf9b} - - - {f10cbc03-9809-4cba-95d8-327c287b18ee} - - - {4285bd3f-3c6c-4670-b7af-a29afef5f6a8} - - - - - - - - - \ No newline at end of file diff --git a/Code/DanBiasGame/DanBiasMaincpp.cpp b/Code/DanBiasGame/DanBiasMaincpp.cpp deleted file mode 100644 index 23c1a119..00000000 --- a/Code/DanBiasGame/DanBiasMaincpp.cpp +++ /dev/null @@ -1,316 +0,0 @@ -//-------------------------------------------------------------------------------------- -// File: TemplateMain.cpp -// -// BTH-D3D-Template -// -// Copyright (c) Stefan Petersson 2011. All rights reserved. -//-------------------------------------------------------------------------------------- -#define NOMINMAX -#include - -#include "DllInterfaces/GFXAPI.h" -#include "IGame.h" - -#include "L_inputClass.h" - -// debug window include -#include -#include -#include -#include - - - - -//-------------------------------------------------------------------------------------- -// Global Variables -//-------------------------------------------------------------------------------------- -HINSTANCE g_hInst = NULL; -HWND g_hWnd = NULL; - -GameLogic::IGame* game; -InputClass* inputObj; - - -//-------------------------------------------------------------------------------------- -// Forward declarations -//-------------------------------------------------------------------------------------- -HRESULT InitWindow( HINSTANCE hInstance, int nCmdShow ); -LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); -HRESULT Render(float deltaTime); -HRESULT Update(float deltaTime); -HRESULT InitDirect3D(); -HRESULT InitGame(); -HRESULT CleanUp(); - - - -//-------------------------------------------------------------------------------------- -// Entry point to the program. Initializes everything and goes into a message processing -// loop. Idle time is used to render the scene. -//-------------------------------------------------------------------------------------- - -void SetStdOutToNewConsole() -{ - // allocate a console for this app - AllocConsole(); - - // redirect unbuffered STDOUT to the console - HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE); - int fileDescriptor = _open_osfhandle((intptr_t)consoleHandle, _O_TEXT); - FILE *fp = _fdopen( fileDescriptor, "w" ); - *stdout = *fp; - setvbuf( stdout, NULL, _IONBF, 0 ); - - // give the console window a nicer title - - SetConsoleTitle(L"Debug Output"); - - // give the console window a bigger buffer size - CONSOLE_SCREEN_BUFFER_INFO csbi; - if ( GetConsoleScreenBufferInfo(consoleHandle, &csbi) ) - { - COORD bufferSize; - bufferSize.X = csbi.dwSize.X; - bufferSize.Y = 50; - SetConsoleScreenBufferSize(consoleHandle, bufferSize); - } -} - -int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow ) -{ - // for dynamic .dll loading - // path is relative to the .exe and .dll pos - // also change the VC directories - working dir is set to $(SolutionDir)..\Bin\Executable\Tester - // to fit with where the .obj files is - // linker/ input/ delayed load .dll - specify the .dll that should be loaded - - BOOL success = SetDllDirectory(L"..\\..\\DLL"); - if (success == 0) - { - return 0; - } - - if( FAILED( InitWindow( hInstance, nCmdShow ) ) ) - return 0; - - if( FAILED( InitDirect3D() ) ) - return 0; - - if( FAILED( InitGame() ) ) - return 0; - - __int64 cntsPerSec = 0; - QueryPerformanceFrequency((LARGE_INTEGER*)&cntsPerSec); - float secsPerCnt = 1.0f / (float)cntsPerSec; - - __int64 prevTimeStamp = 0; - QueryPerformanceCounter((LARGE_INTEGER*)&prevTimeStamp); - - //debug window - //SetStdOutToNewConsole(); - - // Main message loop - MSG msg = {0}; - while(WM_QUIT != msg.message) - { - if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE) ) - { - TranslateMessage( &msg ); - DispatchMessage( &msg ); - } - else - { - __int64 currTimeStamp = 0; - QueryPerformanceCounter((LARGE_INTEGER*)&currTimeStamp); - float dt = (currTimeStamp - prevTimeStamp) * secsPerCnt; - - //render - Update(dt); - Render(dt); - - prevTimeStamp = currTimeStamp; - } - } - CleanUp(); - return (int) msg.wParam; -} - -//-------------------------------------------------------------------------------------- -// Register class and create window -//-------------------------------------------------------------------------------------- -HRESULT InitWindow( HINSTANCE hInstance, int nCmdShow ) -{ - // Register class - WNDCLASSEX wcex; - wcex.cbSize = sizeof(WNDCLASSEX); - wcex.style = CS_HREDRAW | CS_VREDRAW; - wcex.lpfnWndProc = WndProc; - wcex.cbClsExtra = 0; - wcex.cbWndExtra = 0; - wcex.hInstance = hInstance; - wcex.hIcon = 0; - wcex.hCursor = LoadCursor(NULL, IDC_ARROW); - wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); - wcex.lpszMenuName = NULL; - wcex.lpszClassName = L"BTH_D3D_Template"; - wcex.hIconSm = 0; - if( !RegisterClassEx(&wcex) ) - return E_FAIL; - - // Adjust and create window - g_hInst = hInstance; - RECT rc = { 0, 0, 1024, 768 }; - AdjustWindowRect( &rc, WS_OVERLAPPEDWINDOW, FALSE ); - - if(!(g_hWnd = CreateWindow( - L"BTH_D3D_Template", - L"BTH - Direct3D 11.0 Template", - WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, - CW_USEDEFAULT, - rc.right - rc.left, - rc.bottom - rc.top, - NULL, - NULL, - hInstance, - NULL))) - { - return E_FAIL; - } - - ShowWindow( g_hWnd, nCmdShow ); - - return S_OK; -} - -//-------------------------------------------------------------------------------------- -// Create Direct3D with Oyster Graphics -//-------------------------------------------------------------------------------------- -HRESULT InitDirect3D() -{ - if(Oyster::Graphics::API::Init(g_hWnd, false, false, Oyster::Math::Float2( 1024, 768)) != Oyster::Graphics::API::Sucsess) - return E_FAIL; - return S_OK; -} - -//-------------------------------------------------------------------------------------- -// Init the input and the game -//------------------------------------------------------------------------------------- -HRESULT InitGame() -{ - inputObj = new InputClass; - if(!inputObj->Initialize(g_hInst, g_hWnd, 1024, 768)) - { - MessageBox(0, L"Could not initialize the input object.", L"Error", MB_OK); - return false; - } - game = new GameLogic::IGame(); - game->Init(); - game->StartGame(); - - return S_OK; -} - -HRESULT Update(float deltaTime) -{ - inputObj->Update(); - GameLogic::keyInput key = GameLogic::keyInput_none; - - if(inputObj->IsKeyPressed(DIK_W)) - { - key = GameLogic::keyInput_W; - } - else if(inputObj->IsKeyPressed(DIK_A)) - { - key = GameLogic::keyInput_A; - } - else if(inputObj->IsKeyPressed(DIK_S)) - { - key = GameLogic::keyInput_S; - } - else if(inputObj->IsKeyPressed(DIK_D)) - { - key = GameLogic::keyInput_D; - } - - float pitch = 0; - float yaw = 0; - - //if(inputObj->IsMousePressed()) - //{ - pitch = inputObj->GetPitch(); - yaw = inputObj->GetYaw(); - //} - - game->Update(key, pitch, yaw); - - - return S_OK; -} - -HRESULT Render(float deltaTime) -{ - int isPressed = 0; - if(inputObj->IsKeyPressed(DIK_A)) - { - isPressed = 1; - //std::cout<<"test"; - } - - game->Render(); - wchar_t title[255]; - swprintf(title, sizeof(title), L"| Pressing A: %d | \n", (int)(isPressed)); - SetWindowText(g_hWnd, title); - - Oyster::Graphics::API::EndFrame(); - - return S_OK; -} - -HRESULT CleanUp() -{ - - if(game) - { - delete game; - game = NULL; - } - return S_OK; -} -//-------------------------------------------------------------------------------------- -// Called every time the application receives a message -//-------------------------------------------------------------------------------------- -LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) -{ - PAINTSTRUCT ps; - HDC hdc; - - switch (message) - { - case WM_PAINT: - hdc = BeginPaint(hWnd, &ps); - EndPaint(hWnd, &ps); - break; - - case WM_DESTROY: - PostQuitMessage(0); - break; - - case WM_KEYDOWN: - - switch(wParam) - { - case VK_ESCAPE: - PostQuitMessage(0); - break; - } - break; - - default: - return DefWindowProc(hWnd, message, wParam, lParam); - } - - return 0; -} - diff --git a/Code/GameLogic/Camera.cpp b/Code/GameLogic/Camera.cpp deleted file mode 100644 index a969ced5..00000000 --- a/Code/GameLogic/Camera.cpp +++ /dev/null @@ -1,185 +0,0 @@ -#include "Camera.h" - -Camera::Camera() -{ - this->m_position = Oyster::Math::Float3(0, 50, 0); - this->mRight = Oyster::Math::Float3(1, 0, 0); - this->mUp = Oyster::Math::Float3(0, 1, 0); - this->mLook = Oyster::Math::Float3(0, 0, 1); -} - -Camera::~Camera() -{ -} - -void Camera::SetPosition(const Oyster::Math::Float3& v) -{ - this->m_position = v; -} - -Oyster::Math::Float3 Camera::GetPosition()const -{ - return this->m_position; -} - -Oyster::Math::Float3 Camera::GetRight()const -{ - return this->mRight; -} - -Oyster::Math::Float3 Camera::GetUp()const -{ - return this->mUp; -} - -Oyster::Math::Float3 Camera::GetLook()const -{ - return this->mLook; -} - -float Camera::GetNearZ()const -{ - return this->mNearZ; -} - -float Camera::GetFarZ()const -{ - return this->mFarZ; -} - -float Camera::GetAspect()const -{ - return this->mAspect; -} - -Oyster::Math::Float3 Camera::CrossMatrix(const Oyster::Math::Float3& vector, const Oyster::Math::Float4x4& matrix) -{ - Oyster::Math::Float3 vec; - vec.x = matrix.m11*vector.x + matrix.m12*vector.y + matrix.m13*vector.z; - vec.y = matrix.m21*vector.x + matrix.m22*vector.y + matrix.m23*vector.z; - vec.z = matrix.m31*vector.x + matrix.m32*vector.y + matrix.m33*vector.z; - return vec; -} - -void Camera::SetLens(float fovY, float aspect, float zn, float zf) -{ - this->mFovY = fovY; - this->mAspect = aspect; - this->mNearZ = zn; - this->mFarZ = zf; - - float yScale = tan((Oyster::Math::pi*0.5f) - (mFovY*0.5f)); - float xScale = yScale/this->mAspect; - - mProj = Oyster::Math::Float4x4(xScale, 0, 0, 0, - 0, yScale, 0, 0, - 0, 0, zf/(zf-zn), 1, - 0, 0, -zn*zf/(zf-zn), 0); - mProj.Transpose(); -} - -void Camera::LookAt(Oyster::Math::Float3 pos, Oyster::Math::Float3 target, Oyster::Math::Float3 worldUp) -{ - Oyster::Math::Float3 L; - - L = target - pos; - L.Normalize(); - - Oyster::Math::Float3 R; - R = worldUp.Cross(L); - R.Normalize(); - - Oyster::Math::Float3 U; - U = L.Cross(R); - - this->m_position = pos; - this->mLook = L; - this->mRight = R; - this->mUp = U; -} - -Oyster::Math::Float4x4 Camera::View()const -{ - return this->mView; -} - -Oyster::Math::Float4x4 Camera::Proj()const -{ - return this->mProj; -} - -Oyster::Math::Float4x4 Camera::ViewsProj()const -{ - Oyster::Math::Float4x4 M; - M = mView * mProj; - return M; -} - -void Camera::Walk(float dist) -{ - this->m_position += dist*this->mLook; -} - -void Camera::Strafe(float dist) -{ - this->m_position += dist*this->mRight; -} - -void Camera::Pitch(float angle) -{ - float radians = angle * 0.0174532925f; - - Oyster::Math::Float4x4 R; - - Oyster::Math3D::RotationMatrix(radians,-mRight,R); - this->mUp = CrossMatrix(this->mUp, R); - this->mLook = CrossMatrix(this->mLook, R); -} - -void Camera::Yaw(float angle) -{ - float radians = angle * 0.0174532925f; - - Oyster::Math::Float4x4 R; - - Oyster::Math::Float3 up(0,1,0); - Oyster::Math3D::RotationMatrix(radians,-up,R); - - this->mRight = CrossMatrix(this->mRight, R); - this->mUp = CrossMatrix(mUp, R); - this->mLook = CrossMatrix(this->mLook, R); -} - -void Camera::UpdateViewMatrix() -{ - mLook.Normalize(); - mUp = mLook.Cross(mRight); - mUp.Normalize(); - mRight = mUp.Cross(mLook); - - float x = -m_position.Dot(mRight); - float y = -m_position.Dot(mUp); - float z = -m_position.Dot(mLook); - - mView.m11 = mRight.x; - mView.m21 = mRight.y; - mView.m31 = mRight.z; - mView.m41 = x; - - mView.m12 = mUp.x; - mView.m22 = mUp.y; - mView.m32 = mUp.z; - mView.m42 = y; - - mView.m13 = mLook.x; - mView.m23 = mLook.y; - mView.m33 = mLook.z; - mView.m43 = z; - - mView.m14 = 0.0f; - mView.m24 = 0.0f; - mView.m34 = 0.0f; - mView.m44 = 1.0f; - - mView.Transpose(); -} \ No newline at end of file diff --git a/Code/GameLogic/Camera.h b/Code/GameLogic/Camera.h deleted file mode 100644 index deb9df62..00000000 --- a/Code/GameLogic/Camera.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef CAMERA__H -#define CAMERA__H - -#include "OysterMath.h" - -class Camera -{ -private: - - Oyster::Math::Float3 m_position; - Oyster::Math::Float3 mRight; - Oyster::Math::Float3 mUp; - Oyster::Math::Float3 mLook; - - - - float mNearZ; - float mFarZ; - float mAspect; - float mFovY; - - Oyster::Math::Float4x4 mView; - Oyster::Math::Float4x4 mProj; - -public: - Camera(); - virtual ~Camera(); - - void SetPosition(const Oyster::Math::Float3& v); - - Oyster::Math::Float3 GetPosition()const; - - Oyster::Math::Float3 GetRight()const; - Oyster::Math::Float3 GetUp()const; - Oyster::Math::Float3 GetLook()const; - - float GetNearZ()const; - float GetFarZ()const; - float GetAspect()const; - - Oyster::Math::Float3 CrossMatrix(const Oyster::Math::Float3& v, const Oyster::Math::Float4x4& m); - - void SetLens(float fovY, float aspect, float zn, float zf); - - void LookAt(Oyster::Math::Float3 pos, Oyster::Math::Float3 target, Oyster::Math::Float3 worldUp); - - void setLook(Oyster::Math::Float3 look) { mLook = look; } - void setUp(Oyster::Math::Float3 up) { mUp = up; } - void setRight(Oyster::Math::Float3 right) { mRight = right; } - - Oyster::Math::Float4x4 View()const; - Oyster::Math::Float4x4 Proj()const; - Oyster::Math::Float4x4 ViewsProj()const; - - void Walk(float dist); - void Strafe(float dist); - - void Pitch(float angle); - void Yaw(float angle); - - void UpdateViewMatrix(); -}; -#endif \ No newline at end of file diff --git a/Code/GameLogic/CollisionManager.cpp b/Code/GameLogic/CollisionManager.cpp deleted file mode 100644 index f7868b79..00000000 --- a/Code/GameLogic/CollisionManager.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "CollisionManager.h" - - - -namespace GameLogic -{ - - namespace CollisionManager - { - - void PlayerCollision(Oyster::Physics::ICustomBody &rigidBodyPlayer,Oyster::Physics::ICustomBody &obj) - { - Player *player = ((Player*)GameLogic::RefManager::getInstance()->GetMap(rigidBodyPlayer)); - Object *realObj = GameLogic::RefManager::getInstance()->GetMap(obj); - - 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; - } - } - } -} \ No newline at end of file diff --git a/Code/GameLogic/CollisionManager.h b/Code/GameLogic/CollisionManager.h deleted file mode 100644 index a650f595..00000000 --- a/Code/GameLogic/CollisionManager.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef COLLISIONMANAGER_H -#define COLLISIONMANAGER_H - -#include "Object.h" -#include "PhysicsAPI.h" -#include "RefManager.h" -#include "DynamicObject.h" -#include "Player.h" - -namespace GameLogic -{ - - namespace CollisionManager - { - //these are the main collision functions - void PlayerCollision(Oyster::Physics::ICustomBody &rigidBodyPlayer,Oyster::Physics::ICustomBody &obj); - void BoxCollision(Oyster::Physics::ICustomBody &rigidBodyBox, Oyster::Physics::ICustomBody &obj); - - //these are the specific collision case functions - void PlayerVBox(Player &player, DynamicObject &box); - void BoxVBox(DynamicObject &box1, DynamicObject &box2); - - }; - -} - -#endif \ No newline at end of file diff --git a/Code/GameLogic/DynamicObject.cpp b/Code/GameLogic/DynamicObject.cpp deleted file mode 100644 index 14e0518d..00000000 --- a/Code/GameLogic/DynamicObject.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "DynamicObject.h" - -using namespace GameLogic; -using namespace Oyster::Physics; -using namespace Utility::DynamicMemory; - -DynamicObject::DynamicObject(void) - :Object() -{ -} - - -DynamicObject::~DynamicObject(void) -{ -} - -void DynamicObject::Update() -{ - //update object -} \ No newline at end of file diff --git a/Code/GameLogic/DynamicObject.h b/Code/GameLogic/DynamicObject.h deleted file mode 100644 index 2d6ffdc8..00000000 --- a/Code/GameLogic/DynamicObject.h +++ /dev/null @@ -1,28 +0,0 @@ -////////////////////////////////////////////////// -//Created by Erik and Linda of the GameLogic team -////////////////////////////////////////////////// - - -#ifndef DYNAMICOBJECT_H -#define DYNAMICOBJECT_H - -#include "Object.h" - -namespace GameLogic -{ - - - class DynamicObject : public Object - { - - public: - DynamicObject(void); - ~DynamicObject(void); - - void Update(); - - }; - -} - -#endif \ No newline at end of file diff --git a/Code/GameLogic/Game.cpp b/Code/GameLogic/Game.cpp deleted file mode 100644 index b4095130..00000000 --- a/Code/GameLogic/Game.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include "Game.h" -using namespace GameLogic; - -Game::Game(void) -{ - player = NULL; - level = NULL; - camera = NULL; -} - - -Game::~Game(void) -{ - //SAFE_DELETE(player); - if(player) - { - delete player; - player = NULL; - } - if(camera) - { - delete camera; - camera = NULL; - } -} - -void Game::Init() -{ - player = new Player(); - camera = new Camera(); -} -void Game::StartGame() -{ - Oyster::Math::Float3 dir = Oyster::Math::Float3(0,0,-1); - Oyster::Math::Float3 up =Oyster::Math::Float3(0,1,0); - Oyster::Math::Float3 pos = Oyster::Math::Float3(0, 0, 100); - - camera->LookAt(pos, dir, up); - camera->SetLens(3.14f/2, 1024/768, 1, 1000); -} -void Game::Update(keyInput keyPressed, float pitch, float yaw) -{ - //player->Update(keyPressed); - camera->Yaw(yaw); - camera->Pitch(pitch); - if(keyPressed == keyInput_A) - { - camera->Strafe(-0.1); - } - if(keyPressed == keyInput_D) - { - camera->Strafe(0.1); - } - if(keyPressed == keyInput_S) - { - camera->Walk(-0.1); - } - if(keyPressed == keyInput_W) - { - camera->Walk(0.1); - } - camera->UpdateViewMatrix(); -} -void Game::Render() -{ - Oyster::Graphics::API::NewFrame(camera->View(), camera->Proj()); - player->Render(); -} \ No newline at end of file diff --git a/Code/GameLogic/Game.h b/Code/GameLogic/Game.h deleted file mode 100644 index 0a8a031a..00000000 --- a/Code/GameLogic/Game.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef GAME_H -#define GAME_H - -#include "Level.h" -#include "Player.h" -#include "IGame.h" -#include "Camera.h" - -namespace GameLogic -{ - class Game - { - public: - Game(); - ~Game(); - - void Init(); - void StartGame(); - void Update(keyInput keyPressed, float pitch, float yaw); - void Render(); - - private: - Level* level; - Player* player; - Camera* camera; - }; -} -#endif \ No newline at end of file diff --git a/Code/GameLogic/GameLogic.vcxproj b/Code/GameLogic/GameLogic.vcxproj deleted file mode 100644 index 236258d2..00000000 --- a/Code/GameLogic/GameLogic.vcxproj +++ /dev/null @@ -1,210 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {B1195BB9-B3A5-47F0-906C-8DEA384D1520} - GameLogic - - - - DynamicLibrary - true - v110 - Unicode - - - DynamicLibrary - true - v110 - Unicode - - - DynamicLibrary - false - v110 - true - Unicode - - - DynamicLibrary - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - $(SolutionDir)..\Bin\DLL\ - $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ - $(ProjectName)_$(PlatformShortName)D - $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath) - .dll - - - $(SolutionDir)..\Bin\DLL\ - $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ - $(ProjectName)_$(PlatformShortName) - $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath) - - - $(SolutionDir)..\Bin\DLL\ - $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ - $(ProjectName)_$(PlatformShortName)D - $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath) - - - $(SolutionDir)..\Bin\DLL\ - $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ - $(ProjectName)_$(PlatformShortName) - $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath) - - - - Level3 - Disabled - true - $(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories) - GAME_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions) - - - true - OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GamePhysics_$(PlatformShortName)D.lib;%(AdditionalDependencies) - - - - - Level3 - Disabled - true - $(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories) - GAME_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions) - - - true - OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GamePhysics_$(PlatformShortName)D.lib;%(AdditionalDependencies) - - - - - Level3 - MaxSpeed - true - true - true - $(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories) - GAME_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions) - - - true - true - true - OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GamePhysics_$(PlatformShortName).lib;%(AdditionalDependencies) - - - - - Level3 - MaxSpeed - true - true - true - $(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories) - GAME_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions) - - - true - true - true - OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GamePhysics_$(PlatformShortName).lib;%(AdditionalDependencies) - - - - - {104fa3e9-94d9-4e1d-a941-28a03bc8a095} - false - true - false - false - false - - - {7e3990d2-3d94-465c-b58d-64a74b3ecf9b} - - - {2ec4dded-8f75-4c86-a10b-e1e8eb29f3ee} - - - {0ec83e64-230e-48ef-b08c-6ac9651b4f82} - - - {f10cbc03-9809-4cba-95d8-327c287b18ee} - - - {4285bd3f-3c6c-4670-b7af-a29afef5f6a8} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Code/GameLogic/GameLogic.vcxproj.filters b/Code/GameLogic/GameLogic.vcxproj.filters deleted file mode 100644 index f2c5e978..00000000 --- a/Code/GameLogic/GameLogic.vcxproj.filters +++ /dev/null @@ -1,96 +0,0 @@ - - - - - {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 - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/Code/GameLogic/GameMode.cpp b/Code/GameLogic/GameMode.cpp deleted file mode 100644 index 0eddb7f9..00000000 --- a/Code/GameLogic/GameMode.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "GameMode.h" - -using namespace GameLogic; - - -GameMode::GameMode(void) -{ - -} - - -GameMode::~GameMode(void) -{ - -} diff --git a/Code/GameLogic/GameMode.h b/Code/GameLogic/GameMode.h deleted file mode 100644 index 42273946..00000000 --- a/Code/GameLogic/GameMode.h +++ /dev/null @@ -1,22 +0,0 @@ -////////////////////////////////////////////////// -//Created by Erik and Linda of the GameLogic team -////////////////////////////////////////////////// - - -#ifndef GAMEMODE_H -#define GAMEMODE_H - -namespace GameLogic -{ - - class GameMode - { - public: - GameMode(void); - ~GameMode(void); - private: - //variabels that control what game rules the level runs on - }; - -} -#endif \ No newline at end of file diff --git a/Code/GameLogic/IGame.cpp b/Code/GameLogic/IGame.cpp deleted file mode 100644 index dd07c9f8..00000000 --- a/Code/GameLogic/IGame.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "IGame.h" -#include "Game.h" -#include - -BOOL WINAPI DllMain( - _In_ HINSTANCE hinstDLL, - _In_ DWORD fdwReason, - _In_ LPVOID lpvReserved - ) -{ - return TRUE; -} -using namespace GameLogic; - -IGame::IGame() -{ - gameModule = new Game(); -} -IGame::~IGame() -{ - delete gameModule; -} - -void IGame::Init() -{ - gameModule->Init(); -} -void IGame::StartGame() -{ - gameModule->StartGame(); -} -void IGame::Update(keyInput keyPressed, float pitch, float yaw) -{ - gameModule->Update(keyPressed, pitch, yaw); -} -void IGame::Render() -{ - gameModule->Render(); -} -Game* IGame::getGameModule() -{ - return gameModule; -} \ No newline at end of file diff --git a/Code/GameLogic/IGame.h b/Code/GameLogic/IGame.h deleted file mode 100644 index 41b2e0d5..00000000 --- a/Code/GameLogic/IGame.h +++ /dev/null @@ -1,47 +0,0 @@ -////////////////////////////////////////////////// -//Created by Erik and Linda of the GameLogic team -////////////////////////////////////////////////// - -#ifndef IGAME_H -#define IGAME_H - -#if defined GAME_DLL_EXPORT -#define GAME_DLL_USAGE __declspec(dllexport) -#else -#define GAME_DLL_USAGE __declspec(dllimport) -#endif - -namespace GameLogic -{ - class Game; - - enum keyInput - { - keyInput_W, - keyInput_A, - keyInput_S, - keyInput_D, - keyInput_none - }; - - class GAME_DLL_USAGE IGame - { - private: - Game* gameModule; - public: - IGame(); - ~IGame(); - - - void Init(); - void StartGame(); - /************************************************************************/ - /* Get key input to update the player */ - /************************************************************************/ - void Update(keyInput keyPressed, float pitch, float yaw); - void Render(); - Game* getGameModule(); - private: - }; -} -#endif \ No newline at end of file diff --git a/Code/GameLogic/Level.cpp b/Code/GameLogic/Level.cpp deleted file mode 100644 index 32fbe2d5..00000000 --- a/Code/GameLogic/Level.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "Level.h" - -using namespace GameLogic; - -Level::Level(void) -{ -} - - -Level::~Level(void) -{ -} diff --git a/Code/GameLogic/Level.h b/Code/GameLogic/Level.h deleted file mode 100644 index b43f193d..00000000 --- a/Code/GameLogic/Level.h +++ /dev/null @@ -1,37 +0,0 @@ -////////////////////////////////////////////////// -//Created by Erik and Linda of the GameLogic team -////////////////////////////////////////////////// - - -#ifndef LEVEL_H -#define LEVEL_H - -#include "StaticObject.h" -#include "DynamicObject.h" -#include "GameMode.h" - -namespace GameLogic -{ - - class Level - { - - public: - Level(void); - ~Level(void); - - private: - StaticObject** staticObjects; - int nrOfStaticObjects; - - DynamicObject** dynamicObjects; - int nrOfDynamicObjects; - - GameMode* gameMode; - - - - }; - -} -#endif \ No newline at end of file diff --git a/Code/GameLogic/Object.cpp b/Code/GameLogic/Object.cpp deleted file mode 100644 index 33679058..00000000 --- a/Code/GameLogic/Object.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include "Object.h" -#include "OysterMath.h" -#include "DllInterfaces\GFXAPI.h" -#include "CollisionManager.h" - - -using namespace GameLogic; - -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"orca"); - - API::SimpleBodyDescription sbDesc; - //sbDesc.centerPosition = - - ICustomBody* temp = rigidBody = API::Instance().CreateRigidBody(sbDesc).Release(); - - GameLogic::RefManager::getInstance()->AddMapping(*rigidBody, *this); - -} - - -Object::~Object(void) -{ - - Oyster::Graphics::API::DeleteModel(model); - -} - -void Object::Render() -{ - this->rigidBody->GetOrientation(model->WorldMatrix); - Oyster::Graphics::API::RenderScene(model, 1); -} - -Object::OBJECT_TYPE Object::GetType() -{ - return this->type; -} diff --git a/Code/GameLogic/Object.h b/Code/GameLogic/Object.h deleted file mode 100644 index 767edb1f..00000000 --- a/Code/GameLogic/Object.h +++ /dev/null @@ -1,49 +0,0 @@ -////////////////////////////////////////////////// -//Created by Erik and Linda of the GameLogic team -////////////////////////////////////////////////// - - -#ifndef OBJECT_H -#define OBJECT_H - -#include "PhysicsAPI.h" -#include "DllInterfaces/GFXAPI.h" - -#include "Model/Model.h" -#include "Utilities.h" - - - -namespace GameLogic -{ - class Object - { - public: - - enum OBJECT_TYPE - { - OBJECT_TYPE_PLAYER, - OBJECT_TYPE_BOX, - }; - Object(void); - virtual ~Object(void); - - void Render(); - - OBJECT_TYPE GetType(); - - private: - OBJECT_TYPE type; - - protected: - //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; - - }; - -} - -#endif \ No newline at end of file diff --git a/Code/GameLogic/Player.cpp b/Code/GameLogic/Player.cpp deleted file mode 100644 index 93a83506..00000000 --- a/Code/GameLogic/Player.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "Player.h" -#include "OysterMath.h" - -using namespace GameLogic; -using namespace Oyster::Physics; - -Player::Player(void) - :Object() -{ - life = 100; -} -Player::~Player(void) -{ - delete this->rigidBody; -} - -void Player::Update(keyInput keyPressed) -{ - if(keyPressed != keyInput_none) - { - Move(keyPressed); - } -} - -void Player::Move(keyInput keyPressed) -{ - if(keyPressed == keyInput_A) - { - Oyster::Math::Float3 pos = this->rigidBody->GetCenter(); - pos.x -= 0.1; - rigidBody->SetCenter(pos); - } - if(keyPressed == keyInput_D) - { - Oyster::Math::Float3 pos = this->rigidBody->GetCenter(); - pos.x += 0.1; - rigidBody->SetCenter(pos); - } - if(keyPressed == keyInput_S) - { - Oyster::Math::Float3 pos = this->rigidBody->GetCenter(); - pos.y -= 0.1; - rigidBody->SetCenter(pos); - } - if(keyPressed == keyInput_W) - { - Oyster::Math::Float3 pos = this->rigidBody->GetCenter(); - pos.y += 0.1; - rigidBody->SetCenter(pos); - } -} -void Player::Shoot() -{ - -} diff --git a/Code/GameLogic/Player.h b/Code/GameLogic/Player.h deleted file mode 100644 index 7c4045e3..00000000 --- a/Code/GameLogic/Player.h +++ /dev/null @@ -1,37 +0,0 @@ -////////////////////////////////////////////////// -//Created by Erik and Linda of the GameLogic team -////////////////////////////////////////////////// - - -#ifndef PLAYER_H -#define PLAYER_H - -#include "Object.h" -#include "Weapon.h" -#include "IGame.h" - - -namespace GameLogic -{ - class Player : public Object - { - - public: - Player(void); - ~Player(void); - - /******************************************************** - * Update the position of the rigid body - * This will be done with physics later - ********************************************************/ - void Update(keyInput keyPressed); - - void Move(keyInput keyPressed); - void Shoot(); - - private: - int life; - Weapon *weapon; - }; -} -#endif \ No newline at end of file diff --git a/Code/GameLogic/RefManager.cpp b/Code/GameLogic/RefManager.cpp deleted file mode 100644 index a119898c..00000000 --- a/Code/GameLogic/RefManager.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include "RefManager.h" - -using namespace GameLogic; - -typedef std::pair mapData; - -RefManager* RefManager::instance = 0; - -RefManager::RefManager(void) -{ -} - - -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]; -} - -void RefManager::AddMapping(Oyster::Physics::ICustomBody &body, Object &obj) -{ - mapper.insert(mapData(&body,&obj)); -} - - diff --git a/Code/GameLogic/RefManager.h b/Code/GameLogic/RefManager.h deleted file mode 100644 index b5fd91d2..00000000 --- a/Code/GameLogic/RefManager.h +++ /dev/null @@ -1,37 +0,0 @@ -////////////////////////////////////////////////// -//Created by Erik and Linda of the GameLogic team -////////////////////////////////////////////////// - - -#ifndef REFMANAGER_H -#define REFMANAGER_H - -#include -#include "Object.h" -#include "PhysicsAPI.h" - -namespace GameLogic -{ - - class RefManager - { - public: - 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.cpp b/Code/GameLogic/StaticObject.cpp deleted file mode 100644 index 855ef645..00000000 --- a/Code/GameLogic/StaticObject.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "StaticObject.h" - -using namespace GameLogic; - -StaticObject::StaticObject(void) -{ -} - - -StaticObject::~StaticObject(void) -{ -} diff --git a/Code/GameLogic/StaticObject.h b/Code/GameLogic/StaticObject.h deleted file mode 100644 index 07d23311..00000000 --- a/Code/GameLogic/StaticObject.h +++ /dev/null @@ -1,25 +0,0 @@ -////////////////////////////////////////////////// -//Created by Erik and Linda of the GameLogic team -////////////////////////////////////////////////// - - -#ifndef STATICOBJECT_H -#define STATICOBJECT_H - -#include "Object.h" - -namespace GameLogic -{ - - class StaticObject : public Object - { - - public: - StaticObject(void); - ~StaticObject(void); - - }; - -} - -#endif \ No newline at end of file diff --git a/Code/GameLogic/TestGLMain.cpp b/Code/GameLogic/TestGLMain.cpp deleted file mode 100644 index 57392224..00000000 --- a/Code/GameLogic/TestGLMain.cpp +++ /dev/null @@ -1,304 +0,0 @@ -//-------------------------------------------------------------------------------------- -// File: TemplateMain.cpp -// -// BTH-D3D-Template -// -// Copyright (c) Stefan Petersson 2011. All rights reserved. -//-------------------------------------------------------------------------------------- - -////////////////////////////////////////////////////////////////////////// -// Test main function for game logic when .exe -// Doesn't run when Game logic is compiled as a .dll -////////////////////////////////////////////////////////////////////////// - -#define NOMINMAX -#include -#include "Core/Core.h" -#include "DllInterfaces/GFXAPI.h" -#include "IGame.h" - -#include "L_inputClass.h" - -// debug window include -#include -#include -#include -#include - - - - -//-------------------------------------------------------------------------------------- -// Global Variables -//-------------------------------------------------------------------------------------- -HINSTANCE g_hInst = NULL; -HWND g_hWnd = NULL; - -GameLogic::IGame *game; -InputClass *inputObj; - - -//-------------------------------------------------------------------------------------- -// Forward declarations -//-------------------------------------------------------------------------------------- -HRESULT InitWindow( HINSTANCE hInstance, int nCmdShow ); -LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); -HRESULT Render(float deltaTime); -HRESULT Update(float deltaTime); -HRESULT InitDirect3D(); -HRESULT InitGame(); -HRESULT CleanUp(); - - - -//-------------------------------------------------------------------------------------- -// Entry point to the program. Initializes everything and goes into a message processing -// loop. Idle time is used to render the scene. -//-------------------------------------------------------------------------------------- - -void SetStdOutToNewConsole() -{ - // allocate a console for this app - AllocConsole(); - - // redirect unbuffered STDOUT to the console - HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE); - int fileDescriptor = _open_osfhandle((intptr_t)consoleHandle, _O_TEXT); - FILE *fp = _fdopen( fileDescriptor, "w" ); - *stdout = *fp; - setvbuf( stdout, NULL, _IONBF, 0 ); - - // give the console window a nicer title - - SetConsoleTitle(L"Debug Output"); - - // give the console window a bigger buffer size - CONSOLE_SCREEN_BUFFER_INFO csbi; - if ( GetConsoleScreenBufferInfo(consoleHandle, &csbi) ) - { - COORD bufferSize; - bufferSize.X = csbi.dwSize.X; - bufferSize.Y = 50; - SetConsoleScreenBufferSize(consoleHandle, bufferSize); - } -} - -int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow ) -{ - if( FAILED( InitWindow( hInstance, nCmdShow ) ) ) - return 0; - - if( FAILED( InitDirect3D() ) ) - return 0; - - if( FAILED( InitGame() ) ) - return 0; - - __int64 cntsPerSec = 0; - QueryPerformanceFrequency((LARGE_INTEGER*)&cntsPerSec); - float secsPerCnt = 1.0f / (float)cntsPerSec; - - __int64 prevTimeStamp = 0; - QueryPerformanceCounter((LARGE_INTEGER*)&prevTimeStamp); - - //Init debug window - //SetStdOutToNewConsole(); - - // Main message loop - MSG msg = {0}; - while(WM_QUIT != msg.message) - { - if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE) ) - { - TranslateMessage( &msg ); - DispatchMessage( &msg ); - } - else - { - __int64 currTimeStamp = 0; - QueryPerformanceCounter((LARGE_INTEGER*)&currTimeStamp); - float dt = (currTimeStamp - prevTimeStamp) * secsPerCnt; - - //render - Update(dt); - Render(dt); - - prevTimeStamp = currTimeStamp; - } - } - CleanUp(); - return (int) msg.wParam; -} - -//-------------------------------------------------------------------------------------- -// Register class and create window -//-------------------------------------------------------------------------------------- -HRESULT InitWindow( HINSTANCE hInstance, int nCmdShow ) -{ - // Register class - WNDCLASSEX wcex; - wcex.cbSize = sizeof(WNDCLASSEX); - wcex.style = CS_HREDRAW | CS_VREDRAW; - wcex.lpfnWndProc = WndProc; - wcex.cbClsExtra = 0; - wcex.cbWndExtra = 0; - wcex.hInstance = hInstance; - wcex.hIcon = 0; - wcex.hCursor = LoadCursor(NULL, IDC_ARROW); - wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); - wcex.lpszMenuName = NULL; - wcex.lpszClassName = L"BTH_D3D_Template"; - wcex.hIconSm = 0; - if( !RegisterClassEx(&wcex) ) - return E_FAIL; - - // Adjust and create window - g_hInst = hInstance; - RECT rc = { 0, 0, 1024, 768 }; - AdjustWindowRect( &rc, WS_OVERLAPPEDWINDOW, FALSE ); - - if(!(g_hWnd = CreateWindow( - L"BTH_D3D_Template", - L"BTH - Direct3D 11.0 Template", - WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, - CW_USEDEFAULT, - rc.right - rc.left, - rc.bottom - rc.top, - NULL, - NULL, - hInstance, - NULL))) - { - return E_FAIL; - } - - ShowWindow( g_hWnd, nCmdShow ); - - return S_OK; -} - -//-------------------------------------------------------------------------------------- -// Create Direct3D with Oyster Graphics -//-------------------------------------------------------------------------------------- -HRESULT InitDirect3D() -{ - if(Oyster::Graphics::API::Init(g_hWnd, false, false, Oyster::Math::Float2( 1024, 768)) != Oyster::Graphics::API::Sucsess) - return E_FAIL; - return S_OK; -} - -//-------------------------------------------------------------------------------------- -// Init the input and the game -//------------------------------------------------------------------------------------- -HRESULT InitGame() -{ - inputObj = new InputClass; - if(!inputObj->Initialize(g_hInst, g_hWnd, 1024, 768)) - { - MessageBox(0, L"Could not initialize the input object.", L"Error", MB_OK); - return false; - } - game = new GameLogic::IGame(); - game->Init(); - game->StartGame(); - - return S_OK; -} - -HRESULT Update(float deltaTime) -{ - inputObj->Update(); - GameLogic::keyInput key = GameLogic::keyInput_none; - - if(inputObj->IsKeyPressed(DIK_W)) - { - key = GameLogic::keyInput_W; - } - else if(inputObj->IsKeyPressed(DIK_A)) - { - key = GameLogic::keyInput_A; - } - else if(inputObj->IsKeyPressed(DIK_S)) - { - key = GameLogic::keyInput_S; - } - else if(inputObj->IsKeyPressed(DIK_D)) - { - key = GameLogic::keyInput_D; - } - - float pitch = 0; - float yaw = 0; - - // move only when mouse is pressed - //if(inputObj->IsMousePressed()) - //{ - pitch = inputObj->GetPitch(); - yaw = inputObj->GetYaw(); - //} - - game->Update(key, pitch, yaw); - return S_OK; -} - -HRESULT Render(float deltaTime) -{ - int isPressed = 0; - if(inputObj->IsKeyPressed(DIK_A)) - { - isPressed = 1; - //std::cout<<"test"; - } - - game->Render(); - wchar_t title[255]; - swprintf(title, sizeof(title), L"| Pressing A: %d | \n", (int)(isPressed)); - SetWindowText(g_hWnd, title); - - Oyster::Graphics::API::EndFrame(); - - return S_OK; -} - -HRESULT CleanUp() -{ - SAFE_DELETE(game); - return S_OK; -} -//-------------------------------------------------------------------------------------- -// Called every time the application receives a message -//-------------------------------------------------------------------------------------- -LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) -{ - PAINTSTRUCT ps; - HDC hdc; - - switch (message) - { - case WM_PAINT: - hdc = BeginPaint(hWnd, &ps); - EndPaint(hWnd, &ps); - break; - - case WM_DESTROY: - PostQuitMessage(0); - break; - - case WM_KEYDOWN: - - switch(wParam) - { - case VK_ESCAPE: - PostQuitMessage(0); - break; - } - break; - - default: - return DefWindowProc(hWnd, message, wParam, lParam); - } - - return 0; -} - diff --git a/Code/GameLogic/Weapon.cpp b/Code/GameLogic/Weapon.cpp deleted file mode 100644 index 2cbd4e71..00000000 --- a/Code/GameLogic/Weapon.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "Weapon.h" - -using namespace GameLogic; - -Weapon::Weapon(void) -{ -} - - -Weapon::~Weapon(void) -{ -} diff --git a/Code/GameLogic/Weapon.h b/Code/GameLogic/Weapon.h deleted file mode 100644 index e8d37a15..00000000 --- a/Code/GameLogic/Weapon.h +++ /dev/null @@ -1,26 +0,0 @@ -////////////////////////////////////////////////// -//Created by Erik and Linda of the GameLogic team -////////////////////////////////////////////////// - - -#ifndef WEAPON_H -#define WEAPON_H - -#include "Object.h" - -namespace GameLogic -{ - - class Weapon : public Object - { - - public: - Weapon(void); - ~Weapon(void); - - private: - - }; - -} -#endif \ No newline at end of file