@@ -29,14 +29,33 @@ endif | |||||
# Entropia File System Watcher | # Entropia File System Watcher | ||||
efsw := dep/lib/libefsw-static-release.a | |||||
ifeq (, $(shell which premake4)) | |||||
ifeq (, $(shell which premake5)) | |||||
$(error premake is not installed. Please install either premake4 or premake5) | |||||
else | |||||
PREMAKE = premake5 | |||||
endif | |||||
else | |||||
PREMAKE = premake4 | |||||
endif | |||||
ifdef ARCH_WIN | |||||
efsw := dep/lib/efsw-static-release.lib | |||||
else | |||||
efsw := dep/lib/libefsw-static-release.a | |||||
endif | |||||
DEPS += $(efsw) | DEPS += $(efsw) | ||||
OBJECTS += $(efsw) | OBJECTS += $(efsw) | ||||
$(efsw): | $(efsw): | ||||
cd efsw && premake4 gmake | |||||
cd efsw && $(PREMAKE) gmake | |||||
ifdef ARCH_WIN | |||||
cd efsw && $(MAKE) -C make/* config=release_x86_64 efsw-static-lib | |||||
mkdir -p dep/lib dep/include | |||||
cd efsw && cp lib/efsw-static-release.lib $(DEP_PATH)/lib/ | |||||
else | |||||
cd efsw && $(MAKE) -C make/* config=release efsw-static-lib | cd efsw && $(MAKE) -C make/* config=release efsw-static-lib | ||||
mkdir -p dep/lib dep/include | mkdir -p dep/lib dep/include | ||||
cd efsw && cp lib/libefsw-static-release.a $(DEP_PATH)/lib/ | cd efsw && cp lib/libefsw-static-release.a $(DEP_PATH)/lib/ | ||||
endif | |||||
cd efsw && cp -R include/efsw $(DEP_PATH)/include/ | cd efsw && cp -R include/efsw $(DEP_PATH)/include/ | ||||
@@ -74,45 +93,60 @@ endif | |||||
# LuaJIT | # LuaJIT | ||||
ifeq ($(LUAJIT), 1) | ifeq ($(LUAJIT), 1) | ||||
SOURCES += src/LuaJITEngine.cpp | SOURCES += src/LuaJITEngine.cpp | ||||
luajit := dep/lib/libluajit-5.1.a | |||||
luajit := dep/LuaJIT/src/libluajit.a | |||||
OBJECTS += $(luajit) | OBJECTS += $(luajit) | ||||
DEPS += $(luajit) | DEPS += $(luajit) | ||||
$(luajit): | $(luajit): | ||||
$(WGET) "http://luajit.org/download/LuaJIT-2.0.5.tar.gz" | |||||
$(SHA256) LuaJIT-2.0.5.tar.gz 874b1f8297c697821f561f9b73b57ffd419ed8f4278c82e05b48806d30c1e979 | |||||
cd dep && $(UNTAR) ../LuaJIT-2.0.5.tar.gz | |||||
cd dep/LuaJIT-2.0.5 && $(MAKE) BUILDMODE=static PREFIX="$(DEP_PATH)" install | |||||
cd dep && git clone "https://github.com/LuaJIT/LuaJIT.git" | |||||
cd dep/LuaJIT && git checkout v2.1 | |||||
cd dep/LuaJIT && MACOSX_DEPLOYMENT_TARGET=10.9 $(MAKE) BUILDMODE=static PREFIX="$(DEP_PATH)" install | |||||
endif | endif | ||||
# SuperCollider | # SuperCollider | ||||
ifeq ($(SUPERCOLLIDER), 1) | ifeq ($(SUPERCOLLIDER), 1) | ||||
SOURCES += src/SuperColliderEngine.cpp | SOURCES += src/SuperColliderEngine.cpp | ||||
FLAGS += -Idep/supercollider/include -Idep/supercollider/include/common -Idep/supercollider/lang -Idep/supercollider/common -Idep/supercollider/include/plugin_interface | |||||
FLAGS += -Idep/supercollider/include -Idep/supercollider/include/common -Idep/supercollider/lang -Idep/supercollider/common -Idep/supercollider/include/plugin_interface -Idep/supercollider/external_libraries/boost | |||||
# FLAGS += -DSC_VCV_ENGINE_TIMING # uncomment to turn on timing printing while running | # FLAGS += -DSC_VCV_ENGINE_TIMING # uncomment to turn on timing printing while running | ||||
supercollider := dep/supercollider/build/lang/libsclang.a | |||||
ifdef ARCH_WIN | |||||
supercollider := dep/supercollider/build/lang/liblibsclang.a | |||||
else | |||||
supercollider := dep/supercollider/build/lang/libsclang.a | |||||
endif | |||||
OBJECTS += $(supercollider) | OBJECTS += $(supercollider) | ||||
DEPS += $(supercollider) | DEPS += $(supercollider) | ||||
DISTRIBUTABLES += dep/supercollider/SCClassLibrary | DISTRIBUTABLES += dep/supercollider/SCClassLibrary | ||||
DISTRIBUTABLES += support/supercollider_extensions | DISTRIBUTABLES += support/supercollider_extensions | ||||
SUPERCOLLIDER_CMAKE_FLAGS += -DSUPERNOVA=0 -DSC_EL=0 -DSC_VIM=0 -DSC_ED=0 -DSC_IDE=0 -DSC_ABLETON_LINK=0 -DSC_QT=0 -DCMAKE_BUILD_TYPE=Release -DSCLANG_SERVER=0 -DBUILD_TESTING=0 -DNO_LIBSNDFILE=1 | SUPERCOLLIDER_CMAKE_FLAGS += -DSUPERNOVA=0 -DSC_EL=0 -DSC_VIM=0 -DSC_ED=0 -DSC_IDE=0 -DSC_ABLETON_LINK=0 -DSC_QT=0 -DCMAKE_BUILD_TYPE=Release -DSCLANG_SERVER=0 -DBUILD_TESTING=0 -DNO_LIBSNDFILE=1 | ||||
SUPERCOLLIDER_SUBMODULES += external_libraries/hidapi external_libraries/nova-simd external_libraries/nova-tt external_libraries/portaudio_sc_org external_libraries/yaml-cpp | |||||
SUPERCOLLIDER_BRANCH := topic/vcv-prototype-support | |||||
SUPERCOLLIDER_SUBMODULES += external_libraries/hidapi external_libraries/nova-simd external_libraries/nova-tt external_libraries/portaudio/portaudio_submodule external_libraries/yaml-cpp | |||||
SUPERCOLLIDER_BRANCH := 3.13 | |||||
OBJECTS += dep/supercollider/build/external_libraries/libtlsf.a | |||||
OBJECTS += dep/supercollider/build/external_libraries/hidapi/linux/libhidapi.a | |||||
ifdef ARCH_WIN | |||||
OBJECTS += dep/supercollider/build/external_libraries/hidapi/windows/libhidapi.a | |||||
endif | |||||
ifdef ARCH_LIN | |||||
OBJECTS += dep/supercollider/build/external_libraries/hidapi/linux/libhidapi.a | |||||
endif | |||||
ifdef ARCH_MAC | |||||
OBJECTS += dep/supercollider/build/external_libraries/hidapi/mac/libhidapi.a | |||||
endif | |||||
OBJECTS += dep/supercollider/build/external_libraries/hidapi/hidapi_parser/libhidapi_parser.a | OBJECTS += dep/supercollider/build/external_libraries/hidapi/hidapi_parser/libhidapi_parser.a | ||||
OBJECTS += dep/supercollider/build/external_libraries/libboost_thread_lib.a | OBJECTS += dep/supercollider/build/external_libraries/libboost_thread_lib.a | ||||
OBJECTS += dep/supercollider/build/external_libraries/libboost_system_lib.a | OBJECTS += dep/supercollider/build/external_libraries/libboost_system_lib.a | ||||
OBJECTS += dep/supercollider/build/external_libraries/libboost_regex_lib.a | OBJECTS += dep/supercollider/build/external_libraries/libboost_regex_lib.a | ||||
OBJECTS += dep/supercollider/build/external_libraries/libboost_filesystem_lib.a | OBJECTS += dep/supercollider/build/external_libraries/libboost_filesystem_lib.a | ||||
OBJECTS += dep/supercollider/build/external_libraries/libtlsf.a | |||||
OBJECTS += dep/supercollider/build/external_libraries/libyaml.a | OBJECTS += dep/supercollider/build/external_libraries/libyaml.a | ||||
LDFLAGS += -lpthread -lasound -ludev | |||||
ifdef ARCH_LIN | |||||
LDFLAGS += -lpthread -lasound -ludev | |||||
else | |||||
LDFLAGS += -lpthread | |||||
endif | |||||
$(supercollider): | $(supercollider): | ||||
cd dep && git clone "https://github.com/supercollider/supercollider" --branch $(SUPERCOLLIDER_BRANCH) --depth 1 | cd dep && git clone "https://github.com/supercollider/supercollider" --branch $(SUPERCOLLIDER_BRANCH) --depth 1 | ||||
cd dep/supercollider && git checkout 84b14d10d49edce6dd8303045a884fb7f2bc92e8 | |||||
cd dep/supercollider && git checkout c64c5244c5e7bbcb26a829e9cf72d249a529c213 | |||||
cd dep/supercollider && git submodule update --depth 1 --init -- $(SUPERCOLLIDER_SUBMODULES) | cd dep/supercollider && git submodule update --depth 1 --init -- $(SUPERCOLLIDER_SUBMODULES) | ||||
cd dep/supercollider && mkdir build | cd dep/supercollider && mkdir build | ||||
cd dep/supercollider/build && $(CMAKE) .. $(SUPERCOLLIDER_CMAKE_FLAGS) | cd dep/supercollider/build && $(CMAKE) .. $(SUPERCOLLIDER_CMAKE_FLAGS) | ||||
@@ -195,8 +229,8 @@ SOURCES += src/VultEngine.cpp | |||||
vult := dep/vult/vultc.h | vult := dep/vult/vultc.h | ||||
$(vult): | $(vult): | ||||
cd dep && mkdir -p vult | cd dep && mkdir -p vult | ||||
cd dep/vult && $(WGET) "https://github.com/modlfo/vult/releases/download/v0.4.12/vultc.h" | |||||
$(SHA256) $(vult) 3e80f6d30defe7df2804568f0314dbb33e6bf69d53d18a804c8b8132cf5ad146 | |||||
cd dep/vult && $(WGET) "https://github.com/vult-dsp/vult/releases/download/v0.4.15/vultc.h" | |||||
$(SHA256) $(vult) 5c5e6c7c92caacc10dacd8e4dd5e8134b520e630562e1f928ab1332218266638 | |||||
FLAGS += -Idep/vult | FLAGS += -Idep/vult | ||||
DEPS += $(vult) | DEPS += $(vult) | ||||
endif | endif | ||||
@@ -208,7 +242,7 @@ libpd := dep/lib/libpd.a | |||||
SOURCES += src/LibPDEngine.cpp | SOURCES += src/LibPDEngine.cpp | ||||
OBJECTS += $(libpd) | OBJECTS += $(libpd) | ||||
DEPS += $(libpd) | DEPS += $(libpd) | ||||
FLAGS += -Idep/include/libpd -DHAVE_LIBDL | |||||
FLAGS += -Idep/include/libpd -DHAVE_LIBDL -DPDINSTANCE -DPDTHREADS | |||||
ifdef ARCH_WIN | ifdef ARCH_WIN | ||||
# PD_INTERNAL leaves the function declarations for libpd unchanged | # PD_INTERNAL leaves the function declarations for libpd unchanged | ||||
@@ -223,8 +257,8 @@ endif | |||||
$(libpd): | $(libpd): | ||||
cd dep && git clone "https://github.com/libpd/libpd.git" --recursive | cd dep && git clone "https://github.com/libpd/libpd.git" --recursive | ||||
cd dep/libpd && git checkout 5772a612527f06597d44d195843307ad0e3578fe | |||||
cd dep/libpd && git checkout e3980d2fe45ef9eaaec1d45e4d68637eaf76a8b1 | |||||
ifdef ARCH_MAC | ifdef ARCH_MAC | ||||
# libpd's Makefile is handmade, and it doesn't honor CFLAGS and LDFLAGS environments. | # libpd's Makefile is handmade, and it doesn't honor CFLAGS and LDFLAGS environments. | ||||
# So in order for Mac 10.15 (for example) to make a build that works on Mac 10.7+, we have to manually add DEP_MAC_SDK_FLAGS to CFLAGS and LDFLAGS. | # So in order for Mac 10.15 (for example) to make a build that works on Mac 10.7+, we have to manually add DEP_MAC_SDK_FLAGS to CFLAGS and LDFLAGS. | ||||
@@ -219,5 +219,5 @@ struct DuktapeEngine : ScriptEngine { | |||||
__attribute__((constructor(1000))) | __attribute__((constructor(1000))) | ||||
static void constructor() { | static void constructor() { | ||||
addScriptEngine<DuktapeEngine>("js"); | |||||
addScriptEngine<DuktapeEngine>(".js"); | |||||
} | } |
@@ -29,6 +29,10 @@ | |||||
#include <vector> | #include <vector> | ||||
#include <algorithm> | #include <algorithm> | ||||
#include <functional> | #include <functional> | ||||
#if defined ARCH_WIN | |||||
#include <fileapi.h> | |||||
#include <windef.h> | |||||
#endif | |||||
#pragma GCC diagnostic push | #pragma GCC diagnostic push | ||||
#ifndef __clang__ | #ifndef __clang__ | ||||
@@ -250,7 +254,7 @@ public: | |||||
std::string temp_cache = "/tmp/VCVPrototype_" + generateSHA1(script); | std::string temp_cache = "/tmp/VCVPrototype_" + generateSHA1(script); | ||||
#elif defined ARCH_WIN | #elif defined ARCH_WIN | ||||
char buf[MAX_PATH + 1] = {0}; | char buf[MAX_PATH + 1] = {0}; | ||||
GetTempPath(sizeof(buf), buf); | |||||
GetTempPathA(sizeof(buf), buf); | |||||
std::string temp_cache = std::string(buf) + "/VCVPrototype_" + generateSHA1(script); | std::string temp_cache = std::string(buf) + "/VCVPrototype_" + generateSHA1(script); | ||||
#endif | #endif | ||||
std::string error_msg; | std::string error_msg; | ||||
@@ -369,5 +373,5 @@ private: | |||||
__attribute__((constructor(1000))) | __attribute__((constructor(1000))) | ||||
static void constructor() { | static void constructor() { | ||||
addScriptEngine<FaustEngine>("dsp"); | |||||
addScriptEngine<FaustEngine>(".dsp"); | |||||
} | } |
@@ -331,5 +331,5 @@ void LibPDEngine::sendInitialStates(const ProcessBlock* block) { | |||||
__attribute__((constructor(1000))) | __attribute__((constructor(1000))) | ||||
static void constructor() { | static void constructor() { | ||||
addScriptEngine<LibPDEngine>("pd"); | |||||
addScriptEngine<LibPDEngine>(".pd"); | |||||
} | } |
@@ -1,5 +1,5 @@ | |||||
#include "ScriptEngine.hpp" | #include "ScriptEngine.hpp" | ||||
#include <luajit-2.0/lua.hpp> | |||||
#include <luajit-2.1/lua.hpp> | |||||
struct LuaJITEngine : ScriptEngine { | struct LuaJITEngine : ScriptEngine { | ||||
@@ -246,5 +246,5 @@ struct LuaJITEngine : ScriptEngine { | |||||
__attribute__((constructor(1000))) | __attribute__((constructor(1000))) | ||||
static void constructor() { | static void constructor() { | ||||
addScriptEngine<LuaJITEngine>("lua"); | |||||
addScriptEngine<LuaJITEngine>(".lua"); | |||||
} | } |
@@ -334,7 +334,7 @@ struct Prototype : Module { | |||||
std::string extension = system::getExtension(path); | std::string extension = system::getExtension(path); | ||||
scriptEngine = createScriptEngine(extension); | scriptEngine = createScriptEngine(extension); | ||||
if (!scriptEngine) { | if (!scriptEngine) { | ||||
message = string::f("No engine for .%s extension", extension.c_str()); | |||||
message = string::f("No engine for %s extension", extension.c_str()); | |||||
return; | return; | ||||
} | } | ||||
scriptEngine->module = this; | scriptEngine->module = this; | ||||
@@ -406,13 +406,13 @@ struct Prototype : Module { | |||||
} | } | ||||
void newScriptDialog() { | void newScriptDialog() { | ||||
std::string ext = "js"; | |||||
std::string ext = ".js"; | |||||
// Get current extension if a script is currently loaded | // Get current extension if a script is currently loaded | ||||
if (!path.empty()) { | if (!path.empty()) { | ||||
ext = system::getExtension(path); | ext = system::getExtension(path); | ||||
} | } | ||||
std::string dir = asset::plugin(pluginInstance, "examples"); | std::string dir = asset::plugin(pluginInstance, "examples"); | ||||
std::string filename = "Untitled." + ext; | |||||
std::string filename = "Untitled" + ext; | |||||
char* newPathC = osdialog_file(OSDIALOG_SAVE, dir.c_str(), filename.c_str(), NULL); | char* newPathC = osdialog_file(OSDIALOG_SAVE, dir.c_str(), filename.c_str(), NULL); | ||||
if (!newPathC) { | if (!newPathC) { | ||||
return; | return; | ||||
@@ -436,7 +436,7 @@ struct Prototype : Module { | |||||
} | } | ||||
// Copy template to new script | // Copy template to new script | ||||
std::string templatePath = asset::plugin(pluginInstance, "examples/template." + ext); | |||||
std::string templatePath = asset::plugin(pluginInstance, "examples/template" + ext); | |||||
{ | { | ||||
std::ifstream templateFile(templatePath, std::ios::binary); | std::ifstream templateFile(templatePath, std::ios::binary); | ||||
std::ofstream newFile(newPath, std::ios::binary); | std::ofstream newFile(newPath, std::ios::binary); | ||||
@@ -468,7 +468,7 @@ struct Prototype : Module { | |||||
std::string ext = system::getExtension(path); | std::string ext = system::getExtension(path); | ||||
std::string dir = asset::plugin(pluginInstance, "examples"); | std::string dir = asset::plugin(pluginInstance, "examples"); | ||||
std::string filename = "Untitled." + ext; | |||||
std::string filename = "Untitled" + ext; | |||||
char* newPathC = osdialog_file(OSDIALOG_SAVE, dir.c_str(), filename.c_str(), NULL); | char* newPathC = osdialog_file(OSDIALOG_SAVE, dir.c_str(), filename.c_str(), NULL); | ||||
if (!newPathC) { | if (!newPathC) { | ||||
return; | return; | ||||
@@ -478,7 +478,7 @@ struct Prototype : Module { | |||||
// Add extension if user didn't specify one | // Add extension if user didn't specify one | ||||
std::string newExt = system::getExtension(newPath); | std::string newExt = system::getExtension(newPath); | ||||
if (newExt == "") | if (newExt == "") | ||||
newPath += "." + ext; | |||||
newPath += ext; | |||||
// Write and close file | // Write and close file | ||||
{ | { | ||||
@@ -504,7 +504,7 @@ struct Prototype : Module { | |||||
(void) std::system(command.c_str()); | (void) std::system(command.c_str()); | ||||
#elif defined ARCH_WIN | #elif defined ARCH_WIN | ||||
std::string command = editorPath + " \"" + path + "\""; | std::string command = editorPath + " \"" + path + "\""; | ||||
std::wstring commandW = string::toWstring(command); | |||||
std::wstring commandW = string::UTF8toUTF16(command); | |||||
STARTUPINFOW startupInfo; | STARTUPINFOW startupInfo; | ||||
std::memset(&startupInfo, 0, sizeof(startupInfo)); | std::memset(&startupInfo, 0, sizeof(startupInfo)); | ||||
startupInfo.cb = sizeof(startupInfo); | startupInfo.cb = sizeof(startupInfo); | ||||
@@ -594,7 +594,7 @@ struct Prototype : Module { | |||||
if (path == "") | if (path == "") | ||||
return ""; | return ""; | ||||
// HACK check if extension is .pd | // HACK check if extension is .pd | ||||
if (system::getExtension(path) == "pd") | |||||
if (system::getExtension(path) == ".pd") | |||||
return settingsPdEditorPath; | return settingsPdEditorPath; | ||||
return settingsEditorPath; | return settingsEditorPath; | ||||
} | } | ||||
@@ -252,5 +252,5 @@ struct PythonEngine : ScriptEngine { | |||||
__attribute__((constructor(1000))) | __attribute__((constructor(1000))) | ||||
static void constructor() { | static void constructor() { | ||||
addScriptEngine<PythonEngine>("py"); | |||||
addScriptEngine<PythonEngine>(".py"); | |||||
} | } |
@@ -329,5 +329,5 @@ struct QuickJSEngine : ScriptEngine { | |||||
__attribute__((constructor(1000))) | __attribute__((constructor(1000))) | ||||
static void constructor() { | static void constructor() { | ||||
addScriptEngine<QuickJSEngine>("js"); | |||||
addScriptEngine<QuickJSEngine>(".js"); | |||||
} | } |
@@ -405,6 +405,6 @@ bool SC_VcvPrototypeClient::copyArrayOfFloatArrays(const PyrSlot& inSlot, const | |||||
__attribute__((constructor(1000))) | __attribute__((constructor(1000))) | ||||
static void constructor() { | static void constructor() { | ||||
addScriptEngine<SuperColliderEngine>("sc"); | |||||
addScriptEngine<SuperColliderEngine>("scd"); | |||||
addScriptEngine<SuperColliderEngine>(".sc"); | |||||
addScriptEngine<SuperColliderEngine>(".scd"); | |||||
} | } |
@@ -11,7 +11,7 @@ | |||||
// Special version of createScriptEngine that only creates Lua engines | // Special version of createScriptEngine that only creates Lua engines | ||||
ScriptEngine* createLuaEngine() { | ScriptEngine* createLuaEngine() { | ||||
auto it = scriptEngineFactories.find("lua"); | |||||
auto it = scriptEngineFactories.find(".lua"); | |||||
if (it == scriptEngineFactories.end()) | if (it == scriptEngineFactories.end()) | ||||
return NULL; | return NULL; | ||||
return it->second->createScriptEngine(); | return it->second->createScriptEngine(); | ||||
@@ -26,7 +26,10 @@ struct VultEngine : ScriptEngine { | |||||
JSRuntime* rt = NULL; | JSRuntime* rt = NULL; | ||||
JSContext* ctx = NULL; | JSContext* ctx = NULL; | ||||
bool js_failure; | |||||
VultEngine() { | VultEngine() { | ||||
js_failure = false; | |||||
rt = JS_NewRuntime(); | rt = JS_NewRuntime(); | ||||
// Create QuickJS context | // Create QuickJS context | ||||
ctx = JS_NewContext(rt); | ctx = JS_NewContext(rt); | ||||
@@ -41,9 +44,11 @@ struct VultEngine : ScriptEngine { | |||||
JSValue val = | JSValue val = | ||||
JS_Eval(ctx, (const char*)vultc_h, vultc_h_size, "vultc.js", 0); | JS_Eval(ctx, (const char*)vultc_h, vultc_h_size, "vultc.js", 0); | ||||
if (JS_IsException(val)) { | if (JS_IsException(val)) { | ||||
display("Error loading the Vult compiler"); | |||||
WARN("Error loading the Vult compiler"); | |||||
WARN("%s", JS_ToCString(ctx, JS_ToString(ctx,val))); | |||||
JS_FreeValue(ctx, val); | JS_FreeValue(ctx, val); | ||||
JS_FreeValue(ctx, global_obj); | JS_FreeValue(ctx, global_obj); | ||||
js_failure = true; | |||||
return; | return; | ||||
} | } | ||||
} | } | ||||
@@ -62,6 +67,11 @@ struct VultEngine : ScriptEngine { | |||||
} | } | ||||
int run(const std::string& path, const std::string& script) override { | int run(const std::string& path, const std::string& script) override { | ||||
if (js_failure) { | |||||
display("Error loading the Vult compiler"); | |||||
return -1; | |||||
} | |||||
display("Loading..."); | display("Loading..."); | ||||
JSValue global_obj = JS_GetGlobalObject(ctx); | JSValue global_obj = JS_GetGlobalObject(ctx); | ||||
@@ -119,7 +129,7 @@ struct VultEngine : ScriptEngine { | |||||
JSValue luacode = JS_GetPropertyStr(ctx, first, "code"); | JSValue luacode = JS_GetPropertyStr(ctx, first, "code"); | ||||
std::string luacode_str(JS_ToCString(ctx, luacode)); | std::string luacode_str(JS_ToCString(ctx, luacode)); | ||||
//WARN("Generated Code: %s", luacode_str.c_str()); | |||||
WARN("Generated Code: %s", luacode_str.c_str()); | |||||
luaEngine = createLuaEngine(); | luaEngine = createLuaEngine(); | ||||
@@ -142,13 +152,13 @@ struct VultEngine : ScriptEngine { | |||||
} | } | ||||
int process() override { | int process() override { | ||||
if (!luaEngine) | |||||
return -1; | |||||
if (!luaEngine || js_failure) | |||||
return -1; | |||||
return luaEngine->process(); | return luaEngine->process(); | ||||
} | } | ||||
}; | }; | ||||
__attribute__((constructor(1000))) | __attribute__((constructor(1000))) | ||||
static void constructor() { | static void constructor() { | ||||
addScriptEngine<VultEngine>("vult"); | |||||
addScriptEngine<VultEngine>(".vult"); | |||||
} | } |