old_bf_read::ReadBitCellCoord
0x00b66fb0 · 574 bytes · __thiscall
_ZN11old_bf_read16ReadBitCellCoordEi13EBitCoordType
Decompiled
undefined (3 params)
/* old_bf_read::ReadBitCellCoord(int, EBitCoordType) */
longdouble __thiscall old_bf_read::ReadBitCellCoord(old_bf_read *this,int param_1,int param_3)
{
uint uVar1;
int iVar2;
uint uVar3;
uint uVar4;
int iVar5;
float fVar6;
double dVar7;
double dVar8;
double dVar9;
iVar2 = *(int *)(this + 0xc);
iVar5 = iVar2 >> 5;
if (param_3 == 2) {
uVar3 = param_1 + iVar2;
if (*(int *)(this + 8) < (int)uVar3) {
*(int *)(this + 0xc) = *(int *)(this + 8);
fVar6 = 0.0;
this[0x10] = (old_bf_read)0x1;
}
else {
uVar4 = *(uint *)(*(int *)this + iVar5 * 4);
*(uint *)(this + 0xc) = uVar3;
uVar4 = uVar4 >> ((byte)iVar2 & 0x1f);
if (iVar5 == (int)(uVar3 - 1) >> 5) {
if (param_1 != 0x20) {
uVar4 = uVar4 & (&g_ExtraMasks)[param_1];
}
fVar6 = (float)(uVar4 >> 0x10) * 65536.0 + (float)(uVar4 & 0xffff);
}
else {
uVar4 = (*(uint *)(*(int *)this + 4 + iVar5 * 4) & (&g_ExtraMasks)[uVar3 & 0x1f]) <<
((char)param_1 - (char)(uVar3 & 0x1f) & 0x1fU) | uVar4;
fVar6 = (float)(uVar4 >> 0x10) * 65536.0 + (float)(uVar4 & 0xffff);
}
}
}
else {
uVar3 = *(uint *)(this + 8);
uVar4 = param_1 + iVar2;
if ((int)uVar3 < (int)uVar4) {
*(uint *)(this + 0xc) = uVar3;
dVar9 = 0.0;
this[0x10] = (old_bf_read)0x1;
uVar4 = uVar3;
}
else {
uVar1 = *(uint *)(*(int *)this + iVar5 * 4);
*(uint *)(this + 0xc) = uVar4;
uVar1 = uVar1 >> ((byte)iVar2 & 0x1f);
if (iVar5 == (int)(uVar4 - 1) >> 5) {
if (param_1 == 0x20) {
dVar9 = (double)(int)uVar1;
}
else {
dVar9 = (double)(int)(uVar1 & (&g_ExtraMasks)[param_1]);
}
}
else {
dVar9 = (double)(int)((*(uint *)(*(int *)this + 4 + iVar5 * 4) &
(&g_ExtraMasks)[uVar4 & 0x1f]) <<
((char)param_1 - (char)(uVar4 & 0x1f) & 0x1fU) | uVar1);
}
}
iVar2 = (-(uint)(param_3 != 1) & 2) + 3;
uVar1 = iVar2 + uVar4;
if ((int)uVar3 < (int)uVar1) {
*(uint *)(this + 0xc) = uVar3;
dVar7 = 0.0;
this[0x10] = (old_bf_read)0x1;
}
else {
iVar5 = (int)uVar4 >> 5;
uVar3 = *(uint *)(*(int *)this + iVar5 * 4);
*(uint *)(this + 0xc) = uVar1;
uVar3 = uVar3 >> ((byte)uVar4 & 0x1f);
if (iVar5 == (int)(uVar1 - 1) >> 5) {
dVar7 = (double)(int)(uVar3 & (&g_ExtraMasks)[iVar2]);
}
else {
dVar7 = (double)(int)(((&g_ExtraMasks)[uVar1 & 0x1f] &
*(uint *)(*(int *)this + 4 + iVar5 * 4)) <<
((char)iVar2 - (char)(uVar1 & 0x1f) & 0x1fU) | uVar3);
}
}
if (param_3 != 1) {
dVar8 = 0.03125;
}
else {
dVar8 = 0.125;
}
fVar6 = (float)(dVar7 * dVar8 + dVar9);
}
return (longdouble)fVar6;
}
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.