Commit f672f620 authored by David Bruce's avatar David Bruce

added #include "config.h" to SDL_extras.c to fix prob with conditional SDL_Pango.h include



git-svn-id: svn://svn.debian.org/svn/tux4kids/tuxtype/trunk@752 47d30e19-490b-0410-9d18-e851f4e465b3
parent 6569020a
......@@ -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 @@ void free_SDLPango_Context()
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
......
......@@ -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);
......
......@@ -20,11 +20,11 @@ Sreyas Kurumanghat <k.sreyas@gmail.com>
/* 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 @@ static int unicode_in_key_list(wchar_t uni_char);
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,27 +415,27 @@ int unicode_in_key_list(wchar_t uni_char)
#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;
return colour;
}
// 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;
// }
......@@ -544,8 +544,8 @@ SDLPango_Matrix* SDL_Colour_to_SDLPango_Matrix(const SDL_Color *cl)
// return out;
// }
#endif
#endif
//#endif
//#endif
/* End of win32-excluded coded */
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment