diff options
Diffstat (limited to 'source/modules')
61 files changed, 557 insertions, 259 deletions
diff --git a/source/modules/asura-box2d/binding/_body.cpp b/source/modules/asura-box2d/binding/_body.cpp new file mode 100644 index 0000000..51cc0ab --- /dev/null +++ b/source/modules/asura-box2d/binding/_body.cpp @@ -0,0 +1,172 @@ +#include "../body.h" + +using namespace std; + +namespace AsuraEngine +{ + namespace Physics + { + + LUAX_REGISTRY(Body) + { + LUAX_REGISTER_METHODS(state, + { "GetType", _GetType }, + { "GetX", _GetX }, + { "GetY", _GetY }, + { "GetAngle", _GetAngle }, + { "GetPosition", _GetPosition }, + { "GetLinearVelocity", _GetLinearVelocity }, + { "GetWorldCenter", _GetWorldCenter }, + { "GetLocalCenter", _GetLocalCenter }, + { "GetAngularVelocity", _GetAngularVelocity }, + { "GetMass", _GetMass }, + { "GetInertia", _GetInertia }, + { "GetMassData", _GetMassData }, + { "GetAngularDamping", _GetAngularDamping }, + { "GetLinearDamping", _GetLinearDamping }, + { "GetGravityScale", _GetGravityScale }, + { "GetGravityScale", _GetGravityScale } + ); + } + + LUAX_POSTPROCESS(Body) + { + LUAX_REGISTER_ENUM(state, "EBodyType", + { "INVALID", BODY_TYPE_INVALID }, + { "STATIC", BODY_TYPE_STATIC }, + { "DYNAMIC", BODY_TYPE_DYNAMIC }, + { "KINEMATIC", BODY_TYPE_KINEMATIC }, + { "ENUM", BODY_TYPE_MAX_ENUM } + ); + + } + + // body:GetType() + LUAX_IMPL_METHOD(Body, _GetType) + { + LUAX_PREPARE(L, Body); + return 0; + } + + // body:GetX() + LUAX_IMPL_METHOD(Body, _GetX) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetY() + LUAX_IMPL_METHOD(Body, _GetY) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetAngle() + LUAX_IMPL_METHOD(Body, _GetAngle) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetPosition() + LUAX_IMPL_METHOD(Body, _GetPosition) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetLinearVelocity() + LUAX_IMPL_METHOD(Body, _GetLinearVelocity) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetWorldCenter() + LUAX_IMPL_METHOD(Body, _GetWorldCenter) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetLocalCenter() + LUAX_IMPL_METHOD(Body, _GetLocalCenter) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetAngularVelocity() + LUAX_IMPL_METHOD(Body, _GetAngularVelocity) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetMass() + LUAX_IMPL_METHOD(Body, _GetMass) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetInertia() + LUAX_IMPL_METHOD(Body, _GetInertia) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetMassData() + LUAX_IMPL_METHOD(Body, _GetMassData) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetAngularDamping() + LUAX_IMPL_METHOD(Body, _GetAngularDamping) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetLinearDamping() + LUAX_IMPL_METHOD(Body, _GetLinearDamping) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetGravityScale() + LUAX_IMPL_METHOD(Body, _GetGravityScale) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetGravityScale() + LUAX_IMPL_METHOD(Body, _GetGravityScale) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + } +} diff --git a/source/modules/asura-box2d/binding/_world.cpp b/source/modules/asura-box2d/binding/_world.cpp new file mode 100644 index 0000000..6edd193 --- /dev/null +++ b/source/modules/asura-box2d/binding/_world.cpp @@ -0,0 +1,21 @@ +#include "../world.h" + +using namespace std; + +namespace AsuraEngine +{ + namespace Physics + { + + LUAX_REGISTRY(World) + { + + } + + LUAX_POSTPROCESS(World) + { + + } + + } +} diff --git a/source/modules/asura-box2d/body.h b/source/modules/asura-box2d/body.h new file mode 100644 index 0000000..57295c6 --- /dev/null +++ b/source/modules/asura-box2d/body.h @@ -0,0 +1,65 @@ +#ifndef __ASURA_BOX2D_BODY_H__ +#define __ASURA_BOX2D_BODY_H__ + +#include <Box2D/Box2D.h> + +#include <asura-utils/scripting/portable.hpp> + +namespace AsuraEngine +{ + namespace Physics + { + + class World; + + enum BodyType + { + BODY_TYPE_INVALID, + BODY_TYPE_STATIC, + BODY_TYPE_DYNAMIC, + BODY_TYPE_KINEMATIC, + BODY_TYPE_MAX_ENUM + }; + + class Body + : public AEScripting::Portable<Body> + { + public: + + LUAX_DECL_FACTORY(Body); + + b2Body *body; + + private: + + //----------------------------------------------------------------------------// + + LUAX_DECL_ENUM(BodyType); + + LUAX_DECL_METHOD(_GetType); + LUAX_DECL_METHOD(_GetX); + LUAX_DECL_METHOD(_GetY); + LUAX_DECL_METHOD(_GetAngle); + LUAX_DECL_METHOD(_GetPosition); + LUAX_DECL_METHOD(_GetLinearVelocity); + LUAX_DECL_METHOD(_GetWorldCenter); + LUAX_DECL_METHOD(_GetLocalCenter); + LUAX_DECL_METHOD(_GetAngularVelocity); + LUAX_DECL_METHOD(_GetMass); + LUAX_DECL_METHOD(_GetInertia); + LUAX_DECL_METHOD(_GetMassData); + LUAX_DECL_METHOD(_GetAngularDamping); + LUAX_DECL_METHOD(_GetLinearDamping); + LUAX_DECL_METHOD(_GetGravityScale); + LUAX_DECL_METHOD(_GetGravityScale); + + //----------------------------------------------------------------------------// + + World* mWorld; + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/source/modules/asura-box2d/chain_shape.h b/source/modules/asura-box2d/chain_shape.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/chain_shape.h diff --git a/source/modules/asura-box2d/circle_shape.h b/source/modules/asura-box2d/circle_shape.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/circle_shape.h diff --git a/source/modules/asura-box2d/contact.h b/source/modules/asura-box2d/contact.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/contact.h diff --git a/source/modules/asura-box2d/debug_draw.h b/source/modules/asura-box2d/debug_draw.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/debug_draw.h diff --git a/source/modules/asura-box2d/distance_joint.h b/source/modules/asura-box2d/distance_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/distance_joint.h diff --git a/source/modules/asura-box2d/edge_shape.h b/source/modules/asura-box2d/edge_shape.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/edge_shape.h diff --git a/source/modules/asura-box2d/fixture.h b/source/modules/asura-box2d/fixture.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/fixture.h diff --git a/source/modules/asura-box2d/friction_joint.h b/source/modules/asura-box2d/friction_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/friction_joint.h diff --git a/source/modules/asura-box2d/gear_joint.h b/source/modules/asura-box2d/gear_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/gear_joint.h diff --git a/source/modules/asura-box2d/joint.h b/source/modules/asura-box2d/joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/joint.h diff --git a/source/modules/asura-box2d/motor_joint.h b/source/modules/asura-box2d/motor_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/motor_joint.h diff --git a/source/modules/asura-box2d/mouse_joint.h b/source/modules/asura-box2d/mouse_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/mouse_joint.h diff --git a/source/modules/asura-box2d/polygon_shape.h b/source/modules/asura-box2d/polygon_shape.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/polygon_shape.h diff --git a/source/modules/asura-box2d/prismatic_joint.h b/source/modules/asura-box2d/prismatic_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/prismatic_joint.h diff --git a/source/modules/asura-box2d/pulley_joint.h b/source/modules/asura-box2d/pulley_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/pulley_joint.h diff --git a/source/modules/asura-box2d/revolute_joint.h b/source/modules/asura-box2d/revolute_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/revolute_joint.h diff --git a/source/modules/asura-box2d/rope_joint.h b/source/modules/asura-box2d/rope_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/rope_joint.h diff --git a/source/modules/asura-box2d/shape.h b/source/modules/asura-box2d/shape.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/shape.h diff --git a/source/modules/asura-box2d/weld_joint.h b/source/modules/asura-box2d/weld_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/weld_joint.h diff --git a/source/modules/asura-box2d/wheel_joint.h b/source/modules/asura-box2d/wheel_joint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/wheel_joint.h diff --git a/source/modules/asura-box2d/world.h b/source/modules/asura-box2d/world.h new file mode 100644 index 0000000..0aac0c8 --- /dev/null +++ b/source/modules/asura-box2d/world.h @@ -0,0 +1,19 @@ +#ifndef __ASURA_BOX2D_WORLD_H__ +#define __ASURA_BOX2D_WORLD_H__ + +#include <asura-utils/scripting/portable.hpp> + +namespace AsuraEngine +{ + namespace Physics + { + + class World : public AEScripting::Portable<World> + { + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/source/modules/asura-core/graphics/binding/_image.cpp b/source/modules/asura-core/graphics/binding/_image.cpp index cb008d3..1d43067 100644 --- a/source/modules/asura-core/graphics/binding/_image.cpp +++ b/source/modules/asura-core/graphics/binding/_image.cpp @@ -11,7 +11,7 @@ namespace AsuraEngine { LUAX_REGISTER_METHODS(state, { "New", _New }, - { "Load", _Load }, + { "Refresh", _Refresh }, { "GetWidth", _GetWidth }, { "GetHeight", _GetHeight }, { "GetSize", _GetSize }, @@ -25,66 +25,52 @@ namespace AsuraEngine } - // image = Image.New() + // Image.New() LUAX_IMPL_METHOD(Image, _New) { LUAX_STATE(L); - Image* image = new Image(); - image->PushLuaxUserdata(state); return 0; } - // successed = image:Load(image_data) - LUAX_IMPL_METHOD(Image, _Load) + // image:Refresh() + LUAX_IMPL_METHOD(Image, _Refresh) { LUAX_PREPARE(L, Image); - ImageData* imgdata = state.CheckUserdata<ImageData>(2); - bool loaded = self->Load(imgdata); - state.Push(loaded); - return 1; + return 0; } - // width = image:GetWidth() + // image:GetWidth() LUAX_IMPL_METHOD(Image, _GetWidth) { LUAX_PREPARE(L, Image); - state.Push(self->GetWidth()); - return 1; + return 0; } - // height = image:GetHeight() + // image:GetHeight() LUAX_IMPL_METHOD(Image, _GetHeight) { LUAX_PREPARE(L, Image); - state.Push(self->GetHeight()); - return 1; + return 0; } - // w, h = image:GetSize() + // image:GetSize() LUAX_IMPL_METHOD(Image, _GetSize) { LUAX_PREPARE(L, Image); - Math::Vector2u size = self->GetSize(); - state.Push(size.x); - state.Push(size.y); - return 2; + return 0; } - // color32 = image:GetPixel(x, y) + // image:GetPixel() LUAX_IMPL_METHOD(Image, _GetPixel) { LUAX_PREPARE(L, Image); - uint x = state.CheckValue<uint>(2); - uint y = state.CheckValue<uint>(3); - Color32* c32 = new Color32(self->GetPixel(x, y)); - c32->PushLuaxUserdata(state); - return 1; + return 0; } // image:Render() @@ -96,4 +82,4 @@ namespace AsuraEngine } } -}
\ No newline at end of file +} diff --git a/source/modules/asura-core/graphics/binding/_image_data.cpp b/source/modules/asura-core/graphics/binding/_image_data.cpp index 3ff38f9..ac9473b 100644 --- a/source/modules/asura-core/graphics/binding/_image_data.cpp +++ b/source/modules/asura-core/graphics/binding/_image_data.cpp @@ -1,6 +1,11 @@ +#include <asura-utils/threading/thread.h> +#include <asura-utils/io/data_buffer.h> + #include "../image_data.h" using namespace std; +using namespace AEThreading; +using namespace AEIO; namespace AsuraEngine { @@ -15,7 +20,10 @@ namespace AsuraEngine { "GetSize", _GetSize }, { "GetWidth", _GetWidth }, { "GetHeight", _GetHeight }, - { "GetPixelFormat", _GetPixelFormat } + { "GetPixelFormat", _GetPixelFormat }, + { "Decode", _Decode }, + { "DecodeAsync", _DecodeAsync }, + { "IsAvailable", _IsAvailable } ); } @@ -29,6 +37,7 @@ namespace AsuraEngine { LUAX_STATE(L); + return 0; } // imagedata:GetPixel() @@ -36,6 +45,7 @@ namespace AsuraEngine { LUAX_PREPARE(L, ImageData); + return 0; } // imagedata:GetSize() @@ -43,6 +53,7 @@ namespace AsuraEngine { LUAX_PREPARE(L, ImageData); + return 0; } // imagedata:GetWidth() @@ -50,6 +61,7 @@ namespace AsuraEngine { LUAX_PREPARE(L, ImageData); + return 0; } // imagedata:GetHeight() @@ -57,6 +69,7 @@ namespace AsuraEngine { LUAX_PREPARE(L, ImageData); + return 0; } // imagedata:GetPixelFormat() @@ -64,6 +77,34 @@ namespace AsuraEngine { LUAX_PREPARE(L, ImageData); + return 0; + } + + // imagedata:Decode() + LUAX_IMPL_METHOD(ImageData, _Decode) + { + LUAX_PREPARE(L, ImageData); + + return 0; + } + + // imagedata:DecodeAsync(thread, databuffer, callback) + LUAX_IMPL_METHOD(ImageData, _DecodeAsync) + { + LUAX_PREPARE(L, ImageData); + + Thread* thread = state.CheckUserdata<Thread>(2); + DataBuffer* buffer = state.CheckUserdata<DataBuffer>(3); + + return 0; + } + + // imagedata:IsAvailable() + LUAX_IMPL_METHOD(ImageData, _IsAvailable) + { + LUAX_PREPARE(L, ImageData); + + return 0; } } diff --git a/source/modules/asura-core/graphics/canvas.cpp b/source/modules/asura-core/graphics/canvas.cpp index 61787b6..e54ba1f 100644 --- a/source/modules/asura-core/graphics/canvas.cpp +++ b/source/modules/asura-core/graphics/canvas.cpp @@ -14,7 +14,7 @@ namespace AsuraEngine GLint current_fbo; glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, ¤t_fbo); glBindFramebuffer(GL_FRAMEBUFFER, mFBO); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextureHandle, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTexHandle, 0); glBindFramebuffer(GL_FRAMEBUFFER, current_fbo); } @@ -22,7 +22,7 @@ namespace AsuraEngine { GLint current_tex; glGetIntegerv(GL_TEXTURE_BINDING_2D, ¤t_tex); - glBindTexture(GL_TEXTURE_2D, mTextureHandle); + glBindTexture(GL_TEXTURE_2D, mTexHandle); glBindTexture(GL_TEXTURE_2D, current_tex); } diff --git a/source/modules/asura-core/graphics/canvas.h b/source/modules/asura-core/graphics/canvas.h index 7e7b2fd..d1412da 100644 --- a/source/modules/asura-core/graphics/canvas.h +++ b/source/modules/asura-core/graphics/canvas.h @@ -60,7 +60,7 @@ namespace AsuraEngine public: - //---------------------------------------------------------------------------------------------------------- + //----------------------------------------------------------------------------// LUAX_DECL_FACTORY(SimCanvas); @@ -68,7 +68,7 @@ namespace AsuraEngine LUAX_DECL_METHOD(_Bind); LUAX_DECL_METHOD(_Unbind); - //---------------------------------------------------------------------------------------------------------- + //----------------------------------------------------------------------------// }; diff --git a/source/modules/asura-core/graphics/color.h b/source/modules/asura-core/graphics/color.h index d0d0751..c4945ca 100644 --- a/source/modules/asura-core/graphics/color.h +++ b/source/modules/asura-core/graphics/color.h @@ -13,7 +13,7 @@ namespace AsuraEngine class Color32; /// - /// 淶ɫ + /// 淶ɫColor32иIJԡ /// class Color ASURA_FINAL : public Scripting::Portable<Color> @@ -26,7 +26,7 @@ namespace AsuraEngine static Color Green; static Color Blue; - Color(); + Color(); Color(const Color& c); @@ -40,12 +40,24 @@ namespace AsuraEngine float r, g, b, a; + //----------------------------------------------------------------------------// + LUAX_DECL_FACTORY(Color); LUAX_DECL_METHOD(_ToColor32); LUAX_DECL_METHOD(_SetColor); LUAX_DECL_METHOD(_GetColor); - LUAX_DECL_METHOD(_Multiply); // ɫ˷ + LUAX_DECL_METHOD(_GetR); + LUAX_DECL_METHOD(_GetG); + LUAX_DECL_METHOD(_GetB); + LUAX_DECL_METHOD(_GetA); + + // Ԫ + LUAX_DECL_METHOD(__eq); // __eq + LUAX_DECL_METHOD(__add); // __add + LUAX_DECL_METHOD(__sub); // __sub + LUAX_DECL_METHOD(__mul); // __mul + LUAX_DECL_METHOD(__div); // __div }; diff --git a/source/modules/asura-core/graphics/color32.h b/source/modules/asura-core/graphics/color32.h index b18f66c..2b13d1a 100644 --- a/source/modules/asura-core/graphics/color32.h +++ b/source/modules/asura-core/graphics/color32.h @@ -35,13 +35,14 @@ namespace AsuraEngine byte r, g, b, a; LUAX_DECL_METHOD(_ToColor); + + LUAX_DECL_METHOD(_SetColor); + + LUAX_DECL_METHOD(_GetColor); LUAX_DECL_METHOD(_GetRed); LUAX_DECL_METHOD(_GetGreen); LUAX_DECL_METHOD(_GetBlue); LUAX_DECL_METHOD(_GetAlpha); - LUAX_DECL_METHOD(_Multiply); - LUAX_DECL_METHOD(_Index); //r,g,b,a - LUAX_DECL_METHOD(_NewIndex); //r,g,b,a }; diff --git a/source/modules/asura-core/graphics/gl.cpp b/source/modules/asura-core/graphics/gl.cpp index 7c68c8f..41d43a3 100644 --- a/source/modules/asura-core/graphics/gl.cpp +++ b/source/modules/asura-core/graphics/gl.cpp @@ -1,3 +1,5 @@ +#include <asura-utils/type.h> + #include "../core_config.h" #include "gl.h" diff --git a/source/modules/asura-core/graphics/image.cpp b/source/modules/asura-core/graphics/image.cpp index e704945..e0528eb 100644 --- a/source/modules/asura-core/graphics/image.cpp +++ b/source/modules/asura-core/graphics/image.cpp @@ -1,6 +1,9 @@ -#include "Config.h" -#include "Image.h" -#include "GL.h" +#include "../core_config.h" + +#include "image.h" +#include "gl.h" + +using namespace AEIO; namespace AsuraEngine { @@ -16,16 +19,28 @@ namespace AsuraEngine } //\Ϣ - bool Image::Load(ImageData* data) + bool Image::Refresh(DecodedData* data) { ASSERT(data); - glBindTexture(GL_TEXTURE_2D, mTextureHandle); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, data->width, data->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data->pixels); + ImageData* imgData = static_cast<ImageData*>(data); + ASSERT(imgData); + + glBindTexture(GL_TEXTURE_2D, mTexHandle); + + imgData->Lock(); + + int width = imgData->width; + int height = imgData->height; + + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, imgData->pixels); + mImageData = imgData; + + imgData->Unlock(); + glBindTexture(GL_TEXTURE_2D, 0); - return true; - RRA(data, mImageData); + return true; } } diff --git a/source/modules/asura-core/graphics/image.h b/source/modules/asura-core/graphics/image.h index 29fd97c..377e002 100644 --- a/source/modules/asura-core/graphics/image.h +++ b/source/modules/asura-core/graphics/image.h @@ -27,9 +27,9 @@ namespace AsuraEngine /// һֻࡣҪǿǵeditorengineʹòͬķװ /// class Image ASURA_FINAL - : public Drawable + : public Texture , public Scripting::Portable<Image> - , public AEIO::Reloadable + , public AEIO::Renewable { public: @@ -40,19 +40,17 @@ namespace AsuraEngine ~Image(); /// - /// bufferimageϢmPixelsΪգݡ¹image - /// ʹglTexImage2Dύimageݡ + /// ͼύGPUϢ¹imageʹglTexImage2D + /// ύimageݡ /// - bool Load(ImageData* data); + bool Refresh(AEIO::DecodedData* decodeData) override; + bool Refresh(AEIO::DecodedData* decodeData, const AEMath::Recti& rect); - uint GetWidth(); - uint GetHeight(); - Math::Vector2u GetSize(); - /// - /// ijһλõ - /// - Color32 GetPixel(uint x, uint y); + uint GetWidth(); + uint GetHeight(); + Math::Vector2u GetSize(); + Color32 GetPixel(uint x, uint y); void Render(const RenderTarget* rt, const RenderState& state) override; @@ -60,13 +58,14 @@ namespace AsuraEngine private: + /// + /// һͼƬһݵá + /// ImageData* mImageData; Luax::LuaxMemberRef mImageDataRef; - Math::Vector2u mSize; - LUAX_DECL_METHOD(_New); - LUAX_DECL_METHOD(_Load); + LUAX_DECL_METHOD(_Refresh); LUAX_DECL_METHOD(_GetWidth); LUAX_DECL_METHOD(_GetHeight); LUAX_DECL_METHOD(_GetSize); diff --git a/source/modules/asura-core/graphics/image_data.cpp b/source/modules/asura-core/graphics/image_data.cpp index b79dfab..64f83a8 100644 --- a/source/modules/asura-core/graphics/image_data.cpp +++ b/source/modules/asura-core/graphics/image_data.cpp @@ -16,8 +16,12 @@ namespace AsuraEngine new STBDecoder() // jpeg, tga, bmp }; - ImageData::ImageData(const IO::DataBuffer& buffer) - : DecodedData(buffer) + ImageData::ImageData() + : pixels(nullptr) + , size(0) + , width(0) + , height(0) + , format(COLOR_FORMAT_UNKNOWN) { } @@ -27,10 +31,12 @@ namespace AsuraEngine delete[] pixels; } - /// - /// ɹ׳쳣 - /// - void ImageData::Decode(const IO::DataBuffer& buffer) + ImageData::operator bool() + { + return size > 0; + } + + void ImageData::Decode(IO::DataBuffer& buffer) { for (ImageDecoder* decoder : ImageDecoders) { @@ -46,6 +52,16 @@ namespace AsuraEngine { } + + void ImageData::Lock() + { + mMutex.Lock(); + } + + void ImageData::Unlock() + { + mMutex.Unlock(); + } } }
\ No newline at end of file diff --git a/source/modules/asura-core/graphics/image_data.h b/source/modules/asura-core/graphics/image_data.h index ea1d53a..b9d656c 100644 --- a/source/modules/asura-core/graphics/image_data.h +++ b/source/modules/asura-core/graphics/image_data.h @@ -7,8 +7,9 @@ #include <asura-utils/io/decoded_data.h> #include <asura-utils/io/data_buffer.h> #include <asura-utils/threading/thread.h> +#include <asura-utils/threading/mutex.h> -#include "pixel_format.h" +#include "texture.h" #include "color.h" namespace AsuraEngine @@ -29,27 +30,28 @@ namespace AsuraEngine /// /// ͼƬļϢʧܣ׳쳣 /// - ImageData(const AEIO::DataBuffer& buffer); + ImageData(); ~ImageData(); - void Load(const AEIO::DataBuffer& buffer); - void LoadAsync(const AEIO::DataBuffer& buffer, AEThreading::Thread* thread); + void Decode(AEIO::DataBuffer& buffer) override; + + void Lock(); + void Unlock(); Color GetPixel(uint x, uint y); - uint width, height; - PixelFormat format; - std::size_t size; - byte* pixels; + //----------------------------------------------------------------------------// - private: + uint width, height; // سߴ + ColorFormat format; // ʽ + byte* pixels; // + std::size_t size; // ݳ - void Decode(const AEIO::DataBuffer& buffer) override; + //----------------------------------------------------------------------------// - /// - /// ڵһimage dataʱṩdecoderڼdecodersмѡԡ - /// - static std::list<ImageDecoder*> ImageDecoders; + private: + + //----------------------------------------------------------------------------// LUAX_DECL_METHOD(_New); LUAX_DECL_METHOD(_GetPixel); @@ -57,6 +59,21 @@ namespace AsuraEngine LUAX_DECL_METHOD(_GetWidth); LUAX_DECL_METHOD(_GetHeight); LUAX_DECL_METHOD(_GetPixelFormat); + LUAX_DECL_METHOD(_Decode); + LUAX_DECL_METHOD(_DecodeAsync); + LUAX_DECL_METHOD(_IsAvailable); + + //----------------------------------------------------------------------------// + + /// + /// ڵһimage dataʱṩdecoderڼdecodersмѡԡ + /// + static std::list<ImageDecoder*> ImageDecoders; + + /// + /// дݵ + /// + AEThreading::Mutex mMutex; }; diff --git a/source/modules/asura-core/graphics/image_decoder.h b/source/modules/asura-core/graphics/image_decoder.h index 263c694..869c82a 100644 --- a/source/modules/asura-core/graphics/image_decoder.h +++ b/source/modules/asura-core/graphics/image_decoder.h @@ -20,12 +20,12 @@ namespace AsuraEngine /// /// жڴǷñdecoderѹ /// - virtual bool CanDecode(const AEIO::DataBuffer& buffer) = 0; + virtual bool CanDecode(AEIO::DataBuffer& buffer) = 0; /// /// һڴ棬һѹImage dataѹʧܷnullptr /// - virtual void Decode(const AEIO::DataBuffer& buffer, ImageData& data) = 0; + virtual void Decode(AEIO::DataBuffer& buffer, ImageData& data) = 0; }; diff --git a/source/modules/asura-core/graphics/pixel_format.h b/source/modules/asura-core/graphics/pixel_format.h deleted file mode 100644 index 8df07d5..0000000 --- a/source/modules/asura-core/graphics/pixel_format.h +++ /dev/null @@ -1,91 +0,0 @@ -namespace AsuraEngine -{ - namespace Graphics - { - - /// - /// ظʽ - /// - enum PixelFormat - { - PIXELFORMAT_UNKNOWN, - - // these are converted to an actual format by love - PIXELFORMAT_NORMAL, - PIXELFORMAT_HDR, - - // "regular" formats - PIXELFORMAT_R8, - PIXELFORMAT_RG8, - PIXELFORMAT_RGBA8, - PIXELFORMAT_sRGBA8, - PIXELFORMAT_R16, - PIXELFORMAT_RG16, - PIXELFORMAT_RGBA16, - PIXELFORMAT_R16F, - PIXELFORMAT_RG16F, - PIXELFORMAT_RGBA16F, - PIXELFORMAT_R32F, - PIXELFORMAT_RG32F, - PIXELFORMAT_RGBA32F, - - PIXELFORMAT_LA8, // Same as RG8, but accessed as (L, L, L, A) - - // packed formats - PIXELFORMAT_RGBA4, - PIXELFORMAT_RGB5A1, - PIXELFORMAT_RGB565, - PIXELFORMAT_RGB10A2, - PIXELFORMAT_RG11B10F, - - // depth/stencil formats - PIXELFORMAT_STENCIL8, - PIXELFORMAT_DEPTH16, - PIXELFORMAT_DEPTH24, - PIXELFORMAT_DEPTH32F, - PIXELFORMAT_DEPTH24_STENCIL8, - PIXELFORMAT_DEPTH32F_STENCIL8, - - // compressed formats - PIXELFORMAT_DXT1, - PIXELFORMAT_DXT3, - PIXELFORMAT_DXT5, - PIXELFORMAT_BC4, - PIXELFORMAT_BC4s, - PIXELFORMAT_BC5, - PIXELFORMAT_BC5s, - PIXELFORMAT_BC6H, - PIXELFORMAT_BC6Hs, - PIXELFORMAT_BC7, - PIXELFORMAT_PVR1_RGB2, - PIXELFORMAT_PVR1_RGB4, - PIXELFORMAT_PVR1_RGBA2, - PIXELFORMAT_PVR1_RGBA4, - PIXELFORMAT_ETC1, - PIXELFORMAT_ETC2_RGB, - PIXELFORMAT_ETC2_RGBA, - PIXELFORMAT_ETC2_RGBA1, - PIXELFORMAT_EAC_R, - PIXELFORMAT_EAC_Rs, - PIXELFORMAT_EAC_RG, - PIXELFORMAT_EAC_RGs, - PIXELFORMAT_ASTC_4x4, - PIXELFORMAT_ASTC_5x4, - PIXELFORMAT_ASTC_5x5, - PIXELFORMAT_ASTC_6x5, - PIXELFORMAT_ASTC_6x6, - PIXELFORMAT_ASTC_8x5, - PIXELFORMAT_ASTC_8x6, - PIXELFORMAT_ASTC_8x8, - PIXELFORMAT_ASTC_10x5, - PIXELFORMAT_ASTC_10x6, - PIXELFORMAT_ASTC_10x8, - PIXELFORMAT_ASTC_10x10, - PIXELFORMAT_ASTC_12x10, - PIXELFORMAT_ASTC_12x12, - - PIXELFORMAT_MAX_ENUM - }; - - } -} diff --git a/source/modules/asura-core/graphics/png_decoder.cpp b/source/modules/asura-core/graphics/png_decoder.cpp index f919090..80463d5 100644 --- a/source/modules/asura-core/graphics/png_decoder.cpp +++ b/source/modules/asura-core/graphics/png_decoder.cpp @@ -1,16 +1,16 @@ -#include "PNGDecoder.h" +#include "png_decoder.h" namespace AsuraEngine { namespace Graphics { - bool PNGDecoder::CanDecode(const Filesystem::DataBuffer& buffer) + bool PNGDecoder::CanDecode(AEIO::DataBuffer& buffer) { return false; } - void PNGDecoder::Decode(const Filesystem::DataBuffer& buffer, ImageData& data) + void PNGDecoder::Decode(AEIO::DataBuffer& buffer, ImageData& data) { } diff --git a/source/modules/asura-core/graphics/png_decoder.h b/source/modules/asura-core/graphics/png_decoder.h index bc871fa..6377940 100644 --- a/source/modules/asura-core/graphics/png_decoder.h +++ b/source/modules/asura-core/graphics/png_decoder.h @@ -15,9 +15,9 @@ namespace AsuraEngine { public: - bool CanDecode(const AEIO::DataBuffer& buffer) override; + bool CanDecode(AEIO::DataBuffer& buffer) override; - void Decode(const AEIO::DataBuffer& buffer, ImageData& data) override; + void Decode(AEIO::DataBuffer& buffer, ImageData& data) override; }; diff --git a/source/modules/asura-core/graphics/render_state.h b/source/modules/asura-core/graphics/render_state.h index 2b1dd7f..4c3491c 100644 --- a/source/modules/asura-core/graphics/render_state.h +++ b/source/modules/asura-core/graphics/render_state.h @@ -4,7 +4,6 @@ #include <asura-utils/math/vector2.hpp> #include <asura-utils/math/transform.h> -#include "Shader.h" #include "blend_mode.h" namespace AsuraEngine @@ -12,6 +11,8 @@ namespace AsuraEngine namespace Graphics { + class Shader; + /// /// Ⱦǰķʽ /// diff --git a/source/modules/asura-core/graphics/shader.h b/source/modules/asura-core/graphics/shader.h index 97e2c15..8c21ab2 100644 --- a/source/modules/asura-core/graphics/shader.h +++ b/source/modules/asura-core/graphics/shader.h @@ -28,7 +28,7 @@ namespace AsuraEngine /// class Shader ASURA_FINAL : public Scripting::Portable<Shader> - , public AEIO::Reloadable + , public AEIO::Renewable { public: diff --git a/source/modules/asura-core/graphics/stb_decoder.cpp b/source/modules/asura-core/graphics/stb_decoder.cpp index eff2e65..9a14141 100644 --- a/source/modules/asura-core/graphics/stb_decoder.cpp +++ b/source/modules/asura-core/graphics/stb_decoder.cpp @@ -8,49 +8,54 @@ namespace AsuraEngine namespace Graphics { - bool STBDecoder::CanDecode(const Filesystem::DataBuffer& buffer) + bool STBDecoder::CanDecode(IO::DataBuffer& buffer) { int w = 0; int h = 0; int comp = 0; - int status = stbi_info_from_memory((const stbi_uc*)buffer.data, buffer.size, &w, &h, &comp); + int status = stbi_info_from_memory((const stbi_uc*)buffer.GetData(), buffer.GetSize(), &w, &h, &comp); return status == 1 && w > 0 && h > 0; } - void STBDecoder::Decode(const Filesystem::DataBuffer& db, ImageData& imageData) + void STBDecoder::Decode(IO::DataBuffer& db, ImageData& imageData) { - const stbi_uc *buffer = (const stbi_uc *)db.data; - int bufferlen = db.size; + const stbi_uc *buffer = (const stbi_uc *)db.GetData(); + // databufferݳ + int bufferlen = db.GetSize(); + int width, height; int comp = 0; byte* data = nullptr; - PixelFormat format = PIXELFORMAT_UNKNOWN; + ColorFormat format = COLOR_FORMAT_UNKNOWN; std::size_t size = 0; if (stbi_is_hdr_from_memory(buffer, bufferlen)) { // 4channelfloat data = (byte*)stbi_loadf_from_memory(buffer, bufferlen, &width, &height, &comp, STBI_rgb_alpha); - format = PIXELFORMAT_RGBA32F; + format = COLOR_FORMAT_RGBA32F; size = width * height * 4 * sizeof(float); } else { data = (byte*)stbi_load_from_memory(buffer, bufferlen, &width, &height, &comp, STBI_rgb_alpha); - format = PIXELFORMAT_ASTC_8x5; + format = COLOR_FORMAT_RGBA8; size = width * height * 4; } if (data) { - // ֤ڴ汻ͷţһϲûͷŵΪimage dataһԵģimageǶεġ + imageData.Lock(); + if (imageData.pixels) delete[] imageData.pixels; imageData.pixels = (byte*)data; imageData.format = format; imageData.width = width; imageData.height = height; + + imageData.Unlock(); } else { diff --git a/source/modules/asura-core/graphics/stb_decoder.h b/source/modules/asura-core/graphics/stb_decoder.h index 85bad21..76e70c3 100644 --- a/source/modules/asura-core/graphics/stb_decoder.h +++ b/source/modules/asura-core/graphics/stb_decoder.h @@ -16,9 +16,9 @@ namespace AsuraEngine { public: - bool CanDecode(const AEIO::DataBuffer& buffer) override; + bool CanDecode(AEIO::DataBuffer& buffer) override; - void Decode(const AEIO::DataBuffer& buffer, ImageData& data) override; + void Decode(AEIO::DataBuffer& buffer, ImageData& data) override; }; diff --git a/source/modules/asura-core/graphics/texture.cpp b/source/modules/asura-core/graphics/texture.cpp index 6cb6497..0897702 100644 --- a/source/modules/asura-core/graphics/texture.cpp +++ b/source/modules/asura-core/graphics/texture.cpp @@ -6,20 +6,20 @@ namespace AsuraEngine { Texture::Texture() - : mTextureHandle(0) + : mTexHandle(0) { // GL texture - glGenTextures(1, &mTextureHandle); + glGenTextures(1, &mTexHandle); } Texture::~Texture() { - glDeleteTextures(1, &mTextureHandle); + glDeleteTextures(1, &mTexHandle); } GLuint Texture::GetGLTextureHandle() const { - return mTextureHandle; + return mTexHandle; } } diff --git a/source/modules/asura-core/graphics/texture.h b/source/modules/asura-core/graphics/texture.h index 81ced9f..a76e1d4 100644 --- a/source/modules/asura-core/graphics/texture.h +++ b/source/modules/asura-core/graphics/texture.h @@ -1,9 +1,8 @@ -#ifndef __ASURA_ENGINE_TEXTURE_H__ -#define __ASURA_ENGINE_TEXTURE_H__ +#ifndef __ASURA_TEXTURE_H__ +#define __ASURA_TEXTURE_H__ #include <asura-utils/math/rect.hpp> #include <asura-utils/math/vector2.hpp> -#include <asura-utils/scripting/portable.hpp> #include "../core_config.h" @@ -17,20 +16,59 @@ namespace AsuraEngine class RenderTarget; + enum WrapMode + { + WRAP_MODE_REPEAT, + WRAP_MODE_MIRROR, + WRAP_MODE_CLAMPTOEDGE, + WRAP_MODE_CLAMPTOBORDER, + //WRAP_MODE_PERAXIS, // UVвͬ4ֵ + }; + + enum FilterMode + { + FILTER_MODE_NEAREST, + FILTER_MODE_LINEAR, + }; + /// - /// 2D࣬2d meshrender targetбʹáTextureȾԭϽǣϷϲԵѿϵΪ - /// EditorҲϽΪԭ㣬Ϊ˷㡣 + /// ͼݵɫʽ + /// + enum ColorFormat + { + COLOR_FORMAT_UNKNOWN, + + COLOR_FORMAT_RGBA8, ///< RGBA8bits int + COLOR_FORMAT_RGBA32F, ///< RGBA32bits float + }; + + /// + /// 2D࣬2d meshrender targetбʹáTextureȾԭϽǣϷ + /// ϲԵѿϵΪEditorҲϽΪԭ㣬Ϊ + /// 㡣 /// ASURA_ABSTRACT class Texture { public: - Texture(); + LUAX_DECL_ABSTRACT_FACTORY(); + Texture(); virtual ~Texture(); GLuint GetGLTextureHandle() const; + void SetFilterMode(FilterMode min, FilterMode mag); + void SetWrapMode(WrapMode wrapMode); + + void GetFilterMode(); + void GetWrapMode(); + + /// + /// UVfilterΪ + /// + void IsGenMipmap(); + /// /// ȾtexturertϣԭϽǣң /// @@ -41,22 +79,20 @@ namespace AsuraEngine /// virtual void Render(const RenderTarget* rt, const Math::Rectf& quad, const RenderState& state) = 0; - /// - /// ù˷ʽ - /// - void SetSmooth(bool smooth); + protected: - /// - /// ظʽ - /// - void SetRepeated(); + LUAX_DECL_ENUM(ColorFormat); + LUAX_DECL_ENUM(FilterMode); + LUAX_DECL_ENUM(WrapMode); - protected: + GLuint mTexHandle; - /// - /// OpenGL texture handle - /// - GLuint mTextureHandle; + FilterMode mMinFilter; + FilterMode mMagFilter; + + WrapMode mWrapMode; + + bool mIsGenMipmap; }; diff --git a/source/modules/asura-core/input/clipboard.h b/source/modules/asura-core/input/clipboard.h index 4cecd55..b3b9a1a 100644 --- a/source/modules/asura-core/input/clipboard.h +++ b/source/modules/asura-core/input/clipboard.h @@ -19,11 +19,11 @@ namespace AsuraEngine void SetString(const Text::String& text); - //---------------------------------------------------------------------------------------------------------- + //----------------------------------------------------------------------------// LUAX_DECL_SINGLETON(Clipboard); - //---------------------------------------------------------------------------------------------------------- + //----------------------------------------------------------------------------// private: diff --git a/source/modules/asura-core/input/keyboard.h b/source/modules/asura-core/input/keyboard.h index 1480d06..0caf61e 100644 --- a/source/modules/asura-core/input/keyboard.h +++ b/source/modules/asura-core/input/keyboard.h @@ -42,7 +42,7 @@ // // public: // -// //---------------------------------------------------------------------------------------------------------- +// //----------------------------------------------------------------------------// // // LUAX_DECL_SINGLETON(Keyboard); // ͨAsuraEngine.KeyboardֱӷʣûNew // @@ -63,7 +63,7 @@ // // LUAX_DECL_METHOD(GetConstant); // -// //---------------------------------------------------------------------------------------------------------- +// //----------------------------------------------------------------------------// // // }; // diff --git a/source/modules/asura-core/input/mouse.h b/source/modules/asura-core/input/mouse.h index 3ab67fa..050100f 100644 --- a/source/modules/asura-core/input/mouse.h +++ b/source/modules/asura-core/input/mouse.h @@ -40,11 +40,11 @@ namespace AsuraEngine bool SetRelativeMode(bool relative) ; bool GetRelativeMode() const; - //---------------------------------------------------------------------------------------------------------- + //----------------------------------------------------------------------------// LUAX_DECL_SINGLETON(Mouse); - //---------------------------------------------------------------------------------------------------------- + //----------------------------------------------------------------------------// private: diff --git a/source/modules/asura-openal/audio.cpp b/source/modules/asura-openal/audio.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/audio.cpp diff --git a/source/modules/asura-openal/audio.h b/source/modules/asura-openal/audio.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/audio.h diff --git a/source/modules/asura-openal/mpg123_decoder.cpp b/source/modules/asura-openal/mpg123_decoder.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/mpg123_decoder.cpp diff --git a/source/modules/asura-openal/mpg123_decoder.h b/source/modules/asura-openal/mpg123_decoder.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/mpg123_decoder.h diff --git a/source/modules/asura-openal/sound_data.cpp b/source/modules/asura-openal/sound_data.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/sound_data.cpp diff --git a/source/modules/asura-openal/sound_data.h b/source/modules/asura-openal/sound_data.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/sound_data.h diff --git a/source/modules/asura-openal/source.cpp b/source/modules/asura-openal/source.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/source.cpp diff --git a/source/modules/asura-openal/source.h b/source/modules/asura-openal/source.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/source.h diff --git a/source/modules/asura-openal/vorbis_decoder.cpp b/source/modules/asura-openal/vorbis_decoder.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/vorbis_decoder.cpp diff --git a/source/modules/asura-openal/vorbis_decoder.h b/source/modules/asura-openal/vorbis_decoder.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-openal/vorbis_decoder.h diff --git a/source/modules/asura-utils/io/decoded_data.cpp b/source/modules/asura-utils/io/decoded_data.cpp deleted file mode 100644 index 358a7a5..0000000 --- a/source/modules/asura-utils/io/decoded_data.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "../exceptions/exception.h" - -#include "decoded_data.h" - -namespace AsuraEngine -{ - namespace IO - { - - DecodedData::DecodedData(const DataBuffer& databuffer) - { - Decode(databuffer); - } - - DecodedData::~DecodedData() - { - - } - - } -} diff --git a/source/modules/asura-utils/io/decoded_data.h b/source/modules/asura-utils/io/decoded_data.h index e201e91..724dbac 100644 --- a/source/modules/asura-utils/io/decoded_data.h +++ b/source/modules/asura-utils/io/decoded_data.h @@ -2,6 +2,7 @@ #define __ASURA_ENGINE_DATA_H__ #include <cstdlib> +#include <asura-utils/threading/thread.h> #include "../scripting/portable.hpp" @@ -13,8 +14,8 @@ namespace AsuraEngine { /// - /// һ̹߳data̳дࡣͼƬݡƵݵȣһ߳нԭļڲݸʽ - /// ȡ + /// һ̹߳data̳дࡣͼƬݡƵݵȣһ߳нԭ + /// ļڲݸʽصȡ /// ASURA_ABSTRACT class DecodedData { @@ -23,16 +24,13 @@ namespace AsuraEngine /// /// ڴйdataԷһ߳棬Դϵͳء /// - DecodedData(const DataBuffer& databuffer); - - virtual ~DecodedData(); - - protected: + DecodedData() {}; + virtual ~DecodedData() {}; /// - /// ڴеݡ + /// ڴеݲijָʽ档 /// - virtual void Decode(const DataBuffer& buffer) = 0; + virtual void Decode(DataBuffer& buffer) = 0; }; diff --git a/source/modules/asura-utils/io/reloadable.h b/source/modules/asura-utils/io/reloadable.h index 22a721c..c3b89ac 100644 --- a/source/modules/asura-utils/io/reloadable.h +++ b/source/modules/asura-utils/io/reloadable.h @@ -1,5 +1,5 @@ -#ifndef __ASURA_ENGINE_RELOADABLE_H__ -#define __ASURA_ENGINE_RELOADABLE_H__ +#ifndef __ASURA_ENGINE_RENEWABLE_H__ +#define __ASURA_ENGINE_RENEWABLE_H__ #include "../scripting/portable.hpp" @@ -9,15 +9,19 @@ namespace AsuraEngine { /// - /// ¹ݽṹͼƬƵ֣ⲿݿֱӹڱ༭¹ڲıhandleԴ + /// ¹ݽṹͼƬƵ֣ӽݿֱӹڱ༭ + /// ¹handleֵı䲻߱ƻԣڲıhandleԴ /// - ASURA_ABSTRACT class Reloadable + ASURA_ABSTRACT class Renewable { public: - Reloadable(); - virtual ~Reloadable(); + Renewable(); + virtual ~ Renewable(); - // ̳ReloadableҪṩһload + /// + /// ̳RenewableҪṩһRefresh + /// + virtual bool Refresh(AEIO::DecodedData* decode_data) = 0; }; |