some more of those overhauls
This commit is contained in:
parent
8dc22c854c
commit
6bf7bc898e
|
@ -28,15 +28,9 @@ struct LanMenuState::myData
|
||||||
// game client*
|
// game client*
|
||||||
} privData;
|
} privData;
|
||||||
|
|
||||||
LanMenuState::LanMenuState()
|
LanMenuState::LanMenuState() {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
LanMenuState::~LanMenuState() {}
|
||||||
|
|
||||||
LanMenuState::~LanMenuState()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LanMenuState::Init(Oyster::Network::NetworkClient* nwClient)
|
bool LanMenuState::Init(Oyster::Network::NetworkClient* nwClient)
|
||||||
{
|
{
|
||||||
|
@ -204,13 +198,3 @@ bool LanMenuState::Release()
|
||||||
|
|
||||||
return true;
|
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 Render();
|
||||||
virtual bool Release();
|
virtual bool Release();
|
||||||
virtual void Protocol(ProtocolStruct* protocolStruct);
|
|
||||||
|
|
||||||
void PlayerJoinProtocol(PlayerName* name);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Oyster::Network::NetworkClient* nwClient;
|
Oyster::Network::NetworkClient* nwClient;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "LoginState.h"
|
#include "MainState.h"
|
||||||
#include "DllInterfaces/GFXAPI.h"
|
#include "DllInterfaces/GFXAPI.h"
|
||||||
#include "OysterMath.h"
|
#include "OysterMath.h"
|
||||||
#include "C_obj/C_Player.h"
|
#include "C_obj/C_Player.h"
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
using namespace DanBias::Client;
|
using namespace DanBias::Client;
|
||||||
|
|
||||||
struct LoginState::myData
|
struct MainState::myData
|
||||||
{
|
{
|
||||||
myData(){}
|
myData(){}
|
||||||
Oyster::Math3D::Float4x4 view;
|
Oyster::Math3D::Float4x4 view;
|
||||||
|
@ -19,17 +19,11 @@ struct LoginState::myData
|
||||||
// game client*
|
// game client*
|
||||||
} privData;
|
} privData;
|
||||||
|
|
||||||
LoginState::LoginState(void)
|
MainState::MainState(void) {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
MainState::~MainState(void) {}
|
||||||
|
|
||||||
LoginState::~LoginState(void)
|
bool MainState::Init(Oyster::Network::NetworkClient* nwClient)
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LoginState::Init(Oyster::Network::NetworkClient* nwClient)
|
|
||||||
{
|
{
|
||||||
privData = new myData();
|
privData = new myData();
|
||||||
this->nwClient = nwClient;
|
this->nwClient = nwClient;
|
||||||
|
@ -38,7 +32,8 @@ bool LoginState::Init(Oyster::Network::NetworkClient* nwClient)
|
||||||
InitCamera(Oyster::Math::Float3(0,0,5.4f));
|
InitCamera(Oyster::Math::Float3(0,0,5.4f));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool LoginState::LoadModels(std::wstring file)
|
|
||||||
|
bool MainState::LoadModels(std::wstring file)
|
||||||
{
|
{
|
||||||
Oyster::Graphics::Definitions::Pointlight plight;
|
Oyster::Graphics::Definitions::Pointlight plight;
|
||||||
plight.Pos = Oyster::Math::Float3(0,0,5);
|
plight.Pos = Oyster::Math::Float3(0,0,5);
|
||||||
|
@ -69,7 +64,7 @@ bool LoginState::LoadModels(std::wstring file)
|
||||||
return true;
|
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_Perspective(Oyster::Math::pi/2,1024.0f/768.0f,.1f,1000);
|
||||||
//privData->proj = Oyster::Math3D::ProjectionMatrix_Orthographic(1024, 768, 1, 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);
|
privData->view = Oyster::Math3D::InverseOrientationMatrix(privData->view);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
GameClientState::ClientState LoginState::Update(float deltaTime, InputClass* KeyInput)
|
|
||||||
|
GameClientState::ClientState MainState::Update(float deltaTime, InputClass* KeyInput)
|
||||||
{
|
{
|
||||||
// picking
|
// picking
|
||||||
// mouse events
|
// mouse events
|
||||||
|
@ -122,7 +118,8 @@ GameClientState::ClientState LoginState::Update(float deltaTime, InputClass* Key
|
||||||
}
|
}
|
||||||
return ClientState_Same;
|
return ClientState_Same;
|
||||||
}
|
}
|
||||||
bool LoginState::Render()
|
|
||||||
|
bool MainState::Render()
|
||||||
{
|
{
|
||||||
|
|
||||||
Oyster::Graphics::API::SetView(privData->view);
|
Oyster::Graphics::API::SetView(privData->view);
|
||||||
|
@ -142,7 +139,8 @@ bool LoginState::Render()
|
||||||
Oyster::Graphics::API::EndFrame();
|
Oyster::Graphics::API::EndFrame();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool LoginState::Release()
|
|
||||||
|
bool MainState::Release()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < privData->modelCount; i++)
|
for (int i = 0; i < privData->modelCount; i++)
|
||||||
{
|
{
|
||||||
|
@ -155,13 +153,4 @@ bool LoginState::Release()
|
||||||
privData = NULL;
|
privData = NULL;
|
||||||
return true;
|
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
|
#ifndef DANBIAS_CLIENT_MAINSTATE_H
|
||||||
#define DANBIAS_CLIENT_LOGINSTATE_H
|
#define DANBIAS_CLIENT_MAINSTATE_H
|
||||||
|
|
||||||
#include "GameClientState.h"
|
#include "GameClientState.h"
|
||||||
#include "OysterMath.h"
|
#include "OysterMath.h"
|
||||||
|
@ -9,16 +9,15 @@ namespace DanBias
|
||||||
{
|
{
|
||||||
namespace Client
|
namespace Client
|
||||||
{
|
{
|
||||||
|
class MainState : public GameClientState
|
||||||
class LoginState : public GameClientState
|
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
Oyster::Network::NetworkClient* nwClient;
|
Oyster::Network::NetworkClient* nwClient;
|
||||||
struct myData;
|
struct myData;
|
||||||
myData* privData;
|
myData* privData;
|
||||||
public:
|
public:
|
||||||
LoginState(void);
|
MainState(void);
|
||||||
~LoginState(void);
|
~MainState(void);
|
||||||
bool Init(Oyster::Network::NetworkClient* nwClient);
|
bool Init(Oyster::Network::NetworkClient* nwClient);
|
||||||
bool LoadModels(std::wstring file);
|
bool LoadModels(std::wstring file);
|
||||||
bool InitCamera(Oyster::Math::Float3 startPos);
|
bool InitCamera(Oyster::Math::Float3 startPos);
|
||||||
|
@ -26,8 +25,9 @@ namespace DanBias
|
||||||
|
|
||||||
bool Render();
|
bool Render();
|
||||||
bool Release();
|
bool Release();
|
||||||
void Protocol(ProtocolStruct* protocol)override;
|
|
||||||
void PlayerJoinProtocol(PlayerName* name);
|
|
||||||
|
|
||||||
};};};
|
void DataRecieved( ::Oyster::Network::NetEvent<NetworkClient*, ClientEventArgs> e );
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif // ! DANBIAS_CLIENT_LOGINSTATE_H
|
#endif // ! DANBIAS_CLIENT_LOGINSTATE_H
|
Loading…
Reference in New Issue