| 277 | } |
| 278 | |
| 279 | void Sprite_Actor::Draw(Bitmap& dst) { |
| 280 | auto* battler = GetBattler(); |
| 281 | // "do_not_draw" is set to true if the CBA battler name is empty, this |
| 282 | // makes the sprite not being drawn. This fixes issue #1708. |
| 283 | if (battler->IsHidden() || do_not_draw) { |
| 284 | return; |
| 285 | } |
| 286 | |
| 287 | SetTone(Main_Data::game_screen->GetTone()); |
| 288 | SetFlashEffect(battler->GetFlashColor()); |
| 289 | |
| 290 | int steps = static_cast<int>(256 / images.size()); |
| 291 | int opacity = steps; |
| 292 | for (auto it = images.crbegin(); it != images.crend(); ++it) { |
| 293 | Sprite_Battler::SetFixedFlipX(); |
| 294 | Sprite_Battler::SetX(it->x); |
| 295 | Sprite_Battler::SetY(it->y); |
| 296 | Sprite_Battler::SetOpacity(std::min(opacity, 255)); |
| 297 | Sprite_Battler::Draw(dst); |
| 298 | opacity += steps; |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | void Sprite_Actor::UpdatePosition() { |
| 303 | assert(!images.empty()); |
nothing calls this directly
no test coverage detected