diff --git a/Code/Game/GameClient/DanBiasGame_Impl.cpp b/Code/Game/GameClient/DanBiasGame_Impl.cpp index 12b645c0..e5df1557 100644 --- a/Code/Game/GameClient/DanBiasGame_Impl.cpp +++ b/Code/Game/GameClient/DanBiasGame_Impl.cpp @@ -78,8 +78,8 @@ namespace DanBias //if(! data.window->CreateWin(WindowShell::WINDOW_INIT_DESC(L"Window", cPOINT(1600, 900), cPOINT()))) WindowShell::WINDOW_INIT_DESC winDesc; - winDesc.windowSize.x = 1280; - winDesc.windowSize.y = 720; + winDesc.windowSize.x = 1920; + winDesc.windowSize.y = 1080; winDesc.windowProcCallback = WindowCallBack; if(! data.window->CreateWin(winDesc) ) @@ -152,7 +152,7 @@ namespace DanBias Oyster::Graphics::API::Option p; p.modelPath = L"..\\Content\\Models\\"; p.texturePath = L"..\\Content\\Textures\\"; - p.Resolution = Oyster::Math::Float2( 1280.0f, 720.0f ); + p.Resolution = Oyster::Math::Float2( 1920.0f, 1080.0f ); //! @todo fix proper amb value p.AmbientValue = 1.3f; diff --git a/Code/Game/GameClient/GameClientState/GameStateUI.h b/Code/Game/GameClient/GameClientState/GameStateUI.h index 152a7f04..52ade7be 100644 --- a/Code/Game/GameClient/GameClientState/GameStateUI.h +++ b/Code/Game/GameClient/GameClientState/GameStateUI.h @@ -42,17 +42,4 @@ namespace DanBias { namespace Client }; } } -namespace Utility { namespace DynamicMemory -{ // template specializationto allowuse of dynamicmemory tools - template<> - inline void SafeDeleteInstance( ::DanBias::Client::GameStateUI *dynamicInstance ) - { - if( dynamicInstance ) - { - dynamicInstance->Release(); - delete dynamicInstance; - } - } -} } - #endif \ No newline at end of file diff --git a/Code/Game/GameClient/GameClientState/LanMenuState.cpp b/Code/Game/GameClient/GameClientState/LanMenuState.cpp index 14944830..4d7304c8 100644 --- a/Code/Game/GameClient/GameClientState/LanMenuState.cpp +++ b/Code/Game/GameClient/GameClientState/LanMenuState.cpp @@ -59,7 +59,7 @@ bool LanMenuState::Init( SharedStateContent &shared ) this->privData->keyboardInput = shared.keyboardDevice; this->privData->background = Graphics::API::CreateTexture( L"color_white.png" ); - this->privData->mouseCursor = Graphics::API::CreateTexture( L"cursor_md.png" ); + this->privData->mouseCursor = Graphics::API::CreateTexture( L"cursor.png" ); // create guiElements this->privData->connectIP = new TextField( L"noedge-btn-ipfield.png", Float4(1.0f), Float4(1.0f), this, Float3(0.5f, 0.2f, 0.9f), Float2(0.5f, 0.05f), ResizeAspectRatio_Height ); @@ -112,7 +112,7 @@ bool LanMenuState::Render( ) Graphics::API::StartGuiRender(); - Graphics::API::RenderGuiElement( this->privData->mouseCursor, this->privData->mousePos, Float2(0.01f), Float4(1.0f) ); + Graphics::API::RenderGuiElement( this->privData->mouseCursor, this->privData->mousePos, Float2(0.15f, 0.24), Float4(1.0f) ); Graphics::API::RenderGuiElement( this->privData->background, Float3(0.5f, 0.5f, 1.0f), Float2(1.0f) ); this->privData->guiElements.RenderTexture(); @@ -133,7 +133,7 @@ void LanMenuState::ChangeState( ClientState next ) { switch( next ) { - case GameClientState::ClientState_Lobby: + case GameClientState::ClientState_NetLoad: // attempt to connect to lobby if( !this->privData->nwClient->Connect(this->privData->connectPort, (*this->privData->connectIP)[0]) ) return; @@ -141,6 +141,8 @@ void LanMenuState::ChangeState( ClientState next ) default: break; } + this->privData->keyboardInput->ReleaseTextTarget(); + this->privData->nextState = next; } @@ -149,7 +151,7 @@ void OnButtonInteract_Connect( Oyster::Event::ButtonEvent& e ) switch( e.state ) { case ButtonState_Released: - e.owner->ChangeState( GameClientState::ClientState_Lobby ); + e.owner->ChangeState( GameClientState::ClientState_NetLoad ); break; default: break; } diff --git a/Code/Game/GameClient/GameClientState/MainState.cpp b/Code/Game/GameClient/GameClientState/MainState.cpp index 761a2015..8cdc2dc5 100644 --- a/Code/Game/GameClient/GameClientState/MainState.cpp +++ b/Code/Game/GameClient/GameClientState/MainState.cpp @@ -55,7 +55,7 @@ bool MainState::Init( SharedStateContent &shared ) this->privData->mousePos = Float3( 0.0f ); this->privData->background = Graphics::API::CreateTexture( L"color_white.png" ); - this->privData->mouseCursor = Graphics::API::CreateTexture( L"cursor_md.png" ); + this->privData->mouseCursor = Graphics::API::CreateTexture( L"cursor.png" ); // create buttons ButtonRectangle *button; @@ -103,7 +103,11 @@ bool MainState::Render() Graphics::API::NewFrame(); Graphics::API::StartGuiRender(); - Graphics::API::RenderGuiElement( this->privData->mouseCursor, this->privData->mousePos, Float2(0.01f), Float4(1.0f) ); + if(this->privData->mouseInput->IsBtnDown(Input::Enum::SAMI_MouseLeftBtn)) + Graphics::API::RenderGuiElement( this->privData->mouseCursor, this->privData->mousePos, Float2(0.15f), Float4(1.0f) ); + else + Graphics::API::RenderGuiElement( this->privData->mouseCursor, this->privData->mousePos, Float2(0.15f, 0.24), Float4(1.0f) ); + Graphics::API::RenderGuiElement( this->privData->background, Float3(0.5f, 0.5f, 0.9f), Float2(1.0f), Float4(0.0f, 0.0f, 0.0f, 1.0f) ); this->privData->guiElements.RenderTexture(); diff --git a/Code/Misc/Input/Source/Win32/Win32Keyboard.cpp b/Code/Misc/Input/Source/Win32/Win32Keyboard.cpp index 84e3eb28..7abe863f 100644 --- a/Code/Misc/Input/Source/Win32/Win32Keyboard.cpp +++ b/Code/Misc/Input/Source/Win32/Win32Keyboard.cpp @@ -17,6 +17,7 @@ Win32Keyboard::Win32Keyboard(HWND target) this->device.hwndTarget = target; this->device.usUsage = RawInput_Usage_keyboard; this->device.dwFlags = RIDEV_NOLEGACY; + this->writePos = 0; memset(&this->keys[0], 0, sizeof(Win32Keyboard::Keys) * MAXKEYS); } Win32Keyboard::~Win32Keyboard() @@ -140,12 +141,20 @@ void Win32Keyboard::ProccessKeyboardData (RAWKEYBOARD keyboard) } else if (this->keys[SAKI_Left].isDown) { - this->writePos = std::max( this->writePos - 1, (wstring::size_type)0 ); + this->writePos = std::max( ((int)this->writePos) - 1, (int)(wstring::size_type)0 ); } else if (this->keys[SAKI_Right].isDown) { this->writePos = std::min( this->writePos + 1, this->textTarget->size() ); } + else if (this->keys[SAKI_Enter].isDown || this->keys[SAKI_NumpadEnter].isDown) + { + this->textTarget->insert( this->writePos, 1, '\n'); + } + else if ( this->keys[SAKI_Tab].isDown ) + { + this->textTarget->insert( this->writePos, 1, '\t'); + } else if (virtualKey && !isUp) { wchar_t test = towlower((wchar_t)virtualKey); @@ -176,9 +185,11 @@ void Win32Keyboard::ProccessKeyboardData (RAWKEYBOARD keyboard) else if(key == SAKI_0) test = L'}'; else if(key == SAKI_Add) test = L'\\'; } + this->textTarget->insert( this->writePos, 1, test); ++this->writePos; } + } } @@ -251,7 +262,7 @@ void Win32Keyboard::MapKey(RAWKEYBOARD& rawKB, SAKI& out_key, bool& isE0) case VK_DELETE: if (!isE0) out_key = SAKI_NumpadDecimal; - + else out_key = SAKI_Delete; break; case VK_HOME: @@ -271,24 +282,24 @@ void Win32Keyboard::MapKey(RAWKEYBOARD& rawKB, SAKI& out_key, bool& isE0) case VK_NEXT: if (!isE0) out_key = SAKI_Numpad3; - + break; // the standard arrow keys will always have their e0 bit set, but the // corresponding keys on the NUMPAD will not. case VK_LEFT: if (!isE0) out_key = SAKI_Numpad4; - + else out_key = SAKI_Left; break; case VK_RIGHT: if (!isE0) out_key = SAKI_Numpad6; - + else out_key = SAKI_Right; break; case VK_UP: if (!isE0) out_key = SAKI_Numpad8; - + else out_key = SAKI_Up; break; case VK_DOWN: