From 9fa5dcc9310a8c6ff8c77a47a86303f7b950dcf3 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Fri, 22 Jun 2018 12:38:38 -0600 Subject: Updated core Updated all core files to prepare for tech demo --- src/client/lua_api/gui/iguielement.cpp | 6 +++--- src/client/lua_api/gui/iguiimage.cpp | 12 ++++++------ src/client/lua_api/load_gui.cpp | 4 ++-- src/client/lua_api/load_phys.cpp | 11 +++++++++-- src/client/lua_api/load_scene.cpp | 8 -------- src/client/lua_api/load_video.cpp | 12 ++++++------ src/client/lua_api/phys/bphysbuffer.cpp | 2 +- src/client/lua_api/phys/bphysmodel.cpp | 2 +- src/client/lua_api/phys/cbphysbox.cpp | 4 ++-- src/client/lua_api/scene/icamera.cpp | 1 - src/client/lua_api/scene/icube.cpp | 2 +- src/client/lua_api/video/iimage.cpp | 10 +++++----- src/client/lua_api/video/itexture.cpp | 4 ++-- 13 files changed, 38 insertions(+), 40 deletions(-) (limited to 'src/client/lua_api') diff --git a/src/client/lua_api/gui/iguielement.cpp b/src/client/lua_api/gui/iguielement.cpp index b62efef..436bf93 100644 --- a/src/client/lua_api/gui/iguielement.cpp +++ b/src/client/lua_api/gui/iguielement.cpp @@ -27,13 +27,13 @@ static LIGUIElement* toiguielement(lua_State* L){ //move({element},{x,y}) -> nil int moveiguielement(lua_State* L){ - printf("Got call to move element\n"); + //printf("Got call to move element\n"); long x,y; popvector2i(L,&x,&y); //{element} - printf("I want to move to %d %d\n",x,y); + //printf("I want to move to %d %d\n",x,y); lua_getfield(L,-1,"guielement");//{element},*element IGUIElement *el = (IGUIElement*)lua_touserdata(L,-1); - printf("Found element to move: %p\n",el); + //printf("Found element to move: %p\n",el); lua_pop(L,2);// el->move(position2d(x,y)); diff --git a/src/client/lua_api/gui/iguiimage.cpp b/src/client/lua_api/gui/iguiimage.cpp index af1e133..370da68 100644 --- a/src/client/lua_api/gui/iguiimage.cpp +++ b/src/client/lua_api/gui/iguiimage.cpp @@ -54,7 +54,7 @@ extern IGUIEnvironment* env; //new({startx,starty},alpha,{itexture}) -> {guielement} static int newiguiimage(lua_State* L){ - printf("Creating iguiimage\n"); + //printf("Creating iguiimage\n"); lua_getfield(L,-1,"texture");//{startx,starty},alpha,{itexture},*itexture video::ITexture* tex = (video::ITexture*)lua_touserdata(L,-1); @@ -100,18 +100,18 @@ static const luaL_reg iguiimage_m[] = { }; void iguiimage_register(lua_State* L){ - printf("Loading iguiimage\n"); + //printf("Loading iguiimage\n"); luaL_newmetatable(L,"iguiimage");//{m_iguiimg} - printf("made meta table\n"); + //printf("made meta table\n"); lua_newtable(L);//{m_iguiimg},{} luaL_register(L,NULL,iguiimage_m);//{m_iguiimg},{iguiimg_m} - printf("About to set field\n"); + //printf("About to set field\n"); lua_setfield(L,-2,"__index");//{m_iguiimg} lua_pop(L,1);// - printf("Got half way\n"); + //printf("Got half way\n"); lua_getglobal(L,"gui");//{gui} lua_pushcfunction(L,newiguiimage);//{gui},newimg() lua_setfield(L,-2,"newiguiimage");//{gui} lua_pop(L,1);// - printf("Finished loading iguiimage\n"); + //printf("Finished loading iguiimage\n"); } diff --git a/src/client/lua_api/load_gui.cpp b/src/client/lua_api/load_gui.cpp index eb611ef..c90c8f5 100644 --- a/src/client/lua_api/load_gui.cpp +++ b/src/client/lua_api/load_gui.cpp @@ -65,13 +65,13 @@ void load_guifuncs(lua_State* L){ int screenheight(lua_State* L){ core::rect dim = guidevice->getGUIEnvironment()->getRootGUIElement()->getAbsoluteClippingRect(); lua_pushnumber(L,dim.getHeight()); - printf("Got screen height:%d\n",dim.getWidth()); + //printf("Got screen height:%d\n",dim.getWidth()); return 1; } int screenwidth(lua_State* L){ core::rect dim = guidevice->getGUIEnvironment()->getRootGUIElement()->getAbsoluteClippingRect(); lua_pushnumber(L,dim.getWidth()); - printf("Got screen width:%d\n",dim.getWidth()); + //printf("Got screen width:%d\n",dim.getWidth()); return 1; } diff --git a/src/client/lua_api/load_phys.cpp b/src/client/lua_api/load_phys.cpp index 846d34c..23bb22a 100644 --- a/src/client/lua_api/load_phys.cpp +++ b/src/client/lua_api/load_phys.cpp @@ -10,13 +10,20 @@ extern "C" { #include #include "../callbackhandeler.hpp" +#include "phys/cbphysbox.hpp" +#include "phys/bphysmodel.hpp" using namespace irr; using namespace gui; using namespace core; -extern IrrlichtDevice* d; +extern IrrlichtDevice* device; void load_physfuncs(lua_State* L){ - printf("Called load physfuncs..."); + lua_newtable(L);//{} + lua_setglobal(L,"phys");// + //phys things + cbphysbox_register(L); + + bphysmodel_register(L,device); } diff --git a/src/client/lua_api/load_scene.cpp b/src/client/lua_api/load_scene.cpp index 342bc9a..c605581 100644 --- a/src/client/lua_api/load_scene.cpp +++ b/src/client/lua_api/load_scene.cpp @@ -11,8 +11,6 @@ extern "C" { #include "scene/icamera.hpp" #include "scene/imesh.hpp" #include "scene/ilight.hpp" -#include "phys/cbphysbox.hpp" -#include "phys/bphysmodel.hpp" using namespace irr; @@ -27,12 +25,6 @@ void load_scenefuncs(lua_State* L){ imesh_register(L); ilight_register(L); - lua_newtable(L);//{} - lua_setglobal(L,"phys");// - //phys things - cbphysbox_register(L); - - bphysmodel_register(L,device); //lua_pop(L, 1); } diff --git a/src/client/lua_api/load_video.cpp b/src/client/lua_api/load_video.cpp index 746489a..df3a9aa 100644 --- a/src/client/lua_api/load_video.cpp +++ b/src/client/lua_api/load_video.cpp @@ -22,9 +22,9 @@ extern IVideoDriver* driver; //{texture},{x,y},{sourcerect},,{color},use_alpha int draw2dimage(lua_State* L){ int nargs = lua_gettop(L); - printf("Drawing a 2d image\n"); + //printf("Drawing a 2d image\n"); if(nargs == 2){ - printf("2-argument version\n"); + //printf("2-argument version\n"); long x,y; popvector2i(L,&x,&y); lua_getfield(L,-1,"texture"); @@ -32,10 +32,10 @@ int draw2dimage(lua_State* L){ lua_pop(L,2); driver->draw2DImage(tex,position2d(x,y)); }else if(nargs == 5){ - printf("5-argument version\n"); + //printf("5-argument version\n"); int usealpha = lua_toboolean(L,-1); lua_pop(L,1); - printf("Got usealpha: %d\n",usealpha); + //printf("Got usealpha: %d\n",usealpha); long r,g,b,a; popvector4i(L,&r,&g,&b,&a); long ssx,ssy,sex,sey; @@ -54,7 +54,7 @@ int draw2dimage(lua_State* L){ tex, position2d(x,y), rect(ssx,ssy,sex,sey), - &clipedto, + NULL, SColor(a,r,g,b), usealpha == 1 ); @@ -66,7 +66,7 @@ int draw2dimage(lua_State* L){ } void load_videofuncs(lua_State* L){ - printf("Loading video libraries...\n"); + //printf("Loading video libraries...\n"); lua_newtable(L);//{} lua_setglobal(L,"video");// diff --git a/src/client/lua_api/phys/bphysbuffer.cpp b/src/client/lua_api/phys/bphysbuffer.cpp index 367aa37..aa2833a 100644 --- a/src/client/lua_api/phys/bphysbuffer.cpp +++ b/src/client/lua_api/phys/bphysbuffer.cpp @@ -280,7 +280,7 @@ int bphysmodel_register(lua_State* L, IrrlichtDevice* d){ device = d; - printf("bphysmodel registered\n"); + //printf("bphysmodel registered\n"); luaL_newmetatable(L, "phys.physmodel"); diff --git a/src/client/lua_api/phys/bphysmodel.cpp b/src/client/lua_api/phys/bphysmodel.cpp index 424fdf8..95458b1 100644 --- a/src/client/lua_api/phys/bphysmodel.cpp +++ b/src/client/lua_api/phys/bphysmodel.cpp @@ -294,7 +294,7 @@ int bphysmodel_register(lua_State* L, IrrlichtDevice* d){ device = d; - printf("bphysmodel registered\n"); + //printf("bphysmodel registered\n"); luaL_newmetatable(L, "phys.physmodel"); diff --git a/src/client/lua_api/phys/cbphysbox.cpp b/src/client/lua_api/phys/cbphysbox.cpp index 3e72672..6a3d64e 100644 --- a/src/client/lua_api/phys/cbphysbox.cpp +++ b/src/client/lua_api/phys/cbphysbox.cpp @@ -180,8 +180,8 @@ void cbphysbox_register(lua_State* L){ lua_pop(L,1); - printf("When registering physbox, new() is %p\n",newcbphysbox); - printf("setpos is %p\n",cbphyssetpos); + //printf("When registering physbox, new() is %p\n",newcbphysbox); + //printf("setpos is %p\n",cbphyssetpos); lua_pop(L,1); diff --git a/src/client/lua_api/scene/icamera.cpp b/src/client/lua_api/scene/icamera.cpp index ec9469d..dcdec2d 100644 --- a/src/client/lua_api/scene/icamera.cpp +++ b/src/client/lua_api/scene/icamera.cpp @@ -174,6 +174,5 @@ void icamera_register(lua_State* L){ lua_setfield(L,-2,"newfpscamera");//{} lua_pushcfunction(L,newiscenemayacamera);//{},newiscenemayacamera() lua_setfield(L,-2,"newmayacamera");//{} - printf("\"scene\" was set!\n"); lua_pop(L,1);// } diff --git a/src/client/lua_api/scene/icube.cpp b/src/client/lua_api/scene/icube.cpp index d18db2a..8f4c9d8 100644 --- a/src/client/lua_api/scene/icube.cpp +++ b/src/client/lua_api/scene/icube.cpp @@ -63,6 +63,6 @@ void icube_register(lua_State* L){ lua_setfield(L,-2,"newfpscamera");//{} lua_pushcfunction(L,newiscenemayacamera);//{},newiscenemayacamera() lua_setfield(L,-2,"newmayacamera");//{} - printf("\"scene\" was set!\n"); + //printf("\"scene\" was set!\n"); //lua_pop(L,1); } diff --git a/src/client/lua_api/video/iimage.cpp b/src/client/lua_api/video/iimage.cpp index 586085e..3090057 100644 --- a/src/client/lua_api/video/iimage.cpp +++ b/src/client/lua_api/video/iimage.cpp @@ -12,25 +12,25 @@ extern IVideoDriver* driver; //newiimage(ECOLOR_FORMAT,{width,height}) -> {image} int newiimage(lua_State* L){ - printf("Attempting to create new iimage\n"); + //printf("Attempting to create new iimage\n"); long w,h; popvector2i(L,&w,&h); int format = lua_tonumber(L,-1); lua_pop(L,1); - printf("All data collected, creating...\n"); + //printf("All data collected, creating...\n"); IImage* img = driver->createImage((irr::video::ECOLOR_FORMAT)format,irr::core::dimension2d(w,h)); lua_newtable(L); lua_pushlightuserdata(L,img); lua_setfield(L,-2,"image"); luaL_getmetatable(L,"iimage"); lua_setmetatable(L,-2); - printf("Everything sets up, returning\n"); + //printf("Everything sets up, returning\n"); return 1; } //newiimagefromfile("/path/to/file") -> {image} int newiimagefromfile(lua_State* L){ - printf("Creating new iimage from file"); + //printf("Creating new iimage from file"); const char* strpath = lua_tostring(L,-1); lua_pop(L,1); int numloaders = driver->getImageLoaderCount(); @@ -59,7 +59,7 @@ int newiimagefromfile(lua_State* L){ lua_setfield(L,-2,"image"); luaL_getmetatable(L,"iimage"); lua_setmetatable(L,-2); - printf("IImage made, returning!"); + //printf("IImage made, returning!"); return 1; } diff --git a/src/client/lua_api/video/itexture.cpp b/src/client/lua_api/video/itexture.cpp index 599a448..42de1bd 100644 --- a/src/client/lua_api/video/itexture.cpp +++ b/src/client/lua_api/video/itexture.cpp @@ -16,14 +16,14 @@ extern IrrlichtDevice* device; extern IVideoDriver* driver; //newtexture(string name,{image}) -> {texture} int newitexture(lua_State* L){ - printf("About to create new texture\n"); + //printf("About to create new texture\n"); lua_getfield(L,-1,"image");//"name",{image},image* IImage* im = (IImage*) lua_touserdata(L,-1); lua_pop(L,2);//"name" const char* name = lua_tostring(L,-1); lua_pop(L,1);// - printf("About to create texture\n"); + //printf("About to create texture\n"); ITexture* tex = driver->addTexture(name,im); if(!tex){ lua_pushstring(L,"Failed to create texture!"); -- cgit v1.2.3-70-g09d2