MCPcopy Create free account
hub / github.com/EasyRPG/Player / Draw

Method Draw

src/sprite_character.cpp:38–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38void 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
59void Sprite_Character::Update() {
60 if (tile_id != character->GetTileId() ||

Callers

nothing calls this directly

Calls 7

GetFacingMethod · 0.80
GetAnimFrameMethod · 0.80
GetScreenXMethod · 0.80
GetFlashColorMethod · 0.45
GetOpacityMethod · 0.45
GetScreenYMethod · 0.45
GetBushDepthMethod · 0.45

Tested by

no test coverage detected