hlsdk

Charge-dependent gravity

Oct 25th, 2010
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.08 KB | None | 0 0
  1. float C_TFCompoundBow::GetCurrentCharge(void)
  2. {
  3.     double chargeTime = this->GetChargeBeginTime();
  4.     if (chargeTime != 0.0f)
  5.     {
  6.         double currentTime = g_pGlobals->???AbsTime???;
  7.         return Min(currentTime - chargeTime, 1.0f);
  8.     }
  9.     return 0.0f;
  10. }
  11. //This makes no sense, but...
  12. /*
  13. __text:00267480 ; C_TFCompoundBow::GetCurrentCharge(void)
  14. __text:00267480 __ZN15C_TFCompoundBow16GetCurrentChargeEv proc near
  15. __text:00267480                                         ; DATA XREF: __const:00CCC0E0o
  16. __text:00267480
  17. __text:00267480 var_4           = dword ptr -4
  18. __text:00267480 arg_0           = dword ptr  8
  19. __text:00267480
  20. __text:00267480                 push    ebp
  21. __text:00267481                 mov     ebp, esp
  22. __text:00267483                 sub     esp, 4
  23. __text:00267486                 call    ___i686_get_pc_thunk_cx
  24. __text:0026748B                 mov     eax, [ebp+arg_0]
  25. __text:0026748E                 movss   xmm2, dword ptr [eax+24B4h] ; GetChargeBeginTime
  26. __text:00267496                 pxor    xmm0, xmm0
  27. __text:0026749A                 movaps  xmm1, xmm0
  28. __text:0026749D                 ucomiss xmm2, xmm0
  29. __text:002674A0                 jp      short loc_2674A4
  30. __text:002674A2                 jz      short loc_2674BD
  31. __text:002674A4
  32. __text:002674A4 loc_2674A4:                             ; CODE XREF: C_TFCompoundBow::GetCurrentCharge(void)+20j
  33. __text:002674A4                 mov     eax, ds:(g_pGlobals - 26748Bh)[ecx]
  34. __text:002674AA                 mov     eax, [eax]
  35. __text:002674AC                 movss   xmm1, dword ptr [eax+0Ch]
  36. __text:002674B1                 subss   xmm1, xmm2
  37. __text:002674B5                 minss   xmm1, ds:(flt_ABCAC8 - 26748Bh)[ecx]
  38. __text:002674BD
  39. __text:002674BD loc_2674BD:                             ; CODE XREF: C_TFCompoundBow::GetCurrentCharge(void)+22j
  40. __text:002674BD                 movss   [ebp+var_4], xmm1
  41. __text:002674C2                 fld     [ebp+var_4]
  42. __text:002674C5                 leave
  43. __text:002674C6                 retn
  44. __text:002674C6 __ZN15C_TFCompoundBow16GetCurrentChargeEv endp
  45. */
Advertisement
Add Comment
Please, Sign In to add comment