CParticleSystemMgr::DrawRenderCache
0x00bd49e0 · 2238 bytes · __thiscall
_ZN18CParticleSystemMgr15DrawRenderCacheEb
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CParticleSystemMgr::DrawRenderCache(bool) */
void __thiscall CParticleSystemMgr::DrawRenderCache(CParticleSystemMgr *this,bool param_1)
{
undefined4 *puVar1;
ushort *puVar2;
uint *puVar3;
int iVar4;
char cVar5;
int iVar6;
IMatRenderContext *pIVar7;
int *piVar8;
undefined4 *puVar9;
int iVar10;
undefined4 uVar11;
int iVar12;
undefined4 *puVar13;
int iVar14;
byte bVar15;
CUtlVector<CParticleSystemMgr::Batch_t,CUtlMemory<CParticleSystemMgr::Batch_t,int>> *local_254;
int local_24c;
int local_23c;
undefined4 local_22c;
undefined4 local_228;
undefined4 local_224;
undefined4 local_220;
int local_21c;
void *local_218;
undefined4 local_214;
undefined4 local_210;
int local_20c;
void *local_208;
undefined4 local_204 [39];
ushort *local_168;
int local_164;
int local_160;
int local_154;
int *local_150;
undefined4 local_14c;
char local_148;
int local_144;
int local_138;
int *local_134;
int local_130;
int local_12c;
ushort *local_128;
int local_124;
undefined4 local_120;
undefined4 local_11c;
undefined4 local_118;
undefined1 local_114;
undefined4 local_110 [19];
undefined4 local_c4;
uint local_c0;
undefined4 local_bc;
undefined4 local_b0;
undefined4 local_ac;
undefined4 local_a4 [8];
undefined4 local_84 [6];
int *local_6c;
undefined1 local_68;
undefined4 local_64;
int local_60;
undefined4 local_5c;
undefined4 local_58;
undefined4 local_54;
undefined4 local_50;
undefined4 local_4c [8];
undefined4 local_2c;
int local_28;
ushort *local_24;
bVar15 = 0;
iVar4 = *(int *)(this + 0x100);
if (iVar4 != 0) {
local_22c = 0;
local_228 = 0;
if (_towlower == 0) {
local_21c = 0;
}
else {
(**(code **)(_towlower + 0x50))
(_towlower,&local_22c,0,0,0,0,
"/data/src/particles_server/../particles/particles.cpp",0x10e5,
&DrawRenderCache(bool)::tm_fmt,"(%s)%s","Particle/Effect_Rendering",
"CParticleSystemMgr::DrawRenderCache");
local_21c = _towlower;
}
iVar10 = _DAT_0105db00;
local_224 = local_22c;
local_220 = local_228;
/* try { // try from 00bd4acb to 00bd4acf has its CatchHandler @ 00bd5367 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar6 = ThreadGetCurrentId(), iVar10 == iVar6)) {
if ((char *)*_DAT_0105d15c != "CParticleSystemMgr::DrawRenderCache") {
/* try { // try from 00bd5337 to 00bd535a has its CatchHandler @ 00bd5367 */
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd5681c,(char *)0x0,0xd55a87);
}
puVar3 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar3 = *puVar3 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 00bd4ae2 to 00bd4ae7 has its CatchHandler @ 00bd5303 */
pIVar7 = (IMatRenderContext *)(**(code **)(*g_pMaterialSystem + 0x180))(g_pMaterialSystem);
if (pIVar7 != (IMatRenderContext *)0x0) {
/* try { // try from 00bd4af9 to 00bd4afb has its CatchHandler @ 00bd52f1 */
(**(code **)(*(int *)pIVar7 + 8))(pIVar7);
}
/* try { // try from 00bd4b0f to 00bd4b21 has its CatchHandler @ 00bd52ed */
(**(code **)(*(int *)pIVar7 + 0x50))(pIVar7,10);
(**(code **)(*(int *)pIVar7 + 0x54))(pIVar7);
(**(code **)(*(int *)pIVar7 + 0x7c))(pIVar7);
local_214 = 8;
local_210 = 0;
local_218 = malloc(0xe0);
local_20c = 0;
local_208 = local_218;
if (0 < iVar4) {
local_24c = 0;
do {
puVar1 = (undefined4 *)(*(int *)(this + 0xf4) + local_24c * 0x18);
if (puVar1[4] != 0) {
if (param_1) {
uVar11 = *(undefined4 *)(this + 0x108);
}
else {
uVar11 = *puVar1;
}
/* try { // try from 00bd4bad to 00bd4c1d has its CatchHandler @ 00bd52e9 */
BuildBatchList(this,local_24c,pIVar7,(CUtlVector *)&local_218);
iVar10 = local_20c;
if (local_20c != 0) {
(**(code **)(*(int *)pIVar7 + 0x24))(pIVar7,uVar11,0);
local_150 = (int *)0x0;
local_148 = '\0';
local_134 = (int *)0x0;
local_130 = 0;
local_12c = 0;
local_124 = 0;
local_120 = 0;
local_11c = 0xffffffff;
local_118 = 0;
local_6c = (int *)0x0;
local_28 = -1;
local_24 = (ushort *)0x0;
local_60 = 0;
local_5c = 0;
local_64 = 0;
local_2c = 0;
local_c4 = 0xffffffff;
/* try { // try from 00bd4cd5 to 00bd4f64 has its CatchHandler @ 00bd5243 */
piVar8 = (int *)(**(code **)(*(int *)pIVar7 + 0xe8))(pIVar7,1,0,0,0);
if (0 < iVar10) {
local_23c = 0;
do {
puVar1 = (undefined4 *)(local_23c * 0x1c + (int)local_218);
iVar6 = puVar1[1];
uVar11 = *puVar1;
local_148 = '\0';
local_14c = 2;
local_150 = piVar8;
(**(code **)(*piVar8 + 0x30))(piVar8,2);
(**(code **)(*local_150 + 0x4c))(local_150,uVar11,iVar6,local_204);
local_6c = piVar8;
local_64 = uVar11;
local_130 = iVar6;
puVar9 = local_204;
puVar13 = local_110;
for (iVar6 = 0x29; iVar6 != 0; iVar6 = iVar6 + -1) {
*puVar13 = *puVar9;
puVar9 = puVar9 + (uint)bVar15 * -2 + 1;
puVar13 = puVar13 + (uint)bVar15 * -2 + 1;
}
local_114 = 0;
local_144 = local_160;
local_134 = piVar8 + 1;
local_12c = 0;
local_124 = 0;
local_138 = local_154;
local_128 = local_168;
local_60 = 0;
local_68 = 0;
local_c0 = ~-(uint)(local_c0 == 0) & 2;
if (local_28 == -1) {
local_2c = 0;
local_24 = local_168;
local_28 = local_164;
}
local_5c = 0;
local_58 = local_bc;
local_54 = local_b0;
puVar9 = local_a4;
do {
puVar13 = puVar9 + 1;
puVar9[0x16] = *puVar9;
puVar9 = puVar13;
} while (puVar13 != local_84);
local_50 = local_ac;
iVar6 = puVar1[5];
if (0 < iVar6) {
iVar12 = 0;
iVar14 = 0;
do {
puVar9 = (undefined4 *)(puVar1[2] + iVar12 * 0x18);
(**(code **)(*(int *)puVar9[1] + 0x30))
((int *)puVar9[1],*puVar9,puVar9[2],pIVar7,local_204,iVar14,puVar9[3],
puVar9[4]);
iVar12 = iVar12 + 1;
iVar14 = iVar14 + puVar9[5];
} while (iVar12 != iVar6);
}
if (local_148 != '\0') {
switch(local_14c) {
case 4:
iVar6 = local_60 * 2 + -2;
break;
case 5:
iVar6 = local_60 * 2;
break;
case 6:
iVar6 = local_60 * 3 + -6;
break;
case 7:
iVar12 = local_60 * 6;
iVar6 = iVar12 + 3;
if (-1 < iVar12) {
iVar6 = iVar12;
}
iVar6 = iVar6 >> 2;
break;
default:
iVar6 = local_60;
break;
case 9:
iVar6 = 0;
}
if (local_138 != 0) {
if (local_130 - local_124 < iVar6) {
iVar6 = local_130 - local_124;
}
if (iVar6 != 0) {
puVar2 = (ushort *)(local_144 + local_124 * 2);
switch(local_14c) {
case 0:
case 9:
break;
default:
GenerateSequentialIndexBuffer(puVar2,iVar6,(int)local_128);
break;
case 4:
GenerateLineStripIndexBuffer(puVar2,iVar6,(int)local_128);
break;
case 5:
GenerateLineLoopIndexBuffer(puVar2,iVar6,(int)local_128);
break;
case 6:
GeneratePolygonIndexBuffer(local_128,(int)puVar2,iVar6);
break;
case 7:
/* try { // try from 00bd506a to 00bd5101 has its CatchHandler @ 00bd5243 */
GenerateQuadIndexBuffer(puVar2,iVar6,(int)local_128);
}
local_124 = local_124 + local_138 * iVar6;
if (local_12c < local_124) {
local_12c = local_124;
}
}
}
}
(**(code **)(*local_150 + 0x58))(local_150,local_60,local_12c,local_204);
local_134 = (int *)0x0;
local_130 = 0;
local_64 = 0;
local_6c = (int *)0x0;
local_c4 = 0xffffffff;
local_150 = (int *)0x0;
(**(code **)(*piVar8 + 0x34))(piVar8,0xffffffff,0);
local_23c = local_23c + 1;
} while (local_23c != iVar10);
}
if ((local_6c != (int *)0x0) &&
(cVar5 = (**(code **)(*local_6c + 0x10))(local_6c), cVar5 != '\0')) {
(**(code **)(*local_6c + 0x18))(local_6c);
}
if ((local_134 != (int *)0x0) &&
(cVar5 = (**(code **)(*local_134 + 0x10))(local_134), cVar5 != '\0')) {
(**(code **)(*local_134 + 0x18))(local_134);
}
}
}
local_24c = local_24c + 1;
} while (local_24c != iVar4);
}
local_254 = (CUtlVector<CParticleSystemMgr::Batch_t,CUtlMemory<CParticleSystemMgr::Batch_t,int>>
*)&local_218;
iVar6 = 0;
iVar4 = *(int *)(this + 0x100);
iVar10 = 0;
if (0 < iVar4) {
do {
iVar10 = iVar10 + 1;
*(undefined4 *)(*(int *)(this + 0xf4) + 0x10 + iVar6) = 0;
iVar6 = iVar6 + 0x18;
} while (iVar10 != iVar4);
}
/* try { // try from 00bd5159 to 00bd5169 has its CatchHandler @ 00bd52e9 */
(**(code **)(*(int *)pIVar7 + 0x50))(pIVar7,10);
(**(code **)(*(int *)pIVar7 + 0x58))(pIVar7);
CUtlVector<CParticleSystemMgr::Batch_t,CUtlMemory<CParticleSystemMgr::Batch_t,int>>::RemoveAll
(local_254);
CUtlMemory<CParticleSystemMgr::Batch_t,int>::Purge
((CUtlMemory<CParticleSystemMgr::Batch_t,int> *)local_254);
local_208 = local_218;
CUtlMemory<CParticleSystemMgr::Batch_t,int>::Purge
((CUtlMemory<CParticleSystemMgr::Batch_t,int> *)local_254);
(**(code **)(*(int *)pIVar7 + 0xc))(pIVar7);
(**(code **)(*(int *)pIVar7 + 4))(pIVar7);
iVar4 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar10 = ThreadGetCurrentId(), iVar4 == iVar10)) {
cVar5 = CVProfNode::ExitScope();
if (cVar5 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_21c != 0) {
(**(code **)(local_21c + 0x54))(local_21c,local_224,local_220,0,0,0);
}
}
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.