diff --git a/source/renderer/Renderer.cpp b/source/renderer/Renderer.cpp index 42b646dac8..ca911e86c8 100644 --- a/source/renderer/Renderer.cpp +++ b/source/renderer/Renderer.cpp @@ -412,7 +412,12 @@ CRenderer::CRenderer() CColor skycolor; CFG_GET_VAL("skycolor", skystring); if (skycolor.ParseString(skystring, 255.f)) - SetClearColor(skycolor.AsSColor4ub()); + { + m_ClearColor[0] = skycolor.r; + m_ClearColor[1] = skycolor.g; + m_ClearColor[2] = skycolor.b; + m_ClearColor[3] = skycolor.a; + } m_LightEnv = nullptr; @@ -646,15 +651,6 @@ void CRenderer::SetSimulation(CSimulation2* simulation) m->terrainRenderer.SetSimulation(simulation); } -// SetClearColor: set color used to clear screen in BeginFrame() -void CRenderer::SetClearColor(SColor4ub color) -{ - m_ClearColor[0] = float(color.R) / 255.0f; - m_ClearColor[1] = float(color.G) / 255.0f; - m_ClearColor[2] = float(color.B) / 255.0f; - m_ClearColor[3] = float(color.A) / 255.0f; -} - void CRenderer::RenderShadowMap(const CShaderDefines& context) { PROFILE3_GPU("shadow map"); diff --git a/source/renderer/Renderer.h b/source/renderer/Renderer.h index e03043df95..9733e2d2bd 100644 --- a/source/renderer/Renderer.h +++ b/source/renderer/Renderer.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -145,9 +145,6 @@ public: */ void SetSimulation(CSimulation2* simulation); - // set color used to clear screen in BeginFrame() - void SetClearColor(SColor4ub color); - // trigger a reload of shaders (when parameters they depend on have changed) void MakeShadersDirty(); diff --git a/source/tools/atlas/GameInterface/ActorViewer.cpp b/source/tools/atlas/GameInterface/ActorViewer.cpp index 7465947d1b..f1340efceb 100644 --- a/source/tools/atlas/GameInterface/ActorViewer.cpp +++ b/source/tools/atlas/GameInterface/ActorViewer.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -97,8 +97,6 @@ public: bool AxesMarkerEnabled; int PropPointsMode; // 0 disabled, 1 for point markers, 2 for point markers + axes - SColor4ub Background; - CTerrain Terrain; CColladaManager ColladaManager; @@ -267,7 +265,6 @@ ActorViewer::ActorViewer() m.SelectionBoxEnabled = false; m.AxesMarkerEnabled = false; m.PropPointsMode = 0; - m.Background = SColor4ub(0, 0, 0, 255); // Create a tiny empty piece of terrain, just so we can put shadows // on it without having to think too hard @@ -463,12 +460,6 @@ void ActorViewer::SetEnabled(bool enabled) } } -void ActorViewer::SetBackgroundColor(const SColor4ub& color) -{ - m.Background = color; - m.Terrain.SetBaseColor(color); -} - void ActorViewer::SetWalkEnabled(bool enabled) { m.WalkEnabled = enabled; } void ActorViewer::SetGroundEnabled(bool enabled) { m.GroundEnabled = enabled; } void ActorViewer::SetWaterEnabled(bool enabled) @@ -509,8 +500,6 @@ void ActorViewer::Render() { m.Terrain.MakeDirty(RENDERDATA_UPDATE_COLOR); - g_Renderer.SetClearColor(m.Background); - // Set simulation context for rendering purposes g_Renderer.SetSimulation(&m.Simulation2); diff --git a/source/tools/atlas/GameInterface/ActorViewer.h b/source/tools/atlas/GameInterface/ActorViewer.h index ae11c526d1..85f8b13711 100644 --- a/source/tools/atlas/GameInterface/ActorViewer.h +++ b/source/tools/atlas/GameInterface/ActorViewer.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -38,7 +38,6 @@ public: void SetActor(const CStrW& id, const CStr8& animation, player_id_t playerID); void SetEnabled(bool enabled); void UnloadObjects(); - void SetBackgroundColor(const SColor4ub& color); void SetWalkEnabled(bool enabled); void SetGroundEnabled(bool enabled); void SetWaterEnabled(bool enabled); diff --git a/source/tools/atlas/GameInterface/View.cpp b/source/tools/atlas/GameInterface/View.cpp index 966b34555f..dcae2ccb7e 100644 --- a/source/tools/atlas/GameInterface/View.cpp +++ b/source/tools/atlas/GameInterface/View.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -163,12 +163,8 @@ void AtlasViewActor::SetParam(const std::wstring& name, int value) m_ActorViewer->SetPropPointsMode(value); } -void AtlasViewActor::SetParam(const std::wstring& name, const AtlasMessage::Color& value) +void AtlasViewActor::SetParam(const std::wstring& UNUSED(name), const AtlasMessage::Color& UNUSED(value)) { - if (name == L"background") - { - m_ActorViewer->SetBackgroundColor(SColor4ub(value.r, value.g, value.b, 255)); - } }