63 lines
2.3 KiB
C
63 lines
2.3 KiB
C
/**
|
|
* Copyright (c) 2025 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#include "scriptmodule.h"
|
|
#include "script/module/system/modulesystem.h"
|
|
#include "script/module/input/moduleinput.h"
|
|
#include "script/module/moduleplatform.h"
|
|
#include "script/module/scene/modulescene.h"
|
|
#include "script/module/item/moduleitem.h"
|
|
#include "script/module/locale/modulelocale.h"
|
|
#include "script/module/time/moduletime.h"
|
|
#include "script/module/event/moduleevent.h"
|
|
#include "script/module/display/modulecolor.h"
|
|
#include "script/module/display/modulespritebatch.h"
|
|
#include "script/module/display/modulecamera.h"
|
|
#include "script/module/display/moduleglm.h"
|
|
#include "script/module/ui/moduleui.h"
|
|
#include "script/module/display/moduletext.h"
|
|
#include "script/module/display/modulescreen.h"
|
|
#include "script/module/story/modulestoryflag.h"
|
|
#include "script/module/map/modulemap.h"
|
|
#include "script/module/display/moduletexture.h"
|
|
#include "script/module/display/moduletileset.h"
|
|
#include "util/string.h"
|
|
|
|
const scriptmodule_t SCRIPT_MODULE_LIST[] = {
|
|
{ .name = "system", .callback = moduleSystem },
|
|
{ .name = "input", .callback = moduleInput },
|
|
{ .name = "platform", .callback = modulePlatform },
|
|
{ .name = "color", .callback = moduleColor },
|
|
{ .name = "scene", .callback = moduleScene },
|
|
{ .name = "item", .callback = moduleItem },
|
|
{ .name = "locale", .callback = moduleLocale },
|
|
{ .name = "time", .callback = moduleTime },
|
|
{ .name = "event", .callback = moduleEvent },
|
|
{ .name = "spritebatch", .callback = moduleSpriteBatch },
|
|
{ .name = "camera", .callback = moduleCamera },
|
|
{ .name = "glm", .callback = moduleGLM },
|
|
{ .name = "ui", .callback = moduleUi },
|
|
{ .name = "text", .callback = moduleText },
|
|
{ .name = "screen", .callback = moduleScreen },
|
|
{ .name = "storyflag", .callback = moduleStoryFlag },
|
|
{ .name = "map", .callback = moduleMap },
|
|
{ .name = "texture", .callback = moduleTexture },
|
|
{ .name = "tileset", .callback = moduleTileset },
|
|
};
|
|
|
|
#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;
|
|
} |