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

Method MarkDynamicWalls

PanzerChasm/map_loader.cpp:921–948  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

919}
920
921void MapLoader::MarkDynamicWalls( const MapData& map_data, DynamicWallsMask& out_dynamic_walls )
922{
923 for( bool& wall_is_dynamic : out_dynamic_walls )
924 wall_is_dynamic= false;
925
926 for( const MapData::Procedure& procedure : map_data.procedures )
927 {
928 for( const MapData::Procedure::ActionCommand& command : procedure.action_commands )
929 {
930 using Command= MapData::Procedure::ActionCommandId;
931 if( command.id == Command::Move ||
932 command.id == Command::XMove ||
933 command.id == Command::YMove ||
934 command.id == Command::Rotate ||
935 command.id == Command::Up ||
936 command.id == Command::Change )
937 {
938 const unsigned int x= static_cast<unsigned int>(command.args[0]);
939 const unsigned int y= static_cast<unsigned int>(command.args[1]);
940 if( x < MapData::c_map_size &&
941 y < MapData::c_map_size )
942 {
943 out_dynamic_walls[ x + y * MapData::c_map_size ]= true;
944 }
945 }
946 } // for commands
947 } // for procedures
948}
949
950void MapLoader::LoadModels( MapData& map_data )
951{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected