src/sgp/VObject_Blitters.cc
/**********************************************************************************************
Blt8BPPDataTo16BPPBufferShadowZ

	Creates a shadow using a brush, but modifies the destination buffer only if the current
	Z level is equal to higher than what's in the Z buffer at that pixel location. It
	updates the Z buffer with the new Z level.

**********************************************************************************************/
Blt8BPPDataTo16BPPBufferShadowZ
Creates a shadow using a brush, but modifies the destination buffer only if the current
Z level is equal to higher than what's in the Z buffer at that pixel location. It
updates the Z buffer with the new Z level.
Blt8BPPDataTo16BPPBufferShadowZ Creates a shadow using a brush but modifies the destination buffer only if the current Z level is equal to higher than what ' s in the Z buffer at that pixel location . It updates the Z buffer with the new Z level .
void Blt8BPPDataTo16BPPBufferShadowZ( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex )
{
	UINT8  *DestPtr, *ZPtr;
	UINT32 LineSkip;
	Assert( hSrcVObject != NULL );
	Assert( pBuffer != NULL );
	ETRLEObject const& pTrav    = hSrcVObject->SubregionProperties(usIndex);
	UINT32             usHeight = pTrav.usHeight;
	UINT32      const  usWidth  = pTrav.usWidth;
	INT32 const iTempX = iX + pTrav.sOffsetX;
	INT32 const iTempY = iY + pTrav.sOffsetY;
	CHECKV(iTempX >= 0);
	CHECKV(iTempY >= 0);
	UINT8 const* SrcPtr = hSrcVObject->PixData(pTrav);
	DestPtr = (UINT8 *)pBuffer + (uiDestPitchBYTES*iTempY) + (iTempX*2);
	ZPtr = (UINT8 *)pZBuffer + (uiDestPitchBYTES*iTempY) + (iTempX*2);
	LineSkip=(uiDestPitchBYTES-(usWidth*2));
	do
	{
		for (;;)
		{
			UINT8 data = *SrcPtr++;
			if (data == 0) break;
			if (data & 0x80)
			{
				data &= 0x7F;
				DestPtr += 2 * data;
				ZPtr += 2 * data;
			}
			else
			{
				SrcPtr += data;
				do
				{
					if (*(UINT16*)ZPtr < usZValue)
					{
						*(UINT16*)ZPtr = usZValue;
						*(UINT16*)DestPtr = ShadeTable[*(UINT16*)DestPtr];
					}
					DestPtr += 2;
					ZPtr += 2;
				}
				while (--data  > 0);
			}
		}
		DestPtr += LineSkip;
		ZPtr += LineSkip;
	}
	while (--usHeight > 0);
}
void Blt8BPPDataTo16BPPBufferShadowZ ( UINT16 * pBuffer , UINT32 uiDestPitchBYTES , UINT16 * pZBuffer , UINT16 usZValue , HVOBJECT hSrcVObject , INT32 iX , INT32 iY , UINT16 usIndex ) { UINT8 * DestPtr , * ZPtr ; UINT32 LineSkip ; Assert ( hSrcVObject != NULL ) ; Assert ( pBuffer != NULL ) ; ETRLEObject const & pTrav = hSrcVObject -> SubregionProperties ( usIndex ) ; UINT32 usHeight = pTrav . usHeight ; UINT32 const usWidth = pTrav . usWidth ; INT32 const iTempX = iX + pTrav . sOffsetX ; INT32 const iTempY = iY + pTrav . sOffsetY ; CHECKV ( iTempX >= 0 ) ; CHECKV ( iTempY >= 0 ) ; UINT8 const * SrcPtr = hSrcVObject -> PixData ( pTrav ) ; DestPtr = ( UINT8 * ) pBuffer + ( uiDestPitchBYTES * iTempY ) + ( iTempX * 2 ) ; ZPtr = ( UINT8 * ) pZBuffer + ( uiDestPitchBYTES * iTempY ) + ( iTempX * 2 ) ; LineSkip = ( uiDestPitchBYTES - ( usWidth * 2 ) ) ; do { for ( ; ; ) { UINT8 data = * SrcPtr ++ ; if ( data == 0 ) break ; if ( data & 0x80 ) { data &= 0x7F ; DestPtr += 2 * data ; ZPtr += 2 * data ; } else { SrcPtr += data ; do { if ( * ( UINT16 * ) ZPtr < usZValue ) { * ( UINT16 * ) ZPtr = usZValue ; * ( UINT16 * ) DestPtr = ShadeTable [ * ( UINT16 * ) DestPtr ] ; } DestPtr += 2 ; ZPtr += 2 ; } while ( -- data > 0 ) ; } } DestPtr += LineSkip ; ZPtr += LineSkip ; } while ( -- usHeight > 0 ) ; }
Blt8BPPDataTo16BPPBufferShadowZ
Creates a shadow using a brush, but modifies the destination buffer only if the current
Z level is equal to higher than what's in the Z buffer at that pixel location.
Blt8BPPDataTo16BPPBufferShadowZ Creates a shadow using a brush but modifies the destination buffer only if the current Z level is equal to higher than what ' s in the Z buffer at that pixel location .
// Assertions // Get Offsets from Index into structure // Add to start position of dest buffer // Validations