CBitWrite::WriteBitVec3Normal
0x0009d3e0 · 450 bytes · __thiscall
_ZN9CBitWrite18WriteBitVec3NormalERK6Vector
Decompiled
undefined (2 params)
/* CBitWrite::WriteBitVec3Normal(Vector const&) */
void __thiscall CBitWrite::WriteBitVec3Normal(CBitWrite *this,Vector *param_1)
{
float fVar1;
float fVar2;
int iVar3;
uint *puVar4;
uint uVar5;
int iVar6;
uint uVar7;
fVar1 = *(float *)param_1;
if (0.0004885198 <= fVar1) {
fVar2 = *(float *)(param_1 + 4);
uVar5 = 1;
}
else {
fVar2 = *(float *)(param_1 + 4);
uVar5 = (uint)(fVar1 <= -0.0004885198);
}
if (fVar2 < 0.0004885198) {
uVar7 = (uint)(fVar2 <= -0.0004885198);
}
else {
uVar7 = 1;
}
iVar3 = *(int *)(this + 0x14);
uVar5 = uVar5 << (0x20U - (char)iVar3 & 0x1f) | *(uint *)(this + 0x10);
*(int *)(this + 0x14) = iVar3 + -1;
*(uint *)(this + 0x10) = uVar5;
if (iVar3 + -1 == 0) {
puVar4 = *(uint **)(this + 0x18);
if (puVar4 == *(uint **)(this + 0x1c)) {
this[4] = (CBitWrite)0x1;
}
else {
*(uint **)(this + 0x18) = puVar4 + 1;
*puVar4 = uVar5;
}
*(uint *)(this + 0x10) = uVar7;
*(undefined4 *)(this + 0x14) = 0x1f;
}
else {
*(int *)(this + 0x14) = iVar3 + -2;
uVar5 = uVar7 << (0x21U - (char)iVar3 & 0x1f) | uVar5;
*(uint *)(this + 0x10) = uVar5;
if (iVar3 + -2 == 0) {
puVar4 = *(uint **)(this + 0x18);
if (puVar4 == *(uint **)(this + 0x1c)) {
this[4] = (CBitWrite)0x1;
}
else {
*(uint **)(this + 0x18) = puVar4 + 1;
*puVar4 = uVar5;
}
*(undefined4 *)(this + 0x10) = 0;
*(undefined4 *)(this + 0x14) = 0x20;
}
}
if (0.0004885198 <= fVar1 || fVar1 <= -0.0004885198) {
WriteBitNormal(this,*(float *)param_1);
}
if (fVar2 >= 0.0004885198 || fVar2 <= -0.0004885198) {
WriteBitNormal(this,*(float *)(param_1 + 4));
}
iVar3 = *(int *)(this + 0x14);
fVar1 = *(float *)(param_1 + 8);
iVar6 = iVar3 + -1;
*(int *)(this + 0x14) = iVar6;
uVar5 = (uint)(fVar1 <= -0.0004885198) << (0x20U - (char)iVar3 & 0x1f) | *(uint *)(this + 0x10);
*(uint *)(this + 0x10) = uVar5;
if (iVar6 == 0) {
puVar4 = *(uint **)(this + 0x18);
if (puVar4 == *(uint **)(this + 0x1c)) {
this[4] = (CBitWrite)0x1;
}
else {
*(uint **)(this + 0x18) = puVar4 + 1;
*puVar4 = uVar5;
}
*(undefined4 *)(this + 0x10) = 0;
*(undefined4 *)(this + 0x14) = 0x20;
}
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.