diff --git a/Code/Game/GameClient/DanBiasGame_Impl.cpp b/Code/Game/GameClient/DanBiasGame_Impl.cpp index c89e5db9..3a3149d7 100644 --- a/Code/Game/GameClient/DanBiasGame_Impl.cpp +++ b/Code/Game/GameClient/DanBiasGame_Impl.cpp @@ -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::InputManager::Instance()->CreateDevice(Input::Enum::SAIType_Keyboard, handle) ); - if( !data.sharedStateContent.keyboardDevice_raw ) + data.sharedStateContent.keyboardDevice= dynamic_cast( ::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 ); diff --git a/Code/Game/GameClient/GameClient.vcxproj.user b/Code/Game/GameClient/GameClient.vcxproj.user index 2e28d6f7..4b847ee6 100644 --- a/Code/Game/GameClient/GameClient.vcxproj.user +++ b/Code/Game/GameClient/GameClient.vcxproj.user @@ -1,7 +1,7 @@  - true + false $(OutDir) diff --git a/Code/Game/GameClient/GameClientState/GameState.cpp b/Code/Game/GameClient/GameClientState/GameState.cpp index 1e142d6f..27ad8ba9 100644 --- a/Code/Game/GameClient/GameClientState/GameState.cpp +++ b/Code/Game/GameClient/GameClientState/GameState.cpp @@ -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> *staticObjects; ::std::map> *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 ) { diff --git a/Code/Game/GameClient/GameClientState/LanMenuState.cpp b/Code/Game/GameClient/GameClientState/LanMenuState.cpp index dd49dd23..6f72014d 100644 --- a/Code/Game/GameClient/GameClientState/LanMenuState.cpp +++ b/Code/Game/GameClient/GameClientState/LanMenuState.cpp @@ -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" ); diff --git a/Code/Game/GameClient/GameClientState/MainState.cpp b/Code/Game/GameClient/GameClientState/MainState.cpp index e4c1fe0e..68f8d973 100644 --- a/Code/Game/GameClient/GameClientState/MainState.cpp +++ b/Code/Game/GameClient/GameClientState/MainState.cpp @@ -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" ); diff --git a/Code/Game/GameClient/GameClientState/SharedStateContent.h b/Code/Game/GameClient/GameClientState/SharedStateContent.h index 293213d6..cb722cec 100644 --- a/Code/Game/GameClient/GameClientState/SharedStateContent.h +++ b/Code/Game/GameClient/GameClientState/SharedStateContent.h @@ -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; }; } }