MCPcopy Create free account
hub / github.com/Panzerschrek/Chasm-Reverse / LoadMapName

Method LoadMapName

PanzerChasm/map_loader.cpp:466–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464}
465
466void MapLoader::LoadMapName( const Vfs::FileContent& resource_file, MapData& map_data )
467{
468 map_data.map_name[0]= '\0';
469
470 const char* s= GetSubstring( reinterpret_cast<const char*>( resource_file.data() ), "#name" );
471 s+= std::strlen( "#name" );
472
473 // Skip '=' and spaces before '='
474 while( std::isspace(*s) ) s++;
475 s++;
476
477 char* dst= map_data.map_name;
478 while(
479 *s != '\0' &&
480 ! ( *s == '\n' || *s == '\r' ) &&
481 dst < map_data.map_name + sizeof(map_data.map_name) - 1u )
482 {
483 *dst= *s; dst++; s++;
484 }
485 *dst= '\0';
486
487}
488
489void MapLoader::LoadSkyTextureName( const Vfs::FileContent& resource_file, MapData& map_data )
490{

Callers

nothing calls this directly

Calls 1

GetSubstringFunction · 0.85

Tested by

no test coverage detected