Example #1
0
// saves a series of files with names "filenameX.tga"
int tgaSaveSeries(char		*filename,
	short int		width,
	short int		height,
	unsigned char	pixelDepth,
	unsigned char	*imageData) {

	char *newFilename;
	int status;
	// compute the new filename by adding the series number and the extension

	newFilename = (char *)malloc(sizeof(char)* strlen(filename) + 8);

	sprintf(newFilename, "%s%d.tga", filename, savedImages);
	// save the image
	status = tgaSave(newFilename, width, height, pixelDepth, imageData);
	//increase the counter
	savedImages++;
	return(status);
}
Example #2
0
void SaveTGA(TextureData *tex, char *filename)
{
	tgaSave(filename, tex->width, tex->height, 
			tex->bpp, tex->imageData);
}