Mercurial > sdl-ios-xcode
comparison src/video/SDL_RLEaccel.c @ 2222:926294b2bb4e
Emphasized the separation between SDL_Surface and SDL_Texture
- SDL_Surface is a system memory representation of pixel data
- SDL_Texture is a video memory representation of pixel data
The concept of SDL_Surface with SDL_HWSURFACE is no longer used.
Separated SDL_Texture types by usage rather than memory type
- SDL_TEXTUREACCESS_STATIC is for rarely changed pixel data,
can be placed in video memory.
- SDL_TEXTUREACCESS_STREAMING is for frequently changing pixel
data, usually placed in system memory or AGP memory.
Optimized the SDL_compat usage of the OpenGL renderer by only
using one copy of the framebuffer instead of two.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 11 Aug 2007 20:54:31 +0000 |
parents | c121d94672cb |
children | 340942cfda48 |
comparison
equal
deleted
inserted
replaced
2221:1d75c38e1e5c | 2222:926294b2bb4e |
---|---|
1616 | 1616 |
1617 #undef ADD_OPAQUE_COUNTS | 1617 #undef ADD_OPAQUE_COUNTS |
1618 #undef ADD_TRANSL_COUNTS | 1618 #undef ADD_TRANSL_COUNTS |
1619 | 1619 |
1620 /* Now that we have it encoded, release the original pixels */ | 1620 /* Now that we have it encoded, release the original pixels */ |
1621 if (!(surface->flags & SDL_PREALLOC) && !(surface->flags & SDL_HWSURFACE)) { | 1621 if (!(surface->flags & SDL_PREALLOC)) { |
1622 SDL_free(surface->pixels); | 1622 SDL_free(surface->pixels); |
1623 surface->pixels = NULL; | 1623 surface->pixels = NULL; |
1624 } | 1624 } |
1625 | 1625 |
1626 /* realloc the buffer to release unused memory */ | 1626 /* realloc the buffer to release unused memory */ |
1781 ADD_COUNTS(0, 0); | 1781 ADD_COUNTS(0, 0); |
1782 | 1782 |
1783 #undef ADD_COUNTS | 1783 #undef ADD_COUNTS |
1784 | 1784 |
1785 /* Now that we have it encoded, release the original pixels */ | 1785 /* Now that we have it encoded, release the original pixels */ |
1786 if (!(surface->flags & SDL_PREALLOC) && !(surface->flags & SDL_HWSURFACE)) { | 1786 if (!(surface->flags & SDL_PREALLOC)) { |
1787 SDL_free(surface->pixels); | 1787 SDL_free(surface->pixels); |
1788 surface->pixels = NULL; | 1788 surface->pixels = NULL; |
1789 } | 1789 } |
1790 | 1790 |
1791 /* realloc the buffer to release unused memory */ | 1791 /* realloc the buffer to release unused memory */ |
1932 SDL_UnRLESurface(SDL_Surface * surface, int recode) | 1932 SDL_UnRLESurface(SDL_Surface * surface, int recode) |
1933 { | 1933 { |
1934 if ((surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL) { | 1934 if ((surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL) { |
1935 surface->flags &= ~SDL_RLEACCEL; | 1935 surface->flags &= ~SDL_RLEACCEL; |
1936 | 1936 |
1937 if (recode && !(surface->flags & SDL_PREALLOC) | 1937 if (recode && !(surface->flags & SDL_PREALLOC)) { |
1938 && !(surface->flags & SDL_HWSURFACE)) { | |
1939 if ((surface->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY) { | 1938 if ((surface->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY) { |
1940 SDL_Rect full; | 1939 SDL_Rect full; |
1941 unsigned alpha_flag; | 1940 unsigned alpha_flag; |
1942 | 1941 |
1943 /* re-create the original surface */ | 1942 /* re-create the original surface */ |