Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
indent
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Feb 7, 2009
1 parent 4730035 commit 187d46f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/video/SDL_alphamult.c
Expand Up @@ -50,9 +50,11 @@ SDL_PreMultiplyAlpha##fmt(int w, int h, Uint32 *pixels, int pitch) \
} \
}

/* *INDENT-OFF* */
DEFINE_PREMULTIPLY_FUNC(ARGB8888)
DEFINE_PREMULTIPLY_FUNC(RGBA8888)
DEFINE_PREMULTIPLY_FUNC(ABGR8888)
DEFINE_PREMULTIPLY_FUNC(BGRA8888)
/* *INDENT-ON* */

/* vi: set ts=4 sw=4 expandtab: */
2 changes: 2 additions & 0 deletions src/video/SDL_alphamult.h
Expand Up @@ -26,10 +26,12 @@
void \
SDL_PreMultiplyAlpha##fmt(int w, int h, Uint32 *pixels, int pitch);

/* *INDENT-OFF* */
DEFINE_PREMULTIPLY_FUNC(ARGB8888)
DEFINE_PREMULTIPLY_FUNC(RGBA8888)
DEFINE_PREMULTIPLY_FUNC(ABGR8888)
DEFINE_PREMULTIPLY_FUNC(BGRA8888)
/* *INDENT-ON* */

#undef DEFINE_PREMULTIPLY_FUNC

Expand Down
34 changes: 24 additions & 10 deletions src/video/win32/SDL_gdirender.c
Expand Up @@ -478,19 +478,27 @@ GDI_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture)
if (!data->premultiplied && data->pixels) {
switch (texture->format) {
case SDL_PIXELFORMAT_ARGB8888:
SDL_PreMultiplyAlphaARGB8888(texture->w, texture->h, (Uint32 *)data->pixels, data->pitch);
SDL_PreMultiplyAlphaARGB8888(texture->w, texture->h,
(Uint32 *) data->pixels,
data->pitch);
data->premultiplied = SDL_TRUE;
break;
case SDL_PIXELFORMAT_RGBA8888:
SDL_PreMultiplyAlphaRGBA8888(texture->w, texture->h, (Uint32 *)data->pixels, data->pitch);
SDL_PreMultiplyAlphaRGBA8888(texture->w, texture->h,
(Uint32 *) data->pixels,
data->pitch);
data->premultiplied = SDL_TRUE;
break;
case SDL_PIXELFORMAT_ABGR8888:
SDL_PreMultiplyAlphaABGR8888(texture->w, texture->h, (Uint32 *)data->pixels, data->pitch);
SDL_PreMultiplyAlphaABGR8888(texture->w, texture->h,
(Uint32 *) data->pixels,
data->pitch);
data->premultiplied = SDL_TRUE;
break;
case SDL_PIXELFORMAT_BGRA8888:
SDL_PreMultiplyAlphaBGRA8888(texture->w, texture->h, (Uint32 *)data->pixels, data->pitch);
SDL_PreMultiplyAlphaBGRA8888(texture->w, texture->h,
(Uint32 *) data->pixels,
data->pitch);
data->premultiplied = SDL_TRUE;
break;
}
Expand Down Expand Up @@ -554,19 +562,25 @@ GDI_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
dst += data->pitch;
}
if (data->premultiplied) {
Uint32 *pixels = (Uint32 *) data->pixels + rect->y * (data->pitch / 4) + rect->x;
Uint32 *pixels =
(Uint32 *) data->pixels + rect->y * (data->pitch / 4) +
rect->x;
switch (texture->format) {
case SDL_PIXELFORMAT_ARGB8888:
SDL_PreMultiplyAlphaARGB8888(rect->w, rect->h, pixels, data->pitch);
SDL_PreMultiplyAlphaARGB8888(rect->w, rect->h, pixels,
data->pitch);
break;
case SDL_PIXELFORMAT_RGBA8888:
SDL_PreMultiplyAlphaRGBA8888(rect->w, rect->h, pixels, data->pitch);
SDL_PreMultiplyAlphaRGBA8888(rect->w, rect->h, pixels,
data->pitch);
break;
case SDL_PIXELFORMAT_ABGR8888:
SDL_PreMultiplyAlphaABGR8888(rect->w, rect->h, pixels, data->pitch);
SDL_PreMultiplyAlphaABGR8888(rect->w, rect->h, pixels,
data->pitch);
break;
case SDL_PIXELFORMAT_BGRA8888:
SDL_PreMultiplyAlphaBGRA8888(rect->w, rect->h, pixels, data->pitch);
SDL_PreMultiplyAlphaBGRA8888(rect->w, rect->h, pixels,
data->pitch);
break;
}
}
Expand Down Expand Up @@ -745,7 +759,7 @@ GDI_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
SelectPalette(data->memory_hdc, texturedata->hpal, TRUE);
RealizePalette(data->memory_hdc);
}
if (texture->blendMode & (SDL_BLENDMODE_MASK|SDL_BLENDMODE_BLEND)) {
if (texture->blendMode & (SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND)) {
BLENDFUNCTION blendFunc = {
AC_SRC_OVER,
0,
Expand Down

0 comments on commit 187d46f

Please sign in to comment.