mirror of
https://github.com/holub/mame
synced 2025-04-21 16:01:56 +03:00
SDL: reenable SDL_ttf for SDL2 builds (nw)
This commit is contained in:
parent
74f7ba1ce3
commit
7d874efba8
@ -59,7 +59,7 @@ USE_DISPATCH_GL = 1
|
||||
# active development on sdlmame or SDL.
|
||||
|
||||
# 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 SDL 2.1? (this API was removed prior to the 2.0 release)
|
||||
# SDL2_MULTIAPI = 1
|
||||
@ -558,7 +558,7 @@ endif
|
||||
LIBS += `pkg-config --libs fontconfig`
|
||||
|
||||
ifeq ($(SDL_LIBVER),sdl2)
|
||||
#LIBS += -lSDL2_ttf
|
||||
LIBS += -lSDL2_ttf
|
||||
else
|
||||
LIBS += -lSDL_ttf
|
||||
endif
|
||||
|
@ -13,7 +13,7 @@
|
||||
#ifdef SDLMAME_UNIX
|
||||
#if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_EMSCRIPTEN))
|
||||
#if (SDLMAME_SDL2)
|
||||
//#include <SDL2/SDL_ttf.h>
|
||||
#include <SDL2/SDL_ttf.h>
|
||||
#else
|
||||
#include <SDL/SDL_ttf.h>
|
||||
#endif
|
||||
@ -291,12 +291,10 @@ int main(int argc, char *argv[])
|
||||
#ifdef SDLMAME_UNIX
|
||||
sdl_entered_debugger = 0;
|
||||
#if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU)) && (!defined(SDLMAME_EMSCRIPTEN))
|
||||
#if !(SDLMAME_SDL2)
|
||||
if (TTF_Init() == -1)
|
||||
{
|
||||
printf("SDL_ttf failed: %s\n", TTF_GetError());
|
||||
}
|
||||
#endif
|
||||
FcInit();
|
||||
#endif
|
||||
#endif
|
||||
@ -344,9 +342,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
#ifdef SDLMAME_UNIX
|
||||
#if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU)) && (!defined(SDLMAME_EMSCRIPTEN))
|
||||
#if !(SDLMAME_SDL2)
|
||||
TTF_Quit();
|
||||
#endif
|
||||
if (!sdl_entered_debugger)
|
||||
{
|
||||
FcFini();
|
||||
@ -854,7 +850,6 @@ 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);
|
||||
@ -994,7 +989,6 @@ 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
|
||||
@ -1003,7 +997,6 @@ 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;
|
||||
@ -1075,9 +1068,6 @@ 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
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -1087,13 +1077,11 @@ 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
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -1106,7 +1094,6 @@ 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 };
|
||||
@ -1146,9 +1133,6 @@ 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
|
||||
|
Loading…
Reference in New Issue
Block a user