MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / LoadBin

Method LoadBin

engine/Poseidon/World/WorldImpl.cpp:1548–1584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1546 PARAM_CHECK(w->Serialize(ar, message))
1547 return ar.Save(name);
1548}
1549
1550bool World::LoadBin(const char* name, int message)
1551{
1552 LOG_DEBUG(World, "LoadBin: Start - Total allocated: {} MB", Foundation::MemoryUsed() / (1024 * 1024));
1553 LSError err;
1554 {
1555 GDebugger.NextAliveExpected(15 * 60 * 1000);
1556 ParamArchiveLoad ar;
1557 bool result = ar.LoadBin(name);
1558 if (!result)
1559 {
1560 return false;
1561 }
1562
1563 LOG_DEBUG(World, "Load: Total allocated after ar.LoadBin: {} MB", Foundation::MemoryUsed() / (1024 * 1024));
1564 ar.FirstPass();
1565 err = Serialize(ar, message);
1566 if (err == LSOK)
1567 {
1568 ar.SecondPass();
1569 err = Serialize(ar, message);
1570 }
1571 if (err == LSOK)
1572 {
1573 }
1574 else
1575 {
1576 ErrorMessage("Cannot load '%s'. Error '%s' at '%s'.", name, ar.GetErrorName(err),
1577 (const char*)ar.GetErrorContext());
1578 }
1579 LOG_DEBUG(World, "Load: Total allocated after World::Serialize: {} MB",
1580 Foundation::MemoryUsed() / (1024 * 1024));
1581 }
1582 LOG_DEBUG(World, "Total allocated after ~ParamArchive: {} MB", Foundation::MemoryUsed() / (1024 * 1024));
1583 MemoryCleanUp();
1584 LOG_DEBUG(World, "Total allocated after MemoryCleanUp: {} MB", Foundation::MemoryUsed() / (1024 * 1024));
1585 if (err == LSOK)
1586 AspectRatio::SetGameplayActive(true);
1587 return err == LSOK;

Callers 14

InvokeFunction · 0.45
RetryMissionMethod · 0.45
OnChildDestroyedMethod · 0.45
LoadCampaignsMethod · 0.45
OnChildDestroyedMethod · 0.45
LoadMissionFunction · 0.45
ParseCutsceneFunction · 0.45
LoadMethod · 0.45
ObjLoadStatusFunction · 0.45
ObjLoadIdentityFunction · 0.45
TriLoadGameFunction · 0.45

Calls 9

MemoryUsedFunction · 0.85
ErrorMessageFunction · 0.85
NextAliveExpectedMethod · 0.80
FirstPassMethod · 0.80
SecondPassMethod · 0.80
GetErrorNameMethod · 0.80
GetErrorContextMethod · 0.80
SerializeFunction · 0.50
MemoryCleanUpFunction · 0.50

Tested by 1

TriLoadGameFunction · 0.36