diff options
| author | Alexander Pickering <alex@cogarr.net> | 2018-08-19 16:41:02 -0400 |
|---|---|---|
| committer | Alexander Pickering <alex@cogarr.net> | 2018-08-19 16:43:42 -0400 |
| commit | bc66e5c26672a93b4960532dacde9dadd0ab3bf3 (patch) | |
| tree | 3b974085fb800c70ddaaed8491f7a9b594f217bc /src/client/lua_api/load_video.cpp | |
| parent | a0caff7b820c4d1cade6ae567ca3c2e9af87bcda (diff) | |
| download | brokengine-bc66e5c26672a93b4960532dacde9dadd0ab3bf3.tar.gz brokengine-bc66e5c26672a93b4960532dacde9dadd0ab3bf3.tar.bz2 brokengine-bc66e5c26672a93b4960532dacde9dadd0ab3bf3.zip | |
reoganization
Diffstat (limited to 'src/client/lua_api/load_video.cpp')
| -rw-r--r-- | src/client/lua_api/load_video.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/client/lua_api/load_video.cpp b/src/client/lua_api/load_video.cpp index 607759c..e0c7557 100644 --- a/src/client/lua_api/load_video.cpp +++ b/src/client/lua_api/load_video.cpp @@ -20,7 +20,7 @@ extern IVideoDriver* driver; //video.drawtexture //{texture},{x,y} -//{texture},{x,y},{sourcerect},,{color},use_alpha +//{texture},{x,y},{sourcerect},{color},use_alpha int draw2dimage(lua_State* L){ int nargs = lua_gettop(L); //printf("Drawing a 2d image\n"); @@ -66,6 +66,19 @@ int draw2dimage(lua_State* L){ return 0; } +//{sx,sy},{ex,ey},{color} +int draw2dline(lua_State* L){ + long sx,sy,ex,ey; + long r,g,b,a; + popvector4i(L,&r,&g,&b,&a); + popvector2i(L,&ex,&ey); + popvector2i(L,&sx,&sy); + + driver->draw2DLine(position2d<s32>(sx,sy),position2d<s32>(ex,ey),SColor(r,g,b,a)); + + return 0; +} + void load_videofuncs(lua_State* L){ //printf("Loading video libraries...\n"); lua_newtable(L);//{} @@ -74,6 +87,8 @@ void load_videofuncs(lua_State* L){ lua_getglobal(L,"video");//{} lua_pushcfunction(L,draw2dimage);//{},draw2dimage() lua_setfield(L,-2,"drawtexture");//{} + lua_pushcfunction(L,draw2dline);//{},draw2dline() + lua_setfield(L,-2,"drawline");//{} lua_pop(L,1);// smaterial_register(L); |
