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

Function zSceneSave

src/SB/Game/zScene.cpp:1354–1602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1352}
1353
1354void zSceneSave(zScene* ent, xSerial* s)
1355{
1356 zEntPickup_FlushGrabbed();
1357
1358 U32 i;
1359 xSerial xser;
1360
1361 s = &xser;
1362
1363 s->setClient('PLYR');
1364 s->Write_b1(1);
1365 s->Write(globals.player.MaxHealth);
1366 s->Write(gCurrentPlayer);
1367 s->Write(globals.player.Inv_Shiny);
1368 s->Write(globals.player.Inv_Spatula);
1369 s->Write(globals.player.g.PowerUp[0]);
1370 s->Write(globals.player.g.PowerUp[1]);
1371
1372 for (i = 0; i < LEVEL_COUNT; i++)
1373 {
1374 s->Write(globals.player.Inv_PatsSock[i]);
1375 s->Write(globals.player.Inv_LevelPickups[i]);
1376 }
1377
1378 s->Write(globals.player.Inv_PatsSock_Total);
1379
1380 zCutsceneMgrSave(NULL, s);
1381 oob_state::write_persistent(*s);
1382
1383 s->setClient('CNTR');
1384 s->Write_b1(1);
1385
1386 zUI_ScenePortalSave(s);
1387
1388 char tempString[32];
1389
1390 strcpy(tempString, "HB09 ROBOT COUNTER 01");
1391
1392 char c = '1';
1393 U32 id;
1394
1395 for (i = 0; i < LEVEL_COUNT; i++)
1396 {
1397 if (c > '9')
1398 {
1399 c = '0';
1400 tempString[19]++;
1401 }
1402
1403 tempString[20] = c;
1404
1405 c++;
1406
1407 id = xStrHash(tempString);
1408
1409 s->Write(((_xCounter*)zSceneFindObject(id))->count);
1410 }
1411

Callers 4

zSaveLoad_DoAutoSaveFunction · 0.70
zSaveLoad_SaveGameFunction · 0.70
zSceneExitFunction · 0.70
zSceneResetFunction · 0.70

Calls 15

write_persistentFunction · 0.85
zSceneFindObjectFunction · 0.85
zGameExtras_SaveFunction · 0.85
xSceneSaveFunction · 0.85
zEntTriggerSaveFunction · 0.85
zEntPickup_SaveFunction · 0.85
zEnvSaveFunction · 0.85
xFogSaveFunction · 0.85
zLightSaveFunction · 0.85
zPlatform_SaveFunction · 0.85
zCamMarkerSaveFunction · 0.85
zEntSimpleObj_SaveFunction · 0.85

Tested by

no test coverage detected