MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / SetBytesNeededForMapLoad

Method SetBytesNeededForMapLoad

neo/framework/Session.cpp:1513–1535  ·  view source on GitHub ↗

=============== idSessionLocal::SetBytesNeededForMapLoad =============== */

Source from the content-addressed store, hash-verified

1511===============
1512*/
1513void idSessionLocal::SetBytesNeededForMapLoad( const char *mapName, int bytesNeeded ) {
1514 idDecl *mapDecl = const_cast<idDecl *>(declManager->FindType( DECL_MAPDEF, mapName, false ));
1515 idDeclEntityDef *mapDef = static_cast<idDeclEntityDef *>( mapDecl );
1516
1517 if ( com_updateLoadSize.GetBool() && mapDef ) {
1518 // we assume that if com_updateLoadSize is true then the file is writable
1519
1520 mapDef->dict.SetInt( va("size%d", com_machineSpec.GetInteger()), bytesNeeded );
1521
1522 idStr declText = "\nmapDef ";
1523 declText += mapDef->GetName();
1524 declText += " {\n";
1525 for (int i=0; i<mapDef->dict.GetNumKeyVals(); i++) {
1526 const idKeyValue *kv = mapDef->dict.GetKeyVal( i );
1527 if ( kv && (kv->GetKey().Cmp("classname") != 0 ) ) {
1528 declText += "\t\"" + kv->GetKey() + "\"\t\t\"" + kv->GetValue() + "\"\n";
1529 }
1530 }
1531 declText += "}";
1532 mapDef->SetText( declText );
1533 mapDef->ReplaceSourceFileText();
1534 }
1535}
1536
1537/*
1538===============

Callers

nothing calls this directly

Calls 12

vaFunction · 0.85
GetIntegerMethod · 0.80
FindTypeMethod · 0.45
GetBoolMethod · 0.45
SetIntMethod · 0.45
GetNameMethod · 0.45
GetNumKeyValsMethod · 0.45
GetKeyValMethod · 0.45
CmpMethod · 0.45
GetValueMethod · 0.45
SetTextMethod · 0.45
ReplaceSourceFileTextMethod · 0.45

Tested by

no test coverage detected