From 5fad20121f528240e233006c722f7583ff65e563 Mon Sep 17 00:00:00 2001 From: TwinAphex51224 Date: Thu, 27 Sep 2012 18:16:06 +0200 Subject: [PATCH] (PS3) Add preliminary Freetype support for PS3 --- Makefile.ps3 | 11 ++++++++++- Makefile.ps3.retroarch | 8 ++++++-- console/griffin/griffin.c | 7 ++++++- gfx/fonts/freetype.c | 8 ++++++++ ps3/frontend/main.c | 20 ++++++++++++++++++++ 5 files changed, 50 insertions(+), 4 deletions(-) diff --git a/Makefile.ps3 b/Makefile.ps3 index cb2c60913c..17076b1b22 100644 --- a/Makefile.ps3 +++ b/Makefile.ps3 @@ -12,6 +12,7 @@ STRIPPING_ENABLE = 0 HAVE_RGL = 1 HAVE_RGL_NEW = 1 HAVE_LOGGER = 0 +HAVE_FREETYPE = 0 CONTENT_ID_FULL = UP0001-SSNE10000_00-0000000000000001 CONTENT_ID = SSNE10000 @@ -70,6 +71,14 @@ ifeq ($(HAVE_RGL_NEW), 1) GL_LIBS += -lcgc_ps3 endif +ifeq ($(HAVE_FREETYPE), 1) +DEFINES += -DHAVE_FREETYPE +FONT_LIBS := -lfontFT_stub -lfreetype_stub +else +DEFINES += -DHAVE_LIBDBGFONT +FONT_LIBS := -ldbgfont +endif + ifeq ($(CELL_BUILD_TOOLS), SNC) PPU_CXXLD = $(CELL_SDK)/host-win32/sn/bin/ps3ppuld.exe PPU_CXX = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe @@ -83,7 +92,7 @@ ifneq($(system_platform), win) endif -PPU_LDLIBS = -ldbgfont $(GL_LIBS) -lretroarch_ps3 -lretro_ps3 -lcgc -lgcm_cmd -lgcm_sys_stub -lresc_stub -lm -lio_stub -lfs_stub -lsysutil_stub -lsysutil_game_stub -lsysutil_screenshot_stub -lsysutil_np_stub -lpngdec_stub -ljpgdec_stub -lsysmodule_stub -laudio_stub -lnet_stub -lnetctl_stub -lpthread +PPU_LDLIBS = $(FONT_LIBS) $(GL_LIBS) -lretroarch_ps3 -lretro_ps3 -lcgc -lgcm_cmd -lgcm_sys_stub -lresc_stub -lm -lio_stub -lfs_stub -lsysutil_stub -lsysutil_game_stub -lsysutil_screenshot_stub -lsysutil_np_stub -lpngdec_stub -ljpgdec_stub -lsysmodule_stub -laudio_stub -lnet_stub -lnetctl_stub -lpthread DEFINES += -DHAVE_DEFAULT_RETROPAD_INPUT -DHAVE_THREAD -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_PSGL -DHAVE_HEADSET -DHAVE_VID_CONTEXT -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_CG_MENU -DHAVE_FILEBROWSER -DHAVE_HDD_CACHE_PARTITION -DHAVE_FBO -DHAVE_RARCH_MAIN_WRAP -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RGL -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -D__CELLOS_LV2__ -DHAVE_CONFIGFILE=1 -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_OSKUTIL -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) diff --git a/Makefile.ps3.retroarch b/Makefile.ps3.retroarch index 7c35fb9644..3ccf521fc2 100644 --- a/Makefile.ps3.retroarch +++ b/Makefile.ps3.retroarch @@ -9,6 +9,7 @@ CELL_PSGL_VERSION = ultra-opt DEBUG = 0 HAVE_RGL = 1 HAVE_LOGGER = 0 +HAVE_FREETYPE = 0 PC_DEVELOPMENT_IP_ADDRESS = "192.168.1.7" PC_DEVELOPMENT_UDP_PORT = 3490 @@ -36,9 +37,12 @@ PPU_SRCS = console/griffin/griffin.c console/rzlib/rzlib.c ifeq ($(HAVE_RGL), 1) DEFINES = -DHAVE_RGL -GL_LIBS := -lrgl_ps3 +endif + +ifeq ($(HAVE_FREETYPE), 1) +DEFINES += -DHAVE_FREETYPE else -GL_LIBS := -L$(CELL_SDK)/target/ppu/lib/PSGL/RSX/ultra-opt -lPSGL -lPSGLcgc +DEFINES += -DHAVE_LIBDBGFONT endif ifeq ($(CELL_BUILD_TOOLS), SNC) diff --git a/console/griffin/griffin.c b/console/griffin/griffin.c index 574d101382..e1615469c5 100644 --- a/console/griffin/griffin.c +++ b/console/griffin/griffin.c @@ -163,7 +163,11 @@ FONTS ============================================================ */ #if defined(HAVE_OPENGL) || defined(HAVE_D3D8) || defined(HAVE_D3D9) -#if defined(__CELLOS_LV2__) && !defined(__PSL1GHT__) + +#if defined(HAVE_FREETYPE) +#include "../../gfx/fonts/freetype.c" +#include "../../gfx/fonts/fonts.c" +#elif defined(HAVE_LIBDBGFONT) #include "../../gfx/fonts/ps3_libdbgfont.c" #elif defined(_XBOX1) #include "../../gfx/fonts/xdk1_xfonts.c" @@ -172,6 +176,7 @@ FONTS #else #include "../../gfx/fonts/null_fonts.c" #endif + #endif /*============================================================ diff --git a/gfx/fonts/freetype.c b/gfx/fonts/freetype.c index edcdb5a4bb..07eeed6861 100644 --- a/gfx/fonts/freetype.c +++ b/gfx/fonts/freetype.c @@ -316,3 +316,11 @@ void gl_render_msg(void *data, const char *msg) #endif } +void gl_render_msg_place(void *data, float x, float y, float scale, uint32_t color, const char *msg) +{ + /* TODO: Currently a no-op - needs to be implemented for RMenu - text needs to be able to be positioned + arbitrarily + */ + + (void)data; +} diff --git a/ps3/frontend/main.c b/ps3/frontend/main.c index a402aed3cf..14b6586ab7 100644 --- a/ps3/frontend/main.c +++ b/ps3/frontend/main.c @@ -234,6 +234,12 @@ int main(int argc, char *argv[]) #endif #ifdef HAVE_SYSMODULES + +#ifdef HAVE_FREETYPE + cellSysmoduleLoadModule(CELL_SYSMODULE_FREETYPE); + cellSysmoduleLoadModule(CELL_SYSMODULE_FONT); +#endif + cellSysmoduleLoadModule(CELL_SYSMODULE_IO); cellSysmoduleLoadModule(CELL_SYSMODULE_FS); #ifndef __PSL1GHT__ @@ -380,16 +386,30 @@ begin_shutdown: #endif #if defined(HAVE_SYSMODULES) + +/* Freetype font PRX */ + +#ifdef HAVE_FREETYPE + cellSysmoduleUnloadModule(CELL_SYSMODULE_FREETYPE); + cellSysmoduleUnloadModule(CELL_SYSMODULE_FONT); +#endif + +/* screenshot PRX */ + #ifndef __PSL1GHT__ if(g_console.screenshots_enable) cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_SCREENSHOT); #endif + cellSysmoduleUnloadModule(CELL_SYSMODULE_JPGDEC); cellSysmoduleUnloadModule(CELL_SYSMODULE_PNGDEC); + +/* system game utility PRX */ #ifndef __PSL1GHT__ cellSysmoduleUnloadModule(CELL_SYSMODULE_AVCONF_EXT); cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_GAME); #endif + #endif #ifdef HAVE_HDD_CACHE_PARTITION