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

Method DrawSingle

src/battle_animation.cpp:263–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263void BattleAnimationMap::DrawSingle(Bitmap& dst) {
264 //If animation is targeted on the screen
265 if (animation.scope == lcf::rpg::Animation::Scope_screen) {
266 DrawAt(dst, Player::screen_width / 2, Player::screen_height / 2);
267 return;
268 }
269 const int character_height = 24;
270 int x_off = target->GetScreenX();
271 int y_off = target->GetScreenY(false);
272 if (Scene::instance->type == Scene::Map) {
273 x_off += static_cast<Scene_Map*>(Scene::instance.get())->spriteset->GetRenderOx();
274 y_off += static_cast<Scene_Map*>(Scene::instance.get())->spriteset->GetRenderOy();
275 }
276 int vertical_center = y_off - character_height / 2;
277 int offset = CalculateOffset(animation.position, character_height);
278
279 DrawAt(dst, x_off, vertical_center + offset);
280}
281
282void BattleAnimationMap::FlashTargets(int r, int g, int b, int p) {
283 target->Flash(r, g, b, p, 0);

Callers

nothing calls this directly

Calls 6

CalculateOffsetFunction · 0.85
GetScreenXMethod · 0.80
GetScreenYMethod · 0.45
GetRenderOxMethod · 0.45
getMethod · 0.45
GetRenderOyMethod · 0.45

Tested by

no test coverage detected