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

Method LoadTeleports

PanzerChasm/map_loader.cpp:886–919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

884}
885
886void MapLoader::LoadTeleports( std::istringstream& stream, MapData& map_data )
887{
888 while( !stream.eof() )
889 {
890 char line[ 512 ];
891 stream.getline( line, sizeof(line), '\n' );
892
893 if( stream.eof() )
894 break;
895
896 std::istringstream line_stream{ std::string( line ) };
897
898 char str[512]; // must be "tcenter"
899 line_stream >> str;
900 if( line_stream.fail() )
901 continue;
902 if( str[0] == ';' )
903 continue;
904 if( StringEquals( str, "#end" ) )
905 break;
906
907 map_data.teleports.emplace_back();
908 MapData::Teleport& teleport= map_data.teleports.back();
909
910 line_stream >> teleport.from[0];
911 line_stream >> teleport.from[1];
912 line_stream >> teleport.to[0];
913 line_stream >> teleport.to[1];
914
915 unsigned int angle;
916 line_stream >> angle;
917 teleport.angle= -float(angle) / 4.0f * Constants::two_pi - Constants::half_pi;
918 }
919}
920
921void MapLoader::MarkDynamicWalls( const MapData& map_data, DynamicWallsMask& out_dynamic_walls )
922{

Callers

nothing calls this directly

Calls 1

StringEqualsFunction · 0.70

Tested by

no test coverage detected