Mercurial > pygame
diff src/transform.c @ 813:fd421ea279ae
Thanks Christopher Stone, John Myers, John Poppleweel, and Marcus!
64bit fixes, movie.c fix, font fix.
Added -bigw switch for extra gcc warnings.
| author | Rene Dudfield <renesd@gmail.com> |
|---|---|
| date | Tue, 15 May 2007 21:41:08 +0000 |
| parents | 05346fb84a05 |
| children | 8749d7c235f8 |
line wrap: on
line diff
--- a/src/transform.c Thu May 10 00:47:37 2007 +0000 +++ b/src/transform.c Tue May 15 21:41:08 2007 +0000 @@ -27,11 +27,8 @@ #include "pygamedocs.h" #include <math.h> - void scale2x(SDL_Surface *src, SDL_Surface *dst); - - static SDL_Surface* newsurf_fromsurf(SDL_Surface* surf, int width, int height) { SDL_Surface* newsurf; @@ -528,6 +525,7 @@ } else { + SDL_LockSurface(surf); switch(surf->format->BytesPerPixel) { case 1: bgcolor = *(Uint8*)surf->pixels; break; @@ -540,6 +538,7 @@ bgcolor = (((Uint8*)surf->pixels)[2]) + (((Uint8*)surf->pixels)[1]<<8) + (((Uint8*)surf->pixels)[0]<<16); #endif } + SDL_UnlockSurface(surf); bgcolor &= ~surf->format->Amask; } @@ -850,13 +849,12 @@ PYGAME_EXPORT void inittransform(void) { - PyObject *module; - module = Py_InitModule3("transform", transform_builtins, DOC_PYGAMETRANSFORM); + PyObject *module; + module = Py_InitModule3("transform", transform_builtins, + DOC_PYGAMETRANSFORM); - /*imported needed apis*/ - import_pygame_base(); - import_pygame_rect(); - import_pygame_surface(); + /*imported needed apis*/ + import_pygame_base(); + import_pygame_rect(); + import_pygame_surface(); } - -
