SDL: disable TrueType support for SDL2 builds for now. (nw)

This commit is contained in:
R. Belmont 2013-10-26 03:19:45 +00:00
parent 8679ca14bc
commit f710a1b48c
2 changed files with 19 additions and 4 deletions

View File

@ -60,7 +60,7 @@ USE_DISPATCH_GL = 1
# uncomment the next line to compile and link against SDL2.0 # uncomment the next line to compile and link against SDL2.0
# SDL_LIBVER = sdl2 SDL_LIBVER = sdl2
# uncomment the next line to use couriersud's multi-keyboard patch for sdl2.0 # uncomment the next line to use couriersud's multi-keyboard patch for sdl2.0
# SDL2_MULTIAPI = 1 # SDL2_MULTIAPI = 1
@ -546,7 +546,7 @@ INCPATH += `pkg-config --cflags fontconfig`
LIBS += `pkg-config --libs fontconfig` LIBS += `pkg-config --libs fontconfig`
ifeq ($(SDL_LIBVER),sdl2) ifeq ($(SDL_LIBVER),sdl2)
LIBS += -lSDL2_ttf #LIBS += -lSDL2_ttf
else else
LIBS += -lSDL_ttf LIBS += -lSDL_ttf
endif endif

View File

@ -13,7 +13,7 @@
#ifdef SDLMAME_UNIX #ifdef SDLMAME_UNIX
#ifndef SDLMAME_MACOSX #ifndef SDLMAME_MACOSX
#if (SDLMAME_SDL2) #if (SDLMAME_SDL2)
#include <SDL2/SDL_ttf.h> //#include <SDL2/SDL_ttf.h>
#else #else
#include <SDL/SDL_ttf.h> #include <SDL/SDL_ttf.h>
#endif #endif
@ -338,10 +338,12 @@ int main(int argc, char *argv[])
#ifdef SDLMAME_UNIX #ifdef SDLMAME_UNIX
sdl_entered_debugger = 0; sdl_entered_debugger = 0;
#if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU)) #if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU))
#if !(SDLMAME_SDL2)
if (TTF_Init() == -1) if (TTF_Init() == -1)
{ {
printf("SDL_ttf failed: %s\n", TTF_GetError()); printf("SDL_ttf failed: %s\n", TTF_GetError());
} }
#endif
FcInit(); FcInit();
#endif #endif
#endif #endif
@ -390,8 +392,9 @@ int main(int argc, char *argv[])
#ifdef SDLMAME_UNIX #ifdef SDLMAME_UNIX
#if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU)) #if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU))
#if !(SDLMAME_SDL2)
TTF_Quit(); TTF_Quit();
#endif
if (!sdl_entered_debugger) if (!sdl_entered_debugger)
{ {
FcFini(); FcFini();
@ -877,6 +880,7 @@ bool sdl_osd_interface::font_get_bitmap(osd_font font, unicode_char chnum, bitma
} }
#else // UNIX but not OSX #else // UNIX but not OSX
#if !(SDLMAME_SDL2)
static TTF_Font * TTF_OpenFont_Magic(astring name, int fsize) static TTF_Font * TTF_OpenFont_Magic(astring name, int fsize)
{ {
emu_file file(OPEN_FLAG_READ); emu_file file(OPEN_FLAG_READ);
@ -1016,6 +1020,7 @@ static TTF_Font *search_font_config(astring name, bool bold, bool italic, bool u
return font; return font;
} }
#endif #endif
#endif
//------------------------------------------------- //-------------------------------------------------
// font_open - attempt to "open" a handle to the // font_open - attempt to "open" a handle to the
@ -1024,6 +1029,7 @@ static TTF_Font *search_font_config(astring name, bool bold, bool italic, bool u
osd_font sdl_osd_interface::font_open(const char *_name, int &height) osd_font sdl_osd_interface::font_open(const char *_name, int &height)
{ {
#if !(SDLMAME_SDL2)
TTF_Font *font = (TTF_Font *)NULL; TTF_Font *font = (TTF_Font *)NULL;
bool bakedstyles = false; bool bakedstyles = false;
int style = 0; int style = 0;
@ -1095,6 +1101,9 @@ osd_font sdl_osd_interface::font_open(const char *_name, int &height)
height = TTF_FontLineSkip(font); height = TTF_FontLineSkip(font);
return (osd_font)font; return (osd_font)font;
#else
return (osd_font)NULL;
#endif
} }
//------------------------------------------------- //-------------------------------------------------
@ -1104,11 +1113,13 @@ osd_font sdl_osd_interface::font_open(const char *_name, int &height)
void sdl_osd_interface::font_close(osd_font font) void sdl_osd_interface::font_close(osd_font font)
{ {
#if !(SDLMAME_SDL2)
TTF_Font *ttffont; TTF_Font *ttffont;
ttffont = (TTF_Font *)font; ttffont = (TTF_Font *)font;
TTF_CloseFont(ttffont); TTF_CloseFont(ttffont);
#endif
} }
//------------------------------------------------- //-------------------------------------------------
@ -1121,6 +1132,7 @@ void sdl_osd_interface::font_close(osd_font font)
bool sdl_osd_interface::font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) bool sdl_osd_interface::font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
{ {
#if !(SDLMAME_SDL2)
TTF_Font *ttffont; TTF_Font *ttffont;
SDL_Surface *drawsurf; SDL_Surface *drawsurf;
SDL_Color fcol = { 0xff, 0xff, 0xff }; SDL_Color fcol = { 0xff, 0xff, 0xff };
@ -1160,6 +1172,9 @@ bool sdl_osd_interface::font_get_bitmap(osd_font font, unicode_char chnum, bitma
} }
return bitmap.valid(); return bitmap.valid();
#else
return false;
#endif
} }
#endif // not OSX #endif // not OSX
#else // not UNIX #else // not UNIX