Пример #1
0
void CartPusher::getPictures( gfx::Pictures& oPics)
{
    oPics.clear();
    Point offset;

    switch( direction() )
    {
    case direction::west:
        offset = Point( 10, -5 );
        break;
    case direction::east:
        offset = Point( -10, 5 );
        break;
    case direction::north:
        offset = Point( -5, -5 );
        break;
    case direction::south:
        offset = Point( 5, 5 );
        break;
    default:
        break;
    }

    // depending on the walker direction, the cart is ahead or behind
    switch( direction() )
    {
    case direction::west:
    case direction::northWest:
    case direction::north:
    case direction::northEast:
        oPics.push_back( getCartPicture().currentFrame() );
        oPics.push_back( getMainPicture() );
        break;

    case direction::east:
    case direction::southEast:
    case direction::south:
    case direction::southWest:
        oPics.push_back( getMainPicture() );
        oPics.push_back( getCartPicture().currentFrame() );
        break;

    default:
        break;
    }

    if( !oPics.empty() && _d->anim.isBack() )
    {
        std::iter_swap( oPics.begin(), oPics.begin() + 1);
    }

    foreach( it, oPics ) {
        it->addOffset( offset );
    }
Пример #2
0
void PatrolPoint::getPictures( gfx::Pictures& oPics)
{
  oPics.push_back( _d->standart );
  oPics.push_back( _d->emblem );
  oPics.push_back( _d->animation.currentFrame() );
}