diff --git a/BBGE/RenderObject.cpp b/BBGE/RenderObject.cpp index 88e2b7e..a09bcf8 100644 --- a/BBGE/RenderObject.cpp +++ b/BBGE/RenderObject.cpp @@ -126,16 +126,13 @@ RenderObject* RenderObject::getTopParent() const static glm::mat4 matrixChain(const RenderObject *ro) { glm::mat4 tranformMatrix = glm::scale( - glm::translate( - glm::rotate( - glm::translate( - ro->getParent() ? matrixChain(ro->getParent()) : glm::mat4(1.0f), - glm::vec3(ro->position.x+ro->offset.x, ro->position.y+ro->offset.y, 0) - ), - ro->rotation.z + ro->rotationOffset.z, - glm::vec3(0.0f, 0.0f, 1.0f) + glm::rotate( + glm::translate( + ro->getParent() ? matrixChain(ro->getParent()) : glm::mat4(1.0f), + glm::vec3(ro->position.x+ro->offset.x, ro->position.y+ro->offset.y, 0) ), - glm::vec3(ro->beforeScaleOffset.x, ro->beforeScaleOffset.y, 0.0f) + ro->rotation.z + ro->rotationOffset.z, + glm::vec3(0.0f, 0.0f, 1.0f) ), glm::vec3(ro->scale.x, ro->scale.y, 0.0f) ); @@ -154,7 +151,6 @@ static void matrixChain(RenderObject *ro) glTranslatef(ro->position.x+ro->offset.x, ro->position.y+ro->offset.y, 0); glRotatef(ro->rotation.z+ro->rotationOffset.z, 0, 0, 1); - glTranslatef(ro->beforeScaleOffset.x, ro->beforeScaleOffset.y, 0); glScalef(ro->scale.x, ro->scale.y, 0); if (ro->isfh()) { @@ -465,7 +461,6 @@ nofollow: if (isfh()) glRotatef(180, 0, 1, 0); - glTranslatef(beforeScaleOffset.x, beforeScaleOffset.y, beforeScaleOffset.z); const Vector renderScale = scale * rs.scale; glScalef(renderScale.x, renderScale.y, 1); glTranslatef(internalOffset.x, internalOffset.y, internalOffset.z); @@ -732,7 +727,6 @@ void RenderObject::onUpdate(float dt) alpha.update(dt); offset.update(dt); internalOffset.update(dt); - beforeScaleOffset.update(dt); rotationOffset.update(dt); bool hasChildrenToDelete = false; diff --git a/BBGE/RenderObject.h b/BBGE/RenderObject.h index 9d02791..16f934e 100644 --- a/BBGE/RenderObject.h +++ b/BBGE/RenderObject.h @@ -252,7 +252,7 @@ public: InterpolatedVector scale; InterpolatedVector color, alpha; InterpolatedVector rotation; - InterpolatedVector offset, rotationOffset, internalOffset, beforeScaleOffset; + InterpolatedVector offset, rotationOffset, internalOffset; InterpolatedVector velocity, gravity; CountedPtr texture; diff --git a/BBGE/Tile.h b/BBGE/Tile.h index 1d3a3de..53a5937 100644 --- a/BBGE/Tile.h +++ b/BBGE/Tile.h @@ -172,7 +172,6 @@ private: struct TileData { float x, y, scalex, scaley; - //float beforeScaleOffsetX, beforeScaleOffsetY; // almost always 0. // TODO: this is nasty, ideally get rid of this float rotation; unsigned flags; // TileFlags unsigned tag; // FIXME: make this int diff --git a/BBGE/TileRender.cpp b/BBGE/TileRender.cpp index ac8f0eb..18722f4 100644 --- a/BBGE/TileRender.cpp +++ b/BBGE/TileRender.cpp @@ -156,9 +156,6 @@ void TileRender::onRender(const RenderState& rs) const default: ; // both or none set, nothing to do } - // this is only relevant in editor mode and is always 0 otherwise - //glTranslatef(tile.beforeScaleOffsetX, tile.beforeScaleOffsetY, 0); - glScalef(sw, sh, 1);