out.write(src, 8);
out.write(reinterpret_cast<char *>(src), 8);
static void Write_exult_from_tiles	(	ostream& out,			// What to write to.	char *filename,			// Filename to read.	int nframes,			// # frames.	bool bycol,			// If true, go down each column first,					//   else go across each row first.	int dim0_cnt,			// If bycol, #rows; else #cols.	char *palname			// Store palette here if !0.	)	{	cout << "Reading " << filename << " tiled" 		<< (bycol ? ", by cols" : ", by rows") << " first" << endl;					// Figure #tiles in other dim.	int dim1_cnt = (nframes + dim0_cnt - 1)/dim0_cnt;	int needw, needh;		// Figure min. image dims.	if (bycol)		{ needh = dim0_cnt*8; needw = dim1_cnt*8; }	else		{ needw = dim0_cnt*8; needh = dim1_cnt*8; }					// Save starting position.	unsigned long startpos = out.tellp();	int w, h, rowsize, xoff, yoff, palsize;	unsigned char *pixels, *palette;					// Import, with 255 = transp. index.	if (!Import_png8(filename, 255, w, h, rowsize, xoff, yoff,						pixels, palette, palsize))		throw file_read_exception(filename);	if (w < needw || h < needh)		{		cerr << "File " << filename << " image is too small.  " <<			needw << 'x' << needh << " required" << endl;		exit(1);		}	for (int frnum = 0; frnum < nframes; frnum++)		{		int x, y;		if (bycol)			{ y = frnum%dim0_cnt; x = frnum/dim0_cnt; }		else			{ x = frnum%dim0_cnt; y = frnum/dim0_cnt; }		unsigned char *src = pixels + w*8*y + 8*x;		for (int row = 0; row < 8; row++)			{		// Write it out.			out.write(src, 8);			src += w;			}		}	delete pixels;	if (palname)		Write_palettes(palname, palette, palsize);	delete palette;	}