| 36 | } |
| 37 | |
| 38 | void Sprite_Character::Draw(Bitmap &dst) { |
| 39 | if (UsesCharset()) { |
| 40 | int row = character->GetFacing(); |
| 41 | auto frame = character->GetAnimFrame(); |
| 42 | if (frame >= lcf::rpg::EventPage::Frame_middle2) frame = lcf::rpg::EventPage::Frame_middle; |
| 43 | SetSrcRect({frame * chara_width, row * chara_height, chara_width, chara_height}); |
| 44 | } |
| 45 | |
| 46 | SetFlashEffect(character->GetFlashColor()); |
| 47 | |
| 48 | SetOpacity(character->GetOpacity()); |
| 49 | |
| 50 | SetX(character->GetScreenX() + x_offset); |
| 51 | SetY(character->GetScreenY() + y_offset); |
| 52 | |
| 53 | int bush_split = 4 - character->GetBushDepth(); |
| 54 | SetBushDepth(bush_split > 3 ? 0 : GetHeight() / bush_split); |
| 55 | |
| 56 | Sprite::Draw(dst); |
| 57 | } |
| 58 | |
| 59 | void Sprite_Character::Update() { |
| 60 | if (tile_id != character->GetTileId() || |
nothing calls this directly
no test coverage detected