本文整理汇总了C++中Anim::restorePalette方法的典型用法代码示例。如果您正苦于以下问题:C++ Anim::restorePalette方法的具体用法?C++ Anim::restorePalette怎么用?C++ Anim::restorePalette使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Anim
的用法示例。
在下文中一共展示了Anim::restorePalette方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
/**
* Draw episode 1 guardian.
*
* @param ticks Time
* @param change Time since last iteration
*/
void MedGuardian::draw(unsigned int ticks, int change) {
Anim *stageAnim;
unsigned char frame;
if (next) next->draw(ticks, change);
fixed xChange = getDrawX(change);
fixed yChange = getDrawY(change);
frame = ticks / (set->animSpeed << 5);
if (stage == 0)
stageAnim = anim;
else
stageAnim = level->getAnim(set->anims[E_LFINISHANIM | (animType & 1)] & 0x7F);
stageAnim->setFrame(frame + gridX + gridY, true);
if (ticks < flashTime) stageAnim->flashPalette(0);
drawnX = x + anim->getXOffset();
drawnY = y + anim->getYOffset() + stageAnim->getOffset();
stageAnim->draw(xChange, yChange);
if (ticks < flashTime) stageAnim->restorePalette();
return;
}
示例2: drawEnergy
/**
* Draw the event's energy bar
*
* @param ticks Time
*/
void Event::drawEnergy (unsigned int ticks) {
Anim* anim;
int hits;
if (!set || set->modifier != 8) {
if (next) next->drawEnergy(ticks);
return;
} else if (set->strength) {
// Draw boss energy bar
hits = level->getEventHits(gridX, gridY) * 100 / set->strength;
// Devan head
anim = level->getMiscAnim(1);
anim->setFrame(0, true);
if (ticks < flashTime) anim->flashPalette(0);
anim->draw(ITOF(viewW - 44), ITOF(hits + 48));
if (ticks < flashTime) anim->restorePalette();
// Bar
drawRect(viewW - 40, hits + 40, 12, 100 - hits, (ticks < flashTime)? 0: 32);
}
return;
}