CVoxelHash::EnumerateElementsAlongRay_ExtrudedRay
0x001e08e0 · 1493 bytes · __thiscall
_ZN10CVoxelHash37EnumerateElementsAlongRay_ExtrudedRayEiRK5Ray_tRK6VectorS5_P20IPartitionEnumerator
Decompiled
undefined (6 params)
/* CVoxelHash::EnumerateElementsAlongRay_ExtrudedRay(int, Ray_t const&, Vector const&, Vector
const&, IPartitionEnumerator*) */
undefined4 __thiscall
CVoxelHash::EnumerateElementsAlongRay_ExtrudedRay
(CVoxelHash *this,int param_1,Ray_t *param_2,Vector *param_3,Vector *param_4,
IPartitionEnumerator *param_5)
{
bool bVar1;
char cVar2;
int *piVar3;
int iVar4;
byte bVar5;
uint uVar6;
int iVar7;
uint uVar8;
undefined4 uVar9;
uint uVar10;
float fVar11;
float fVar12;
float fVar13;
float fVar14;
float fVar15;
ushort local_13c;
uint local_124;
uint local_120;
uint local_11c;
float local_10c;
float local_108;
float local_104;
float local_100;
float local_fc;
float local_f8;
uint local_f4 [6];
uint local_dc [3];
float local_d0 [6];
float local_b8 [3];
undefined4 local_ac;
CUtlHashFast<int,CUtlHashFastNoHash> local_a8 [72];
undefined4 local_60;
undefined4 local_5c;
undefined4 uStack_58;
undefined4 uStack_54;
undefined4 uStack_50;
undefined4 local_4c;
undefined4 uStack_48;
undefined4 uStack_44;
undefined4 uStack_40;
undefined4 local_3c;
undefined4 uStack_38;
undefined4 uStack_34;
undefined4 uStack_30;
undefined4 local_2c;
undefined4 uStack_28;
undefined4 uStack_24;
undefined4 uStack_20;
local_10c = *(float *)param_2 - *(float *)(param_2 + 0x30);
local_108 = *(float *)(param_2 + 4) - *(float *)(param_2 + 0x34);
local_fc = *(float *)(param_2 + 4) + *(float *)(param_2 + 0x34);
local_100 = *(float *)param_2 + *(float *)(param_2 + 0x30);
local_104 = *(float *)(param_2 + 8) - *(float *)(param_2 + 0x38);
local_f8 = *(float *)(param_2 + 0x38) + *(float *)(param_2 + 8);
bVar5 = (char)*(undefined4 *)(this + 0x104c) * '\x02' + 8;
local_f4[0] = (int)(local_10c - *(float *)this) >> (bVar5 & 0x1f);
local_f4[3] = (int)(local_100 - *(float *)this) >> (bVar5 & 0x1f);
local_f4[1] = (int)(local_108 - *(float *)(this + 4)) >> (bVar5 & 0x1f);
local_f4[4] = (int)(local_fc - *(float *)(this + 4)) >> (bVar5 & 0x1f);
local_f4[5] = (int)(local_f8 - *(float *)(this + 8)) >> (bVar5 & 0x1f);
local_f4[2] = (int)(local_104 - *(float *)(this + 8)) >> (bVar5 & 0x1f);
iVar4 = *(int *)(this + 0x1048);
CUtlHashFast<int,CUtlHashFastNoHash>::CUtlHashFast(local_a8);
piVar3 = (int *)___tls_get_addr();
local_ac = *(undefined4 *)(iVar4 + 0x3c + *piVar3 * 4);
local_60 = *(undefined4 *)(iVar4 + 0x38);
local_5c = *(undefined4 *)param_2;
uStack_58 = *(undefined4 *)(param_2 + 4);
uStack_54 = *(undefined4 *)(param_2 + 8);
uStack_50 = *(undefined4 *)(param_2 + 0xc);
local_4c = *(undefined4 *)(param_2 + 0x10);
uStack_48 = *(undefined4 *)(param_2 + 0x14);
uStack_44 = *(undefined4 *)(param_2 + 0x18);
uStack_40 = *(undefined4 *)(param_2 + 0x1c);
local_3c = *(undefined4 *)param_3;
uStack_38 = *(undefined4 *)(param_3 + 4);
uStack_34 = *(undefined4 *)(param_3 + 8);
uStack_30 = *(undefined4 *)(param_3 + 0xc);
local_2c = *(undefined4 *)(param_2 + 0x30);
uStack_28 = *(undefined4 *)(param_2 + 0x34);
uStack_24 = *(undefined4 *)(param_2 + 0x38);
uStack_20 = *(undefined4 *)(param_2 + 0x3c);
local_124 = local_f4[0];
uVar6 = local_f4[0] & 0xffff;
uVar8 = local_f4[3];
if ((int)local_f4[0] <= (int)local_f4[3]) {
do {
local_13c = (ushort)uVar6 & 0x7ff;
uVar6 = uVar6 & 0x7ff;
local_120 = local_f4[1];
local_11c = local_f4[1] & 0xffff;
if ((int)local_f4[1] <= (int)local_f4[4]) {
do {
local_11c = local_11c & 0xffff07ff;
uVar6 = uVar6 & 0xffc007ff | local_11c << 0xb;
uVar10 = local_f4[2];
uVar8 = local_f4[2];
if ((int)local_f4[2] <= (int)local_f4[5]) {
do {
uVar6 = uVar6 & 0x3fffff | (uVar8 & 0xffff03ff) << 0x16;
/* try { // try from 001e0b2a to 001e0e4a has its CatchHandler @ 001e0ec7 */
bVar1 = EnumerateElementsInVoxel<CIntersectSweptBox>
(this,uVar6,&local_ac,param_1,param_5);
if (!bVar1) goto LAB_001e0b33;
uVar8 = (uVar8 & 0xffff03ff) + 1;
uVar10 = uVar10 + 1;
} while ((int)uVar10 <= (int)local_f4[5]);
}
local_120 = local_120 + 1;
local_11c = (uint)(ushort)((short)local_11c + 1);
uVar8 = local_f4[3];
} while ((int)local_120 <= (int)local_f4[4]);
}
local_124 = local_124 + 1;
uVar6 = (uint)(ushort)(local_13c + 1);
} while ((int)local_124 <= (int)uVar8);
}
bVar5 = (char)*(undefined4 *)(this + 0x104c) * '\x02' + 8;
if ((((((int)((*(float *)param_4 - *(float *)(param_2 + 0x30)) - *(float *)this) >> (bVar5 & 0x1f)
< (int)local_f4[0]) ||
((int)((*(float *)(param_4 + 4) - *(float *)(param_2 + 0x34)) - *(float *)(this + 4)) >>
(bVar5 & 0x1f) < (int)local_f4[1])) ||
((int)((*(float *)(param_4 + 8) - *(float *)(param_2 + 0x38)) - *(float *)(this + 8)) >>
(bVar5 & 0x1f) < (int)local_f4[2])) ||
(((int)uVar8 <
(int)((*(float *)param_4 + *(float *)(param_2 + 0x30)) - *(float *)this) >> (bVar5 & 0x1f)
|| ((int)local_f4[4] <
(int)((*(float *)(param_4 + 4) + *(float *)(param_2 + 0x34)) - *(float *)(this + 4)) >>
(bVar5 & 0x1f))))) ||
((int)local_f4[5] <
(int)((*(float *)(param_4 + 8) + *(float *)(param_2 + 0x38)) - *(float *)(this + 8)) >>
(bVar5 & 0x1f))) {
LeafListExtrudedRaySetup
(this,param_2,param_3,(Vector *)&local_10c,(Vector *)&local_100,(int *)local_f4,
(int *)(local_f4 + 3),(int *)(local_f4 + 6),local_d0 + 3,local_d0,local_d0 + 6);
fVar12 = local_d0[0];
fVar13 = local_d0[1];
fVar14 = local_d0[2];
LAB_001e0d28:
if (fVar12 < 1.0) goto LAB_001e0d43;
LAB_001e0d35:
if ((fVar13 < 1.0) || (fVar14 < 1.0)) {
LAB_001e0d43:
if (fVar13 <= fVar12) goto LAB_001e0dd8;
do {
if (fVar14 <= fVar12) goto LAB_001e0e98;
iVar4 = 0;
fVar15 = fVar12;
LAB_001e0d5b:
if (local_d0[4] <= local_d0[3]) {
if (local_d0[5] <= local_d0[4]) goto LAB_001e0e70;
iVar7 = 1;
fVar11 = local_d0[4];
}
else if (local_d0[5] <= local_d0[3]) {
LAB_001e0e70:
iVar7 = 2;
fVar11 = local_d0[5];
}
else {
iVar7 = 0;
fVar11 = local_d0[3];
}
if (fVar15 <= fVar11) {
uVar6 = local_f4[iVar4 + 6];
local_d0[iVar4] = fVar15 + local_d0[iVar4 + 6];
if ((int)uVar6 < 1) {
local_f4[iVar4] = local_f4[iVar4] + uVar6;
}
else {
local_f4[iVar4 + 3] = local_f4[iVar4 + 3] + uVar6;
}
cVar2 = EnumerateElementsAlongRay_ExtrudedRaySlice
(this,param_1,param_5,(CIntersectSweptBox *)&local_ac,(int *)local_f4,
(int *)(local_f4 + 3),iVar4,(int *)(local_f4 + 6));
fVar12 = local_d0[0];
fVar13 = local_d0[1];
fVar14 = local_d0[2];
if (cVar2 != '\0') goto LAB_001e0d28;
goto LAB_001e0b33;
}
uVar6 = local_f4[iVar7 + 6];
local_d0[iVar7 + 3] = fVar11 + local_d0[iVar7 + 6];
if ((int)uVar6 < 1) {
local_f4[iVar7 + 3] = local_f4[iVar7 + 3] + uVar6;
goto LAB_001e0d28;
}
local_f4[iVar7] = local_f4[iVar7] + uVar6;
if (1.0 <= fVar12) goto LAB_001e0d35;
} while (fVar12 < fVar13);
LAB_001e0dd8:
if (fVar14 <= fVar13) {
LAB_001e0e98:
iVar4 = 2;
fVar15 = fVar14;
}
else {
iVar4 = 1;
fVar15 = fVar13;
}
goto LAB_001e0d5b;
}
}
uVar9 = 1;
LAB_001e0b35:
CUtlHashFast<int,CUtlHashFastNoHash>::~CUtlHashFast(local_a8);
return uVar9;
LAB_001e0b33:
uVar9 = 0;
goto LAB_001e0b35;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.