mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-03 12:27:21 +12:00
Embed LuaJIT part 1
This commit is contained in:
parent
c0e3d6d7dd
commit
b908f3efc1
7 changed files with 99 additions and 2 deletions
|
@ -13,6 +13,7 @@
|
|||
#include "crypto/aes_engine.hpp"
|
||||
#include "discord_rpc.hpp"
|
||||
#include "io_file.hpp"
|
||||
#include "lua.hpp"
|
||||
#include "memory.hpp"
|
||||
|
||||
#ifdef PANDA3DS_ENABLE_HTTP_SERVER
|
||||
|
@ -77,6 +78,7 @@ class Emulator {
|
|||
NCSD loadedNCSD;
|
||||
|
||||
std::optional<std::filesystem::path> romPath = std::nullopt;
|
||||
LuaManager lua;
|
||||
|
||||
public:
|
||||
// Decides whether to reload or not reload the ROM when resetting. We use enum class over a plain bool for clarity.
|
||||
|
|
32
include/lua.hpp
Normal file
32
include/lua.hpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
#pragma once
|
||||
#include "helpers.hpp"
|
||||
|
||||
#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;
|
||||
|
||||
public:
|
||||
void close();
|
||||
void initialize();
|
||||
void loadFile(const char* path);
|
||||
void reset();
|
||||
};
|
||||
|
||||
#elif // Lua not enabled, Lua manager does nothing
|
||||
class LuaManager {
|
||||
public:
|
||||
void close() {}
|
||||
void initialize() {}
|
||||
void loadFile(const char* path) {}
|
||||
void reset() {}
|
||||
};
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue