comparison src/video/SDL_surface.c @ 5281:15a71bec4a55

merged
author Eric Wing <ewing . public |-at-| gmail . com>
date Sat, 12 Feb 2011 19:16:09 -0800
parents b530ef003506
children
comparison
equal deleted inserted replaced
5219:adfcdd311ae0 5281:15a71bec4a55
1 /* 1 /*
2 SDL - Simple DirectMedia Layer 2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2010 Sam Lantinga 3 Copyright (C) 1997-2011 Sam Lantinga
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public 6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version. 8 version 2.1 of the License, or (at your option) any later version.
25 #include "SDL_compat.h" 25 #include "SDL_compat.h"
26 #include "SDL_sysvideo.h" 26 #include "SDL_sysvideo.h"
27 #include "SDL_blit.h" 27 #include "SDL_blit.h"
28 #include "SDL_RLEaccel_c.h" 28 #include "SDL_RLEaccel_c.h"
29 #include "SDL_pixels_c.h" 29 #include "SDL_pixels_c.h"
30 #include "SDL_leaks.h"
31 30
32 31
33 /* Public routines */ 32 /* Public routines */
34 /* 33 /*
35 * Create an empty RGB surface of the appropriate depth 34 * Create an empty RGB surface of the appropriate depth
143 SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND); 142 SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND);
144 } 143 }
145 144
146 /* The surface is ready to go */ 145 /* The surface is ready to go */
147 surface->refcount = 1; 146 surface->refcount = 1;
148 #ifdef CHECK_LEAKS
149 ++surfaces_allocated;
150 #endif
151 return surface; 147 return surface;
152 } 148 }
153 149
154 /* 150 /*
155 * Create an RGB surface from an existing memory buffer 151 * Create an RGB surface from an existing memory buffer
929 } 925 }
930 if (surface->pixels && ((surface->flags & SDL_PREALLOC) != SDL_PREALLOC)) { 926 if (surface->pixels && ((surface->flags & SDL_PREALLOC) != SDL_PREALLOC)) {
931 SDL_free(surface->pixels); 927 SDL_free(surface->pixels);
932 } 928 }
933 SDL_free(surface); 929 SDL_free(surface);
934 #ifdef CHECK_LEAKS
935 --surfaces_allocated;
936 #endif
937 } 930 }
938 931
939 /* vi: set ts=4 sw=4 expandtab: */ 932 /* vi: set ts=4 sw=4 expandtab: */