diff --git a/Aquaria/Element.cpp b/Aquaria/Element.cpp index c3ea191..fc7f28d 100644 --- a/Aquaria/Element.cpp +++ b/Aquaria/Element.cpp @@ -40,7 +40,6 @@ ElementEffectData::ElementEffectData() Element::Element() : Quad() { elementFlag = EF_NONE; - elementActive = true; bgLayer = 0; tag = 0; templateIdx = -1; @@ -307,8 +306,8 @@ static inline const Vector& getTagColor(int tag) void Element::render(const RenderState& rs) const { - if (!elementActive) return; - + // FIXME: this should be part of the layer render, not here + // (not relevant until Elements are batched per-layer) if (game->isSceneEditorActive() && this->bgLayer == game->sceneEditor.bgLayer && game->sceneEditor.editType == ET_ELEMENTS) { @@ -345,7 +344,7 @@ void Element::render(const RenderState& rs) const void Element::fillGrid() { - if (life == 1 && elementActive) + if (life == 1 && !_hidden) { if (elementFlag == EF_SOLID) { diff --git a/Aquaria/Element.h b/Aquaria/Element.h index ce54bfb..db395f5 100644 --- a/Aquaria/Element.h +++ b/Aquaria/Element.h @@ -70,10 +70,10 @@ public: void render(const RenderState& rs) const OVERRIDE; ElementFlag elementFlag; void fillGrid(); - bool isElementActive() const { return elementActive; } + bool isElementActive() const { return !_hidden; } int getElementEffectIndex(); void setElementEffectByIndex(int e); - void setElementActive(bool v) { elementActive = v; } + void setElementActive(bool v) { _hidden = !v; } void doInteraction(Entity *ent, float mult, float touchWidth); void setTag(int tag); protected: @@ -82,10 +82,7 @@ protected: void setGridFromWavy(); ElementEffectData *eff; - void updateEffects(float dt); - - bool elementActive; -}; + void updateEffects(float dt);}; typedef std::vector ElementContainer;