| 3227 | } |
| 3228 | |
| 3229 | void Map::EmitModelDestructionEffects( const unsigned int model_number ) |
| 3230 | { |
| 3231 | PC_ASSERT( model_number < static_models_.size() ); |
| 3232 | const StaticModel& model= static_models_[ model_number ]; |
| 3233 | |
| 3234 | if( model.model_id >= map_data_->models_description.size() ) |
| 3235 | return; |
| 3236 | |
| 3237 | const MapData::ModelDescription& description= map_data_->models_description[ model.model_id ]; |
| 3238 | const Model& model_data= map_data_->models[ model.model_id ]; |
| 3239 | |
| 3240 | const unsigned int blow_effect_id= description.blow_effect % 100u; |
| 3241 | |
| 3242 | m_Vec3 pos= model.pos; |
| 3243 | // TODO - tune this formula. It can be invalid. |
| 3244 | pos.z+= ( model_data.z_min + model_data.z_max ) * 0.5f + float( description.bmpz ) / 128.0f; |
| 3245 | |
| 3246 | particles_effects_messages_.emplace_back(); |
| 3247 | Messages::ParticleEffectBirth& message= particles_effects_messages_.back(); |
| 3248 | |
| 3249 | PositionToMessagePosition( pos, message.xyz ); |
| 3250 | message.effect_id= static_cast<unsigned char>( ParticleEffect::FirstBlowEffect ) + blow_effect_id; |
| 3251 | |
| 3252 | if( description.break_sfx_number != 0 ) |
| 3253 | PlayMapEventSound( pos, description.break_sfx_number ); |
| 3254 | } |
| 3255 | |
| 3256 | void Map::GenParticleEffectForRocketHit( const m_Vec3& pos, const unsigned int rocket_type_id ) |
| 3257 | { |
nothing calls this directly
no test coverage detected