post merge fixes

This commit is contained in:
Dander7BD 2014-02-21 12:09:38 +01:00
parent adda3c1fff
commit 9a470fc175
6 changed files with 19 additions and 47 deletions

View File

@ -20,7 +20,6 @@
#include "EventHandler/EventHandler.h"
#include "GameClientState/SharedStateContent.h"
#include "Win32/Win32ApplicationKeyboard.h"
#include "Utilities.h"
using namespace ::Oyster;
@ -46,27 +45,23 @@ namespace DanBias
NetworkClient networkClient;
SharedStateContent sharedStateContent;
::Input::Win32ApplicationKeyboard *keyboardDevice_application;
bool serverOwner;
float capFrame;
DanBiasGamePrivateData()
{
this->sharedStateContent.network = nullptr;
this->sharedStateContent.mouseDevice = nullptr;
this->sharedStateContent.keyboardDevice_raw = nullptr;
this->sharedStateContent.keyboardDevice_application =
this->keyboardDevice_application = new ::Input::Win32ApplicationKeyboard();
this->serverOwner = false;
this->capFrame = 0;
this->sharedStateContent.network = nullptr;
this->sharedStateContent.mouseDevice = nullptr;
this->sharedStateContent.keyboardDevice = nullptr;
this->serverOwner = false;
this->capFrame = 0;
}
~DanBiasGamePrivateData()
{
SafeDeleteInstance( this->sharedStateContent.mouseDevice );
SafeDeleteInstance( this->sharedStateContent.keyboardDevice_raw );
SafeDeleteInstance( this->sharedStateContent.keyboardDevice_application );
SafeDeleteInstance( this->sharedStateContent.keyboardDevice );
}
} data;
}
@ -177,16 +172,14 @@ namespace DanBias
MessageBox( 0, L"Could not initialize the mouseDevice.", L"Error", MB_OK );
return E_FAIL;
}
data.sharedStateContent.mouseDevice->Disable();
data.sharedStateContent.keyboardDevice_raw = dynamic_cast<Input::Keyboard*>( ::Input::InputManager::Instance()->CreateDevice(Input::Enum::SAIType_Keyboard, handle) );
if( !data.sharedStateContent.keyboardDevice_raw )
data.sharedStateContent.keyboardDevice= dynamic_cast<Input::Keyboard*>( ::Input::InputManager::Instance()->CreateDevice(Input::Enum::SAIType_Keyboard, handle) );
if( !data.sharedStateContent.keyboardDevice )
{
MessageBox( 0, L"Could not initialize the raw keyboard device.", L"Error", MB_OK );
return E_FAIL;
}
data.keyboardDevice_application->Disable();
return S_OK;
}
@ -275,25 +268,12 @@ namespace DanBias
LRESULT CALLBACK WindowCallBack(HWND handle, UINT message, WPARAM wParam, LPARAM lParam )
{
//PAINTSTRUCT ps;
//HDC hdc;
switch ( message )
{
//case WM_PAINT:
// hdc = BeginPaint( handle, &ps );
// EndPaint( handle, &ps );
//break;
case WM_DESTROY:
PostQuitMessage( 0 );
break;
default:
if( DanBias::data.keyboardDevice_application->IsActive() )
{
DanBias::data.keyboardDevice_application->CaptureText( message, wParam );
}
break;
default: break;
}
return DefWindowProc( handle, message, wParam, lParam );

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>true</ShowAllFiles>
<ShowAllFiles>false</ShowAllFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>

View File

@ -27,8 +27,7 @@ struct GameState::MyData
GameClientState::ClientState nextState;
NetworkClient *nwClient;
::Input::Mouse *mouseInput;
::Input::Keyboard *keyboardInput_raw;
::Input::ApplicationKeyboard *keyboardInput_app;
::Input::Keyboard *keyboardInput;
::std::map<int, ::Utility::DynamicMemory::UniquePointer<::DanBias::Client::C_StaticObj>> *staticObjects;
::std::map<int, ::Utility::DynamicMemory::UniquePointer<::DanBias::Client::C_DynamicObj>> *dynamicObjects;
@ -67,15 +66,11 @@ bool GameState::Init( SharedStateContent &shared )
this->privData->nextState = GameClientState::ClientState_Same;
this->privData->nwClient = shared.network;
this->privData->mouseInput = shared.mouseDevice;
this->privData->keyboardInput_raw = shared.keyboardDevice_raw;
this->privData->keyboardInput_app = shared.keyboardDevice_application;
this->privData->keyboardInput = shared.keyboardDevice;
this->privData->staticObjects = &shared.staticObjects;
this->privData->dynamicObjects = &shared.dynamicObjects;
this->privData->lights = &shared.lights;
this->privData->keyboardInput_app->Deactivate();
this->privData->mouseInput->Enable();
Graphics::API::Option gfxOp = Graphics::API::GetOption();
Float aspectRatio = gfxOp.Resolution.x / gfxOp.Resolution.y;
this->privData->camera.SetPerspectiveProjection( Utility::Value::Radian(90.0f), aspectRatio, 0.1f, 1000.0f );
@ -101,7 +96,7 @@ bool GameState::Init( SharedStateContent &shared )
}
// create UI states
this->gameUI = new GamingUI(this->privData->mouseInput, this->privData->keyboardInput_raw, this->privData->nwClient, &this->privData->camera);
this->gameUI = new GamingUI(this->privData->mouseInput, this->privData->keyboardInput, this->privData->nwClient, &this->privData->camera);
this->respawnUI = new RespawnUI(this->privData->nwClient, 20);
this->currGameUI = gameUI;
((GamingUI*)gameUI)->Init();
@ -268,8 +263,6 @@ bool GameState::Release()
Graphics::API::Option o = Graphics::API::GetOption();
if( privData )
{
this->privData->mouseInput->Disable();
auto staticObject = this->privData->staticObjects->begin();
for( ; staticObject != this->privData->staticObjects->end(); ++staticObject )
{
@ -323,7 +316,7 @@ void GameState::ReadKeyInput()
#ifdef _DEBUG // DEGUG KEYS
// Reload shaders
if( this->privData->keyboardInput_raw->IsKeyDown(::Input::Enum::SAKI_R) )
if( this->privData->keyboardInput->IsKeyDown(::Input::Enum::SAKI_R) )
{
if( !this->key_Reload_Shaders )
{
@ -337,7 +330,7 @@ void GameState::ReadKeyInput()
this->key_Reload_Shaders = false;
// toggle wire frame render
if( this->privData->keyboardInput_raw->IsKeyDown(::Input::Enum::SAKI_T) )
if( this->privData->keyboardInput->IsKeyDown(::Input::Enum::SAKI_T) )
{
if( !this->key_Wireframe_Toggle )
{

View File

@ -29,7 +29,7 @@ struct LanMenuState::MyData
GameClientState::ClientState nextState;
NetworkClient *nwClient;
::Input::Mouse *mouseInput;
::Input::ApplicationKeyboard *keyboardInput;
::Input::Keyboard *keyboardInput;
Graphics::API::Texture background;
EventButtonCollection guiElements;
@ -55,8 +55,7 @@ bool LanMenuState::Init( SharedStateContent &shared )
this->privData->nextState = GameClientState::ClientState_Same;
this->privData->nwClient = shared.network;
this->privData->mouseInput = shared.mouseDevice;
this->privData->keyboardInput = shared.keyboardDevice_application;
this->privData->keyboardInput->Activate();
this->privData->keyboardInput = shared.keyboardDevice;
this->privData->background = Graphics::API::CreateTexture( L"color_white.png" );

View File

@ -48,6 +48,7 @@ bool MainState::Init( SharedStateContent &shared )
this->privData->nextState = GameClientState::ClientState_Same;
this->privData->nwClient = shared.network;
this->privData->mouseInput = shared.mouseDevice;
//this->privData->mouseInput->
this->privData->background = Graphics::API::CreateTexture( L"color_white.png" );

View File

@ -28,8 +28,7 @@ namespace DanBias { namespace Client
::Oyster::Network::NetworkClient *network;
::Input::Mouse *mouseDevice;
::Input::Keyboard *keyboardDevice_raw;
::Input::ApplicationKeyboard *keyboardDevice_application;
::Input::Keyboard *keyboardDevice;
};
} }