Generalize DrivenEngine::drv_invoke

This commit is contained in:
2024-09-02 21:48:24 -04:00
parent 47a570064c
commit bf3e963949
11 changed files with 67 additions and 101 deletions

View File

@@ -20,6 +20,15 @@
#define DRV_ERRMSG_SIZE 8192
#define DRV_SHORTSTRING_SIZE 65536
enum class InvocationKind {
INVALID,
LUA_CALL,
LUA_EXPR,
LUA_SOURCE,
FLUSH_PRINTS,
TICK,
};
class DrivenEngine;
class PlayLogfile;
class ReplayLogfile;
@@ -197,21 +206,12 @@ struct EngineWrapper {
//
void (*play_invoke_event_update)(EngineWrapper *w, double clock);
// Send an invoke/KIND_LUA_CALL
// Send an invoke.
//
// This is the main pathway for blueprints, or the unreal C++ code,
// to reach into lua. The datapack mus contain a classname, a function
// name, and then arguments for the function.
// to change the state of the world.
//
void (*play_invoke_lua_call)(EngineWrapper *w, int64_t place, uint32_t datapklen, const char *datapk);
// Send an invoke/KIND_LUA_SOURCE
//
// This is used to update the lua source at runtime, without stopping
// the game. In addition to sending the invoke/KIND_LUA_SOURCE, it also
// clears the rescan_lua_source flag.
//
void (*play_invoke_lua_source)(EngineWrapper *w, uint32_t srcpklen, const char *srcpk);
void (*play_invoke)(EngineWrapper *w, InvocationKind kind, int64_t place, uint32_t datapklen, const char *datapk);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////