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.
OTclient now compiles in "Microsoft Visual Studio 2013 Express for Windows Desktop"
All the needed libraries you can download at https://www.dropbox.com/s/2yfb1c763io8efy/otclient-msvc13-libs.zip
NOTE: You have to change VC++ Directories to the properly directories
NOTE: Latested MSVC 2013 or greated is required
I am able to login in global Tibia however there are game protocol errors
* there is a new opcode 167, which I dont know what it is
* there are changes in opcode 147 which handles text messages that I don't know too
Connection writing was optimized, playing "lag" should improve by 10ms,
and improve much more in systems with low fps
io_service::reset was not called before io_service::poll, meaning that new events would be really polled in the next Connection::poll call, this could lead to network lag in computers with low framerate (ie: a user with 10 fps would have 100ms lag just because of that)
00729bbc2e
from Spawn to CreatureType
I didn't have a closer look at how his code was structured, what he
basically did
is that he set all creatures in a spawn as NPC's even if it's a monster
which is
so erroneous.
Highlights:
- Add branch prediction macros
- Minor code style fixes & some others
Hopefully the branch prediction thing will speed up OTB since it's
awfully slow.