Little cleanup (#461)
* Remove FAKEMETA leftovers * Move "require_module" native to where it belongs * Remove broken AMX module support * Remove useless natives * Remove "alloc_amxmemory" and "free_amxmemory" functions * Remove "strip_name" function * Clean engine a bit * Export "GiveFnptrsToDll" (Windows) (Core) * memcpy -> ke::SafeStrcpy * Export GiveFnptrsToDll in modules * Update msvc project files
This commit is contained in:
committed by
Vincent Herbet
parent
d2e736b10a
commit
d6e71c8f4f
@ -6,7 +6,7 @@ binary = AMXX.MetaModule(builder, 'engine')
|
||||
binary.compiler.defines += [
|
||||
'HAVE_STDINT_H',
|
||||
]
|
||||
|
||||
|
||||
binary.sources = [
|
||||
'../../public/sdk/amxxmodule.cpp',
|
||||
'amxxapi.cpp',
|
||||
@ -18,8 +18,12 @@ binary.sources = [
|
||||
'../../public/memtools/CDetour/detours.cpp',
|
||||
'../../public/memtools/CDetour/asm/asm.c',
|
||||
]
|
||||
|
||||
|
||||
if builder.target_platform == 'windows':
|
||||
binary.sources += ['version.rc']
|
||||
|
||||
binary.compiler.linkflags += [
|
||||
'/EXPORT:GiveFnptrsToDll=_GiveFnptrsToDll@8,@1',
|
||||
'/SECTION:.data,RW',
|
||||
]
|
||||
|
||||
AMXX.modules += [builder.Add(binary)]
|
||||
|
@ -232,8 +232,7 @@ DETOUR_DECL_STATIC2(LightStyle, void, int, style, const char *, val) // void (*p
|
||||
DETOUR_STATIC_CALL(LightStyle)(style, val);
|
||||
|
||||
if (!style && strcmp(val, glinfo.szRealLights)) {
|
||||
memset(glinfo.szRealLights, 0x0, 128);
|
||||
memcpy(glinfo.szRealLights, val, ke::Min(strlen(val), (size_t)127));
|
||||
ke::SafeStrcpy(glinfo.szRealLights, sizeof(glinfo.szRealLights), val);
|
||||
}
|
||||
|
||||
if (glinfo.bCheckLights && strcmp(val, glinfo.szLastLights))
|
||||
@ -280,4 +279,4 @@ void CreateDetours()
|
||||
void DestroyDetours()
|
||||
{
|
||||
LightStyleDetour->Destroy();
|
||||
}
|
||||
}
|
||||
|
@ -557,8 +557,7 @@ static cell AMX_NATIVE_CALL set_lights(AMX *amx, cell *params) {
|
||||
glinfo.bCheckLights = true;
|
||||
|
||||
//Reset LastLights and store custom lighting
|
||||
memset(glinfo.szLastLights, 0x0, 128);
|
||||
memcpy(glinfo.szLastLights, szLights, ke::Min(iLength, 127));
|
||||
ke::SafeStrcpy(glinfo.szLastLights, sizeof(glinfo.szLastLights), szLights);
|
||||
|
||||
LightStyleDetour->DisableDetour();
|
||||
LIGHT_STYLE(0, glinfo.szLastLights);
|
||||
|
@ -74,6 +74,8 @@
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<IgnoreSpecificDefaultLibraries>LIBCMT;</IgnoreSpecificDefaultLibraries>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
<AdditionalOptions>/EXPORT:GiveFnptrsToDll=_GiveFnptrsToDll@8,@1 %(AdditionalOptions)</AdditionalOptions>
|
||||
<SpecifySectionAttributes>.data,RW</SpecifySectionAttributes>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
@ -95,6 +97,8 @@
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<ImportLibrary>$(OutDir)engine.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalOptions>/EXPORT:GiveFnptrsToDll=_GiveFnptrsToDll@8,@1 %(AdditionalOptions)</AdditionalOptions>
|
||||
<SpecifySectionAttributes>.data,RW</SpecifySectionAttributes>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
@ -129,4 +133,4 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
Reference in New Issue
Block a user