Skip to content

Commit

Permalink
re add css, sdk2013 to build script
Browse files Browse the repository at this point in the history
  • Loading branch information
rafradek committed Jun 16, 2024
1 parent 4fd4094 commit e5a4ad1
Show file tree
Hide file tree
Showing 7 changed files with 248 additions and 113 deletions.
9 changes: 8 additions & 1 deletion AMBuildScript
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os, sys
import os, sys, copy, json

class SDK(object):
def __init__(self, sdk, ext, aDef, name, platform, dir, dll_dir):
Expand Down Expand Up @@ -130,6 +130,13 @@ class ExtensionConfig(object):
SdkHelpers.find_sdk_path = self.findSdkPath
SdkHelpers.findSdks(builder, self.all_targets, sdk_list)

if 'css' in SdkHelpers.sdks and 'sdk2013' in SdkHelpers.sdks:
with open(os.path.join(builder.sourcePath, 'css.json'), 'rt') as fp:
sdk = json.load(fp)
builder.AddConfigureFile(os.path.join(builder.sourcePath, 'css.json'))
SdkHelpers.sdks['css'] = sdk
SdkHelpers.sdks['css']['path'] = SdkHelpers.sdks['sdk2013']['path']

self.sdks = SdkHelpers.sdks
self.sdk_manifests = SdkHelpers.sdk_manifests
self.sdk_targets = SdkHelpers.sdk_targets
Expand Down
3 changes: 2 additions & 1 deletion PackageScript
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ CopyFiles('gamedata/sigsegv', 'addons/sourcemod/gamedata/sigsegv',
'custom_attributes.txt',
'datamaps.txt',
'debugoverlay.txt',
'entities.txt',
'globals.txt',
'misc.txt',
'nav.txt',
Expand Down Expand Up @@ -137,7 +138,7 @@ l4dlinks = [
for cxx_task in Extension.extensions:
src = os.path.join('..', cxx_task.binary.path)
# binary marked as using 'other' engine is the "default engine"
name = os.path.basename(cxx_task.binary.path).replace(".2.other", "")
name = os.path.basename(cxx_task.binary.path).replace(".2.sdk2013", "")

dst = ''
if cxx_task.target.arch == 'x86_64':
Expand Down
2 changes: 1 addition & 1 deletion autoconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cd ..

mkdir -p build/release
pushd build/release
CC=gcc CXX=g++ $CONFIGURE $PATHS --targets=x86_64,x86 --sdks=tf2 --build-all --enable-optimize --exclude-mods-debug --exclude-mods-visualize --exclude-vgui
CC=gcc CXX=g++ $CONFIGURE $PATHS --targets=x86_64,x86 --sdks=tf2,css,sdk2013 --build-all --enable-optimize --exclude-mods-debug --exclude-mods-visualize --exclude-vgui
popd

mkdir -p build/x86
Expand Down
78 changes: 78 additions & 0 deletions css.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"name": "css",
"env_var": "HL2SDKCSS",
"extension": "2.css",
"code": 6,
"define": "CSS",
"steam": {
"app_id": 232330
},
"platforms": {
"windows": [
"x86"
],
"linux": [
"x86"
],
"mac": [
"x86"
]
},
"source2": false,
"include_paths": [
"public",
"public/engine",
"public/mathlib",
"public/vstdlib",
"public/tier0",
"public/tier1",
"public/toolframework",
"public/game/server",
"game/shared",
"common"
],
"linux": {
"defines": [
"NO_HOOK_MALLOC",
"NO_MALLOC_OVERRIDE"
],
"x86": {
"postlink_libs": [
"lib/public/linux32/mathlib.a",
"lib/public/linux32/tier1.a"
],
"dynamic_libs": [
"lib/public/linux32/libtier0_srv.so",
"lib/public/linux32/libvstdlib_srv.so"
]
},
"uses_system_cxxlib": false
},
"mac": {
"defines": [
"NO_HOOK_MALLOC",
"NO_MALLOC_OVERRIDE"
],
"x86": {
"postlink_libs": [
"lib/public/osx32/mathlib.a",
"lib/public/osx32/tier1.a"
],
"dynamic_libs": [
"lib/public/osx32/libtier0.dylib",
"lib/public/osx32/libvstdlib.dylib"
]
},
"cxxlib": "c++"
},
"windows": {
"x86": {
"libs": [
"lib/public/mathlib.lib",
"lib/public/tier0.lib",
"lib/public/tier1.lib",
"lib/public/vstdlib.lib"
]
}
}
}
10 changes: 5 additions & 5 deletions src/mod/mvm/blu_velocity_limit_remove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace Mod::MvM::Blu_Velocity_Limit_Remove
buf.SetDword(0x00 +1, (uint32_t)AddrManager::GetAddr("CBaseEntity::GetTeamNumber"));
mask[0x05 + 2] = 0x00;

mask.SetDword(0x0b + 1, 0x00000000);
mask.SetDword(0x0b + 2, 0x00000000);
#endif

return true;
Expand All @@ -51,11 +51,11 @@ namespace Mod::MvM::Blu_Velocity_Limit_Remove

mask.SetRange(0x05, 3, 0xff);
#else
buf[0x09 + 0] = 0x83;
buf[0x09 + 1] = 0xF8;
buf[0x09 + 2] = 0xFF;
buf[0x08 + 0] = 0x83;
buf[0x08 + 1] = 0xF8;
buf[0x08 + 2] = 0xFF;

mask.SetRange(0x09, 3, 0xff);
mask.SetRange(0x08, 3, 0xff);
#endif

return true;
Expand Down
10 changes: 6 additions & 4 deletions src/mod/perf/sendprop_optimize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ NOINLINE void SetTransmitAlways(CServerNetworkProperty *netProp, bool bAlways) {
if ( bAlways || (parentIndex < MAX_EDICTS)) {
transmitAlways->Set(edict->m_EdictIndex);
}
else if (edict != nullptr && edict->m_fStateFlags & FL_EDICT_DIRTY_PVS_INFORMATION) {
else if (edict->m_fStateFlags & FL_EDICT_DIRTY_PVS_INFORMATION) {
edict->m_fStateFlags &= ~FL_EDICT_DIRTY_PVS_INFORMATION;
engine->BuildEntityClusterList(edict, &(netProp->m_PVSInfo));
}
Expand All @@ -183,14 +183,16 @@ REPLACE_FUNC_MEMBER(void, CBaseEntity_SetTransmit, CCheckTransmitInfo *pInfo, bo
{
auto entity = reinterpret_cast<CBaseEntity *>(this);
CServerNetworkProperty *netProp = entity->NetworkProp();
int index = netProp->entindex();
int parentIndex = netProp->m_hParent.GetEntryIndex();
auto edict = netProp->m_pPev;
if (edict == nullptr) return;

pInfo->m_pTransmitEdict->Set(index);
pInfo->m_pTransmitEdict->Set(edict->m_EdictIndex);

if (transmitAlways) {
SetTransmitAlways(netProp, bAlways);
}

int parentIndex = netProp->m_hParent.GetEntryIndex();
if (parentIndex >= MAX_EDICTS || pInfo->m_pTransmitEdict->Get(parentIndex)) return;
CBaseEntity *parent = (CBaseEntity *)(g_pWorldEdict+parentIndex)->GetUnknown();

Expand Down
Loading

0 comments on commit e5a4ad1

Please sign in to comment.