this is usefull because it should read a lua program directly from a ram memory buffer, but I'm stuck on how to get the C string from the "helloworld.lua" file wich is putted into and compressed archive ("script.zip") wich is opened by irrlicht. So my problem is to get the C string from a file using irrlicht. I tried something but seems that some characters are changed during loading.
Last edited by REDDemon on Wed Dec 21, 2011 3:58 pm, edited 1 time in total.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
You use a regular IReadFile to read in the contents of your lua file (binary or text, doesnt matter) into a buffer
Then you can use luaL_loadbuffer and pass it the buffer you created with the IReadFile and it will handle everything for you
The lua documentation can be quite confusing sometimes
long size= file->getSize();
char * str = new char[size];
file->read(str,size);
luaL_loadbuffer(L,str,size,filename);
delete str;
I will try immediatly.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me