mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-26 22:38:35 +00:00
Setting up Qt (#294)
* Initial Qt setup * Fix copy paste derp * Remove QApplication include * Test MacOS Qt build * Update Qt_Build.yml * Update Qt_Build.yml * Properly detect architecture for Qt * Revert back to manual Qt installation to handle DLL nightmares * Install Qt for MacOS CI * AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA * Rename lua.hpp to lua_manager.hpp * Add Windows Qt deploy step * Update Qt_Build.yml * Update Qt_Build.yml * Update Qt_Build.yml * Update Qt_Build.yml * AAAAAAAAAAAAAAAAAAAAAA * Update Qt_Build.yml * AAAAAAAAAAAAAA * Update Qt_Build.yml * Update Qt_Build.yml * Update Qt_Build.yml * Create mac-bundle-qt.sh * Update Qt_Build.yml * Update Qt_Build.yml * Update mac-bundle-qt.sh * Update Qt_Build.yml * Update mac-bundle-qt.sh * Update mac-bundle-qt.sh * Update mac-bundle-qt.sh * Update mac-bundle-qt.sh * Recovering from heartbreak after the dylibbundler fork made me sad * Help * Update Qt_Build.yml * Add mac dynlib manager from MelonDS * Update mac-bundle-qt.sh * Update mac-bundle-qt.sh * Update mac-libs.rb * Update mac-bundle-qt.sh * Create linux-appimage-qt.sh * Update Qt_Build.yml
This commit is contained in:
parent
49368e0db6
commit
89ed176d97
9 changed files with 492 additions and 3 deletions
58
include/lua_manager.hpp
Normal file
58
include/lua_manager.hpp
Normal file
|
@ -0,0 +1,58 @@
|
|||
#pragma once
|
||||
#include "helpers.hpp"
|
||||
#include "memory.hpp"
|
||||
|
||||
// The kinds of events that can cause a Lua call.
|
||||
// Frame: Call program on frame end
|
||||
// TODO: Add more
|
||||
enum class LuaEvent {
|
||||
Frame,
|
||||
};
|
||||
|
||||
#ifdef PANDA3DS_ENABLE_LUA
|
||||
extern "C" {
|
||||
#include <lauxlib.h>
|
||||
#include <lua.h>
|
||||
#include <lualib.h>
|
||||
|
||||
#include "luajit.h"
|
||||
}
|
||||
|
||||
class LuaManager {
|
||||
lua_State* L = nullptr;
|
||||
bool initialized = false;
|
||||
bool haveScript = false;
|
||||
|
||||
void signalEventInternal(LuaEvent e);
|
||||
|
||||
public:
|
||||
// For Lua we must have some global pointers to our emulator objects to use them in script code via thunks. See the thunks in lua.cpp as an
|
||||
// example
|
||||
static Memory* g_memory;
|
||||
|
||||
LuaManager(Memory& mem) { g_memory = &mem; }
|
||||
|
||||
void close();
|
||||
void initialize();
|
||||
void initializeThunks();
|
||||
void loadFile(const char* path);
|
||||
void reset();
|
||||
void signalEvent(LuaEvent e) {
|
||||
if (haveScript) [[unlikely]] {
|
||||
signalEventInternal(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#elif // Lua not enabled, Lua manager does nothing
|
||||
class LuaManager {
|
||||
public:
|
||||
LuaManager(Memory& mem) {}
|
||||
|
||||
void close() {}
|
||||
void initialize() {}
|
||||
void loadFile(const char* path) {}
|
||||
void reset() {}
|
||||
void signalEvent(LuaEvent e) {}
|
||||
};
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue