Sync SDL2 wiki -> header

[ci skip]
This commit is contained in:
SDL Wiki Bot
2024-10-20 01:02:07 +00:00
parent 1af0b39833
commit bcf1397e33
+40 -37
View File
@@ -806,52 +806,55 @@ extern DECLSPEC int SDLCALL SDL_FillRects
/** /**
* Performs a fast blit from the source surface to the destination surface. * Performs a fast blit from the source surface to the destination surface.
* *
* This is defined as a macro to SDL_UpperBlit to be less confusing.This * This assumes that the source and destination rectangles are the same size.
* assumes that the source and destination rectangles are the same size. If * If either `srcrect` or `dstrect` are NULL, the entire surface (`src` or
* either `srcrect` or `dstrect` are NULL, the entire surface (`src` or `dst`) * `dst`) is copied. The final blit rectangles are saved in `srcrect` and
* is copied. The final blit rectangles are saved in `srcrect` and `dstrect` * `dstrect` after all clipping is performed.
* after all clipping is performed.
* *
* The blit function should not be called on a locked surface. * The blit function should not be called on a locked surface.
* *
* The blit semantics for surfaces with and without blending and colorkey are * The blit semantics for surfaces with and without blending and colorkey are
* defined as follows: * defined as follows:
* *
* RGBA to RGB: * ```
* * RGBA->RGB:
* - Source surface blend mode set to SDL_BLENDMODE_BLEND: * alpha-blend * Source surface blend mode set to SDL_BLENDMODE_BLEND:
* (using the source alpha-channel and per-surface alpha) SDL_SRCCOLORKEY * alpha-blend (using the source alpha-channel and per-surface alpha)
* ignored. * SDL_SRCCOLORKEY ignored.
* - Source surface blend mode set to SDL_BLENDMODE_NONE: * copy RGB. * if * Source surface blend mode set to SDL_BLENDMODE_NONE:
* SDL_SRCCOLORKEY set, only copy the pixels matching the RGB values of the * copy RGB.
* source color key, ignoring alpha in the comparison. * if SDL_SRCCOLORKEY set, only copy the pixels matching the
* * RGB values of the source color key, ignoring alpha in the
* RGB to RGBA:
*
* - Source surface blend mode set to SDL_BLENDMODE_BLEND: * alpha-blend
* (using the source per-surface alpha)
* - Source surface blend mode set to SDL_BLENDMODE_NONE: * copy RGB, set
* destination alpha to source per-surface alpha value.
* - both: * if SDL_SRCCOLORKEY set, only copy the pixels matching the source
* color key.
*
* RGBA to RGBA:
*
* - Source surface blend mode set to SDL_BLENDMODE_BLEND: * alpha-blend
* (using the source alpha-channel and per-surface alpha) * SDL_SRCCOLORKEY
* ignored.
* - Source surface blend mode set to SDL_BLENDMODE_NONE: * copy all of RGBA
* to the destination. * if SDL_SRCCOLORKEY set, only copy the pixels
* matching the RGB values of the source color key, ignoring alpha in the
* comparison. * comparison.
* *
* RGB to RGB: * RGB->RGBA:
* Source surface blend mode set to SDL_BLENDMODE_BLEND:
* alpha-blend (using the source per-surface alpha)
* Source surface blend mode set to SDL_BLENDMODE_NONE:
* copy RGB, set destination alpha to source per-surface alpha value.
* both:
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
* source color key.
* *
* - Source surface blend mode set to SDL_BLENDMODE_BLEND: * alpha-blend * RGBA->RGBA:
* (using the source per-surface alpha) * Source surface blend mode set to SDL_BLENDMODE_BLEND:
* - Source surface blend mode set to SDL_BLENDMODE_NONE: * copy RGB. * alpha-blend (using the source alpha-channel and per-surface alpha)
* - both: * if SDL_SRCCOLORKEY set, only copy the pixels matching the source * SDL_SRCCOLORKEY ignored.
* color key. * Source surface blend mode set to SDL_BLENDMODE_NONE:
* copy all of RGBA to the destination.
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
* RGB values of the source color key, ignoring alpha in the
* comparison.
*
* RGB->RGB:
* Source surface blend mode set to SDL_BLENDMODE_BLEND:
* alpha-blend (using the source per-surface alpha)
* Source surface blend mode set to SDL_BLENDMODE_NONE:
* copy RGB.
* both:
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
* source color key.
* ```
* *
* You should call SDL_BlitSurface() unless you know exactly how SDL blitting * You should call SDL_BlitSurface() unless you know exactly how SDL blitting
* works internally and how to use the other blit functions. * works internally and how to use the other blit functions.