summaryrefslogtreecommitdiff
path: root/library/LuaWrapper.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update license, add contributors file, bump release numberPetr Mrázek2012-09-301-2/+2
|
* Fix a problem with number to address cast for high-half addresses.Alexander Gavrilov2012-06-161-1/+1
| | | | | If the address is out of the signed int range, lua_tointeger produces unspecified result. lua_tounsigned is guaranteed to wrap.
* Support casting references and allocating arrays of numbers in lua wrapper.Alexander Gavrilov2012-06-131-5/+84
|
* Support sorting items in the trade screens.Alexander Gavrilov2012-05-181-0/+13
| | | | Caveat: sorts items in containers independently from the container.
* Fix lua wrapper sizeof for static arrays.Alexander Gavrilov2012-04-201-2/+15
| | | | Since it actually depends on the element type, it is more tricky.
* Wrap MaterialInfo for lua.Alexander Gavrilov2012-04-061-0/+3
|
* Experimental: try wrapping a dfhack api function.Alexander Gavrilov2012-04-051-1/+4
|
* Add functions for checking validity of lua wrapper objects.Alexander Gavrilov2012-04-021-0/+106
|
* Optimize wrapper: use pointers instead of strings as most frequent keys.Alexander Gavrilov2012-04-011-36/+54
|
* Fix a bug: LookupTypeInfo cannot assume the result is userdata.Alexander Gavrilov2012-04-011-6/+4
|
* Add df.is_instance(a,b) to check if typeof(b) is subtype of typeof(a).Alexander Gavrilov2012-04-011-11/+54
| | | | | Allows both objects and types as arguments. Also accepts nil and primitives as b, returning nil.
* Pull console output support and REPL out of dfusion into core lib.Alexander Gavrilov2012-03-311-11/+1
|
* Update lua to 5.2 and fix obvious breakage due to obsolete api.Alexander Gavrilov2012-03-311-9/+8
|
* Allow assigning NULL lightuserdata to pointers, and export a global.Alexander Gavrilov2012-03-291-8/+6
| | | | Otherwise there is no way to specify NULL via recursive lua table assign.
* Implement __pairs and __ipairs for DF objects.Alexander Gavrilov2012-03-291-12/+76
| | | | | | Structs enumerate fields in memory order in pairs(). Containers & biftields enumerate int indexes in ipairs, and string keys in pairs (i.e. using index-enum for arrays).
* Merge branch 'master' of https://github.com/peterix/dfhackQuietust2012-03-281-13/+47
|\ | | | | | | | | | | Conflicts: library/LuaTypes.cpp library/LuaWrapper.cpp
| * Disable pointer auto-vivification unless new is specified.Alexander Gavrilov2012-03-281-12/+46
| | | | | | | | | | | | | | Since it is essentially allocating non-gc managed objects, it can lead to memory leaks and shouldn't happen invisibly. Also support using the 'assign' key to request assign() from another object before processing the current map.
| * Implement recursive transfer of values from lua to c++ structures.Alexander Gavrilov2012-03-281-9/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | E.g. df.global.cursor = { x = 1, y = 2, z = 3 }. The lua data must be represented by raw lua tables. For structs, the entries in the table are assigned to matching fields. For containers, if a 'resize' field is missing or nil, the table is treated like 1-based lua array, and the container is resized to match its # length. Otherwise, the field must be either an explicit number, true or false. If it is true, the size is selected by the highest index in the table. After that, entries are copied using 0-based indices. For pointers, the table must match the target object. If the pointer is null, the object is auto-allocated; this can be controlled using the 'new' field, the value of which will be passed to df.new().
* | Implement recursive transfer of values from lua to c++ structures.Alexander Gavrilov2012-03-271-9/+106
|/ | | | | | | | | | | | | | | | | E.g. df.global.cursor = { x = 1, y = 2, z = 3 }. The lua data must be represented by raw lua tables. For structs, the entries in the table are assigned to matching fields. For containers, if a 'resize' field is missing or nil, the table is treated like 1-based lua array, and the container is resized to match its # length. Otherwise, the field must be either an explicit number, true or false. If it is true, the size is selected by the highest index in the table. After that, entries are copied using 0-based indices. For pointers, the table must match the target object. If the pointer is null, the object is auto-allocated; this can be controlled using the 'new' field, the value of which will be passed to df.new().
* Make enum attributes accessible through the lua wrapper.Alexander Gavrilov2012-03-251-4/+52
| | | | TODO: make them completely read-only.
* Add a delete() method to the objects in the lua wrapper.Alexander Gavrilov2012-03-251-4/+35
|
* Attach static methods to the type objects in the lua wrapper.Alexander Gavrilov2012-03-251-81/+96
|
* Support resize/erase/insert for containers, and allow any index in BitArray.Alexander Gavrilov2012-03-241-1/+4
|
* Split LuaWrapper.cpp into two files.Alexander Gavrilov2012-03-241-926/+39
|
* Implement allocation and copy for c++ objects in the lua wrapper.Alexander Gavrilov2012-03-241-47/+255
|
* Add a _field method that returns refs to struct and container items.Alexander Gavrilov2012-03-231-6/+139
| | | | Hack: allocate ad-hoc pointer identities as full lua userdata.
* Add a _displace method that implements offsetting a pointer by an int.Alexander Gavrilov2012-03-231-2/+73
|
* Add a sizeof method/function to retrieve object/type size and address.Alexander Gavrilov2012-03-231-11/+110
|
* Get rid of the write mode field table in metamethods.Alexander Gavrilov2012-03-231-66/+57
| | | | | Two separate tables can be confusing, e.g. if a builtin field overrides a writable custom one only in the read table.
* Remove the return type from lua_read, because it always returns 1.Alexander Gavrilov2012-03-231-32/+36
|
* Minor refactoring of container indexing and object allocation.Alexander Gavrilov2012-03-221-18/+7
|
* Implement bitfields and add a _kind metadata field to types and objects.Alexander Gavrilov2012-03-211-27/+372
|
* Support containers in the lua wrapper.Alexander Gavrilov2012-03-211-73/+371
|
* Support ordinary struct and class fields.Alexander Gavrilov2012-03-201-72/+317
|
* Add support for primitive type fields in lua wrapper.Alexander Gavrilov2012-03-201-5/+334
|
* Export the type tree with enum keys to lua.Alexander Gavrilov2012-03-191-0/+218