From 44a1421c393632978d59c0698a93ae22243b97e9 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 10 Jun 2020 20:39:54 -0400 Subject: Various progress for 1klutz Added convext shape casts, still a little broken, but it might be just broken bullet side. --- src/client/lua_api/video/draw.cpp | 58 +++++++++++++++++++-------------------- src/client/lua_api/video/draw.hpp | 16 +++++------ 2 files changed, 37 insertions(+), 37 deletions(-) (limited to 'src/client/lua_api/video') diff --git a/src/client/lua_api/video/draw.cpp b/src/client/lua_api/video/draw.cpp index 1f38f34..7140162 100644 --- a/src/client/lua_api/video/draw.cpp +++ b/src/client/lua_api/video/draw.cpp @@ -1,29 +1,29 @@ - -#include -#include -#include "draw.hpp" - -using namespace irr; -using namespace video; -using namespace core; - -extern IrrlichtDevice* device; -extern IVideoDriver* driver; -//drawline2d {startx,starty},{endx,endy},{r,g,b,a} -int drawline2d(lua_State *L){ - long r,g,b,a; - popvector4i(L, &r, &g, &b, &a); - long endx, endy; - popvector2i(L, &endx, &endy); - long startx, starty; - popvector2i(L, &startx, &starty); - driver->draw2DLine(position2d(startx, starty), position2d(endx,endy), SColor(r,g,b,a)); - return 0; -} - -void draw_register(lua_State *L){ - lua_getglobal(L,"video");//{video} - lua_pushcfunction(L,drawline2d);//{video},drawline2d() - lua_setfield(L,-2,"drawline2d");//{video} - lua_pop(L,1);// -} + +#include +#include +#include "draw.hpp" + +using namespace irr; +using namespace video; +using namespace core; + +extern IrrlichtDevice* device; +extern IVideoDriver* driver; +//drawline2d {startx,starty},{endx,endy},{r,g,b,a} +int drawline2d(lua_State *L){ + long r,g,b,a; + popvector4i(L, &r, &g, &b, &a); + long endx, endy; + popvector2i(L, &endx, &endy); + long startx, starty; + popvector2i(L, &startx, &starty); + driver->draw2DLine(position2d(startx, starty), position2d(endx,endy), SColor(r,g,b,a)); + return 0; +} + +void draw_register(lua_State *L){ + lua_getglobal(L,"video");//{video} + lua_pushcfunction(L,drawline2d);//{video},drawline2d() + lua_setfield(L,-2,"drawline2d");//{video} + lua_pop(L,1);// +} diff --git a/src/client/lua_api/video/draw.hpp b/src/client/lua_api/video/draw.hpp index eb5a9a7..836cd3d 100644 --- a/src/client/lua_api/video/draw.hpp +++ b/src/client/lua_api/video/draw.hpp @@ -1,8 +1,8 @@ - -extern "C" { - #include - #include - #include -} - -void draw_register(lua_State* L); + +extern "C" { + #include + #include + #include +} + +void draw_register(lua_State* L); -- cgit v1.2.3-70-g09d2