[Tux4kids-commits] r752 - tuxtype/trunk/src

dbruce-guest at alioth.debian.org dbruce-guest at alioth.debian.org
Mon Sep 8 11:36:52 UTC 2008


Author: dbruce-guest
Date: 2008-09-08 11:36:51 +0000 (Mon, 08 Sep 2008)
New Revision: 752

Modified:
   tuxtype/trunk/src/SDL_extras.c
   tuxtype/trunk/src/SDL_extras.h
   tuxtype/trunk/src/alphabet.c
   tuxtype/trunk/src/funcs.h
Log:
added #include "config.h" to SDL_extras.c to fix prob with conditional SDL_Pango.h include



Modified: tuxtype/trunk/src/SDL_extras.c
===================================================================
--- tuxtype/trunk/src/SDL_extras.c	2008-09-08 03:25:33 UTC (rev 751)
+++ tuxtype/trunk/src/SDL_extras.c	2008-09-08 11:36:51 UTC (rev 752)
@@ -15,9 +15,9 @@
 #include "globals.h"
 #include "pixels.h"
 
-
 #ifdef HAVE_LIBSDL_PANGO
 #include "SDL_Pango.h"
+static SDLPango_Matrix* SDL_Colour_to_SDLPango_Matrix(const SDL_Color* cl);
 #endif
 
 
@@ -337,6 +337,25 @@
     SDLPango_FreeContext(context);
   context = NULL;
 }
+
+
+SDLPango_Matrix* SDL_Colour_to_SDLPango_Matrix(const SDL_Color *cl)
+{
+  SDLPango_Matrix *colour;
+  colour=malloc(sizeof(SDLPango_Matrix));
+  int k;
+  for(k=0;k<4;k++){
+  	(*colour).m[0][k]=(*cl).r;
+  	(*colour).m[1][k]=(*cl).g;
+  	(*colour).m[2][k]=(*cl).b;
+  }
+  (*colour).m[3][0]=0;
+  (*colour).m[3][1]=255;
+  (*colour).m[3][2]=0;
+  (*colour).m[3][3]=0;
+
+  return colour;
+}
 #endif
 
 

Modified: tuxtype/trunk/src/SDL_extras.h
===================================================================
--- tuxtype/trunk/src/SDL_extras.h	2008-09-08 03:25:33 UTC (rev 751)
+++ tuxtype/trunk/src/SDL_extras.h	2008-09-08 11:36:51 UTC (rev 752)
@@ -13,9 +13,19 @@
 #ifndef SDL_EXTRAS_H
 #define SDL_EXTRAS_H
 
+// Need this so the #ifdef HAVE_LIBSDL_PANGO will work:
+#include "../config.h"
+
 #include "SDL.h"
 #include "SDL_ttf.h"
 
+#ifdef HAVE_LIBSDL_PANGO
+//#include "SDL_Pango.h"
+//extern SDLPango_Context *context;
+void init_SDLPango_Context();
+void free_SDLPango_Context();
+#endif
+
 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
 #define rmask 0xff000000
 #define gmask 0x00ff0000
@@ -28,15 +38,7 @@
 #define amask 0xff000000
 #endif
 
-#ifdef HAVE_LIBSDL_PANGO
-//#ifdef SDL_Pango
-#include "SDL_Pango.h"
-
-extern SDLPango_Context *context;
-void init_SDLPango_Context();
-void free_SDLPango_Context();
-#endif
-
+/* "Public" function prototypes: */
 void DrawButton(SDL_Rect* target_rect, int radius, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 void RoundCorners(SDL_Surface* s, Uint16 radius);
 SDL_Surface* Flip(SDL_Surface *in, int x, int y);

Modified: tuxtype/trunk/src/alphabet.c
===================================================================
--- tuxtype/trunk/src/alphabet.c	2008-09-08 03:25:33 UTC (rev 751)
+++ tuxtype/trunk/src/alphabet.c	2008-09-08 11:36:51 UTC (rev 752)
@@ -20,11 +20,11 @@
 
 
 /* Needed to handle rendering issues for Indic languages*/
-#ifndef WIN32
-#ifndef MACOSX
-#include <SDL_Pango.h>
-#endif
-#endif
+//#ifndef WIN32
+//#ifndef MACOSX
+//#include <SDL_Pango.h>
+//#endif
+//#endif
 
 /* Needed to convert UTF-8 under Windows because we don't have glibc: */
 #include "ConvertUTF.h"
@@ -97,11 +97,11 @@
 int check_needed_unicodes_str(const wchar_t* s);
 int map_keys(wchar_t wide_char,kbd_char* keyboard_entry);
 
-#ifndef WIN32
-#ifndef MACOSX
-static SDLPango_Matrix* SDL_Colour_to_SDLPango_Matrix(const SDL_Color* cl);
-#endif
-#endif
+//#ifndef WIN32
+//#ifndef MACOSX
+//static SDLPango_Matrix* SDL_Colour_to_SDLPango_Matrix(const SDL_Color* cl);
+//#endif
+//#endif
 
 
 
@@ -415,30 +415,30 @@
 
 
 
-#ifndef WIN32
-#ifndef MACOSX
+//#ifndef WIN32
+//#ifndef MACOSX
 /*Convert SDL_Colour to SDLPango_Matrix*/
 
-SDLPango_Matrix* SDL_Colour_to_SDLPango_Matrix(const SDL_Color *cl)
-{
-  SDLPango_Matrix *colour;
-  colour=malloc(sizeof(SDLPango_Matrix));
-  int k;
-  for(k=0;k<4;k++){
-  	(*colour).m[0][k]=(*cl).r;
-  	(*colour).m[1][k]=(*cl).g;
-  	(*colour).m[2][k]=(*cl).b;
-  }
-  (*colour).m[3][0]=0;
-  (*colour).m[3][1]=255;
-  (*colour).m[3][2]=0;
-  (*colour).m[3][3]=0;
+// SDLPango_Matrix* SDL_Colour_to_SDLPango_Matrix(const SDL_Color *cl)
+// {
+//   SDLPango_Matrix *colour;
+//   colour=malloc(sizeof(SDLPango_Matrix));
+//   int k;
+//   for(k=0;k<4;k++){
+//   	(*colour).m[0][k]=(*cl).r;
+//   	(*colour).m[1][k]=(*cl).g;
+//   	(*colour).m[2][k]=(*cl).b;
+//   }
+//   (*colour).m[3][0]=0;
+//   (*colour).m[3][1]=255;
+//   (*colour).m[3][2]=0;
+//   (*colour).m[3][3]=0;
+// 
+//   return colour;
+// }
 
-  return colour;
-}
 
 
-
 // /* This version basically uses the SDLPango lib instead of */
 // /* TTF_RenderUTF*_Blended() to properly render Indic text. */
 // SDL_Surface* BlackOutline_SDLPango(const unsigned char* t, const TTF_Font* font, const SDL_Color* c)
@@ -544,8 +544,8 @@
 //   return out;
 // }
 
-#endif
-#endif
+//#endif
+//#endif
 /* End of win32-excluded coded */
 
 

Modified: tuxtype/trunk/src/funcs.h
===================================================================
--- tuxtype/trunk/src/funcs.h	2008-09-08 03:25:33 UTC (rev 751)
+++ tuxtype/trunk/src/funcs.h	2008-09-08 11:36:51 UTC (rev 752)
@@ -29,9 +29,9 @@
 //SDL_Surface* BlackOutline(const unsigned char* t, const TTF_Font* font, const SDL_Color* c);
 //SDL_Surface* BlackOutline_Unicode(const Uint16* t, const TTF_Font* font, const SDL_Color* c);
 
-#ifndef WIN32
+//#ifndef WIN32
 //SDL_Surface* BlackOutline_SDLPango(const unsigned char* t, const TTF_Font* font, const SDL_Color* c);
-#endif
+//#endif
 
 /* (still in alphabet.c:) */
 int CheckNeededGlyphs(void);




More information about the Tux4kids-commits mailing list