aboutsummaryrefslogtreecommitdiff
path: root/src/client/lua_api/scene/igeneric.cpp
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2018-03-27 22:42:57 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2018-03-27 22:42:57 -0400
commit6cf098e3450ba99c238cf0499c6cecaa246f4d50 (patch)
tree175b84e32a3cf24f3fb7356825827f6611bab1ed /src/client/lua_api/scene/igeneric.cpp
parent2831e232b886c5e3b0791ea5192f9e5194e6abf3 (diff)
downloadbrokengine-6cf098e3450ba99c238cf0499c6cecaa246f4d50.tar.gz
brokengine-6cf098e3450ba99c238cf0499c6cecaa246f4d50.tar.bz2
brokengine-6cf098e3450ba99c238cf0499c6cecaa246f4d50.zip
Fixed the procedural textures
Procedural textures are now completely working.
Diffstat (limited to 'src/client/lua_api/scene/igeneric.cpp')
-rw-r--r--src/client/lua_api/scene/igeneric.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/client/lua_api/scene/igeneric.cpp b/src/client/lua_api/scene/igeneric.cpp
index 8280008..c016788 100644
--- a/src/client/lua_api/scene/igeneric.cpp
+++ b/src/client/lua_api/scene/igeneric.cpp
@@ -66,14 +66,15 @@ int iscenesetangle(lua_State* L){//{node=ud_ISceneNode},{x,y,z}
return 0;
}
-/*
+//iscenesetmaterial(ud_ISceneNode,ud_itexture)
int iscenesetmaterial(lua_State* L){
- ISceneNode* i = toiscenenode(L,1)->n;
- const char* s = luaL_optstring(L,2,"error.png");
- printf("Setting material to %s",s);
- IVideoDriver* driver = device->getVideoDriver();
- i->setMaterialTexture(0, driver->getTexture(s));
+ printf("Calling generic iscenesetmaterial function\n");
+ ITexture* txt = (ITexture*)lua_touserdata(L,-1);//ud_ISceneNode,ud_itexture
+ lua_pop(L,1);//ud_ISceneNode
+ ISceneNode* i = (ISceneNode*)lua_touserdata(L,-1);//ud_ISceneNode
+ lua_pop(L,2);//
+
+ i->setMaterialTexture(0,txt);
- return 0;
+ return 0;
}
-*/