diff options
author | Michael Smith <mikesmiffy128@gmail.com> | 2023-08-30 23:18:38 +0100 |
---|---|---|
committer | Michael Smith <mikesmiffy128@gmail.com> | 2023-08-30 23:44:50 +0100 |
commit | 464c9398ae49d8faae46f81fb7040155408858f7 (patch) | |
tree | 3c8f035e752124a7f9f32179fa01d5c56c9d2439 /src/build | |
parent | 8a1c4de9b33128c10378f1938d8a60c071f01ad0 (diff) |
Perform very minor load/unload optimisations
Because why not.
Diffstat (limited to 'src/build')
-rw-r--r-- | src/build/mkentprops.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/build/mkentprops.c b/src/build/mkentprops.c index fdb6982..9fb2a50 100644 --- a/src/build/mkentprops.c +++ b/src/build/mkentprops.c @@ -157,15 +157,7 @@ _( " const char *varname = mem_loadptr(mem_offset(p, off_SP_varname));") pp - c->props.data < c->props.sz; ++pp) { F( " %sif (!strcmp(varname, \"%s\")) {", else2, (*pp)->propname) F( " has_%s = true;", (*pp)->varname) - // from AM L4D2 SDK headers: - // > SENDPROP_VECTORELEM makes [offset] negative to start with so we - // > can detect that and set the SPROP_IS_VECTOR_ELEM flag. - // apparently if we're loaded via VDF, it hasn't been flipped back - // yet. just calling abs() on everything as an easy solution. - // TODO(opt): if we moved this into deferred init we wouldn't need - // to bother with this, but that might involve untangling more - // engineapi stuff -F( " %s = abs(*(int *)mem_offset(p, off_SP_offset));", +F( " %s = mem_load32(mem_offset(p, off_SP_offset));", (*pp)->varname) _( " if (!--needprops) break;") _( " }") |