From 6cf098e3450ba99c238cf0499c6cecaa246f4d50 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Tue, 27 Mar 2018 22:42:57 -0400 Subject: Fixed the procedural textures Procedural textures are now completely working. --- src/client/main.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/client/main.cpp') diff --git a/src/client/main.cpp b/src/client/main.cpp index 54aafc0..fbe707b 100644 --- a/src/client/main.cpp +++ b/src/client/main.cpp @@ -98,6 +98,16 @@ void UpdateElement(btRigidBody* TObject){ } +SColor background = SColor(255,100,101,140); + +//setbackgroundcolor(r,g,b) +int setbackgroundcolor(lua_State* L){ + long r,g,b; + popvector3i(L,&r,&g,&b); + background = SColor(255,r,g,b); + return 0; +} + int main(int argc, char *argv[]){ printf("Brok[en]gine Client"); // Initialize bullet @@ -140,6 +150,10 @@ int main(int argc, char *argv[]){ //u32 TimeStamp = irrTimer->getTime(), DeltaTime = 0; //high_resolution_clock::time_point t1 = high_resolution_clock::now(); + lua_getglobal(L,"GAME"); + lua_pushcfunction(L,setbackgroundcolor); + lua_setfield(L,-2,"setbackgroundcolor"); + lua_pop(L,1); while(device->run()){ gameloop_net(L); gameloop_phys(UpdateElement); @@ -149,7 +163,7 @@ int main(int argc, char *argv[]){ //double steps = delta.count() * 100; //UpdatePhysics(steps,UpdateElement); //t1 = now; - driver->beginScene(true, true, SColor(255,100,101,140)); + driver->beginScene(true, true, background); smgr->drawAll(); guienv->drawAll(); driver->endScene(); -- cgit v1.2.3-70-g09d2