MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / xSGAddSaveClient

Function xSGAddSaveClient

src/SB/Core/x/xsavegame.cpp:354–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352}
353
354S32 xSGAddSaveClient(st_XSAVEGAME_DATA* xsgdata, U32 clttag, void* cltdata,
355 S32 (*infofunc)(void*, st_XSAVEGAME_DATA*, S32*, S32*),
356 S32 (*procfunc)(void*, st_XSAVEGAME_DATA*, st_XSAVEGAME_WRITECONTEXT*))
357{
358 S32 result = 1;
359 if (xsgdata->stage & 0x40000000)
360 {
361 result = 0;
362 }
363 else if (!(xsgdata->stage & 1))
364 {
365 result = 0;
366 }
367
368 if (xsgdata->stkcnt + 1 >= 128)
369 {
370 xUtil_idtag2string(clttag, 0);
371 result = 0;
372 }
373
374 st_XSAVEGAME_CLIENT* clt = &xsgdata->cltstk[xsgdata->stkcnt++];
375 clt->idtag = clttag;
376 clt->cltinfo = infofunc;
377 clt->cltproc = procfunc;
378 clt->cltdata = cltdata;
379 clt->needamt = 0;
380 clt->realamt = 0;
381 clt->buf_sizepos = NULL;
382
383 xsgdata->stage |= 4;
384 if (result == 0)
385 {
386 xsgdata->stage |= 0x40000000;
387 }
388 return result;
389}
390
391S32 xSGAddLoadClient(st_XSAVEGAME_DATA* xsgdata, U32 clttag, void* cltdata,
392 S32 (*loadfunc)(void*, st_XSAVEGAME_DATA*, st_XSAVEGAME_READCONTEXT*,

Callers 4

xSerial_svgame_registerFunction · 0.70
xSGInitFunction · 0.70
zSaveLoad_DoAutoSaveFunction · 0.50
zSaveLoad_SaveGameFunction · 0.50

Calls 1

xUtil_idtag2stringFunction · 0.70

Tested by

no test coverage detected