vs2022 build
This commit is contained in:
parent
841c26762a
commit
6f9cb89b54
@ -1,3 +1,4 @@
|
|||||||
@echo off
|
@echo off
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
tools\premake5 %* vs2019
|
tools\premake5 %* vs2022
|
||||||
|
pause
|
14
premake5.lua
14
premake5.lua
@ -248,25 +248,23 @@ end
|
|||||||
|
|
||||||
flags {"NoIncrementalLink", "NoMinimalRebuild", "MultiProcessorCompile", "No64BitChecks"}
|
flags {"NoIncrementalLink", "NoMinimalRebuild", "MultiProcessorCompile", "No64BitChecks"}
|
||||||
|
|
||||||
|
filter "platforms:x64"
|
||||||
configuration "windows"
|
|
||||||
defines {"_WINDOWS", "WIN32"}
|
defines {"_WINDOWS", "WIN32"}
|
||||||
|
filter {}
|
||||||
|
|
||||||
configuration "Release"
|
filter "configurations:Release"
|
||||||
optimize "Size"
|
optimize "Size"
|
||||||
buildoptions {"/GL"}
|
buildoptions {"/GL"}
|
||||||
linkoptions { "/IGNORE:4702", "/LTCG" }
|
linkoptions { "/IGNORE:4702", "/LTCG" }
|
||||||
|
|
||||||
defines {"NDEBUG"}
|
defines {"NDEBUG"}
|
||||||
|
|
||||||
flags {"FatalCompileWarnings"}
|
flags {"FatalCompileWarnings"}
|
||||||
|
filter {}
|
||||||
|
|
||||||
configuration "Debug"
|
filter "configurations:Debug"
|
||||||
optimize "Debug"
|
optimize "Debug"
|
||||||
buildoptions {"/bigobj"}
|
buildoptions {"/bigobj"}
|
||||||
defines {"DEBUG", "_DEBUG"}
|
defines {"DEBUG", "_DEBUG"}
|
||||||
|
filter {}
|
||||||
configuration {}
|
|
||||||
|
|
||||||
project "common"
|
project "common"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
|
@ -264,8 +264,6 @@ namespace scripting
|
|||||||
void array::set(const std::string& key, const script_value& _value) const
|
void array::set(const std::string& key, const script_value& _value) const
|
||||||
{
|
{
|
||||||
const auto value = _value.get_raw();
|
const auto value = _value.get_raw();
|
||||||
|
|
||||||
const auto string_value = game::SL_GetString(key.data(), 0);
|
|
||||||
const auto variable_id = this->get_value_id(key);
|
const auto variable_id = this->get_value_id(key);
|
||||||
|
|
||||||
if (!variable_id)
|
if (!variable_id)
|
||||||
|
@ -30,7 +30,20 @@ namespace scripting::lua
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_entity_type(sol::state& state, event_handler& handler, scheduler& scheduler)
|
void setup_io(sol::state& state)
|
||||||
|
{
|
||||||
|
state["io"]["fileexists"] = utils::io::file_exists;
|
||||||
|
state["io"]["writefile"] = utils::io::write_file;
|
||||||
|
state["io"]["filesize"] = utils::io::file_size;
|
||||||
|
state["io"]["createdirectory"] = utils::io::create_directory;
|
||||||
|
state["io"]["directoryexists"] = utils::io::directory_exists;
|
||||||
|
state["io"]["directoryisempty"] = utils::io::directory_is_empty;
|
||||||
|
state["io"]["listfiles"] = utils::io::list_files;
|
||||||
|
state["io"]["copyfolder"] = utils::io::copy_folder;
|
||||||
|
state["io"]["readfile"] = static_cast<std::string(*)(const std::string&)>(utils::io::read_file);
|
||||||
|
}
|
||||||
|
|
||||||
|
void setup_vector_type(sol::state& state)
|
||||||
{
|
{
|
||||||
state["level"] = entity{*::game::levelEntityId};
|
state["level"] = entity{*::game::levelEntityId};
|
||||||
state["player"] = call("getentbynum", {0}).as<entity>();
|
state["player"] = call("getentbynum", {0}).as<entity>();
|
||||||
@ -181,6 +194,12 @@ namespace scripting::lua
|
|||||||
{
|
{
|
||||||
return call("anglestoforward", {a}).as<vector>();
|
return call("anglestoforward", {a}).as<vector>();
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
void setup_entity_type(sol::state& state, event_handler& handler, scheduler& scheduler)
|
||||||
|
{
|
||||||
|
state["level"] = entity{ *::game::levelEntityId };
|
||||||
|
state["player"] = call("getentbynum", { 0 }).as<entity>();
|
||||||
|
|
||||||
auto entity_type = state.new_usertype<entity>("entity");
|
auto entity_type = state.new_usertype<entity>("entity");
|
||||||
|
|
||||||
@ -307,7 +326,10 @@ namespace scripting::lua
|
|||||||
std::vector<unsigned int> returns = {entref.entnum, entref.classnum};
|
std::vector<unsigned int> returns = {entref.entnum, entref.classnum};
|
||||||
return sol::as_returns(returns);
|
return sol::as_returns(returns);
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
void setup_game_type(sol::state& state, event_handler& handler, scheduler& scheduler)
|
||||||
|
{
|
||||||
struct game
|
struct game
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
@ -407,7 +429,7 @@ namespace scripting::lua
|
|||||||
return detour;
|
return detour;
|
||||||
};
|
};
|
||||||
|
|
||||||
game_type["getfunctions"] = [entity_type](const game&, const sol::this_state s, const std::string& filename)
|
game_type["getfunctions"] = [](const game&, const sol::this_state s, const std::string& filename)
|
||||||
{
|
{
|
||||||
if (scripting::script_function_table.find(filename) == scripting::script_function_table.end())
|
if (scripting::script_function_table.find(filename) == scripting::script_function_table.end())
|
||||||
{
|
{
|
||||||
@ -611,7 +633,10 @@ namespace scripting::lua
|
|||||||
return this->folder_;
|
return this->folder_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
setup_io(this->state_);
|
||||||
|
setup_vector_type(this->state_);
|
||||||
setup_entity_type(this->state_, this->event_handler_, this->scheduler_);
|
setup_entity_type(this->state_, this->event_handler_, this->scheduler_);
|
||||||
|
setup_game_type(this->state_, this->event_handler_, this->scheduler_);
|
||||||
|
|
||||||
printf("Loading script '%s'\n", this->folder_.data());
|
printf("Loading script '%s'\n", this->folder_.data());
|
||||||
this->load_script("__init__");
|
this->load_script("__init__");
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#pragma warning(disable: 4702)
|
#pragma warning(disable: 4702)
|
||||||
#pragma warning(disable: 4996)
|
#pragma warning(disable: 4996)
|
||||||
#pragma warning(disable: 5054)
|
#pragma warning(disable: 5054)
|
||||||
|
#pragma warning(disable: 5056)
|
||||||
#pragma warning(disable: 6011)
|
#pragma warning(disable: 6011)
|
||||||
#pragma warning(disable: 6297)
|
#pragma warning(disable: 6297)
|
||||||
#pragma warning(disable: 6385)
|
#pragma warning(disable: 6385)
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user