From 64d9d7b3eb7cece81da8b2cb56eb0f50d87a5964 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 1 Mar 2019 08:50:34 +0800 Subject: *misc --- Source/Asura.Engine/Graphics/Image.h | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'Source/Asura.Engine/Graphics/Image.h') diff --git a/Source/Asura.Engine/Graphics/Image.h b/Source/Asura.Engine/Graphics/Image.h index 391d1c4..da881aa 100644 --- a/Source/Asura.Engine/Graphics/Image.h +++ b/Source/Asura.Engine/Graphics/Image.h @@ -1,13 +1,12 @@ #ifndef __ASURA_ENGINE_IMAGE_H__ #define __ASURA_ENGINE_IMAGE_H__ -#include "Math/Vector2.h" #include "StringMap.hpp" #include "Manager.hpp" #include "Texture.h" #include "Color.h" #include "Factory.h" -#include "SimClass.h" +#include "ImageData.h" namespace AsuraEngine { @@ -20,7 +19,7 @@ namespace AsuraEngine /// Image是图片从内存中载入后,读取进游戏后保存的结果。一个Image在内存、显存中只会保存一份,不会产生副本。需要特征 /// 化的区别image,如锚点位置,缩放和旋转角度,使用sprite。是一个只读类。主要是考虑到editor和engine使用不同的封装。 /// - class Image final : public Texture, public SimClass + class Image final : public Drawable, public Scripting::Portable { public: @@ -28,10 +27,10 @@ namespace AsuraEngine ~Image(); /// - /// 从数据buffer构建image,如果mPixels不为空,先清空数据。用来重新构建image,使用glTexImage2D重新提交image的像素 - /// 数据。 + /// 从数据buffer构建image像素信息,如果mPixels不为空,先清空数据。用来重新构建image,使用glTexImage2D重新提交image + /// 的像素数据。 /// - bool Load(const void* data, size_t size); + bool Load(const ImageData* data); uint GetWidth(); uint GetHeight(); @@ -39,11 +38,11 @@ namespace AsuraEngine /// /// 获得某一个位置的像素 /// - Color GetPixel(uint x, uint y); + Color32 GetPixel(uint x, uint y); - void Render(int x, int y, int sx, int sy, int ox, int oy, int r) override; + virtual void Render(const RenderTarget* rt, const RenderState& state) override; - void Render(const Math::Rect& quad, int x, int y, int sx, int sy, int ox, int oy, int r) override; + virtual void Render(const RenderTarget* rt, const Math::Rectf& quad, const RenderState& state) override; //---------------------------------------------------------------------------------------------------------- @@ -58,12 +57,7 @@ namespace AsuraEngine private: - /// - /// 大小(以像素为单位) - /// - uint mWidth, mHeight; - - Color* mPixels; + const ImageData* mImageData; }; -- cgit v1.1-26-g67d0