From fc7b4579e49aaeecc81919e247e03f68bd5abfd4 Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 18 Nov 2018 22:32:55 +0800 Subject: =?UTF-8?q?*=E7=B2=92=E5=AD=90=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Graphics/je_sprite.h | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'src/libjin/Graphics/je_sprite.h') diff --git a/src/libjin/Graphics/je_sprite.h b/src/libjin/Graphics/je_sprite.h index 65e00eb..faf16df 100644 --- a/src/libjin/Graphics/je_sprite.h +++ b/src/libjin/Graphics/je_sprite.h @@ -41,36 +41,29 @@ namespace JinEngine void setPosition(float x, float y); void setScale(float sx, float sy); void setColor(Color color); - void setShader(Shaders::Shader* shader); void setGraphic(const Graphic* graphic); void move(float x, float y); void rotate(float r); void scale(float sx, float sy); - float getRotation() { return mRotation; } + float getRotation() { return mTransform.getRotation(); } Math::Vector2 getSize() { return Math::Vector2(mQuad.w, mQuad.h); } const Math::Quad& getQuad() { return mQuad; } - const Math::Vector2& getPosition() { return mPosition; } - const Math::Vector2& getOrigin() { return mOrigin; } - const Math::Vector2& getScale() { return mScale; } + const Math::Vector2& getPosition() { return mTransform.getPosition(); } + const Math::Vector2& getOrigin() { return mTransform.getOrigin(); } + const Math::Vector2& getScale() { return mTransform.getScale(); } const Color& getColor() { return mColor; } const Graphic* getGraphic() { return mGraphic; } - const Shaders::Shader* getShader() { return mShader; } - /// - /// Render callback. - /// - virtual void render(); + void render(); private: /// /// Origin must be 0~1 float value. /// - Math::Vector2 mPosition; - Math::Vector2 mOrigin; - Math::Vector2 mScale; - float mRotation; + Math::Transform mTransform; + Color mColor; Math::Quad mQuad; @@ -78,7 +71,6 @@ namespace JinEngine bool mIsOriginEnum; Origin mOriginEnum; - Shaders::Shader* mShader; const Graphic* mGraphic; }; -- cgit v1.1-26-g67d0