comparison src/SDL_compat.c @ 2267:c785543d1843

Okay, still some bugs, but everything builds again...
author Sam Lantinga <slouken@libsdl.org>
date Sat, 18 Aug 2007 05:39:09 +0000
parents e61ad15a205f
children d87417504c75
comparison
equal deleted inserted replaced
2266:e61ad15a205f 2267:c785543d1843
606 } 606 }
607 607
608 SDL_Surface * 608 SDL_Surface *
609 SDL_DisplayFormat(SDL_Surface * surface) 609 SDL_DisplayFormat(SDL_Surface * surface)
610 { 610 {
611 Uint32 flags; 611 SDL_Surface *converted;
612 612
613 if (!SDL_PublicSurface) { 613 if (!SDL_PublicSurface) {
614 SDL_SetError("No video mode has been set"); 614 SDL_SetError("No video mode has been set");
615 return NULL; 615 return NULL;
616 } 616 }
617 617
618 /* Set the flags appropriate for copying to display surface */ 618 /* Set the flags appropriate for copying to display surface */
619 return SDL_ConvertSurface(surface, SDL_PublicSurface->format, SDL_RLEACCELOK); 619 converted = SDL_ConvertSurface(surface, SDL_PublicSurface->format, 0);
620 SDL_SetSurfaceRLE(converted, 1);
621 return converted;
620 } 622 }
621 623
622 SDL_Surface * 624 SDL_Surface *
623 SDL_DisplayFormatAlpha(SDL_Surface * surface) 625 SDL_DisplayFormatAlpha(SDL_Surface * surface)
624 { 626 {
625 SDL_PixelFormat *vf; 627 SDL_PixelFormat *vf;
626 SDL_PixelFormat *format; 628 SDL_PixelFormat *format;
627 SDL_Surface *converted; 629 SDL_Surface *converted;
628 Uint32 flags;
629 /* default to ARGB8888 */ 630 /* default to ARGB8888 */
630 Uint32 amask = 0xff000000; 631 Uint32 amask = 0xff000000;
631 Uint32 rmask = 0x00ff0000; 632 Uint32 rmask = 0x00ff0000;
632 Uint32 gmask = 0x0000ff00; 633 Uint32 gmask = 0x0000ff00;
633 Uint32 bmask = 0x000000ff; 634 Uint32 bmask = 0x000000ff;
664 /* We have no other optimised formats right now. When/if a new 665 /* We have no other optimised formats right now. When/if a new
665 optimised alpha format is written, add the converter here */ 666 optimised alpha format is written, add the converter here */
666 break; 667 break;
667 } 668 }
668 format = SDL_AllocFormat(32, rmask, gmask, bmask, amask); 669 format = SDL_AllocFormat(32, rmask, gmask, bmask, amask);
669 converted = SDL_ConvertSurface(surface, format, SDL_RLEACCELOK); 670 converted = SDL_ConvertSurface(surface, format, 0);
671 SDL_SetSurfaceRLE(converted, 1);
670 SDL_FreeFormat(format); 672 SDL_FreeFormat(format);
671 return converted; 673 return converted;
672 } 674 }
673 675
674 int 676 int