Mercurial > sdl-ios-xcode
comparison test/automated/render/render.c @ 5187:d976b67150c5
Restored SDL_BLENDMODE_MOD for MAME
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 04 Feb 2011 19:50:56 -0800 |
parents | e2b3f003e085 |
children | 29df83fe4cd1 |
comparison
equal
deleted
inserted
replaced
5186:227d81a4b66c | 5187:d976b67150c5 |
---|---|
186 fail = 1; | 186 fail = 1; |
187 ret = SDL_GetRenderDrawBlendMode(renderer, &mode ); | 187 ret = SDL_GetRenderDrawBlendMode(renderer, &mode ); |
188 if (!render_isSupported(ret)) | 188 if (!render_isSupported(ret)) |
189 fail = 1; | 189 fail = 1; |
190 ret = (mode != SDL_BLENDMODE_ADD); | 190 ret = (mode != SDL_BLENDMODE_ADD); |
191 if (!render_isSupported(ret)) | |
192 fail = 1; | |
193 ret = SDL_SetRenderDrawBlendMode( SDL_BLENDMODE_MOD ); | |
194 if (!render_isSupported(ret)) | |
195 fail = 1; | |
196 ret = SDL_GetRenderDrawBlendMode( &mode ); | |
197 if (!render_isSupported(ret)) | |
198 fail = 1; | |
199 ret = (mode != SDL_BLENDMODE_MOD); | |
191 if (!render_isSupported(ret)) | 200 if (!render_isSupported(ret)) |
192 fail = 1; | 201 fail = 1; |
193 ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE ); | 202 ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE ); |
194 if (!render_isSupported(ret)) | 203 if (!render_isSupported(ret)) |
195 fail = 1; | 204 fail = 1; |
827 return -1; | 836 return -1; |
828 if (render_compare( "Blit blending output not the same (using SDL_BLENDMODE_ADD).", | 837 if (render_compare( "Blit blending output not the same (using SDL_BLENDMODE_ADD).", |
829 &img_blendAdd, ALLOWABLE_ERROR_BLENDED )) | 838 &img_blendAdd, ALLOWABLE_ERROR_BLENDED )) |
830 return -1; | 839 return -1; |
831 | 840 |
841 /* Test Mod. */ | |
842 if (render_testBlitBlendMode( tface, SDL_BLENDMODE_MOD )) | |
843 return -1; | |
844 if (render_compare( "Blit blending output not the same (using SDL_BLENDMODE_MOD).", | |
845 &img_blendMod, ALLOWABLE_ERROR_BLENDED )) | |
846 return -1; | |
847 | |
832 /* Clear surface. */ | 848 /* Clear surface. */ |
833 if (render_clearScreen()) | 849 if (render_clearScreen()) |
834 return -1; | 850 return -1; |
835 | 851 |
836 /* Loop blit. */ | 852 /* Loop blit. */ |
850 /* Crazy blending mode magic. */ | 866 /* Crazy blending mode magic. */ |
851 mode = (i/4*j/4) % 4; | 867 mode = (i/4*j/4) % 4; |
852 if (mode==0) mode = SDL_BLENDMODE_NONE; | 868 if (mode==0) mode = SDL_BLENDMODE_NONE; |
853 else if (mode==1) mode = SDL_BLENDMODE_BLEND; | 869 else if (mode==1) mode = SDL_BLENDMODE_BLEND; |
854 else if (mode==2) mode = SDL_BLENDMODE_ADD; | 870 else if (mode==2) mode = SDL_BLENDMODE_ADD; |
855 else if (mode==3) mode = SDL_BLENDMODE_NONE; | 871 else if (mode==3) mode = SDL_BLENDMODE_MOD; |
856 ret = SDL_SetTextureBlendMode( tface, mode ); | 872 ret = SDL_SetTextureBlendMode( tface, mode ); |
857 if (SDL_ATassert( "SDL_SetTextureBlendMode", ret == 0)) | 873 if (SDL_ATassert( "SDL_SetTextureBlendMode", ret == 0)) |
858 return -1; | 874 return -1; |
859 | 875 |
860 /* Blitting. */ | 876 /* Blitting. */ |