mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-10-27 06:16:04 +03:00
feat(gameui): add Game Script table
This commit is contained in:
parent
6c5c560dc7
commit
679ed1101f
File diff suppressed because it is too large
Load Diff
@ -6,9 +6,11 @@
|
||||
|
||||
struct lua_State;
|
||||
|
||||
#define NUM_SCRIPT_FUNCTIONS_GAME 310
|
||||
#define NUM_SCRIPT_FUNCTIONS_CAMERA 22
|
||||
|
||||
namespace GameScript {
|
||||
extern FrameScript_Method s_ScriptFunctions_Game[NUM_SCRIPT_FUNCTIONS_GAME];
|
||||
extern FrameScript_Method s_ScriptFunctions_Camera[NUM_SCRIPT_FUNCTIONS_CAMERA];
|
||||
}
|
||||
|
||||
|
||||
@ -156,7 +156,12 @@ void FrameScript_CreateEvents(const char* names[], uint32_t count) {
|
||||
}
|
||||
|
||||
void FrameScript_Destroy() {
|
||||
// TODO
|
||||
lua_close(FrameScript::s_context);
|
||||
FrameScript::s_context = nullptr;
|
||||
luaM_freePool(FrameScript::s_mempool);
|
||||
FrameScript::s_mempool = nullptr;
|
||||
FrameScript::s_scriptEventsHash.Clear();
|
||||
FrameScript::s_scriptEvents.Clear();
|
||||
}
|
||||
|
||||
void FrameScript_Execute(const char* source, const char* filename, const char* a3) {
|
||||
|
||||
@ -30,6 +30,25 @@ void* luaM_initPool() {
|
||||
return pools;
|
||||
}
|
||||
|
||||
void luaM_freePool(void* ptr) {
|
||||
if (!ptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
MemPool** pools = reinterpret_cast<MemPool**>(ptr);
|
||||
|
||||
for (uint32_t i = 0; i < 9; ++i) {
|
||||
MemPool* pool = pools[i];
|
||||
if (pool) {
|
||||
// Is the sub_8556E0(pool) a desturctor?
|
||||
pool->~MemPool();
|
||||
SMemFree(pool, __FILE__, __LINE__, 0);
|
||||
}
|
||||
}
|
||||
|
||||
SMemFree(pools, __FILE__, __LINE__, 0);
|
||||
}
|
||||
|
||||
void* luaM_reallocPool(void* ud, void* ptr, size_t osize, size_t nsize) {
|
||||
void* result; // eax
|
||||
signed int v5; // esi
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
#include <cstdlib>
|
||||
|
||||
void* luaM_initPool();
|
||||
void luaM_freePool(void* ptr);
|
||||
void* luaM_reallocPool(void* ud, void* ptr, size_t osize, size_t nsize);
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user