diff options
Diffstat (limited to 'source/modules/asura-core/graphics/binding/_image.cpp')
-rw-r--r-- | source/modules/asura-core/graphics/binding/_image.cpp | 42 |
1 files changed, 14 insertions, 28 deletions
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 +} |