From 6bf7bc898ec1d38d6632e27c323dab2d0e8df78e Mon Sep 17 00:00:00 2001 From: Dander7BD Date: Wed, 12 Feb 2014 09:49:08 +0100 Subject: [PATCH] some more of those overhauls --- .../DanBiasGame/GameClientState/GameState.cpp | 2 +- .../DanBiasGame/GameClientState/GameState.h | 2 +- .../GameClientState/LanMenuState.cpp | 22 ++-------- .../GameClientState/LanMenuState.h | 3 -- .../{LoginState.cpp => MainState.cpp} | 41 +++++++------------ .../{LoginState.h => MainState.h} | 18 ++++---- 6 files changed, 29 insertions(+), 59 deletions(-) rename Code/Game/DanBiasGame/GameClientState/{LoginState.cpp => MainState.cpp} (83%) rename Code/Game/DanBiasGame/GameClientState/{LoginState.h => MainState.h} (61%) diff --git a/Code/Game/DanBiasGame/GameClientState/GameState.cpp b/Code/Game/DanBiasGame/GameClientState/GameState.cpp index 5dfabd6d..4099541c 100644 --- a/Code/Game/DanBiasGame/GameClientState/GameState.cpp +++ b/Code/Game/DanBiasGame/GameClientState/GameState.cpp @@ -14,7 +14,7 @@ struct GameState::myData int modelCount; Oyster::Network::NetworkClient* nwClient; gameStateState state; -}privData; +} privData; GameState::GameState(void) { diff --git a/Code/Game/DanBiasGame/GameClientState/GameState.h b/Code/Game/DanBiasGame/GameClientState/GameState.h index d4a60493..1fec5a24 100644 --- a/Code/Game/DanBiasGame/GameClientState/GameState.h +++ b/Code/Game/DanBiasGame/GameClientState/GameState.h @@ -52,7 +52,7 @@ namespace Client bool Render()override; bool Release()override; - void DataRecieved(::Oyster::Network::NetEvent e); + void DataRecieved( ::Oyster::Network::NetEvent e ); }; } } diff --git a/Code/Game/DanBiasGame/GameClientState/LanMenuState.cpp b/Code/Game/DanBiasGame/GameClientState/LanMenuState.cpp index 092307af..a1a3a443 100644 --- a/Code/Game/DanBiasGame/GameClientState/LanMenuState.cpp +++ b/Code/Game/DanBiasGame/GameClientState/LanMenuState.cpp @@ -26,17 +26,11 @@ struct LanMenuState::myData // UI object // game client* -}privData; +} privData; -LanMenuState::LanMenuState() -{ +LanMenuState::LanMenuState() {} -} - -LanMenuState::~LanMenuState() -{ - -} +LanMenuState::~LanMenuState() {} bool LanMenuState::Init(Oyster::Network::NetworkClient* nwClient) { @@ -203,14 +197,4 @@ bool LanMenuState::Release() privData = NULL; return true; -} - -void LanMenuState::Protocol(ProtocolStruct* protocolStruct) -{ - if((PlayerName*)protocolStruct) - PlayerJoinProtocol((PlayerName*)protocolStruct); -} -void LanMenuState::PlayerJoinProtocol(PlayerName* name) -{ - } \ No newline at end of file diff --git a/Code/Game/DanBiasGame/GameClientState/LanMenuState.h b/Code/Game/DanBiasGame/GameClientState/LanMenuState.h index 6b11fd20..def6074b 100644 --- a/Code/Game/DanBiasGame/GameClientState/LanMenuState.h +++ b/Code/Game/DanBiasGame/GameClientState/LanMenuState.h @@ -24,9 +24,6 @@ namespace DanBias virtual bool Render(); virtual bool Release(); - virtual void Protocol(ProtocolStruct* protocolStruct); - - void PlayerJoinProtocol(PlayerName* name); private: Oyster::Network::NetworkClient* nwClient; diff --git a/Code/Game/DanBiasGame/GameClientState/LoginState.cpp b/Code/Game/DanBiasGame/GameClientState/MainState.cpp similarity index 83% rename from Code/Game/DanBiasGame/GameClientState/LoginState.cpp rename to Code/Game/DanBiasGame/GameClientState/MainState.cpp index 2a354d1b..409d1164 100644 --- a/Code/Game/DanBiasGame/GameClientState/LoginState.cpp +++ b/Code/Game/DanBiasGame/GameClientState/MainState.cpp @@ -1,4 +1,4 @@ -#include "LoginState.h" +#include "MainState.h" #include "DllInterfaces/GFXAPI.h" #include "OysterMath.h" #include "C_obj/C_Player.h" @@ -8,7 +8,7 @@ using namespace DanBias::Client; -struct LoginState::myData +struct MainState::myData { myData(){} Oyster::Math3D::Float4x4 view; @@ -17,19 +17,13 @@ struct LoginState::myData int modelCount; // UI object // game client* -}privData; +} privData; -LoginState::LoginState(void) -{ +MainState::MainState(void) {} -} +MainState::~MainState(void) {} -LoginState::~LoginState(void) -{ - -} - -bool LoginState::Init(Oyster::Network::NetworkClient* nwClient) +bool MainState::Init(Oyster::Network::NetworkClient* nwClient) { privData = new myData(); this->nwClient = nwClient; @@ -38,7 +32,8 @@ bool LoginState::Init(Oyster::Network::NetworkClient* nwClient) InitCamera(Oyster::Math::Float3(0,0,5.4f)); return true; } -bool LoginState::LoadModels(std::wstring file) + +bool MainState::LoadModels(std::wstring file) { Oyster::Graphics::Definitions::Pointlight plight; plight.Pos = Oyster::Math::Float3(0,0,5); @@ -69,7 +64,7 @@ bool LoginState::LoadModels(std::wstring file) return true; } -bool LoginState::InitCamera(Oyster::Math::Float3 startPos) +bool MainState::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); @@ -79,7 +74,8 @@ bool LoginState::InitCamera(Oyster::Math::Float3 startPos) privData->view = Oyster::Math3D::InverseOrientationMatrix(privData->view); return true; } -GameClientState::ClientState LoginState::Update(float deltaTime, InputClass* KeyInput) + +GameClientState::ClientState MainState::Update(float deltaTime, InputClass* KeyInput) { // picking // mouse events @@ -122,7 +118,8 @@ GameClientState::ClientState LoginState::Update(float deltaTime, InputClass* Key } return ClientState_Same; } -bool LoginState::Render() + +bool MainState::Render() { Oyster::Graphics::API::SetView(privData->view); @@ -142,7 +139,8 @@ bool LoginState::Render() Oyster::Graphics::API::EndFrame(); return true; } -bool LoginState::Release() + +bool MainState::Release() { for (int i = 0; i < privData->modelCount; i++) { @@ -155,13 +153,4 @@ bool LoginState::Release() privData = NULL; return true; } -void LoginState::Protocol(ProtocolStruct* protocol) -{ - if((PlayerName*)protocol) - PlayerJoinProtocol((PlayerName*)protocol); -} -void LoginState::PlayerJoinProtocol(PlayerName* name) -{ - -} \ No newline at end of file diff --git a/Code/Game/DanBiasGame/GameClientState/LoginState.h b/Code/Game/DanBiasGame/GameClientState/MainState.h similarity index 61% rename from Code/Game/DanBiasGame/GameClientState/LoginState.h rename to Code/Game/DanBiasGame/GameClientState/MainState.h index d426187d..789e9a7b 100644 --- a/Code/Game/DanBiasGame/GameClientState/LoginState.h +++ b/Code/Game/DanBiasGame/GameClientState/MainState.h @@ -1,5 +1,5 @@ -#ifndef DANBIAS_CLIENT_LOGINSTATE_H -#define DANBIAS_CLIENT_LOGINSTATE_H +#ifndef DANBIAS_CLIENT_MAINSTATE_H +#define DANBIAS_CLIENT_MAINSTATE_H #include "GameClientState.h" #include "OysterMath.h" @@ -9,16 +9,15 @@ namespace DanBias { namespace Client { - - class LoginState : public GameClientState + class MainState : public GameClientState { private: Oyster::Network::NetworkClient* nwClient; struct myData; myData* privData; public: - LoginState(void); - ~LoginState(void); + MainState(void); + ~MainState(void); bool Init(Oyster::Network::NetworkClient* nwClient); bool LoadModels(std::wstring file); bool InitCamera(Oyster::Math::Float3 startPos); @@ -26,8 +25,9 @@ namespace DanBias bool Render(); bool Release(); - void Protocol(ProtocolStruct* protocol)override; - void PlayerJoinProtocol(PlayerName* name); - };};}; + void DataRecieved( ::Oyster::Network::NetEvent e ); + }; + } +} #endif // ! DANBIAS_CLIENT_LOGINSTATE_H \ No newline at end of file