Commit Graph

18 Commits (528d7b1be146f04d6f2c414e6b932967e3a73e76)

Author SHA1 Message Date
Pauli f0632347d0 Remove Core.h include from DataDefs.h
Core.h isn't required for DataDefs.h which removes Core.h dependency
from DataStatics*.
2018-12-30 17:08:42 -05:00
Quietust 4edc7a6f43
update DataFuncs to support vmethods with 12-13 parameters (#1192) 2017-12-02 21:41:44 -06:00
lethosor 9fc43cff4d Make const method wrappers possible
Reverts ae3052f
Ref #935
2016-05-28 20:11:42 -04:00
lethosor 347a112aa1 Add support for 11-argument function wrappers
Needed by item::addImprovementFromJob() as of 0.42:
dfhack/df-structures@f6361e2
2015-12-18 17:45:23 -05:00
Petr Mrázek 8812238bf6 Update license, add contributors file, bump release number 2012-09-30 04:03:37 +02:00
Alexander Gavrilov c1e20c6f05 Follow changes to structures. 2012-09-17 12:47:18 +04:00
Alexander Gavrilov 236ffd578b Add experimental support for interposing vmethods of known classes.
The hairiest bit is the abuse of compiler-specific pointer-to-member
internals in order to provide more or less transparent API.
2012-08-17 22:40:53 +04:00
Alexander Gavrilov b7edbf2076 Support 7-argument vmethods. 2012-06-05 14:00:52 +04:00
Alexander Gavrilov c6b52067bd Request designation rescan in auto-growing burrows.
This improves performance of burrowed miners digging 1-wide tunnels.
2012-05-12 20:54:26 +04:00
Alexander Gavrilov 14709e5d45 Add an official core lua context, and allow plugins to send events to it.
- This context requires core suspend lock and asserts it in a few places.
- Special 'event' objects are introduced. They can be invoked as
  functions, in which case they iterate all their fields and call
  them as functions. Errors are printed and consumed.
- When a plugin is opened by the core context, events registered in
  a special array are linked to it. The system is organized so as to
  avoid even trying to pass the event to lua if the module isn't loaded.
2012-04-15 19:09:25 +04:00
Alexander Gavrilov cb49c92b99 Allow plugins to export functions to lua with safe reload support.
- To ensure reload safety functions have to be wrapped. Every call
  checks the loaded state and locks a mutex in Plugin. If the plugin
  is unloaded, calling its functions throws a lua error. Therefore,
  plugins may not create closures or export yieldable functions.

- The set of function argument and return types supported by
  LuaWrapper is severely limited when compared to being compiled
  inside the main library.
  Currently supported types: numbers, bool, std::string, df::foo,
  df::foo*, std::vector<bool>, std::vector<df::foo*>.

- To facilitate postponing initialization until after all plugins
  have been loaded, the core sends a SC_CORE_INITIALIZED event.

- As an example, the burrows plugin now exports its functions.
2012-04-14 19:44:07 +04:00
Alexander Gavrilov 0c2b78b96b Add api for manipulating burrows to the core. 2012-04-11 19:42:05 +04:00
Alexander Gavrilov 9eed9f0d24 Wrap a few utility functions defined on the c++ side for lua. 2012-04-05 19:55:59 +04:00
Alexander Gavrilov 3afed43cdb Experimental: try wrapping a dfhack api function. 2012-04-05 11:59:39 +04:00
Alexander Gavrilov d1b27418a6 Add a World::GetPersistentData version that auto-adds if not found. 2012-04-05 11:32:23 +04:00
Alexander Gavrilov 00a5bfcf3e Work around a msvc issue with spurious specialization ambiguity errors. 2012-03-26 10:46:51 +04:00
Alexander Gavrilov d0090e9551 Fix lua wrapper: create one function identity instance per method.
Otherwise all methods of the same prototype are lumped into one.
2012-03-25 21:12:20 +04:00
Alexander Gavrilov 8d345be6e7 Expose virtual methods in the lua wrapper. 2012-03-25 14:06:05 +04:00