CCurveData::SaveToBuffer
0x00ba7030 · 475 bytes · __cdecl
_ZN10CCurveData12SaveToBufferER10CUtlBufferP17IChoreoStringPool
Decompiled
undefined (2 params)
/* CCurveData::SaveToBuffer(CUtlBuffer&, IChoreoStringPool*) */
void CCurveData::SaveToBuffer(CUtlBuffer *param_1,IChoreoStringPool *param_2)
{
uint uVar1;
char cVar2;
int iVar3;
void *pvVar4;
uint uVar5;
float *pfVar6;
float fVar7;
undefined1 local_24;
undefined1 uStack_23;
undefined1 uStack_22;
undefined1 uStack_21;
undefined1 local_20;
undefined1 local_1f;
undefined1 local_1e;
undefined1 local_1d;
uVar1 = *(uint *)(param_1 + 0xc);
if (((byte)param_2[0x15] & 1) == 0) {
cVar2 = CUtlBuffer::CheckPut((CUtlBuffer *)param_2,1);
if (cVar2 != '\0') {
*(char *)(*(int *)param_2 + (*(int *)(param_2 + 0x10) - *(int *)(param_2 + 0x20))) =
(char)uVar1;
*(int *)(param_2 + 0x10) = *(int *)(param_2 + 0x10) + 1;
CUtlBuffer::AddNullTermination((CUtlBuffer *)param_2);
}
}
else {
CUtlBuffer::Printf((CUtlBuffer *)param_2,"%u",uVar1 & 0xff);
}
uVar5 = 0;
if ((int)uVar1 < 1) {
return;
}
LAB_00ba70e0:
do {
if ((int)uVar5 < *(int *)(param_1 + 0xc)) {
pfVar6 = (float *)(*(int *)param_1 + uVar5 * 10);
fVar7 = pfVar6[1];
if (((byte)param_2[0x15] & 1) != 0) goto LAB_00ba7085;
LAB_00ba70fe:
cVar2 = CUtlBuffer::CheckPut((CUtlBuffer *)param_2,4);
if (cVar2 != '\0') {
if (((byte)param_2[0x34] & 1) == 0) {
*(float *)(*(int *)param_2 + (*(int *)(param_2 + 0x10) - *(int *)(param_2 + 0x20))) =
fVar7;
iVar3 = *(int *)(param_2 + 0x10);
}
else {
iVar3 = *(int *)(param_2 + 0x10);
pvVar4 = (void *)((iVar3 - *(int *)(param_2 + 0x20)) + *(int *)param_2);
if (pvVar4 != (void *)0x0) {
uStack_21 = (undefined1)((uint)fVar7 >> 0x18);
local_20 = uStack_21;
uStack_22 = (undefined1)((uint)fVar7 >> 0x10);
local_1f = uStack_22;
uStack_23 = (undefined1)((uint)fVar7 >> 8);
local_1e = uStack_23;
local_24 = SUB41(fVar7,0);
local_1d = local_24;
_V_memcpy(pvVar4,&local_20,4);
iVar3 = *(int *)(param_2 + 0x10);
}
}
*(int *)(param_2 + 0x10) = iVar3 + 4;
CUtlBuffer::AddNullTermination((CUtlBuffer *)param_2);
}
}
else {
pfVar6 = (float *)0x0;
fVar7 = fRam00000004;
if (((byte)param_2[0x15] & 1) == 0) goto LAB_00ba70fe;
LAB_00ba7085:
CUtlBuffer::Printf((CUtlBuffer *)param_2,"%f",(double)fVar7);
}
fVar7 = *pfVar6;
if (((byte)param_2[0x15] & 1) == 0) {
cVar2 = CUtlBuffer::CheckPut((CUtlBuffer *)param_2,1);
if (cVar2 != '\0') {
uVar5 = uVar5 + 1;
*(char *)(*(int *)param_2 + (*(int *)(param_2 + 0x10) - *(int *)(param_2 + 0x20))) =
(char)(int)(fVar7 * 255.0);
*(int *)(param_2 + 0x10) = *(int *)(param_2 + 0x10) + 1;
CUtlBuffer::AddNullTermination((CUtlBuffer *)param_2);
if (uVar5 == uVar1) {
return;
}
goto LAB_00ba70e0;
}
}
else {
CUtlBuffer::Printf((CUtlBuffer *)param_2,"%u",(int)(fVar7 * 255.0) & 0xff);
}
uVar5 = uVar5 + 1;
if (uVar5 == uVar1) {
return;
}
} while( true );
}
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.