src/bbcvdu.c
// Blit a rectangular region (source and destination may overlap):
Blit a rectangular region (source and destination may overlap).
Blit a rectangular region ( source and destination may overlap ) .
static void blit (int dstx, int dsty, int srcx, int srcy, int w, int h, int bg)
{
	SDL_Rect dst = {dstx, dsty, w, h} ;
	SDL_Rect src = {srcx, srcy, w, h} ;
	SDL_Texture *tex, *tex2, *target ;
	tex = SDL_CreateTexture (memhdc, SDL_PIXELFORMAT_ABGR8888,
                                 SDL_TEXTUREACCESS_TARGET, w, h) ;
	target = SDL_GetRenderTarget (memhdc) ;
	SDL_SetRenderTarget (memhdc, tex) ;
	SDL_RenderClear (memhdc) ; 
	SDL_RenderCopy (memhdc, target, &src, NULL) ;
	if (bg == 1)
	{
		tex2 = SDL_CreateTexture (memhdc, SDL_PIXELFORMAT_ABGR8888,
					  SDL_TEXTUREACCESS_TARGET, w, h) ;
		SDL_SetRenderTarget (memhdc, tex2) ;
		SDL_RenderCopy (memhdc, target, &dst, NULL) ;
	}
	SDL_SetRenderTarget (memhdc, target) ;
	if (bg < 0)
	{
		setcol (bg & 0xFF) ;
		SDL_RenderFillRect (memhdc, &src) ;
	}
	SDL_RenderCopy (memhdc, tex, NULL, &dst) ;
	if (bg == 1)
	{
		SDL_RenderCopy (memhdc, tex2, NULL, &src) ;
		SDL_DestroyTexture (tex2) ;
	}
	SDL_DestroyTexture (tex) ;
}
static void blit ( int dstx , int dsty , int srcx , int srcy , int w , int h , int bg ) { SDL_Rect dst = { dstx , dsty , w , h } ; SDL_Rect src = { srcx , srcy , w , h } ; SDL_Texture * tex , * tex2 , * target ; tex = SDL_CreateTexture ( memhdc , SDL_PIXELFORMAT_ABGR8888 , SDL_TEXTUREACCESS_TARGET , w , h ) ; target = SDL_GetRenderTarget ( memhdc ) ; SDL_SetRenderTarget ( memhdc , tex ) ; SDL_RenderClear ( memhdc ) ; SDL_RenderCopy ( memhdc , target , & src , NULL ) ; if ( bg == 1 ) { tex2 = SDL_CreateTexture ( memhdc , SDL_PIXELFORMAT_ABGR8888 , SDL_TEXTUREACCESS_TARGET , w , h ) ; SDL_SetRenderTarget ( memhdc , tex2 ) ; SDL_RenderCopy ( memhdc , target , & dst , NULL ) ; } SDL_SetRenderTarget ( memhdc , target ) ; if ( bg < 0 ) { setcol ( bg & 0xFF ) ; SDL_RenderFillRect ( memhdc , & src ) ; } SDL_RenderCopy ( memhdc , tex , NULL , & dst ) ; if ( bg == 1 ) { SDL_RenderCopy ( memhdc , tex2 , NULL , & src ) ; SDL_DestroyTexture ( tex2 ) ; } SDL_DestroyTexture ( tex ) ; }
Blit a rectangular region (source and destination may overlap):
Blit a rectangular region ( source and destination may overlap ) :
// important