本文整理汇总了C++中Animation::NextFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ Animation::NextFrame方法的具体用法?C++ Animation::NextFrame怎么用?C++ Animation::NextFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Animation
的用法示例。
在下文中一共展示了Animation::NextFrame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Draw
void TileOverlay::Draw(Region viewport, std::vector< TileOverlay*> &overlays)
{
Video* vid = core->GetVideoDriver();
Region vp = vid->GetViewport();
// if the video's viewport is partially outside of the map, bump it back
BumpViewport(viewport, vp);
// determine which tiles are visible
int sx = vp.x / 64;
int sy = vp.y / 64;
int dx = ( vp.x + vp.w + 63 ) / 64;
int dy = ( vp.y + vp.h + 63 ) / 64;
for (int y = sy; y < dy && y < h; y++) {
for (int x = sx; x < dx && x < w; x++) {
Tile* tile = tiles[( y* w ) + x];
//draw door tiles if there are any
Animation* anim = tile->anim[tile->tileIndex];
if (!anim && tile->tileIndex) {
anim = tile->anim[0];
}
vid->BlitTile( anim->NextFrame(), 0, viewport.x + ( x * 64 ),
viewport.y + ( y * 64 ), &viewport, false );
if (!tile->om || tile->tileIndex) {
continue;
}
//draw overlay tiles, they should be half transparent
int mask = 2;
for (size_t z = 1;z<overlays.size();z++) {
TileOverlay * ov = overlays[z];
if (ov && ov->count > 0) {
Tile *ovtile = ov->tiles[0]; //allow only 1x1 tiles now
if (tile->om & mask) {
if (RedrawTile) {
vid->BlitTile( ovtile->anim[0]->NextFrame(),
tile->anim[0]->NextFrame(),
viewport.x + ( x * 64 ),
viewport.y + ( y * 64 ),
&viewport, false );
} else {
Sprite2D* mask = 0;
if (tile->anim[1])
mask = tile->anim[1]->NextFrame();
vid->BlitTile( ovtile->anim[0]->NextFrame(),
mask,
viewport.x + ( x * 64 ),
viewport.y + ( y * 64 ),
&viewport, true );
}
}
}
mask<<=1;
}
}
}
}
示例2: NextFrame
void Sprite::NextFrame()
{
Animation* temp;
temp = pAnimations->GetAnimation( current_behaviour );
temp->NextFrame();
}