Modules
Some checks failed
Build Dusk / build-linux (push) Successful in 1m13s
Build Dusk / build-psp (push) Failing after 1m27s

This commit is contained in:
2025-12-25 08:02:11 +10:00
parent f39b2060a8
commit b16dbaceec
23 changed files with 370 additions and 158 deletions

32
src/script/scriptmodule.c Normal file
View File

@@ -0,0 +1,32 @@
/**
* Copyright (c) 2025 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "scriptmodule.h"
#include "script/module/modulesystem.h"
#include "script/module/moduleinput.h"
#include "script/module/moduleplatform.h"
#include "script/module/modulescene.h"
const scriptmodule_t SCRIPT_MODULE_LIST[] = {
{ .name = "system", .callback = moduleSystem },
{ .name = "input", .callback = moduleInput },
{ .name = "platform", .callback = modulePlatform },
{ .name = "scene", .callback = moduleScene },
};
#define SCRIPT_MODULE_COUNT ( \
sizeof(SCRIPT_MODULE_LIST) / sizeof(scriptmodule_t) \
)
const scriptmodule_t * scriptModuleGetByName(const char_t *name) {
for(uint_fast8_t i = 0; i < SCRIPT_MODULE_COUNT; i++) {
if(stringCompare(SCRIPT_MODULE_LIST[i].name, name) != 0) continue;
return &SCRIPT_MODULE_LIST[i];
}
return NULL;
}