CBitWrite::WriteBitAngle
0x00b75bc0 · 226 bytes · __thiscall
_ZN9CBitWrite13WriteBitAngleEfi
Decompiled
undefined (3 params)
/* CBitWrite::WriteBitAngle(float, int) */
void __thiscall CBitWrite::WriteBitAngle(CBitWrite *this,float param_1,int param_2)
{
int iVar1;
uint *puVar2;
byte bVar3;
uint uVar4;
uint uVar5;
uVar4 = (int)(param_1 * 0.0027777778 *
((float)((&GetBitForBitnum(int)::bitsForBitnum)[param_2 & 0x1f] + -0x80000000) +
2.1474836e+09)) & (&GetBitForBitnum(int)::bitsForBitnum)[param_2 & 0x1f] - 1;
iVar1 = *(int *)(this + 0x14);
bVar3 = (byte)iVar1;
if (param_2 <= iVar1) {
*(int *)(this + 0x14) = iVar1 - param_2;
uVar4 = uVar4 << (0x20 - bVar3 & 0x1f) | *(uint *)(this + 0x10);
*(uint *)(this + 0x10) = uVar4;
if (iVar1 - param_2 == 0) {
puVar2 = *(uint **)(this + 0x18);
if (puVar2 == *(uint **)(this + 0x1c)) {
this[4] = (CBitWrite)0x1;
}
else {
*(uint **)(this + 0x18) = puVar2 + 1;
*puVar2 = uVar4;
}
*(undefined4 *)(this + 0x10) = 0;
*(undefined4 *)(this + 0x14) = 0x20;
}
return;
}
puVar2 = *(uint **)(this + 0x18);
uVar5 = (*(uint *)(CBitBuffer::s_nMaskTable + iVar1 * 4) & uVar4) << (0x20 - bVar3 & 0x1f) |
*(uint *)(this + 0x10);
*(uint *)(this + 0x10) = uVar5;
if (puVar2 == *(uint **)(this + 0x1c)) {
this[4] = (CBitWrite)0x1;
}
else {
*(uint **)(this + 0x18) = puVar2 + 1;
*puVar2 = uVar5;
}
*(uint *)(this + 0x10) = uVar4 >> (bVar3 & 0x1f);
*(int *)(this + 0x14) = 0x20 - (param_2 - iVar1);
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.