=============== idSessionLocal::SetBytesNeededForMapLoad =============== */
| 1511 | =============== |
| 1512 | */ |
| 1513 | void 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 | =============== |
nothing calls this directly
no test coverage detected