From a0ca4df3be179045231e5cbac67cd943614f79ef Mon Sep 17 00:00:00 2001 From: Tleety Date: Tue, 8 Mar 2016 13:29:21 +0100 Subject: [PATCH] Some server list components and entities. --- resources/Schema/Components.xsd | 2 + .../Schema/Components/ServerIdentity.xml | 7 + .../Schema/Components/ServerIdentity.xsd | 23 ++ resources/Schema/Components/ServerList.xml | 6 + resources/Schema/Components/ServerList.xsd | 20 ++ resources/Schema/Entities/MainMenu.xml | 302 ++++++++++-------- resources/Schema/Entities/ServerIdentity.xml | 94 ++++++ resources/Schema/Entities/ServerList.xml | 65 ++++ resources/Schema/Types/Entity.xsd | 2 + src/Engine/GUI/MainMenuSystem.cpp | 3 - src/Engine/Rendering/BlurHUD.cpp | 36 +-- 11 files changed, 397 insertions(+), 163 deletions(-) create mode 100644 resources/Schema/Components/ServerIdentity.xml create mode 100644 resources/Schema/Components/ServerIdentity.xsd create mode 100644 resources/Schema/Components/ServerList.xml create mode 100644 resources/Schema/Components/ServerList.xsd create mode 100644 resources/Schema/Entities/ServerIdentity.xml create mode 100644 resources/Schema/Entities/ServerList.xml diff --git a/resources/Schema/Components.xsd b/resources/Schema/Components.xsd index cf282eec..632fad19 100644 --- a/resources/Schema/Components.xsd +++ b/resources/Schema/Components.xsd @@ -65,4 +65,6 @@ + + \ No newline at end of file diff --git a/resources/Schema/Components/ServerIdentity.xml b/resources/Schema/Components/ServerIdentity.xml new file mode 100644 index 00000000..b14a309c --- /dev/null +++ b/resources/Schema/Components/ServerIdentity.xml @@ -0,0 +1,7 @@ + + + 0.0.0.0 + 0 + UnkownServer + 0 + \ No newline at end of file diff --git a/resources/Schema/Components/ServerIdentity.xsd b/resources/Schema/Components/ServerIdentity.xsd new file mode 100644 index 00000000..961a69c5 --- /dev/null +++ b/resources/Schema/Components/ServerIdentity.xsd @@ -0,0 +1,23 @@ + + + + + A component for tracking the data of servers in the serverlist. + + + + The IP adress of the server. + + + Port used to connect to the server. + + + Name of the server. + + + Amount of players connected to the server. + + + + + \ No newline at end of file diff --git a/resources/Schema/Components/ServerList.xml b/resources/Schema/Components/ServerList.xml new file mode 100644 index 00000000..d3571d07 --- /dev/null +++ b/resources/Schema/Components/ServerList.xml @@ -0,0 +1,6 @@ + + + 0 + 0 + + \ No newline at end of file diff --git a/resources/Schema/Components/ServerList.xsd b/resources/Schema/Components/ServerList.xsd new file mode 100644 index 00000000..b422acda --- /dev/null +++ b/resources/Schema/Components/ServerList.xsd @@ -0,0 +1,20 @@ + + + + + The menulist where servers will be listed. + + + + The amount of server identities in this list. + + + Where the next serverIdentity should be placed. + + + How much offset should be applied per position + + + + + \ No newline at end of file diff --git a/resources/Schema/Entities/MainMenu.xml b/resources/Schema/Entities/MainMenu.xml index a88c1407..47292c30 100644 --- a/resources/Schema/Entities/MainMenu.xml +++ b/resources/Schema/Entities/MainMenu.xml @@ -1,163 +1,203 @@ - + + - - + - - - - - - - - - - Textures/Core/White.png - - - - - - - - - - - - Play - Fonts/DroidSans.ttf,64 - - - - - - - - - - - - - - - + - + + - + - - - Textures/Core/White.png - - - - - + - + + + + + + Textures/Core/White.png + true + + + + + Play + 1 + + + + + + + + + + + Play + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + - + - - Option - Fonts/DroidSans.ttf,64 - - - - - - - + - + + + + + + Textures/Core/White.png + true + + + + + + + + + + + + + Option + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + + + + + + + + + + Textures/Core/White.png + true + + + + + + + + + + + + + Credits + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + + + + + + + + + + Textures/Core/White.png + true + + + + + + + + + + + + + Quit + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + - + - + - + - - - Textures/Core/White.png - - - - - - - - - - - - Credits - Fonts/DroidSans.ttf,64 - - - - - - - - - - - - - - - - - - - - - - - - - - Textures/Core/White.png - - - - - - - - - - - - Quit - Fonts/DroidSans.ttf,64 - - - - - - - - - + + Schema/Entities/ServerList.xml + + diff --git a/resources/Schema/Entities/ServerIdentity.xml b/resources/Schema/Entities/ServerIdentity.xml new file mode 100644 index 00000000..ca803c34 --- /dev/null +++ b/resources/Schema/Entities/ServerIdentity.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + 0.0.0.0 + Fonts/DroidSans.ttf,64 + + + + + + + ServerIdentity + ServerIdentity + IP + + + + + + + + + + + 0 + Fonts/DroidSans.ttf,64 + + + + + + + ServerIdentity + ServerIdentity + Port + + + + + + + + + + + UnkownServer + Fonts/DroidSans.ttf,64 + + + + + + + ServerIdentity + ServerIdentity + ServerName + + + + + + + + + 0 + Fonts/DroidSans.ttf,64 + + + + + + + ServerIdentity + ServerIdentity + PlayersConnected + + + + + + + + + + diff --git a/resources/Schema/Entities/ServerList.xml b/resources/Schema/Entities/ServerList.xml new file mode 100644 index 00000000..be16fa16 --- /dev/null +++ b/resources/Schema/Entities/ServerList.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + Textures/Core/White.png + true + + + + + + + + + + + + + + Textures/Core/White.png + true + + + + + + + + + + + + + Textures/Icons/rotate.png + + + + + + + + + + + + + + + diff --git a/resources/Schema/Types/Entity.xsd b/resources/Schema/Types/Entity.xsd index 4865b936..ec5dba58 100644 --- a/resources/Schema/Types/Entity.xsd +++ b/resources/Schema/Types/Entity.xsd @@ -68,6 +68,8 @@ + + diff --git a/src/Engine/GUI/MainMenuSystem.cpp b/src/Engine/GUI/MainMenuSystem.cpp index f8bf032b..c37aabc1 100644 --- a/src/Engine/GUI/MainMenuSystem.cpp +++ b/src/Engine/GUI/MainMenuSystem.cpp @@ -27,15 +27,12 @@ bool MainMenuSystem::OnButtonClick(const Events::ButtonClicked& e) printf("No, you stay"); } else if (e.EntityName == "Res1080") { glfwSetWindowSize(m_Renderer->Window(), 1920, 1080); - printf("\n1080"); } else if (e.EntityName == "Res720") { glfwSetWindowSize(m_Renderer->Window(), 1280, 720); glViewport(0, 0, 1280, 720); - printf("\n720"); } else if (e.EntityName == "Res480") { glfwSetWindowSize(m_Renderer->Window(), 854, 480); glViewport(0, 0, 854, 480); - printf("\n480"); } else if (e.EntityName == "FullScreen") { printf("No fullscreen for now"); } diff --git a/src/Engine/Rendering/BlurHUD.cpp b/src/Engine/Rendering/BlurHUD.cpp index 4787510b..422b9ec4 100644 --- a/src/Engine/Rendering/BlurHUD.cpp +++ b/src/Engine/Rendering/BlurHUD.cpp @@ -126,19 +126,19 @@ GLuint BlurHUD::Draw(GLuint texture, RenderScene& scene) state.Disable(GL_DEPTH_TEST); state.Disable(GL_CULL_FACE); - GLuint shaderHandle_horiz = m_GaussianProgram_horiz->GetHandle(); - GLuint shaderHandle_vert = m_GaussianProgram_vert->GetHandle(); - - - - //Horizontal pass, first use the given texture then save it to the horizontal framebuffer. - m_GaussianFrameBuffer_horiz.Bind(); state.Enable(GL_STENCIL_TEST); state.StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); state.StencilFunc(GL_EQUAL, 1, 0xFF); state.StencilMask(0x00); state.DepthMask(GL_FALSE); state.Enable(GL_SCISSOR_TEST); + + GLuint shaderHandle_horiz = m_GaussianProgram_horiz->GetHandle(); + GLuint shaderHandle_vert = m_GaussianProgram_vert->GetHandle(); + + //Horizontal pass, first use the given texture then save it to the horizontal framebuffer. + m_GaussianFrameBuffer_horiz.Bind(); + glViewport(0, 0, m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality); glScissor(0, 0, m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height); @@ -153,13 +153,6 @@ GLuint BlurHUD::Draw(GLuint texture, RenderScene& scene) for (int i = 1; i < m_Iterations; i++) { //Vertical pass m_GaussianFrameBuffer_vert.Bind(); - state.Enable(GL_STENCIL_TEST); - state.StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); - state.StencilFunc(GL_EQUAL, 1, 0xFF); - state.StencilMask(0x00); - state.DepthMask(GL_FALSE); - glViewport(0, 0, m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality); - glScissor(0, 0, m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height); m_GaussianProgram_vert->Bind(); glActiveTexture(GL_TEXTURE0); @@ -171,15 +164,7 @@ GLuint BlurHUD::Draw(GLuint texture, RenderScene& scene) , GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex); //horizontal pass m_GaussianFrameBuffer_vert.Unbind(); - m_GaussianFrameBuffer_horiz.Bind(); - state.Enable(GL_STENCIL_TEST); - state.StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); - state.StencilFunc(GL_EQUAL, 1, 0xFF); - state.StencilMask(0x00); - state.DepthMask(GL_FALSE); - glViewport(0, 0, m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality); - glScissor(0, 0, m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height); m_GaussianProgram_horiz->Bind(); glActiveTexture(GL_TEXTURE0); @@ -195,13 +180,6 @@ GLuint BlurHUD::Draw(GLuint texture, RenderScene& scene) //final vertical gaussian after the iterations are done m_GaussianFrameBuffer_vert.Bind(); - state.Enable(GL_STENCIL_TEST); - state.StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); - state.StencilFunc(GL_EQUAL, 1, 0xFF); - state.StencilMask(0x00); - state.DepthMask(GL_FALSE); - glViewport(0, 0, m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality); - glScissor(0, 0, m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height); m_GaussianProgram_vert->Bind(); glActiveTexture(GL_TEXTURE0);