update sdl_ttf patch for SDL 2 (fix SDL_AllocSurface to SDL_CreateRGBSurface). closes #15

This commit is contained in:
Mathieu Virbel 2012-07-21 19:10:39 +02:00
parent f70b893790
commit 0291b0867f

View file

@ -1,6 +1,15 @@
diff -Naur SDL_ttf-2.0.10/SDL_ttf.c SDL_ttf-2.0.10.orig/SDL_ttf.c
--- SDL_ttf-2.0.10.orig/SDL_ttf.c 2012-07-21 16:47:06.000000000 +0200
+++ SDL_ttf-2.0.10/SDL_ttf.c 2009-10-19 10:18:05.000000000 +0200
@@ -1319,7 +1319,7 @@
}
/* Create the target surface */
- textbuf = SDL_AllocSurface(SDL_SWSURFACE, width, height, 8, 0, 0, 0, 0);
+ textbuf = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 8, 0, 0, 0, 0);
if( textbuf == NULL ) {
return NULL;
}
@@ -1336,7 +1336,7 @@
palette->colors[1].r = fg.r;
palette->colors[1].g = fg.g;
@ -19,3 +28,21 @@ diff -Naur SDL_ttf-2.0.10/SDL_ttf.c SDL_ttf-2.0.10.orig/SDL_ttf.c
/* Copy the character from the pixmap */
src = glyph->bitmap.buffer;
@@ -1574,7 +1574,7 @@
}
/* Create the target surface */
- textbuf = SDL_AllocSurface(SDL_SWSURFACE, width, height, 8, 0, 0, 0, 0);
+ textbuf = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 8, 0, 0, 0, 0);
if( textbuf == NULL ) {
return NULL;
}
@@ -1831,7 +1831,7 @@
}
/* Create the target surface */
- textbuf = SDL_AllocSurface(SDL_SWSURFACE, width, height, 32,
+ textbuf = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32,
0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000);
if ( textbuf == NULL ) {
return(NULL);