Supported Browsers Home   
SrcTransBltBM Previous   
SrcTransBltSys Next   
GA_2DRenderFuncs Up   

SrcTransBltLin

Copy a linear block of video memory to another location in video memory with source transparency.

Declaration

void NAPI GA_2DRenderFuncs::SrcTransBltLin(
    N_int32 srcOfs,
    N_int32 srcPitch,
    N_int32 srcLeft,
    N_int32 srcTop,
    N_int32 width,
    N_int32 height,
    N_int32 dstLeft,
    N_int32 dstTop,
    N_int32 mix,
    GA_color transparent)

Prototype In

snap/graphics.h

Parameters

srcOfs

Offset of source bitmap in video memory

srcPitch

Pitch of source bitmap in bytes

srcLeft

Left coordinate within source bitmap to copy

srcTop

Top coordinate within source bitmap to copy

width

Width of the rectangle in pixels

height

Height of the rectangle in scanlines

dstLeft

Left coordinate of destination

dstTop

Top coordinate of destination

mix

Mix code for the copy (GA_mixCodesType)

transparent

Transparent color value

 

Description

This routine will copy a linear region of video memory from srcOfs from the start of video memory to the destination rectangle (dstLeft, dstTop, dstLeft+width-1, dstTop+height-1) with the specified mix and with source transparency. The mix code will be used to combine the source bitmap data with the pixels in the destination bitmap. The transparent color passed will be used to mask out pixels in the source bitmap from being written to the destination area. Where a pixel in the source bitmap matches the transparent color, the pixel will not be written to the destination bitmap. Note that the value of srcOfs must be aligned to the boundary specified in the BitmapStartAlign member of the GA_modeInfo structure, and the srcPitch value must be padded to multiples of the BitmapStridePad member of the GA_modeInfo structure. The results of this routine are undefined if the video memory regions overlap.

Note that the srcLeft and srcTop coordinates define an offset within the source bitmap to be copied, so it will copy only a portion of an offscreen bitmap. This is useful for storing multiple images in a single offscreen bitmap, or for handling the case of software clipping offscreen bitmaps if the destination lies outside of the software clip rectangle for the destination buffer.

This version is different to the standard BitBlt function in that the source bitmap to be copied can be non-conforming, and can have a different logical scanline width to the destination bitmap. This allows the bitmaps to be stored contiguously in offscreen video memory, rather than requiring the offscreen video memory to be divided up into rectangular regions, resulting in more efficient use of available offscreen memory for bitmap storage.

Note:    The value of srcOfs must be aligned to the boundary specified in the BitmapStartAlign member of the GA_modeInfo structure, and the dstPitch value must be padded to multiples of the BitmapStridePad member of the GA_modeInfo structure.

Note:    Although you can achieve the same effect of this routine using the generic BitBltFxLin function, this function is provided separately as it is usually a workhorse function for sprite based game applications and needs to be as efficient as possible.

See Also

SrcTransBlt, SrcTransBltSys, SrcTransBltBM, DstTransBlt, BitBlt, BitBltFx

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com