| 884 | } |
| 885 | |
| 886 | void 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 | |
| 921 | void MapLoader::MarkDynamicWalls( const MapData& map_data, DynamicWallsMask& out_dynamic_walls ) |
| 922 | { |
nothing calls this directly
no test coverage detected