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

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