Mercurial > sdl-ios-xcode
comparison src/video/SDL_surface.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 | e743b9c3f6d6 |
children | bbdf9250ee8b |
comparison
equal
deleted
inserted
replaced
5186:227d81a4b66c | 5187:d976b67150c5 |
---|---|
446 return -1; | 446 return -1; |
447 } | 447 } |
448 | 448 |
449 status = 0; | 449 status = 0; |
450 flags = surface->map->info.flags; | 450 flags = surface->map->info.flags; |
451 surface->map->info.flags &= ~(SDL_COPY_BLEND | SDL_COPY_ADD); | 451 surface->map->info.flags &= |
452 ~(SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD); | |
452 switch (blendMode) { | 453 switch (blendMode) { |
453 case SDL_BLENDMODE_NONE: | 454 case SDL_BLENDMODE_NONE: |
454 break; | 455 break; |
455 case SDL_BLENDMODE_BLEND: | 456 case SDL_BLENDMODE_BLEND: |
456 surface->map->info.flags |= SDL_COPY_BLEND; | 457 surface->map->info.flags |= SDL_COPY_BLEND; |
457 break; | 458 break; |
458 case SDL_BLENDMODE_ADD: | 459 case SDL_BLENDMODE_ADD: |
459 surface->map->info.flags |= SDL_COPY_ADD; | 460 surface->map->info.flags |= SDL_COPY_ADD; |
461 break; | |
462 case SDL_BLENDMODE_MOD: | |
463 surface->map->info.flags |= SDL_COPY_MOD; | |
460 break; | 464 break; |
461 default: | 465 default: |
462 SDL_Unsupported(); | 466 SDL_Unsupported(); |
463 status = -1; | 467 status = -1; |
464 break; | 468 break; |
487 | 491 |
488 if (!blendMode) { | 492 if (!blendMode) { |
489 return 0; | 493 return 0; |
490 } | 494 } |
491 | 495 |
492 switch (surface->map->info.flags & (SDL_COPY_BLEND | SDL_COPY_ADD)) { | 496 switch (surface->map-> |
497 info.flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD)) { | |
493 case SDL_COPY_BLEND: | 498 case SDL_COPY_BLEND: |
494 *blendMode = SDL_BLENDMODE_BLEND; | 499 *blendMode = SDL_BLENDMODE_BLEND; |
495 break; | 500 break; |
496 case SDL_COPY_ADD: | 501 case SDL_COPY_ADD: |
497 *blendMode = SDL_BLENDMODE_ADD; | 502 *blendMode = SDL_BLENDMODE_ADD; |
503 break; | |
504 case SDL_COPY_MOD: | |
505 *blendMode = SDL_BLENDMODE_MOD; | |
498 break; | 506 break; |
499 default: | 507 default: |
500 *blendMode = SDL_BLENDMODE_NONE; | 508 *blendMode = SDL_BLENDMODE_NONE; |
501 break; | 509 break; |
502 } | 510 } |