Update premake5
This commit is contained in:
parent
7c7cd24a82
commit
653c55ced9
@ -1,54 +0,0 @@
|
||||
iw4mvm = {
|
||||
settings = nil
|
||||
}
|
||||
|
||||
function iw4mvm.setup(settings)
|
||||
if not settings.source then error("Missing source.") end
|
||||
|
||||
iw4mvm.settings = settings
|
||||
|
||||
if not iw4mvm.settings.defines then iw4mvm.settings.defines = {} end
|
||||
end
|
||||
|
||||
function iw4mvm.import()
|
||||
if not iw4mvm.settings then error("You need to call iw4mvm.setup first") end
|
||||
|
||||
links { "iw4mvm" }
|
||||
iw4mvm.includes()
|
||||
end
|
||||
|
||||
function iw4mvm.includes()
|
||||
if not iw4mvm.settings then error("You need to call iw4mvm.setup first") end
|
||||
|
||||
includedirs { iw4mvm.settings.source }
|
||||
libdirs { path.join(iw4mvm.settings.source, "IW4MVM") }
|
||||
defines(iw4mvm.settings.defines)
|
||||
end
|
||||
|
||||
function iw4mvm.project()
|
||||
if not iw4mvm.settings then error("You need to call iw4mvm.setup first") end
|
||||
|
||||
project "iw4mvm"
|
||||
language "C++"
|
||||
|
||||
characterset ("MBCS")
|
||||
|
||||
defines("_CRT_SECURE_NO_WARNINGS")
|
||||
|
||||
iw4mvm.includes()
|
||||
files
|
||||
{
|
||||
path.join(iw4mvm.settings.source, "IW4MVM/*.h"),
|
||||
path.join(iw4mvm.settings.source, "IW4MVM/*.cpp"),
|
||||
}
|
||||
|
||||
removefiles
|
||||
{
|
||||
--path.join(iw4mvm.settings.source, "IW4MVM/detours.cpp"),
|
||||
path.join(iw4mvm.settings.source, "IW4MVM/DllMain.cpp"),
|
||||
}
|
||||
|
||||
-- not our code, ignore POSIX usage warnings for now
|
||||
warnings "Off"
|
||||
kind "StaticLib"
|
||||
end
|
23
premake5.lua
23
premake5.lua
@ -193,7 +193,6 @@ require "premake/pdcurses"
|
||||
require "premake/protobuf"
|
||||
require "premake/zlib"
|
||||
require "premake/udis86"
|
||||
require "premake/iw4mvm"
|
||||
require "premake/dxsdk"
|
||||
|
||||
json11.setup
|
||||
@ -240,15 +239,6 @@ udis86.setup
|
||||
{
|
||||
source = path.join(depsBasePath, "udis86"),
|
||||
}
|
||||
iw4mvm.setup
|
||||
{
|
||||
defines = {
|
||||
"IW4X",
|
||||
"DETOURS_X86",
|
||||
"DETOURS_32BIT",
|
||||
},
|
||||
source = path.join(depsBasePath, "iw4mvm"),
|
||||
}
|
||||
dxsdk.setup
|
||||
{
|
||||
source = path.join(depsBasePath, "dxsdk"),
|
||||
@ -267,10 +257,9 @@ workspace "iw4x"
|
||||
|
||||
staticruntime "On"
|
||||
|
||||
configuration "windows"
|
||||
defines { "_WINDOWS", "WIN32" }
|
||||
defines { "_WINDOWS", "WIN32" }
|
||||
|
||||
configuration "Release*"
|
||||
filter "configurations:Release"
|
||||
defines { "NDEBUG" }
|
||||
flags { "MultiProcessorCompile", "LinkTimeOptimization", "No64BitChecks" }
|
||||
optimize "On"
|
||||
@ -279,7 +268,7 @@ workspace "iw4x"
|
||||
rtti ("Off")
|
||||
end
|
||||
|
||||
configuration "Debug*"
|
||||
filter "configurations:Debug"
|
||||
defines { "DEBUG", "_DEBUG" }
|
||||
flags { "MultiProcessorCompile", "No64BitChecks" }
|
||||
optimize "Debug"
|
||||
@ -347,7 +336,6 @@ workspace "iw4x"
|
||||
protobuf.import()
|
||||
zlib.import()
|
||||
udis86.import()
|
||||
--iw4mvm.import()
|
||||
dxsdk.import()
|
||||
|
||||
-- fix vpaths for protobuf sources
|
||||
@ -411,12 +399,12 @@ workspace "iw4x"
|
||||
flags { "Symbols" }
|
||||
end
|
||||
|
||||
configuration "Release*"
|
||||
filter "configurations:Release"
|
||||
flags {
|
||||
"FatalCompileWarnings",
|
||||
"FatalLinkWarnings",
|
||||
}
|
||||
configuration {}
|
||||
filter {}
|
||||
|
||||
--[[
|
||||
-- Generate source code from protobuf definitions
|
||||
@ -461,7 +449,6 @@ workspace "iw4x"
|
||||
protobuf.project()
|
||||
zlib.project()
|
||||
udis86.project()
|
||||
--iw4mvm.project()
|
||||
|
||||
workspace "*"
|
||||
cppdialect "C++17"
|
||||
|
@ -48,9 +48,6 @@ namespace Components
|
||||
Loader::Register(new Party());
|
||||
Loader::Register(new Zones());
|
||||
Loader::Register(new D3D9Ex());
|
||||
#if (!defined(VLD_RPTHOOK_INSTALL) || defined(VLDEnable)) && defined(COMPILE_IW4MVM) // IW4MVM uses detours which produces memory leaks, but those are not really relevant
|
||||
Loader::Register(new IW4MVM());
|
||||
#endif
|
||||
Loader::Register(new Logger());
|
||||
Loader::Register(new Script());
|
||||
Loader::Register(new Weapon());
|
||||
|
@ -88,7 +88,6 @@ namespace Components
|
||||
#include "Modules/Node.hpp"
|
||||
#include "Modules/RCon.hpp"
|
||||
#include "Modules/Party.hpp" // Destroys the order, but requires network classes :D
|
||||
#include "Modules/IW4MVM.hpp"
|
||||
#include "Modules/Logger.hpp"
|
||||
#include "Modules/Friends.hpp"
|
||||
#include "Modules/IPCPipe.hpp"
|
||||
|
@ -1,36 +0,0 @@
|
||||
#include "STDInclude.hpp"
|
||||
|
||||
#ifdef COMPILE_IW4MVM
|
||||
#include <IW4MVM/client_main.h>
|
||||
#endif
|
||||
|
||||
namespace Components
|
||||
{
|
||||
IW4MVM::IW4MVM()
|
||||
{
|
||||
if (Dedicated::IsEnabled() || ZoneBuilder::IsEnabled() || Monitor::IsEnabled() || Loader::IsPerformingUnitTests()) return;
|
||||
|
||||
DWORD oldProtect;
|
||||
std::uint8_t* _module = reinterpret_cast<std::uint8_t*>(GetModuleHandle(nullptr));
|
||||
VirtualProtect(_module + 0x1000, 0x2D6000, PAGE_EXECUTE_READWRITE, &oldProtect);
|
||||
|
||||
#ifdef COMPILE_IW4MVM
|
||||
client_main::Init();
|
||||
Scheduler::Once(client_main::PostInit);
|
||||
#endif
|
||||
Scheduler::OnFrame([]()
|
||||
{
|
||||
if (!Game::CL_IsCgameInitialized())
|
||||
{
|
||||
Dvar::Var("com_timescale").set(1.0f);
|
||||
}
|
||||
});
|
||||
|
||||
VirtualProtect(_module + 0x1000, 0x2D6000, PAGE_EXECUTE_READ, &oldProtect);
|
||||
}
|
||||
|
||||
IW4MVM::~IW4MVM()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// Disabled for public release
|
||||
//#define COMPILE_IW4MVM
|
||||
|
||||
namespace Components
|
||||
{
|
||||
class IW4MVM : public Component
|
||||
{
|
||||
public:
|
||||
IW4MVM();
|
||||
~IW4MVM();
|
||||
};
|
||||
}
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user