From c14a161053c22070d61c526e81c99df770f1de6e Mon Sep 17 00:00:00 2001 From: Death Killer <884052+deathkiller@users.noreply.github.com> Date: Sat, 13 Jan 2024 14:02:31 +0100 Subject: [PATCH] Fixed build, removed debug messages --- Sources/Jazz2/UI/Menu/MainMenu.cpp | 43 +----------------------------- 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/Sources/Jazz2/UI/Menu/MainMenu.cpp b/Sources/Jazz2/UI/Menu/MainMenu.cpp index ba226d9a..f7834eb0 100644 --- a/Sources/Jazz2/UI/Menu/MainMenu.cpp +++ b/Sources/Jazz2/UI/Menu/MainMenu.cpp @@ -853,23 +853,17 @@ namespace Jazz2::UI::Menu void MainMenu::RenderTexturedBackground(RenderQueue& renderQueue) { - LOGW("Test 20"); - auto target = _texturedBackgroundPass._target.get(); if (target == nullptr) { return; } - LOGW("Test 21"); - Vector4f horizonColor; switch (_preset) { case Preset::Default: horizonColor = Vector4f(0.098f, 0.35f, 1.0f, 0.0f); break; default: horizonColor = Vector4f(0.0f, 0.0f, 0.06f, 1.0f); break; } - LOGW("Test 22"); - Vector2i viewSize = _canvasBackground->ViewSize; auto command = &_texturedBackgroundPass._outputRenderCommand; @@ -886,14 +880,10 @@ namespace Jazz2::UI::Menu command->material().setTexture(*target); renderQueue.addCommand(command); - - LOGW("Test 23"); } bool MainMenu::RenderLegacyBackground(RenderQueue& renderQueue) { - LOGW("Test 1"); - auto* res16 = _metadata->FindAnimation(Menu16); auto* res32 = _metadata->FindAnimation(Menu32); auto* res128 = _metadata->FindAnimation(Menu128); @@ -901,8 +891,6 @@ namespace Jazz2::UI::Menu return false; } - LOGW("Test 2"); - float animTime = _canvasBackground->AnimTime; Vector2f center = (_canvasBackground->ViewSize / 2).As(); @@ -911,8 +899,6 @@ namespace Jazz2::UI::Menu GenericGraphicResource* base = res16->Base; base->TextureDiffuse->setWrap(SamplerWrapping::Repeat); - LOGW("Test 3"); - constexpr float repeats = 96.0f; float scale = (0.6f + 0.04f * sinf(animTime * 0.2f)) * repeats; Vector2f size = base->FrameDimensions.As() * scale; @@ -924,16 +910,12 @@ namespace Jazz2::UI::Menu // Required to reset render command properly //command->setTransformation(command->transformation()); - LOGW("Test 4"); - GLUniformCache* textureUniform = command->material().uniform(Material::TextureUniformName); if (textureUniform && textureUniform->intValue(0) != 0) { textureUniform->setIntValue(0); // GL_TEXTURE0 } } - LOGW("Test 5"); - command->material().setBlendingFactors(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); auto instanceBlock = command->material().uniformBlock(Material::InstanceBlockName); @@ -941,8 +923,6 @@ namespace Jazz2::UI::Menu instanceBlock->uniform(Material::SpriteSizeUniformName)->setFloatVector(size.Data()); instanceBlock->uniform(Material::ColorUniformName)->setFloatVector(Colorf::White.Data()); - LOGW("Test 6"); - Matrix4x4f worldMatrix = Matrix4x4f::Translation(center.X, center.Y, 0.0f); worldMatrix.RotateZ(animTime * -0.2f); worldMatrix.Translate(size.X * -0.5f, size.Y * -0.5f, 0.0f); @@ -950,11 +930,7 @@ namespace Jazz2::UI::Menu command->setLayer(100); command->material().setTexture(*base->TextureDiffuse.get()); - LOGW("Test 7"); - renderQueue.addCommand(command); - - LOGW("Test 8"); } // 32 @@ -962,8 +938,6 @@ namespace Jazz2::UI::Menu GenericGraphicResource* base = res32->Base; base->TextureDiffuse->setWrap(SamplerWrapping::Repeat); - LOGW("Test 9"); - constexpr float repeats = 56.0f; float scale = (0.6f + 0.04f * sinf(animTime * 0.2f)) * repeats; Vector2f size = base->FrameDimensions.As() * scale; @@ -972,8 +946,6 @@ namespace Jazz2::UI::Menu centerBg.X += 96.0f * sinf(animTime * 0.37f); centerBg.Y += 96.0f * cosf(animTime * 0.31f); - LOGW("Test 10"); - auto command = _canvasBackground->RentRenderCommand(); if (command->material().setShaderProgramType(Material::ShaderProgramType::SPRITE)) { command->material().reserveUniformsDataMemory(); @@ -987,8 +959,6 @@ namespace Jazz2::UI::Menu } } - LOGW("Test 11"); - command->material().setBlendingFactors(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); auto instanceBlock = command->material().uniformBlock(Material::InstanceBlockName); @@ -1003,8 +973,6 @@ namespace Jazz2::UI::Menu command->setLayer(110); command->material().setTexture(*base->TextureDiffuse.get()); - LOGW("Test 12"); - renderQueue.addCommand(command); } @@ -1013,8 +981,6 @@ namespace Jazz2::UI::Menu GenericGraphicResource* base = res128->Base; base->TextureDiffuse->setWrap(SamplerWrapping::Repeat); - LOGW("Test 13"); - constexpr float repeats = 20.0f; float scale = (0.6f + 0.2f * sinf(animTime * 0.4f)) * repeats; Vector2f size = base->FrameDimensions.As() * scale; @@ -1023,8 +989,6 @@ namespace Jazz2::UI::Menu centerBg.X += 64.0f * sinf(animTime * 0.25f); centerBg.Y += 64.0f * cosf(animTime * 0.32f); - LOGW("Test 14"); - auto command = _canvasBackground->RentRenderCommand(); if (command->material().setShaderProgramType(Material::ShaderProgramType::SPRITE)) { command->material().reserveUniformsDataMemory(); @@ -1038,9 +1002,6 @@ namespace Jazz2::UI::Menu } } - - LOGW("Test 15"); - command->material().setBlendingFactors(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); auto instanceBlock = command->material().uniformBlock(Material::InstanceBlockName); @@ -1056,13 +1017,11 @@ namespace Jazz2::UI::Menu command->material().setTexture(*base->TextureDiffuse.get()); renderQueue.addCommand(command); - - LOGW("Test 16"); } DrawElement(MenuGlow, 0, center.X, 70.0f, 130, Alignment::Center, Colorf(1.0f, 1.0f, 1.0f, 0.14f), 16.0f, 10.0f, true); - LOGW("Test 17"); + return true; } void MainMenu::TexturedBackgroundPass::Initialize()