mirror of
https://github.com/rive-app/rive-cpp.git
synced 2026-01-18 21:21:17 +01:00
feat(scripting): forward declare luastate (#11418) a08d538dbf
Fixes an issue when building runtimes with scripting enabled where certain headers may not be included Co-authored-by: David Skuza <david@rive.app>
This commit is contained in:
@@ -1 +1 @@
|
||||
3734dc3ab996c24c024129cb5f88d257f241074d
|
||||
a08d538dbf15a1f997108de82b626df71226d271
|
||||
|
||||
@@ -24,6 +24,7 @@ enum ScriptProtocol
|
||||
};
|
||||
|
||||
#ifdef WITH_RIVE_SCRIPTING
|
||||
class LuaState;
|
||||
class ScriptAssetImporter;
|
||||
#endif
|
||||
|
||||
@@ -61,7 +62,9 @@ private:
|
||||
int m_implementedMethods = 0;
|
||||
|
||||
protected:
|
||||
#ifdef WITH_RIVE_SCRIPTING
|
||||
bool verifyImplementation(ScriptedObject* object, LuaState* luaState);
|
||||
#endif
|
||||
|
||||
public:
|
||||
int implementedMethods() { return m_implementedMethods; }
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include "rive/factory.hpp"
|
||||
#include "rive/file_asset_loader.hpp"
|
||||
#include "rive/assets/manifest_asset.hpp"
|
||||
#include "rive/lua/lua_state.hpp"
|
||||
#include "rive/viewmodel/data_enum.hpp"
|
||||
#include "rive/viewmodel/viewmodel_component.hpp"
|
||||
#include "rive/viewmodel/viewmodel_instance.hpp"
|
||||
@@ -40,6 +39,7 @@ class BindableArtboard;
|
||||
#ifdef WITH_RIVE_SCRIPTING
|
||||
class CPPRuntimeScriptingContext;
|
||||
class ScriptingVM;
|
||||
class LuaState;
|
||||
#endif
|
||||
|
||||
///
|
||||
|
||||
@@ -43,10 +43,10 @@ ScriptInput* ScriptInput::from(Core* component)
|
||||
|
||||
void ScriptInput::initScriptedValue() {}
|
||||
|
||||
#ifdef WITH_RIVE_SCRIPTING
|
||||
bool OptionalScriptedMethods::verifyImplementation(ScriptedObject* object,
|
||||
LuaState* luaState)
|
||||
{
|
||||
#ifdef WITH_RIVE_SCRIPTING
|
||||
auto state = luaState->state;
|
||||
lua_pushvalue(state, -1);
|
||||
if (static_cast<lua_Status>(rive_lua_pcall(state, 0, 1)) != LUA_OK)
|
||||
@@ -144,12 +144,8 @@ bool OptionalScriptedMethods::verifyImplementation(ScriptedObject* object,
|
||||
}
|
||||
rive_lua_pop(state, 1);
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef WITH_RIVE_SCRIPTING
|
||||
LuaState* ScriptAsset::vm()
|
||||
{
|
||||
if (m_file == nullptr)
|
||||
|
||||
Reference in New Issue
Block a user