commit eef7a4e066b3bc19c0f6f6f39b67ac0bac5f2d9e
Author: Fabian Greffrath <fabian@greffrath.com>
AuthorDate: Tue Feb 20 22:55:39 2018 +0100
Commit: Fabian Greffrath <fabian@greffrath.com>
CommitDate: Tue Feb 20 22:55:39 2018 +0100
video: rename rgbabuffer variable to argbbuffer
This is just a cosmetic change, the variable is static in i_video.c
and its name has been chosen rather arbitrarily based on the false
assumption that ARGB is the most common pixel format nowadays (it is
the standard pixel format for the PNG image format, though).
In Chocolate Doom, we do not hard-code the pixel format anymore, but
rely on the screen's native format instead. Since nowadays all major
systems apparently use the the 8-8-8-8 ARGB format,
"ARGB is the right thing by monopoly vote."
<http://stereopsis.com/doubleblend.html>
So, if we so have to raise expectations about the pixel format by
our choice of the variable name, it should be the most common one.
---
src/i_video.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/i_video.c b/src/i_video.c
index 95281419..77d66240 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -65,7 +65,7 @@ static char *window_title = "";
// in turn is finally rendered to screen using "linear" scaling.
static SDL_Surface *screenbuffer = NULL;
-static SDL_Surface *rgbabuffer = NULL;
+static SDL_Surface *argbbuffer = NULL;
static SDL_Texture *texture = NULL;
static SDL_Texture *texture_upscaled = NULL;
@@ -766,11 +766,11 @@ void I_FinishUpdate (void)
// Blit from the paletted 8-bit screen buffer to the intermediate
// 32-bit RGBA buffer that we can load into the texture.
- SDL_LowerBlit(screenbuffer, &blit_rect, rgbabuffer, &blit_rect);
+ SDL_LowerBlit(screenbuffer, &blit_rect, argbbuffer, &blit_rect);
// Update the intermediate texture with the contents of the RGBA buffer.
- SDL_UpdateTexture(texture, NULL, rgbabuffer->pixels, rgbabuffer->pitch);
+ SDL_UpdateTexture(texture, NULL, argbbuffer->pixels, argbbuffer->pitch);
// Make sure the pillarboxes are kept clear each frame.
@@ -1267,16 +1267,16 @@ static void SetVideoMode(void)
SDL_FillRect(screenbuffer, NULL, 0);
}
- // Format of rgbabuffer must match the screen pixel format because we
+ // Format of argbbuffer must match the screen pixel format because we
// import the surface data into the texture.
- if (rgbabuffer == NULL)
+ if (argbbuffer == NULL)
{
SDL_PixelFormatEnumToMasks(pixel_format, &unused_bpp,
&rmask, &gmask, &bmask, &amask);
- rgbabuffer = SDL_CreateRGBSurface(0,
+ argbbuffer = SDL_CreateRGBSurface(0,
SCREENWIDTH, SCREENHEIGHT, 32,
rmask, gmask, bmask, amask);
- SDL_FillRect(rgbabuffer, NULL, 0);
+ SDL_FillRect(argbbuffer, NULL, 0);
}
if (texture != NULL)