Unfortunately UITextEdit is really bad in terms of performance. It
cannot be used as overlying widget (just like in terminal). On the other
hand we could optimize it by rewriting (unfortunately) the whole widget.
There still is a lot of things to do, but for now it is possible to
select several lines of text and copy it using CTRL + C. In order to
make text copyable in context menu it will be required to override
onMousePress (return true).
* Dat now loads (new animations aren't yet functional).
* Fixed the way we reference client versions.
TODO: Write new animation functionality & find out protocol changes.
This can recursively find files in a directory that's not in physfs search
path, this is needed for mapeditor needs, esp the file browser.
We do not want to limit users to the application run directory
so we have to use this.
This function uses boost filesystem.
Prototype:
g_resources.getDirectoryFiles(directory STRING, filenameOnly BOOL,
recursive BOOL)
filenameOnly is there if we want to just get the filenames in the
directory.
recursive if we want to loop directories in the directory.
lua_newtable() definition:
#define lua_newtable(L) lua_createtable(L, 0, 0)
This simply allocates space for 0 fields, meaning, if we push any
values into this array, it will re-allocate the array, which is bad.
This function statically allocates an array, so it's ready to have
X fields into it.
Performance tests:
lua_newtable
1428161
1426992
1413513
lua_createtable
2004544
1974117
1957533
These tests were done on an AMD 8350fx CPU, single thread used.
narr: This is for fields that just have an index, e.g. arr[0] etc.
nrec: For fields which needs like arr.a, arr.b etc.
This is how many times each of the functions can run per second, as
you can see about 1.7x the calls to lua_newtable.
All credits goes to @dalkon, he was too lazy to do it by himself, and
asked me to do it for him.