CPooledVBAllocator_ColorMesh::Allocate
0x00185a10 · 122 bytes · __thiscall
_ZN28CPooledVBAllocator_ColorMesh8AllocateEi
Decompiled
undefined (2 params)
/* CPooledVBAllocator_ColorMesh::Allocate(int) */
int __thiscall
CPooledVBAllocator_ColorMesh::Allocate(CPooledVBAllocator_ColorMesh *this,int param_1)
{
int iVar1;
if (*(int *)(this + 4) == 0) {
Warning(
"ERROR: CPooledVBAllocator_ColorMesh::Allocate cannot be called before Init (expect a crash)\n"
);
iVar1 = -1;
}
else if (this[0x20] == (CPooledVBAllocator_ColorMesh)0x0) {
if (*(int *)(this + 0xc) - *(int *)(this + 0x18) < param_1) {
Warning(
"ERROR: CPooledVBAllocator_ColorMesh::Allocate failing - not enough space left in the vertex buffer!\n"
);
iVar1 = -1;
}
else {
iVar1 = *(int *)(this + 0x1c);
*(int *)(this + 0x18) = *(int *)(this + 0x18) + param_1;
*(int *)(this + 0x14) = *(int *)(this + 0x14) + 1;
*(int *)(this + 0x1c) = param_1 * *(int *)(this + 0x10) + iVar1;
}
}
else {
Warning(
"ERROR: CPooledVBAllocator_ColorMesh::Allocate being called after some (but not all) calls to Deallocate have been called - invalid! (expect visual artifacts)\n"
);
iVar1 = -1;
}
return iVar1;
}
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.