tcod_sys/libtcod/src/image_c.c
bool TCOD_image_mipmap_copy_internal(TCOD_image_t srcImage, TCOD_image_t dstImage) {
	int i;
	image_data_t *img_src = (image_data_t *)srcImage;
	image_data_t *img_dst = (image_data_t *)dstImage;
	if (!img_src->mipmaps || img_src->sys_img || !img_dst->mipmaps || img_dst->sys_img) /* Both internal images. */
		return false;
	if (img_src->mipmaps[0].width != img_dst->mipmaps[0].width || img_src->mipmaps[0].height != img_dst->mipmaps[0].height)
		return false;
	/* Copy all mipmaps? */
	img_dst->mipmaps[0].dirty = img_src->mipmaps[0].dirty;
	memcpy(img_dst->mipmaps[0].buf, img_src->mipmaps[0].buf, sizeof(TCOD_color_t)*(img_src->mipmaps[0].width)*(img_src->mipmaps[0].height));
	for (i = 1; i < img_src->nb_mipmaps; i++)
		img_dst->mipmaps[i].dirty = true;
	return true;
}
/*
Internal way of copying rendering fg/bg color frame data.
*/
Internal way of copying rendering fg/bg color frame data.
Internal way of copying rendering fg / bg color frame data .
bool TCOD_image_mipmap_copy_internal(TCOD_image_t srcImage, TCOD_image_t dstImage) {
	int i;
	image_data_t *img_src = (image_data_t *)srcImage;
	image_data_t *img_dst = (image_data_t *)dstImage;
	if (!img_src->mipmaps || img_src->sys_img || !img_dst->mipmaps || img_dst->sys_img) 
		return false;
	if (img_src->mipmaps[0].width != img_dst->mipmaps[0].width || img_src->mipmaps[0].height != img_dst->mipmaps[0].height)
		return false;
	img_dst->mipmaps[0].dirty = img_src->mipmaps[0].dirty;
	memcpy(img_dst->mipmaps[0].buf, img_src->mipmaps[0].buf, sizeof(TCOD_color_t)*(img_src->mipmaps[0].width)*(img_src->mipmaps[0].height));
	for (i = 1; i < img_src->nb_mipmaps; i++)
		img_dst->mipmaps[i].dirty = true;
	return true;
}
bool TCOD_image_mipmap_copy_internal ( TCOD_image_t srcImage , TCOD_image_t dstImage ) { int i ; image_data_t * img_src = ( image_data_t * ) srcImage ; image_data_t * img_dst = ( image_data_t * ) dstImage ; if ( ! img_src -> mipmaps || img_src -> sys_img || ! img_dst -> mipmaps || img_dst -> sys_img ) return false ; if ( img_src -> mipmaps [ 0 ] . width != img_dst -> mipmaps [ 0 ] . width || img_src -> mipmaps [ 0 ] . height != img_dst -> mipmaps [ 0 ] . height ) return false ; img_dst -> mipmaps [ 0 ] . dirty = img_src -> mipmaps [ 0 ] . dirty ; memcpy ( img_dst -> mipmaps [ 0 ] . buf , img_src -> mipmaps [ 0 ] . buf , sizeof ( TCOD_color_t ) * ( img_src -> mipmaps [ 0 ] . width ) * ( img_src -> mipmaps [ 0 ] . height ) ) ; for ( i = 1 ; i < img_src -> nb_mipmaps ; i ++ ) img_dst -> mipmaps [ i ] . dirty = true ; return true ; }
Internal way of copying rendering fg/bg color frame data.
Internal way of copying rendering fg / bg color frame data .
/* Both internal images. */ /* Copy all mipmaps? */