/*********************************************************/
/* This source code copyright (c) 1991-2001, Aaron Giles */
/* See the Read Me file for licensing information.       */
/* Contact email: mac@aarongiles.com                     */
/*********************************************************/

// void CopyTo32(ulong *srcRow, void *dstRow, uchar *iTable, ColorSpec *cTable,
//				 DitherErrorsPtr eBuffer, DitherErrorsPtr oBuffer,
//				 short *rgnBuffer, uchar *errorMap, short columns)

#if applec
#pragma unused(iTable, cTable, eBuffer, oBuffer, errorMap)
#endif

	ulong *src = srcRow;
	ulong *dst = (ulong *)dstRow;
	long rgnCol;
	
	if (!(rgnCol = *rgnBuffer++)) rgnCol -= *rgnBuffer++;
	while (columns--) {
		if (rgnCol > 0) {
			dst++, src++;
			if (!--rgnCol) rgnCol = rgnBuffer[-1] - rgnBuffer[0], rgnBuffer++;
		} else {
			*dst++ = *src++;
			if (!++rgnCol) rgnCol = rgnBuffer[0] - rgnBuffer[-1], rgnBuffer++;
		}
	}
