MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / drawHandSprite

Method drawHandSprite

src/Ruleset/RuleItem.cpp:502–508  ·  view source on GitHub ↗

* Draws and centers the hand sprite on a surface * according to its dimensions. * @param texture Pointer to the surface set to get the sprite from. * @param surface Pointer to the surface to draw to. */

Source from the content-addressed store, hash-verified

500 * @param surface Pointer to the surface to draw to.
501 */
502void RuleItem::drawHandSprite(SurfaceSet *texture, Surface *surface) const
503{
504 Surface *frame = texture->getFrame(this->getBigSprite());
505 frame->setX((RuleInventory::HAND_W - this->getInventoryWidth()) * RuleInventory::SLOT_W/2);
506 frame->setY((RuleInventory::HAND_H - this->getInventoryHeight()) * RuleInventory::SLOT_H/2);
507 texture->getFrame(this->getBigSprite())->blit(surface);
508}
509
510/**
511 * Gets the heal quantity of the item.

Callers 4

invClickMethod · 0.80
updateSoldierInfoMethod · 0.80
setSelectedItemMethod · 0.80
ArticleStateItemMethod · 0.80

Calls 7

getBigSpriteMethod · 0.95
getInventoryWidthMethod · 0.95
getInventoryHeightMethod · 0.95
getFrameMethod · 0.80
setXMethod · 0.45
setYMethod · 0.45
blitMethod · 0.45

Tested by

no test coverage detected