palette, 256))
palette, 256, true))
static void Write_frame	(	char *basename,			// Base filename to write.	int frnum,			// Frame #.	Shape_frame *frame,		// What to write.	unsigned char *palette		// 3*256 bytes.	)	{	assert(frame != 0);	char *fullname = new char[strlen(basename) + 30];	sprintf(fullname, "%s%02d.png", basename, frnum);	cout << "Writing " << fullname << endl;	int w = frame->get_width(), h = frame->get_height();	Image_buffer8 img(w, h);	// Render into a buffer.	img.fill8(transp);		// Fill with transparent pixel.	frame->paint(&img, frame->get_xleft(), frame->get_yabove());	int xoff = 0, yoff = 0;	if (frame->is_rle())		{		xoff = -frame->get_xright();		yoff = -frame->get_ybelow();		}					// Write out to the .png.	if (!Export_png8(fullname, transp, w, h, w, xoff, yoff, img.get_bits(),					palette, 256))		throw file_write_exception(fullname);	delete fullname;	}