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
* Begin working on a new layout system for UIMinimap and later UIMap,
this new layout system allows to add widgets to the minimap
* Add option to disable motd
* Rework hotkey binding
* Lots of fixes in hotkeys manager
* Add fullmap view using Ctrl+Shift+M
* Prevent some crashs in ThingType draw
* Add function to load minimap from PNG files
* Fixes in minimap saving
* Fixes in Tile::isClickable
* Add UIMapAnchorLayout, new layout for maps
* Fix freezes in win32 when pressing alt key
* IMPORTANT: A new dependency is required, boost_locale, comes with boost 1.50.0 or later
* Copying and pasting special characters should now work
* Running otclient from filepaths with special characters should work now too
Implement new classes:
* stdext::any => ligher replacement for boost::any
* stdext::packed_any => like any but optimized to use less memory
* stdext::shared_object => ligher replacement for std::shared_ptr
* stdext::shared_object_ptr => replacement for boost::intrusive_ptr
* stdext::fast_storage => for storing dynamic data
* stdext::packed_storage => same but with less memory
* stdext::packed_vector => std::vector with less memory
Compiling should be a little faster now because global boost including
is not needed anymore
Create a new shared pointer type stdext::shared_object_ptr and stdext::shared_obj
using boost::intrusive_ptr
Advantages:
* half memory usage
* faster and lightweight
Disadvantages:
* using weak_ptr is not supported anymore
* compiling seems slower
Sandboxing makes module scripts run inside an isolated lua environments,
making more easier and secure to script
Move and rework TextMessage using the new sandbox system
Make otclient's framework flexible enough to run console apps like
servers, so this mean is possible to build otclient versions without
graphical interface and use it's framework to code servers