diff options
| author | Alexander <alex@cogarr.net> | 2019-01-09 16:09:39 -0500 |
|---|---|---|
| committer | Alexander <alex@cogarr.net> | 2019-01-09 16:09:39 -0500 |
| commit | bb9f6d43a4e574506e3049bd56c890c242d35e8b (patch) | |
| tree | 5935b51197a2f571593a01d972559b85ca485773 /src/client/lua_api/video | |
| parent | 2009501214f3c2e3f8d8b1a06432afdf39276bd5 (diff) | |
| download | brokengine-bb9f6d43a4e574506e3049bd56c890c242d35e8b.tar.gz brokengine-bb9f6d43a4e574506e3049bd56c890c242d35e8b.tar.bz2 brokengine-bb9f6d43a4e574506e3049bd56c890c242d35e8b.zip | |
Moved the define constant definition into common/shared header
Diffstat (limited to 'src/client/lua_api/video')
| -rw-r--r-- | src/client/lua_api/video/iimage.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/client/lua_api/video/iimage.cpp b/src/client/lua_api/video/iimage.cpp index 6fbf6c5..4c7795d 100644 --- a/src/client/lua_api/video/iimage.cpp +++ b/src/client/lua_api/video/iimage.cpp @@ -135,9 +135,24 @@ int getiimagepixel(lua_State* L){ return 1; } +/*** +Returns the dimensions of the image +@function iimage:getDimensions() +@treturn vec2i dimensions The dimensions of the image +*/ +//getdimensions({self}) +int getiimagedimensions(lua_State *L){ + lua_getfield(L,-1,"image"); + IImage *img = (IImage*)lua_touserdata(L,-1); + core::dimension2d<u32> dims = img->getDimension(); + pushvector2i(L,dims.Height, dims.Width); + return 1; +} + static const luaL_reg iimage_m[] = { {"setpixel", setiimagepixel}, {"getpixel", getiimagepixel}, + {"getdimensions", getiimagedimensions}, {0,0}, }; |
