diff --git a/src/osd/sdl/sdl.mak b/src/osd/sdl/sdl.mak index 0df20976efd..acf3c19d309 100644 --- a/src/osd/sdl/sdl.mak +++ b/src/osd/sdl/sdl.mak @@ -60,7 +60,7 @@ USE_DISPATCH_GL = 1 # 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 # SDL2_MULTIAPI = 1 @@ -546,7 +546,7 @@ INCPATH += `pkg-config --cflags fontconfig` LIBS += `pkg-config --libs fontconfig` ifeq ($(SDL_LIBVER),sdl2) -LIBS += -lSDL2_ttf +#LIBS += -lSDL2_ttf else LIBS += -lSDL_ttf endif diff --git a/src/osd/sdl/sdlmain.c b/src/osd/sdl/sdlmain.c index e98060e7889..29bc853c9ae 100644 --- a/src/osd/sdl/sdlmain.c +++ b/src/osd/sdl/sdlmain.c @@ -13,7 +13,7 @@ #ifdef SDLMAME_UNIX #ifndef SDLMAME_MACOSX #if (SDLMAME_SDL2) -#include +//#include #else #include #endif @@ -338,10 +338,12 @@ int main(int argc, char *argv[]) #ifdef SDLMAME_UNIX sdl_entered_debugger = 0; #if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU)) +#if !(SDLMAME_SDL2) if (TTF_Init() == -1) { printf("SDL_ttf failed: %s\n", TTF_GetError()); } +#endif FcInit(); #endif #endif @@ -390,8 +392,9 @@ int main(int argc, char *argv[]) #ifdef SDLMAME_UNIX #if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU)) +#if !(SDLMAME_SDL2) TTF_Quit(); - +#endif if (!sdl_entered_debugger) { FcFini(); @@ -877,6 +880,7 @@ bool sdl_osd_interface::font_get_bitmap(osd_font font, unicode_char chnum, bitma } #else // UNIX but not OSX +#if !(SDLMAME_SDL2) static TTF_Font * TTF_OpenFont_Magic(astring name, int fsize) { 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; } #endif +#endif //------------------------------------------------- // 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) { +#if !(SDLMAME_SDL2) TTF_Font *font = (TTF_Font *)NULL; bool bakedstyles = false; int style = 0; @@ -1095,6 +1101,9 @@ osd_font sdl_osd_interface::font_open(const char *_name, int &height) height = TTF_FontLineSkip(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) { +#if !(SDLMAME_SDL2) TTF_Font *ttffont; ttffont = (TTF_Font *)font; 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) { +#if !(SDLMAME_SDL2) TTF_Font *ttffont; SDL_Surface *drawsurf; 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(); +#else + return false; +#endif } #endif // not OSX #else // not UNIX