summaryrefslogtreecommitdiffhomepage
path: root/src/autojump.c
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2022-04-24 03:27:35 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2022-04-24 03:43:26 +0100
commit7b12eb811ff62d9d14ccb7c152a9821796efe9a5 (patch)
treede95be73de40e732d8bbd002b721b4683fbf12c0 /src/autojump.c
parent99e9a6765a9a358987c062ec4a251f8254581933 (diff)
Replace udis86 with a very small x86 decoder
hook_inline() uses the new x86_len() function to get instruction lengths instead of doing full-blown disassembly, which should be a tiny bit quicker, and also removes the next for about 90KiB of lookup tables and such in the final binary. The code-digging logic in demorecord is also rewritten to be opcode-based rather than mnenmonic based. In general, going forward the plan is to always rely on opcodes and thus avoid a bunch of disassembly work every plugin load. udis86 is still in the tree for now to provide dbg_asmdump(), but it's only compiled into debug builds and left out of releases completely. As such, the whole BSD licence statement is also gone from the distribution LICENCE files. There's now also a dbg_toghidra() which spits out a rebased address to look stuff up for proper reverse engineering, which might be more useful than dbg_asmdump() anyway. If nobody ends up using the latter ever again, udis86 could get chucked completely. We'll see. Also shoehorned into this commit are a couple more forgotten copyright year bumps and some general minor cleanup here and there, because I couldn't be bothered wading through all the diff hunks. Oh, and makebindist.bat now makes an effort to make the zip file timestamps predictable/reproducible. That should be a different commit for sure, but oh well too bad.
Diffstat (limited to 'src/autojump.c')
-rw-r--r--src/autojump.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/src/autojump.c b/src/autojump.c
index e91c854..6c30df9 100644
--- a/src/autojump.c
+++ b/src/autojump.c
@@ -1,5 +1,5 @@
/*
- * Copyright © 2021 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2022 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -30,29 +30,18 @@ DEF_CVAR(sst_autojump, "Jump upon hitting the ground while holding space", 0,
struct vec3f { float x, y, z; };
struct CMoveData {
- bool firstrun : 1;
- bool gamecodemoved : 1;
+ bool firstrun : 1, gamecodemoved : 1;
ulong playerhandle;
int impulse;
- struct vec3f viewangles;
- struct vec3f absviewangles;
- int buttons;
- int oldbuttons;
- float mv_forward;
- float mv_side;
- float mv_up;
- float maxspeed;
- float clientmaxspeed;
- struct vec3f vel;
- struct vec3f angles;
- struct vec3f oldangles;
+ struct vec3f viewangles, absviewangles;
+ int buttons, oldbuttons;
+ float mv_forward, mv_side, mv_up;
+ float maxspeed, clmaxspeed;
+ struct vec3f vel, angles, oldangles;
float out_stepheight;
- struct vec3f out_wishvel;
- struct vec3f out_jumpvel;
- struct vec3f constraint_center;
- float constraint_radius;
- float constraint_width;
- float constraint_speedfactor;
+ struct vec3f out_wishvel, out_jumpvel;
+ struct vec3f constraint_centre;
+ float constraint_radius, constraint_width, constraint_speedfactor;
struct vec3f origin;
};