some more of those overhauls
This commit is contained in:
parent
8dc22c854c
commit
6bf7bc898e
|
@ -14,7 +14,7 @@ struct GameState::myData
|
|||
int modelCount;
|
||||
Oyster::Network::NetworkClient* nwClient;
|
||||
gameStateState state;
|
||||
}privData;
|
||||
} privData;
|
||||
|
||||
GameState::GameState(void)
|
||||
{
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace Client
|
|||
bool Render()override;
|
||||
bool Release()override;
|
||||
|
||||
void DataRecieved(::Oyster::Network::NetEvent<NetworkClient*, ClientEventArgs> e);
|
||||
void DataRecieved( ::Oyster::Network::NetEvent<NetworkClient*, ClientEventArgs> e );
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
||||
}
|
|
@ -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<NetworkClient*, ClientEventArgs> e );
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif // ! DANBIAS_CLIENT_LOGINSTATE_H
|
Loading…
Reference in New Issue