Skip to content

Commit

Permalink
update sdl_ttf patch for SDL 2 (fix SDL_AllocSurface to SDL_CreateRGB…
Browse files Browse the repository at this point in the history
…Surface). closes kivy#15
  • Loading branch information
tito committed Jul 21, 2012
1 parent f70b893 commit 0291b08
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tools/patches/SDL_ttf-colorkey.patch
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);

0 comments on commit 0291b08

Please sign in to comment.