Ejemplo n.º 1
0
void WgGfxDevice::BlitHorrBar(	const WgSurfacePtr& _pSurf, const WgRect& _src,
                                const WgBorder& _borders, bool _bTile,
                                int _dx, int _dy, int _len )
{
    // Blit left edge

    WgRect	r( _src.x, _src.y, _borders.left, _src.h );
    Blit( _pSurf, r, _dx, _dy );

    _len -= _borders.Width();			// Remove left and right edges from len.
    _dx += _borders.left;

    // Blit tiling part

    r.x += _borders.left;
    r.w = _src.w - _borders.Width();

    if( _bTile )
    {
        while( _len > r.w )
        {
            Blit( _pSurf, r, _dx, _dy );
            _len -= r.w;
            _dx += r.w;
        }
        if( _len != 0 )
        {
            r.w = _len;
            Blit( _pSurf, r, _dx, _dy );
            _dx += _len;
        }
    }
    else
    {
        StretchBlit( _pSurf, r, WgRect( _dx, _dy, _len, r.h ) );
        _dx += _len;
    }

    // Blit right edge

    r.x = _src.x + _src.w - _borders.right;
    r.w = _borders.right;
    Blit( _pSurf, r, _dx, _dy );
}
Ejemplo n.º 2
0
void WgGfxDevice::BlitVertBar(	const WgSurfacePtr& _pSurf, const WgRect& _src,
                                const WgBorder& _borders, bool _bTile,
                                int _dx, int _dy, int _len )
{
    // Blit top edge

    WgRect	r( _src.x, _src.y, _src.w, _borders.top );
    Blit( _pSurf, r, _dx, _dy );

    _len -= _borders.Height();			// Remove top and bottom borders from len.
    _dy += _borders.top;

    // Blit tiling part

    r.y += _borders.top;
    r.h = _src.h - _borders.Height();

    if( _bTile )
    {
        while( _len > r.h )
        {
            Blit( _pSurf, r, _dx, _dy );
            _len -= r.h;
            _dy += r.h;
        }
        if( _len != 0 )
        {
            r.h = _len;
            Blit( _pSurf, r, _dx, _dy );
            _dy += _len;
        }
    }
    else
    {
        StretchBlit( _pSurf, r, WgRect( _dx, _dy, r.w, _len ) );
        _dy += _len;
    }

    // Blit bottom edge

    r.y = _src.y + _src.h - _borders.bottom;
    r.h = _borders.bottom;
    Blit( _pSurf, r, _dx, _dy );
}
Ejemplo n.º 3
0
void PixmanBitmap::StretchBlit(Bitmap* src, Rect src_rect, int opacity) {
	StretchBlit(GetRect(), src, src_rect, opacity);
}