aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/lua_api/gui/iguicolorselector.hpp22
-rw-r--r--src/client/lua_api/gui/iguicombobox.cpp262
-rw-r--r--src/client/lua_api/gui/iguicombobox.hpp22
-rw-r--r--src/client/lua_api/gui/iguieditbox.hpp24
-rw-r--r--src/client/lua_api/phys/cbcharactercontroller.cpp246
-rw-r--r--src/client/lua_api/phys/cbcharactercontroller.hpp20
-rw-r--r--src/client/lua_api/phys/cbphysbox.cpp2
-rw-r--r--src/client/lua_api/video/draw.cpp58
-rw-r--r--src/client/lua_api/video/draw.hpp16
9 files changed, 336 insertions, 336 deletions
diff --git a/src/client/lua_api/gui/iguicolorselector.hpp b/src/client/lua_api/gui/iguicolorselector.hpp
index 9460f3e..c0cc168 100644
--- a/src/client/lua_api/gui/iguicolorselector.hpp
+++ b/src/client/lua_api/gui/iguicolorselector.hpp
@@ -1,11 +1,11 @@
-
-#include <stdio.h>
-#include <stdlib.h>
-extern "C" {
- #include <lua.h>
- #include <lauxlib.h>
- #include <lualib.h>
-}
-#include <irrlicht.h>
-
-int iguicolorselector_register(lua_State* L);
+
+#include <stdio.h>
+#include <stdlib.h>
+extern "C" {
+ #include <lua.h>
+ #include <lauxlib.h>
+ #include <lualib.h>
+}
+#include <irrlicht.h>
+
+int iguicolorselector_register(lua_State* L);
diff --git a/src/client/lua_api/gui/iguicombobox.cpp b/src/client/lua_api/gui/iguicombobox.cpp
index 66b19d2..43c66f1 100644
--- a/src/client/lua_api/gui/iguicombobox.cpp
+++ b/src/client/lua_api/gui/iguicombobox.cpp
@@ -1,131 +1,131 @@
-extern "C" {
- #include <lua.h>
- #include <lauxlib.h>
- #include <lualib.h>
-}
-#include <irrlicht.h>
-#include "../guiparts.hpp"
-#include "iguielement.hpp"
-#include "client/callbackhandeler.hpp"
-#include <shared/util/hashmap.hpp>
-#include <shared/lua_api/common.hpp>
-#include <client/lua_api/gui/iguicombobox.hpp>
-
-/***
-@module gui
-*/
-using namespace irr;
-using namespace core;
-using namespace gui;
-
-extern IrrlichtDevice* device;
-
-/***
-Creates a new combo box.
-Buttons may have the following fields set for callbacks:
-`.onChange(self)`
-@function newcombobox()
-@tparam rect dimensions The rectangle to place the button at. If the box has a parent,
-it is offset from the upper-left of the parent element.
-@tparam ?iguielement parent The parent element of the button.
-@treturn iguicombobox The combo box element
-*/
-//gui.newcombobox({{sx,sy},{ex,ey}}[,parent])
-static int newiguicombobox(lua_State* L){
- //printf("Createing gui button!\n");
-
- int nargs = lua_gettop(L);
- IGUIElement* parent = NULL;
- if(nargs == 2){
- lua_getfield(L,-1,"guielement");
- parent = (IGUIElement*)lua_touserdata(L,-1);
- lua_pop(L,2);//{{sx,sy},{ex,ey}}
- }
-
- long sx,sy,ex,ey;
- poprecti(L,&sx,&sy,&ex,&ey);//
-
- rect<s32> dim = rect<s32>(sx,sy,ex,ey);
- IGUIEnvironment* env = device->getGUIEnvironment();
- IGUIComboBox* but = env->addComboBox(dim,parent,-1);
-
- lua_newtable(L);//{}
- lua_pushlightuserdata(L,but);//{},ud_iguicombobox
- lua_setfield(L,-2,"guielement");//{guielement}
- luaL_getmetatable(L,"gui.iguicombobox");//{guielement},{m_iguicombobox}
- lua_setmetatable(L,-2);//{guielement}
-
- setelementcallback(L,EGET_COMBO_BOX_CHANGED,"onChange");//
-
- return 1;
-}
-
-//{combobox}.addItem(self,text,id)
-int additem(lua_State *L){
- int id = lua_tonumber(L,-1);
- lua_pop(L,1);//self,text
- const char *name_c = lua_tostring(L,-1);
- size_t name_c_len = strlen(name_c);
- printf("adding item to combo box: %s\n",name_c);
- wchar_t name_w[name_c_len + 1];
- mbstowcs(name_w,name_c,name_c_len);
- name_w[name_c_len] = L'\0';
- lua_pop(L,1);//self
- lua_getfield(L,-1,"guielement");//self,ud_guielement
- IGUIComboBox *box = (IGUIComboBox*)lua_touserdata(L,-1);
- box->addItem(name_w,id);
- lua_pop(L,2);//
- return 0;
-}
-
-// {combobox}.getselected(self)
-int getselected(lua_State *L){
- lua_getfield(L,-1,"guielement");//self,ud_guielement
- IGUIComboBox *box = (IGUIComboBox*)lua_touserdata(L,-1);
- lua_pop(L,2);//
- s32 sel = box->getSelected();
- lua_pushnumber(L,sel);//num_selected
- return 1;
-}
-
-//{combobox}.removeitem(self,id)
-int removeitem(lua_State *L){
- int idx = lua_tonumber(L,-1);//self,id
- lua_pop(L,1);//self
- lua_getfield(L,-1,"guielement");//self,ud_guielement
- IGUIComboBox *box = (IGUIComboBox*)lua_touserdata(L,-1);
- lua_pop(L,2);//
- box->removeItem(idx);
- return 0;
-}
-
-static const luaL_reg iguicombobox_f[] = {
- {"new", newiguicombobox},
- {0,0},
-};
-
-static const luaL_reg iguicombobox_m[] = {
- {"addItem", additem},
- {"getSelected", getselected},
- {"removeItem", removeitem},
- {0,0},
-};
-
-void iguicombobox_register(lua_State* L){
- tL = L;
-
- luaL_newmetatable(L, "gui.iguicombobox");//{m_iguibutton}
- lua_newtable(L);//{m_iguibutton},{}
- luaL_register(L,NULL,iguielement_m);
- luaL_register(L,NULL,iguicombobox_m);//{m_iguibutton},{}
- lua_setfield(L,-2,"__index");//{m_iguibutton}
-
- lua_pop(L,1);
-
- lua_getglobal(L,"gui");
- //luaL_register(L,NULL,iguicombobox_f)
- lua_pushcfunction(L,newiguicombobox);
- lua_setfield(L,-2,"newcombobox");
-
- lua_pop(L,1);
-}
+extern "C" {
+ #include <lua.h>
+ #include <lauxlib.h>
+ #include <lualib.h>
+}
+#include <irrlicht.h>
+#include "../guiparts.hpp"
+#include "iguielement.hpp"
+#include "client/callbackhandeler.hpp"
+#include <shared/util/hashmap.hpp>
+#include <shared/lua_api/common.hpp>
+#include <client/lua_api/gui/iguicombobox.hpp>
+
+/***
+@module gui
+*/
+using namespace irr;
+using namespace core;
+using namespace gui;
+
+extern IrrlichtDevice* device;
+
+/***
+Creates a new combo box.
+Buttons may have the following fields set for callbacks:
+`.onChange(self)`
+@function newcombobox()
+@tparam rect dimensions The rectangle to place the button at. If the box has a parent,
+it is offset from the upper-left of the parent element.
+@tparam ?iguielement parent The parent element of the button.
+@treturn iguicombobox The combo box element
+*/
+//gui.newcombobox({{sx,sy},{ex,ey}}[,parent])
+static int newiguicombobox(lua_State* L){
+ //printf("Createing gui button!\n");
+
+ int nargs = lua_gettop(L);
+ IGUIElement* parent = NULL;
+ if(nargs == 2){
+ lua_getfield(L,-1,"guielement");
+ parent = (IGUIElement*)lua_touserdata(L,-1);
+ lua_pop(L,2);//{{sx,sy},{ex,ey}}
+ }
+
+ long sx,sy,ex,ey;
+ poprecti(L,&sx,&sy,&ex,&ey);//
+
+ rect<s32> dim = rect<s32>(sx,sy,ex,ey);
+ IGUIEnvironment* env = device->getGUIEnvironment();
+ IGUIComboBox* but = env->addComboBox(dim,parent,-1);
+
+ lua_newtable(L);//{}
+ lua_pushlightuserdata(L,but);//{},ud_iguicombobox
+ lua_setfield(L,-2,"guielement");//{guielement}
+ luaL_getmetatable(L,"gui.iguicombobox");//{guielement},{m_iguicombobox}
+ lua_setmetatable(L,-2);//{guielement}
+
+ setelementcallback(L,EGET_COMBO_BOX_CHANGED,"onChange");//
+
+ return 1;
+}
+
+//{combobox}.addItem(self,text,id)
+int additem(lua_State *L){
+ int id = lua_tonumber(L,-1);
+ lua_pop(L,1);//self,text
+ const char *name_c = lua_tostring(L,-1);
+ size_t name_c_len = strlen(name_c);
+ printf("adding item to combo box: %s\n",name_c);
+ wchar_t name_w[name_c_len + 1];
+ mbstowcs(name_w,name_c,name_c_len);
+ name_w[name_c_len] = L'\0';
+ lua_pop(L,1);//self
+ lua_getfield(L,-1,"guielement");//self,ud_guielement
+ IGUIComboBox *box = (IGUIComboBox*)lua_touserdata(L,-1);
+ box->addItem(name_w,id);
+ lua_pop(L,2);//
+ return 0;
+}
+
+// {combobox}.getselected(self)
+int getselected(lua_State *L){
+ lua_getfield(L,-1,"guielement");//self,ud_guielement
+ IGUIComboBox *box = (IGUIComboBox*)lua_touserdata(L,-1);
+ lua_pop(L,2);//
+ s32 sel = box->getSelected();
+ lua_pushnumber(L,sel);//num_selected
+ return 1;
+}
+
+//{combobox}.removeitem(self,id)
+int removeitem(lua_State *L){
+ int idx = lua_tonumber(L,-1);//self,id
+ lua_pop(L,1);//self
+ lua_getfield(L,-1,"guielement");//self,ud_guielement
+ IGUIComboBox *box = (IGUIComboBox*)lua_touserdata(L,-1);
+ lua_pop(L,2);//
+ box->removeItem(idx);
+ return 0;
+}
+
+static const luaL_reg iguicombobox_f[] = {
+ {"new", newiguicombobox},
+ {0,0},
+};
+
+static const luaL_reg iguicombobox_m[] = {
+ {"addItem", additem},
+ {"getSelected", getselected},
+ {"removeItem", removeitem},
+ {0,0},
+};
+
+void iguicombobox_register(lua_State* L){
+ tL = L;
+
+ luaL_newmetatable(L, "gui.iguicombobox");//{m_iguibutton}
+ lua_newtable(L);//{m_iguibutton},{}
+ luaL_register(L,NULL,iguielement_m);
+ luaL_register(L,NULL,iguicombobox_m);//{m_iguibutton},{}
+ lua_setfield(L,-2,"__index");//{m_iguibutton}
+
+ lua_pop(L,1);
+
+ lua_getglobal(L,"gui");
+ //luaL_register(L,NULL,iguicombobox_f)
+ lua_pushcfunction(L,newiguicombobox);
+ lua_setfield(L,-2,"newcombobox");
+
+ lua_pop(L,1);
+}
diff --git a/src/client/lua_api/gui/iguicombobox.hpp b/src/client/lua_api/gui/iguicombobox.hpp
index ff6ba97..d3e8111 100644
--- a/src/client/lua_api/gui/iguicombobox.hpp
+++ b/src/client/lua_api/gui/iguicombobox.hpp
@@ -1,11 +1,11 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <vector>
-extern "C" {
- #include <lua.h>
- #include <lauxlib.h>
- #include <lualib.h>
-}
-#include <irrlicht.h>
-
-void iguicombobox_register(lua_State* L);
+#include <stdio.h>
+#include <stdlib.h>
+#include <vector>
+extern "C" {
+ #include <lua.h>
+ #include <lauxlib.h>
+ #include <lualib.h>
+}
+#include <irrlicht.h>
+
+void iguicombobox_register(lua_State* L);
diff --git a/src/client/lua_api/gui/iguieditbox.hpp b/src/client/lua_api/gui/iguieditbox.hpp
index 51bf832..429f119 100644
--- a/src/client/lua_api/gui/iguieditbox.hpp
+++ b/src/client/lua_api/gui/iguieditbox.hpp
@@ -1,12 +1,12 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <vector>
-extern "C" {
- #include <lua.h>
- #include <lauxlib.h>
- #include <lualib.h>
-}
-#include <irrlicht.h>
-
-void iguieditbox_register(lua_State* L);
-
+#include <stdio.h>
+#include <stdlib.h>
+#include <vector>
+extern "C" {
+ #include <lua.h>
+ #include <lauxlib.h>
+ #include <lualib.h>
+}
+#include <irrlicht.h>
+
+void iguieditbox_register(lua_State* L);
+
diff --git a/src/client/lua_api/phys/cbcharactercontroller.cpp b/src/client/lua_api/phys/cbcharactercontroller.cpp
index f93d01a..e116ee8 100644
--- a/src/client/lua_api/phys/cbcharactercontroller.cpp
+++ b/src/client/lua_api/phys/cbcharactercontroller.cpp
@@ -1,123 +1,123 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <list>
-extern "C" {
- #include <lua.h>
- #include <lauxlib.h>
- #include <lualib.h>
-}
-
-#include <btBulletDynamicsCommon.h>
-#include <BulletDynamics/Character/btKinematicCharacterController.h>
-#include <BulletCollision/CollisionDispatch/btGhostObject.h>
-#include <irrlicht.h>
-#include "cbphysbox.hpp"
-#include "../scene/imesh.hpp"
-#include "../scene/igeneric.hpp"
-#include <shared/lua_api/phys/bcharactercontroller.hpp>
-#include <shared/lua_api/common.hpp>
-
-#include <shared/lua_api/phys/bphysgeneric.hpp>
-
-using namespace irr;
-using namespace scene;
-using namespace core;
-using namespace video;
-
-extern IrrlichtDevice* device;
-
-extern btDiscreteDynamicsWorld* World;
-extern std::list<btRigidBody*> Objects;
-
-
-//phys.newcharactercontroller({vector3 size},{vector3 origin})
-static int newcbcharactercontroller(lua_State* L){//
- printf("Createing new cbcharactercontroller\n");
- double sx,sy,sz,x,y,z;
- //Get the data
- popvector3d(L,&x,&y,&z);//{v3 size}
- popvector3d(L,&sx,&sy,&sz);//
-
- pushvector3d(L,sx,sy,sz);//{v3 size}
- pushvector3d(L,x,y,z);//{v3 size},{v3 origin}
- makenewbcharactercontroller(L);//ud_cc
- btKinematicCharacterController* cc = (btKinematicCharacterController*)lua_touserdata(L,-1);//ud_cc
- lua_pop(L,1);
-
- pushvector3d(L,sx,sy,sz);//{v3 size}
- pushvector3d(L,x,y,z);//{v3 size},{v3 origin}
- makenewiscenecube(L);//ud_iscenenode
- ISceneNode* n = (ISceneNode*)lua_touserdata(L,-1);//ud_iscenenode
- lua_pop(L,1);
-
- cc->getGhostObject()->setUserPointer(n);
- //cc->setUserPointer(n);//TODO: what does this break?
-
- lua_newtable(L);//{}
- lua_pushlightuserdata(L,cc);//{},ud_cc
- lua_setfield(L,-2,"character");//{}
- lua_pushlightuserdata(L,n);//{},ud_iscenenode
- lua_setfield(L,-2,"node");//{}
- lua_pushstring(L,"character");
- lua_setfield(L,-2,"type");
-
- luaL_getmetatable(L,"phys.charactercontroller");//{},{phys.charactercontroller}
- lua_setmetatable(L,-2);//{}
-
- return 1;
-}
-
-//setMaterial(self,material)
-//int cbsetmaterial(lua_State* L){
- //printf("Call to setmaterial\n");
- ////SMaterial* mat = (SMaterial*)lua_touserdata(L,-1);//{node=ud_ISceneNode},ud_IMaterial
- //ITexture* tex = (ITexture*)lua_touserdata(L,-1);
- //lua_pop(L,1);//{node=ud_ISceneNode}
- //printf("About to get field node\n");
- //lua_getfield(L,-1,"node");//{node=ud_ISceneNode},ud_ISceneNode
- //printf("After call to field node\n");
- //ISceneNode* i = (ISceneNode*)lua_touserdata(L,-1);//{node=ud_ISceneNode},ud_ISceneNode
- //lua_pop(L,2);//
-
- //lua_pushlightuserdata(L,i);
- //lua_pushlightuserdata(L,tex);
- //printf("Finished getting everything for setmaterial\n");
- //iscenesetmaterial(L);
-
- //return 0;
-//}
-
-//int cbchar
-
-static const luaL_reg cbcharactercontroller_m[] = {
- //{"setpos", cbcharsetpos},//overload
- //{"getpos", cbchargetpos},
- //{"getgravity", cbphysgetgravity},
- //{"applygravity",cbphysapplygravity},
- //{"setMaterial", cbsetmaterial},
-// {"delete", delbphysbox},//client side delete needs to delete the visual representation
- {0, 0},
-};
-
-void cbcharactercontroller_register(lua_State* L){
- bcharactercontroller_register(L);//
- lua_getglobal(L,"phys");//{}
- lua_pushcfunction(L,newcbcharactercontroller);//{},newcbphysbox()
- lua_setfield(L,-2,"newccharactercontroller");//{}
-
- lua_pop(L,1);//
-
- luaL_getmetatable(L,"phys.charactercontroller");//phys.physbox
- lua_newtable(L);//phys.physbox,{}
- //luaL_register(L,NULL,brigidbody_m);
- luaL_register(L,NULL,igeneric_m);
- luaL_register(L,NULL,cbcharactercontroller_m);//phys.physbox,{}
- luaL_register(L,NULL,bcharactercontroller_m);
- lua_setfield(L,-2,"__index");//phys.physbox
-
- lua_pop(L,1);
-
- //printf("When registering physbox, new() is %p\n",newcbphysbox);
- //printf("setpos is %p\n",cbphyssetpos);
-
-}
+#include <stdio.h>
+#include <stdlib.h>
+#include <list>
+extern "C" {
+ #include <lua.h>
+ #include <lauxlib.h>
+ #include <lualib.h>
+}
+
+#include <btBulletDynamicsCommon.h>
+#include <BulletDynamics/Character/btKinematicCharacterController.h>
+#include <BulletCollision/CollisionDispatch/btGhostObject.h>
+#include <irrlicht.h>
+#include "cbphysbox.hpp"
+#include "../scene/imesh.hpp"
+#include "../scene/igeneric.hpp"
+#include <shared/lua_api/phys/bcharactercontroller.hpp>
+#include <shared/lua_api/common.hpp>
+
+#include <shared/lua_api/phys/bphysgeneric.hpp>
+
+using namespace irr;
+using namespace scene;
+using namespace core;
+using namespace video;
+
+extern IrrlichtDevice* device;
+
+extern btDiscreteDynamicsWorld* World;
+extern std::list<btRigidBody*> Objects;
+
+
+//phys.newcharactercontroller({vector3 size},{vector3 origin})
+static int newcbcharactercontroller(lua_State* L){//
+ printf("Createing new cbcharactercontroller\n");
+ double sx,sy,sz,x,y,z;
+ //Get the data
+ popvector3d(L,&x,&y,&z);//{v3 size}
+ popvector3d(L,&sx,&sy,&sz);//
+
+ pushvector3d(L,sx,sy,sz);//{v3 size}
+ pushvector3d(L,x,y,z);//{v3 size},{v3 origin}
+ makenewbcharactercontroller(L);//ud_cc
+ btKinematicCharacterController* cc = (btKinematicCharacterController*)lua_touserdata(L,-1);//ud_cc
+ lua_pop(L,1);
+
+ pushvector3d(L,sx,sy,sz);//{v3 size}
+ pushvector3d(L,x,y,z);//{v3 size},{v3 origin}
+ makenewiscenecube(L);//ud_iscenenode
+ ISceneNode* n = (ISceneNode*)lua_touserdata(L,-1);//ud_iscenenode
+ lua_pop(L,1);
+
+ cc->getGhostObject()->setUserPointer(n);
+ //cc->setUserPointer(n);//TODO: what does this break?
+
+ lua_newtable(L);//{}
+ lua_pushlightuserdata(L,cc);//{},ud_cc
+ lua_setfield(L,-2,"character");//{}
+ lua_pushlightuserdata(L,n);//{},ud_iscenenode
+ lua_setfield(L,-2,"node");//{}
+ lua_pushstring(L,"character");
+ lua_setfield(L,-2,"type");
+
+ luaL_getmetatable(L,"phys.charactercontroller");//{},{phys.charactercontroller}
+ lua_setmetatable(L,-2);//{}
+
+ return 1;
+}
+
+//setMaterial(self,material)
+//int cbsetmaterial(lua_State* L){
+ //printf("Call to setmaterial\n");
+ ////SMaterial* mat = (SMaterial*)lua_touserdata(L,-1);//{node=ud_ISceneNode},ud_IMaterial
+ //ITexture* tex = (ITexture*)lua_touserdata(L,-1);
+ //lua_pop(L,1);//{node=ud_ISceneNode}
+ //printf("About to get field node\n");
+ //lua_getfield(L,-1,"node");//{node=ud_ISceneNode},ud_ISceneNode
+ //printf("After call to field node\n");
+ //ISceneNode* i = (ISceneNode*)lua_touserdata(L,-1);//{node=ud_ISceneNode},ud_ISceneNode
+ //lua_pop(L,2);//
+
+ //lua_pushlightuserdata(L,i);
+ //lua_pushlightuserdata(L,tex);
+ //printf("Finished getting everything for setmaterial\n");
+ //iscenesetmaterial(L);
+
+ //return 0;
+//}
+
+//int cbchar
+
+static const luaL_reg cbcharactercontroller_m[] = {
+ //{"setpos", cbcharsetpos},//overload
+ //{"getpos", cbchargetpos},
+ //{"getgravity", cbphysgetgravity},
+ //{"applygravity",cbphysapplygravity},
+ //{"setMaterial", cbsetmaterial},
+// {"delete", delbphysbox},//client side delete needs to delete the visual representation
+ {0, 0},
+};
+
+void cbcharactercontroller_register(lua_State* L){
+ bcharactercontroller_register(L);//
+ lua_getglobal(L,"phys");//{}
+ lua_pushcfunction(L,newcbcharactercontroller);//{},newcbphysbox()
+ lua_setfield(L,-2,"newccharactercontroller");//{}
+
+ lua_pop(L,1);//
+
+ luaL_getmetatable(L,"phys.charactercontroller");//phys.physbox
+ lua_newtable(L);//phys.physbox,{}
+ //luaL_register(L,NULL,brigidbody_m);
+ luaL_register(L,NULL,igeneric_m);
+ luaL_register(L,NULL,cbcharactercontroller_m);//phys.physbox,{}
+ luaL_register(L,NULL,bcharactercontroller_m);
+ lua_setfield(L,-2,"__index");//phys.physbox
+
+ lua_pop(L,1);
+
+ //printf("When registering physbox, new() is %p\n",newcbphysbox);
+ //printf("setpos is %p\n",cbphyssetpos);
+
+}
diff --git a/src/client/lua_api/phys/cbcharactercontroller.hpp b/src/client/lua_api/phys/cbcharactercontroller.hpp
index d7b76eb..d86701f 100644
--- a/src/client/lua_api/phys/cbcharactercontroller.hpp
+++ b/src/client/lua_api/phys/cbcharactercontroller.hpp
@@ -1,10 +1,10 @@
-#include <stdio.h>
-#include <stdlib.h>
-extern "C" {
- #include <lua.h>
- #include <lauxlib.h>
- #include <lualib.h>
-}
-#include <irrlicht.h>
-
-void cbcharactercontroller_register(lua_State* L);
+#include <stdio.h>
+#include <stdlib.h>
+extern "C" {
+ #include <lua.h>
+ #include <lauxlib.h>
+ #include <lualib.h>
+}
+#include <irrlicht.h>
+
+void cbcharactercontroller_register(lua_State* L);
diff --git a/src/client/lua_api/phys/cbphysbox.cpp b/src/client/lua_api/phys/cbphysbox.cpp
index 6763945..5fcba3b 100644
--- a/src/client/lua_api/phys/cbphysbox.cpp
+++ b/src/client/lua_api/phys/cbphysbox.cpp
@@ -48,7 +48,7 @@ static int newcbphysbox(lua_State* L){//
btRigidBody* r = (btRigidBody*)lua_touserdata(L,-1);//ud_btRigidbody
lua_pop(L,1);
- pushvector3d(L,sx,sy,sz);//{v3 size}
+ pushvector3d(L,sx*2,sy*2,sz*2);//{v3 size}
pushvector3d(L,x,y,z);//{v3 size},{v3 origin}
makenewiscenecube(L);//ud_iscenenode
ISceneNode* n = (ISceneNode*)lua_touserdata(L,-1);//ud_iscenenode
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 <irrlicht.h>
-#include <shared/lua_api/common.hpp>
-#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<s32>(startx, starty), position2d<s32>(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 <irrlicht.h>
+#include <shared/lua_api/common.hpp>
+#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<s32>(startx, starty), position2d<s32>(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 <lua.h>
- #include <lauxlib.h>
- #include <lualib.h>
-}
-
-void draw_register(lua_State* L);
+
+extern "C" {
+ #include <lua.h>
+ #include <lauxlib.h>
+ #include <lualib.h>
+}
+
+void draw_register(lua_State* L);