Index: ps/trunk/source/graphics/Decal.h =================================================================== --- ps/trunk/source/graphics/Decal.h +++ ps/trunk/source/graphics/Decal.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 @@ -63,11 +63,6 @@ virtual CModelAbstract* Clone() const; - virtual void SetDirtyRec(int dirtyflags) - { - SetDirty(dirtyflags); - } - virtual void SetTerrainDirty(ssize_t i0, ssize_t j0, ssize_t i1, ssize_t j1); virtual void CalcBounds(); Index: ps/trunk/source/graphics/GameView.h =================================================================== --- ps/trunk/source/graphics/GameView.h +++ ps/trunk/source/graphics/GameView.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 @@ -92,9 +92,6 @@ // Unloads all graphics resources loaded by RegisterInit. void UnloadResources(); - // Checks whether lighting environment has changed and update vertex data if necessary. - void CheckLightEnv(); - CGameViewImpl* m; }; Index: ps/trunk/source/graphics/GameView.cpp =================================================================== --- ps/trunk/source/graphics/GameView.cpp +++ ps/trunk/source/graphics/GameView.cpp @@ -236,8 +236,6 @@ } g_Renderer.GetSceneRenderer().SetSceneCamera(m->ViewCamera, m->CullCamera); - CheckLightEnv(); - m->Game->CachePlayerColors(); } @@ -279,27 +277,6 @@ m->Game->GetSimulation2()->RenderSubmit(*c, frustum, m->Culling); } - -void CGameView::CheckLightEnv() -{ - if (m->CachedLightEnv == g_LightEnv) - return; - - m->CachedLightEnv = g_LightEnv; - CTerrain* pTerrain = m->Game->GetWorld()->GetTerrain(); - - if (!pTerrain) - return; - - PROFILE("update light env"); - pTerrain->MakeDirty(RENDERDATA_UPDATE_COLOR); - - const std::vector& units = m->Game->GetWorld()->GetUnitManager().GetUnits(); - for (size_t i = 0; i < units.size(); ++i) - units[i]->GetModel().SetDirtyRec(RENDERDATA_UPDATE_COLOR); -} - - void CGameView::UnloadResources() { g_TexMan.UnloadTerrainTextures(); Index: ps/trunk/source/graphics/Model.h =================================================================== --- ps/trunk/source/graphics/Model.h +++ ps/trunk/source/graphics/Model.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 @@ -125,14 +125,6 @@ // TODO: replace with more generic shader define + flags setting void RemoveShadowsRec(); - // recurse down tree setting dirty bits - virtual void SetDirtyRec(int dirtyflags) { - SetDirty(dirtyflags); - for (size_t i=0;iSetDirtyRec(dirtyflags); - } - } - virtual void SetTerrainDirty(ssize_t i0, ssize_t j0, ssize_t i1, ssize_t j1) { for (size_t i = 0; i < m_Props.size(); ++i) Index: ps/trunk/source/graphics/ModelAbstract.h =================================================================== --- ps/trunk/source/graphics/ModelAbstract.h +++ ps/trunk/source/graphics/ModelAbstract.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 @@ -89,9 +89,6 @@ // and this seems the easiest way to integrate with other code that wants // type-specific processing) - /// Calls SetDirty on this model and all child objects. - virtual void SetDirtyRec(int dirtyflags) = 0; - /// Returns world space bounds of this object and all child objects. virtual const CBoundingBoxAligned GetWorldBoundsRec() { return GetWorldBounds(); } // default implementation Index: ps/trunk/source/graphics/ModelDummy.h =================================================================== --- ps/trunk/source/graphics/ModelDummy.h +++ ps/trunk/source/graphics/ModelDummy.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 @@ -36,7 +36,6 @@ virtual CModelDummy* ToCModelDummy() { return this; } virtual void CalcBounds() {}; - virtual void SetDirtyRec(int) {}; virtual void SetTerrainDirty(ssize_t, ssize_t, ssize_t, ssize_t) {} virtual void ValidatePosition() {}; virtual void InvalidatePosition() {}; Index: ps/trunk/source/graphics/ParticleEmitter.h =================================================================== --- ps/trunk/source/graphics/ParticleEmitter.h +++ ps/trunk/source/graphics/ParticleEmitter.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 @@ -186,11 +186,6 @@ virtual CModelAbstract* Clone() const; - virtual void SetDirtyRec(int dirtyflags) - { - SetDirty(dirtyflags); - } - virtual void SetTerrainDirty(ssize_t UNUSED(i0), ssize_t UNUSED(j0), ssize_t UNUSED(i1), ssize_t UNUSED(j1)) { } Index: ps/trunk/source/graphics/RenderableObject.h =================================================================== --- ps/trunk/source/graphics/RenderableObject.h +++ ps/trunk/source/graphics/RenderableObject.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 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 @@ -31,7 +31,6 @@ // need updating #define RENDERDATA_UPDATE_VERTICES (1<<1) #define RENDERDATA_UPDATE_INDICES (1<<2) -#define RENDERDATA_UPDATE_COLOR (1<<4) /////////////////////////////////////////////////////////////////////////////// Index: ps/trunk/source/renderer/Renderer.cpp =================================================================== --- ps/trunk/source/renderer/Renderer.cpp +++ ps/trunk/source/renderer/Renderer.cpp @@ -435,10 +435,6 @@ g_RenderingOptions.m_RenderPath = rp; MakeShadersDirty(); - - // We might need to regenerate some render data after changing path - if (g_Game) - g_Game->GetWorld()->GetTerrain()->MakeDirty(RENDERDATA_UPDATE_COLOR); } bool CRenderer::ShouldRender() const Index: ps/trunk/source/tools/atlas/GameInterface/ActorViewer.cpp =================================================================== --- ps/trunk/source/tools/atlas/GameInterface/ActorViewer.cpp +++ ps/trunk/source/tools/atlas/GameInterface/ActorViewer.cpp @@ -500,7 +500,6 @@ void ActorViewer::Render() { // TODO: ActorViewer should reuse CRenderer code and not duplicate it. - m.Terrain.MakeDirty(RENDERDATA_UPDATE_COLOR); // Set simulation context for rendering purposes g_Renderer.GetSceneRenderer().SetSimulation(&m.Simulation2);