1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-01-24 17:26:41 +00:00

remove RenderObjectLayer::update. now all layers are updated, always.

The original use case of the update flag was to prevent those layers that
only had map Element tiles on them to update each tile, which would be
very slow and most tiles never had any reason to be updated.
(Those that needed to were tracked in a separate list.)

Since the map Element class does no longer exist and tiles are handled
much more efficiently now, it makes sense to not arbitarily disable
object updates for layers that used to have only map tiles on them.

Note to self: This fixes the skeleton entities properly reacting to
shots now when placed on tile layers.
This commit is contained in:
fgenesis 2024-05-12 18:01:43 +02:00
parent db98e79e1d
commit bcffbac2b5
5 changed files with 0 additions and 17 deletions

View file

@ -2558,8 +2558,6 @@ void Game::applyState()
useWaterLevel = false; useWaterLevel = false;
waterLevel = saveWaterLevel = 0; waterLevel = saveWaterLevel = 0;
dsq->getRenderObjectLayer(LR_BLACKGROUND)->update = false;
grad = 0; grad = 0;
maxLookDistance = 600; maxLookDistance = 600;
saveFile = 0; saveFile = 0;
@ -4754,8 +4752,6 @@ void Game::removeState()
if (core->afterEffectManager) if (core->afterEffectManager)
core->afterEffectManager->clear(); core->afterEffectManager->clear();
dsq->getRenderObjectLayer(LR_BLACKGROUND)->update = true;
if (saveFile) if (saveFile)
{ {
delete saveFile; delete saveFile;

View file

@ -2337,7 +2337,6 @@ void SceneEditor::toggle(bool on)
if (on) if (on)
{ {
btnMenu->alpha = 1; btnMenu->alpha = 1;
dsq->getRenderObjectLayer(LR_BLACKGROUND)->update = true;
dsq->tileRenders[bgLayer]->renderBorders = true; dsq->tileRenders[bgLayer]->renderBorders = true;
game->togglePause(on); game->togglePause(on);
@ -2352,11 +2351,6 @@ void SceneEditor::toggle(bool on)
dsq->darkLayer.toggle(false); dsq->darkLayer.toggle(false);
for (int i = LR_ELEMENTS1; i <= LR_ELEMENTS8; i++)
{
dsq->getRenderObjectLayer(i)->update = true;
}
oldGlobalScale = core->globalScale; oldGlobalScale = core->globalScale;
const float cameraOffset = 1/oldGlobalScale.x - 1/zoom.x; const float cameraOffset = 1/oldGlobalScale.x - 1/zoom.x;
core->cameraPos.x += cameraOffset * core->getVirtualWidth()/2; core->cameraPos.x += cameraOffset * core->getVirtualWidth()/2;
@ -2375,7 +2369,6 @@ void SceneEditor::toggle(bool on)
movingEntity = 0; movingEntity = 0;
dsq->getRenderObjectLayer(LR_BLACKGROUND)->update = false;
dsq->tileRenders[bgLayer]->renderBorders = false; dsq->tileRenders[bgLayer]->renderBorders = false;
game->togglePause(on); game->togglePause(on);

View file

@ -1059,9 +1059,6 @@ void Core::updateRenderObjects(float dt)
RenderObjectLayer *rl = &renderObjectLayers[c]; RenderObjectLayer *rl = &renderObjectLayers[c];
if (!rl->update)
continue;
for (RenderObject *r = rl->getFirst(); r; r = rl->getNext()) for (RenderObject *r = rl->getFirst(); r; r = rl->getNext())
{ {
r->update(dt); r->update(dt);

View file

@ -171,8 +171,6 @@ public:
Vector followCameraMult; // calculated based on followCameraLock Vector followCameraMult; // calculated based on followCameraLock
int followCameraLock; int followCameraLock;
bool update;
PreRenderFunc preRender; PreRenderFunc preRender;
PostRenderFunc postRender; PostRenderFunc postRender;

View file

@ -30,7 +30,6 @@ RenderObjectLayer::RenderObjectLayer()
visible = true; visible = true;
startPass = endPass = 0; startPass = endPass = 0;
followCameraLock = FCL_NONE; followCameraLock = FCL_NONE;
update = true;
const int size = renderObjects.size(); const int size = renderObjects.size();
for (int i = 0; i < size; i++) for (int i = 0; i < size; i++)