diff options
Diffstat (limited to 'src/inputhud.c')
| -rw-r--r-- | src/inputhud.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/inputhud.c b/src/inputhud.c index fdefe6a..ef7f9ac 100644 --- a/src/inputhud.c +++ b/src/inputhud.c @@ -18,6 +18,7 @@ #include <math.h> +#include "chunklets/x86.h" #include "con_.h" #include "engineapi.h" #include "event.h" @@ -32,7 +33,6 @@ #include "langext.h" #include "mem.h" #include "vcall.h" -#include "x86.h" #include "x86util.h" FEATURE("button input HUD") @@ -150,16 +150,12 @@ static inline int bsf(uint x) { // doing a straight bsf (e.g. via BitScanForward or __builtin_ctz) creates // a false dependency on many CPUs, which compilers don't understand somehow int ret = 0; -#if defined(__GNUC__) || defined(__clang__) - __asm__ volatile ( - "bsfl %1, %0\n" + __asm volatile ( + "bsf %0, %1\n" : "+r" (ret) : "r" (x) ); return ret; -#else -#error need some sort of inline asm, or a non-broken(!) bitscan intrinsic -#endif } // IMPORTANT: these things must all match the button order in engineapi.h @@ -432,14 +428,16 @@ INIT { // HL2 sprint HUD, so move it up. This is a bit yucky, but at least we don't // have to go through all the virtual setter crap twice... if (GAMETYPE_MATCHES(L4D)) { - sst_inputhud_y->defaultval = "0.82"; - sst_inputhud_y->fval = 0.82f; - sst_inputhud_y->ival = 0; + struct con_var_common *c = con_getvarcommon(sst_inputhud_y); + c->defaultval = "0.82"; + c->fval = 0.82f; + c->ival = 0; } else if (GAMETYPE_MATCHES(HL2series)) { - sst_inputhud_y->defaultval = "0.75"; - sst_inputhud_y->fval = 0.75f; - sst_inputhud_y->ival = 0; + struct con_var_common *c = con_getvarcommon(sst_inputhud_y); + c->defaultval = "0.75"; + c->fval = 0.75f; + c->ival = 0; } return FEAT_OK; |
