Navigation Menu

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

Commit

Permalink
Fixed a bunch of bugs in the blit blend mode tests
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Nov 18, 2009
1 parent c12b513 commit 66887f1
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions test/automated/render/render.c
Expand Up @@ -732,8 +732,8 @@ static int render_testBlitBlendMode( SDL_TextureID tface, int mode )
for (j=0; j <= nj; j+=4) {
for (i=0; i <= ni; i+=4) {
/* Set blend mode. */
ret = SDL_SetRenderDrawBlendMode( mode );
if (SDL_ATassert( "SDL_SetRenderDrawBlendMode", ret == 0))
ret = SDL_SetTextureBlendMode( tface, mode );
if (SDL_ATassert( "SDL_SetTextureBlendMode", ret == 0))
return -1;

/* Blitting. */
Expand Down Expand Up @@ -782,8 +782,8 @@ static int render_testBlitBlend (void)
rect.h = img_face.height;

/* Set alpha mod. */
ret = SDL_SetRenderDrawColor( 255, 255, 255, 100 );
if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0))
ret = SDL_SetTextureAlphaMod( tface, 100 );
if (SDL_ATassert( "SDL_SetTextureAlphaMod", ret == 0))
return -1;

/* Test None. */
Expand Down Expand Up @@ -831,8 +831,13 @@ static int render_testBlitBlend (void)
for (i=0; i <= ni; i+=4) {

/* Set colour mod. */
ret = SDL_SetRenderDrawColor( (255/nj)*j, (255/ni)*i, (255/nj)*j, (100/ni)*i );
if (SDL_ATassert( "SDL_SetRenderDrawColor", ret == 0))
ret = SDL_SetTextureColorMod( tface, (255/nj)*j, (255/ni)*i, (255/nj)*j );
if (SDL_ATassert( "SDL_SetTextureColorMod", ret == 0))
return -1;

/* Set alpha mod. */
ret = SDL_SetTextureAlphaMod( tface, (100/ni)*i );
if (SDL_ATassert( "SDL_SetTextureAlphaMod", ret == 0))
return -1;

/* Crazy blending mode magic. */
Expand All @@ -841,8 +846,8 @@ static int render_testBlitBlend (void)
else if (mode==1) mode = SDL_BLENDMODE_BLEND;
else if (mode==2) mode = SDL_BLENDMODE_ADD;
else if (mode==3) mode = SDL_BLENDMODE_MOD;
ret = SDL_SetRenderDrawBlendMode( mode );
if (SDL_ATassert( "SDL_SetRenderDrawBlendMode", ret == 0))
ret = SDL_SetTextureBlendMode( tface, mode );
if (SDL_ATassert( "SDL_SetTextureBlendMode", ret == 0))
return -1;

/* Blitting. */
Expand Down

0 comments on commit 66887f1

Please sign in to comment.