18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-19 01:46:01 +01:00

Lua script screens beside the WebAssembly ones

This commit is contained in:
2026-11-10 15:29:25 +01:00
parent a73585dca0
commit c4924f756d
34 changed files with 3777 additions and 1635 deletions

View File

@@ -425,10 +425,11 @@ int eu07_application::init(int Argc, char *Argv[])
{
m_taskqueue.init();
}
crashreport_add_info("luascreens_enabled", Global.luascreens_enabled ? "yes" : "no");
crashreport_add_info("wasm_enabled", Global.wasm_enabled ? "yes" : "no");
if (Global.wasm_enabled)
if (Global.luascreens_enabled || Global.wasm_enabled)
{
m_wasmqueue.init();
m_screenqueue.init();
}
if ((result = init_modes()) != 0)
{
@@ -640,7 +641,7 @@ int eu07_application::run()
EditorTerrain.update(Global.pCamera.Pos);
m_taskqueue.update();
m_wasmqueue.update();
m_screenqueue.update();
opengl_texture::reset_unit_cache();
if (!GfxRenderer->Render())
@@ -738,7 +739,7 @@ void eu07_application::exit()
// the python workers detach their GL context on the way out, so they have to be done before the windows they use are destroyed
m_taskqueue.exit();
m_wasmqueue.exit();
m_screenqueue.exit();
step("the windows");
for (auto *window : m_windows)
{

View File

@@ -11,7 +11,7 @@ http://mozilla.org/MPL/2.0/.
#include "application/applicationmode.h"
#include "scripting/PyInt.h"
#include "scripting/wasmscreens.h"
#include "scripting/scriptscreens.h"
#include "network/manager.h"
#include "utilities/headtrack.h"
#ifdef WITH_UART
@@ -50,10 +50,10 @@ public:
// frees the python gil and swaps out the main thread
void
release_python_lock();
// the screens drawn by WebAssembly modules
wasm_screen_queue &
wasm_screens() {
return m_wasmqueue; }
// the screens drawn by scripts (Lua, WebAssembly)
script_screen_queue &
screens() {
return m_screenqueue; }
void
exit();
void
@@ -127,7 +127,7 @@ private:
modeptr_array m_modes { nullptr }; // collection of available application behaviour modes
mode_stack m_modestack; // current behaviour mode
python_taskqueue m_taskqueue;
wasm_screen_queue m_wasmqueue;
script_screen_queue m_screenqueue;
std::vector<GLFWwindow *> m_windows;
int m_glfwversion;