rename test library to app & rename app.name to app.script

This commit is contained in:
MihailRis
2024-12-25 06:06:55 +03:00
parent deb85ba2d8
commit ad6a6666da
7 changed files with 35 additions and 35 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ extern const luaL_Reg packlib[];
extern const luaL_Reg particleslib[]; // gfx.particles
extern const luaL_Reg playerlib[];
extern const luaL_Reg quatlib[];
extern const luaL_Reg testlib[];
extern const luaL_Reg applib[];
extern const luaL_Reg text3dlib[]; // gfx.text3d
extern const luaL_Reg timelib[];
extern const luaL_Reg tomllib[];
@@ -1,5 +1,5 @@
#include "api_lua.hpp"
const luaL_Reg testlib[] = {
const luaL_Reg applib[] = {
{NULL, NULL}
};
+5 -5
View File
@@ -58,10 +58,10 @@ static void create_libs(State* L, StateType stateType) {
openlib(L, "vec3", vec3lib);
openlib(L, "vec4", vec4lib);
if (stateType == StateType::TEST) {
openlib(L, "test", testlib);
if (stateType == StateType::SCRIPT) {
openlib(L, "app", applib);
}
if (stateType == StateType::BASE || stateType == StateType::TEST) {
if (stateType == StateType::BASE || stateType == StateType::SCRIPT) {
openlib(L, "gui", guilib);
openlib(L, "input", inputlib);
openlib(L, "inventory", inventorylib);
@@ -119,10 +119,10 @@ void lua::initialize(const EnginePaths& paths, const CoreParameters& params) {
logger.info() << LUAJIT_VERSION;
main_thread = create_state(
paths, params.headless ? StateType::TEST : StateType::BASE
paths, params.headless ? StateType::SCRIPT : StateType::BASE
);
lua::pushstring(main_thread, params.scriptFile.stem().u8string());
lua::setglobal(main_thread, "__VC_TEST_NAME");
lua::setglobal(main_thread, "__VC_SCRIPT_NAME");
}
void lua::finalize() {
+1 -1
View File
@@ -13,7 +13,7 @@ struct CoreParameters;
namespace lua {
enum class StateType {
BASE,
TEST,
SCRIPT,
GENERATOR,
};