engine/wii/video.c
/**
 * Blits the game screen to the monitor/TV screen.
 * @param src the source image
 * @return 1 on success, 0 on error
 */
Blits the game screen to the monitor/TV screen.
@param src the source image
@return 1 on success, 0 on error
Blits the game screen to the monitor / TV screen . @param src the source image @return 1 on success 0 on error
int video_copy_screen(s_screen* src)
{
	whichtexture ^= 1;
	switch(bytes_per_pixel)
	{
	case 1: video_swizzle_simple(src->data, texturemem[whichtexture], src->width, src->height); break;
	case 2: video_swizzle_simple(src->data, texturemem[whichtexture], src->width * 2, src->height); break;
	case 4: copyscreen32(src); break;
	default: assert(!"bytes_per_pixel not 1, 2, or 4");
	}
	GX_DrawDone();
	whichbuffer ^= 1;
	DCFlushRange(texturemem[whichbuffer], texturemem_size);
	GX_LoadTexObj(&texture[whichbuffer], GX_TEXMAP0);
	if(stretch)
		video_draw_quad(0, 0, viewportWidth, viewportHeight);
	else
		video_draw_quad(xoffset, yoffset, scaledWidth, scaledHeight);
	GX_CopyDisp(xfb[whichbuffer], GX_FALSE);
	GX_Flush();
	VIDEO_SetNextFramebuffer(xfb[whichbuffer]);
	VIDEO_Flush();
	return 1;
}
int video_copy_screen ( s_screen * src ) { whichtexture ^= 1 ; switch ( bytes_per_pixel ) { case 1 : video_swizzle_simple ( src -> data , texturemem [ whichtexture ] , src -> width , src -> height ) ; break ; case 2 : video_swizzle_simple ( src -> data , texturemem [ whichtexture ] , src -> width * 2 , src -> height ) ; break ; case 4 : copyscreen32 ( src ) ; break ; default : assert ( ! " " ) ; } GX_DrawDone ( ) ; whichbuffer ^= 1 ; DCFlushRange ( texturemem [ whichbuffer ] , texturemem_size ) ; GX_LoadTexObj ( & texture [ whichbuffer ] , GX_TEXMAP0 ) ; if ( stretch ) video_draw_quad ( 0 , 0 , viewportWidth , viewportHeight ) ; else video_draw_quad ( xoffset , yoffset , scaledWidth , scaledHeight ) ; GX_CopyDisp ( xfb [ whichbuffer ] , GX_FALSE ) ; GX_Flush ( ) ; VIDEO_SetNextFramebuffer ( xfb [ whichbuffer ] ) ; VIDEO_Flush ( ) ; return 1 ; }
Blits the game screen to the monitor/TV screen.
Blits the game screen to the monitor / TV screen .
// use the currently inactive video buffer for the next frame // upload the texture to the Flipper/Hollywood // draw the screen texture onto the EFB as a textured quad // blit the contents of the EFB to the XFB, and swap video buffers