// fill in the destination rect
destrect.left = x;
destrect.top = y;
destrect.right = x+width-1;
destrect.bottom = y+height-1;
// fill in the source rect
sourcerect.left = cx;
sourcerect.top = cy;
sourcerect.right = width-1;
sourcerect.bottom = height-1;
// test transparency flag
if (transparent)
{
// enable color key blit
// blt to destination surface
if (FAILED(lpDDSBack->Blt(&destrect, source,
&sourcerect,(DDBLT_WAIT | DDBLT_KEYSRC),
NULL)))
return 0;
} // end if
else
{
// perform blit without color key
// blt to destination surface
if (FAILED(lpDDSBack->Blt(&destrect, source,
&sourcerect,(DDBLT_WAIT),
NULL)))
return 0;