[mupen64plus-core] 122/310: Use Bitmap OSD fonts to reduce slowdowns
Sven Eckelmann
ecsv-guest at moszumanska.debian.org
Thu Nov 26 05:57:33 UTC 2015
This is an automated email from the git hooks/post-receive script.
ecsv-guest pushed a commit to branch armhf_test
in repository mupen64plus-core.
commit 7105c2c284a48f31dbb93a85337812e3ded8a35f
Author: Sven Eckelmann <sven at narfation.org>
Date: Mon Oct 17 10:34:41 2011 +0200
Use Bitmap OSD fonts to reduce slowdowns
---
debian/patches/ftgl_fontrendering.patch | 81 +++++++++++++++++++++++----------
1 file changed, 58 insertions(+), 23 deletions(-)
diff --git a/debian/patches/ftgl_fontrendering.patch b/debian/patches/ftgl_fontrendering.patch
index 8f5e70b..e833426 100644
--- a/debian/patches/ftgl_fontrendering.patch
+++ b/debian/patches/ftgl_fontrendering.patch
@@ -2,11 +2,51 @@ Description: Replace builtin OGLFT with FTGL font rendering library
Author: Sven Eckelmann <sven at narfation.org>
---
+diff --git a/LICENSES b/LICENSES
+index 02c42d639a8fcd338fc1a632d210f3ff50d0d3aa..2e07a00f031f8c07cce6993943b6308e90839be5 100644
+--- a/LICENSES
++++ b/LICENSES
+@@ -30,10 +30,6 @@ Mupen64Plus is based on GPL-licensed source code from Mupen64 v0.5, originally w
+ Mupen64Plus-Core includes a GPL-license demo rom (in mupen64plus.v64.gz) written by:
+ * Marshallh
+
+-The OGLFT library used for the On-Screen Display is based on GPL/LGPL-licensed code Copyright 2002 lignum Computing. Please see the included doc/lgpl-license file for the terms and conditions of the GNU Lesser General Public License. More information about this library is available at the following websites:
+- - http://oglft.sourceforge.net/index.html
+- - http://directory.fsf.org/project/OGLFT/
+-
+ Additionally, mupen includes a number of components licensed under other OSI approved licenses:
+
+ The BSD license:
+diff --git a/README b/README
+index 47182e5096dfb7ba228d9e21fa17c5db8f5a3c41..e0876dd2b4b188c498822033f05a3c0ac150e2e0 100644
+--- a/README
++++ b/README
+@@ -24,8 +24,9 @@ README Sections
+
+ - SDL 1.2
+ - libpng
+- - freetype 2
+- - zlib
++ - FTGL
++ - zlib
++ - OpenGL (GL/glu)
+
+ *Source Build Requirements*
+
diff --git a/projects/unix/Makefile b/projects/unix/Makefile
-index 93fa9928c257e6125c8664f9517d801a51ecce69..d8fadaa7ff45e0db7db14d1e4f1bb4e55767e7d2 100644
+index 93fa9928c257e6125c8664f9517d801a51ecce69..4579566836e26bf226b3dbf468833718f643de23 100644
--- a/projects/unix/Makefile
+++ b/projects/unix/Makefile
-@@ -178,8 +178,11 @@ endif
+@@ -169,17 +169,17 @@ endif
+ ifeq ($(shell pkg-config --modversion zlib 2>/dev/null),)
+ $(error No zlib development libraries found!)
+ endif
+-ifeq ($(shell pkg-config --modversion freetype2 2>/dev/null),)
+- $(error No FreeType 2 development libraries found!)
+-endif
+ ifeq ($(shell pkg-config --modversion gl 2>/dev/null),)
+ $(error No OpenGL development libraries found!)
+ endif
ifeq ($(shell pkg-config --modversion glu 2>/dev/null),)
$(error No OpenGL utility development libraries found!)
endif
@@ -15,12 +55,12 @@ index 93fa9928c257e6125c8664f9517d801a51ecce69..d8fadaa7ff45e0db7db14d1e4f1bb4e5
+ifeq ($(shell pkg-config --modversion ftgl 2>/dev/null),)
+ $(error No FTGL development libraries found!)
+endif
-+CFLAGS += $(shell pkg-config --cflags libpng zlib freetype2 gl glu ftgl)
-+LDLIBS += $(shell pkg-config --libs libpng zlib freetype2 gl glu ftgl)
++CFLAGS += $(shell pkg-config --cflags libpng zlib gl glu ftgl)
++LDLIBS += $(shell pkg-config --libs libpng zlib gl glu ftgl)
# test for presence of SDL
ifeq ($(shell which sdl-config 2>/dev/null),)
-@@ -314,7 +317,6 @@ SOURCE = \
+@@ -314,7 +314,6 @@ SOURCE = \
$(SRCDIR)/r4300/special.c \
$(SRCDIR)/r4300/regimm.c \
$(SRCDIR)/r4300/tlb.c \
@@ -1644,7 +1684,7 @@ index 22a7a9c691923bdb8526c610630f1ed898c2c02b..00000000000000000000000000000000
-#endif /* OGLFT_H */
-
diff --git a/src/osd/osd.cpp b/src/osd/osd.cpp
-index 29bea2d2475e91a51e79c37a2876d0f040e09fdd..7e7e426604521537f9e3f4ecd734ec96b969585d 100644
+index 29bea2d2475e91a51e79c37a2876d0f040e09fdd..d95eec6a842cab25bb2e2127ab9623885199d70e 100644
--- a/src/osd/osd.cpp
+++ b/src/osd/osd.cpp
@@ -22,7 +22,7 @@
@@ -1661,11 +1701,11 @@ index 29bea2d2475e91a51e79c37a2876d0f040e09fdd..7e7e426604521537f9e3f4ecd734ec96
static list_t l_messageQueue = NULL;
-static OGLFT::Monochrome *l_font;
-+static FTGLPixmapFont *l_font = NULL;
++static FTBitmapFont *l_font = NULL;
static float l_fLineHeight = -1.0;
static void animation_none(osd_message_t *);
-@@ -66,77 +66,74 @@ static void (*l_animations[OSD_NUM_ANIM_TYPES])(osd_message_t *) = {
+@@ -66,77 +66,71 @@ static void (*l_animations[OSD_NUM_ANIM_TYPES])(osd_message_t *) = {
static void draw_message(osd_message_t *msg, int width, int height)
{
float x = 0.,
@@ -1681,10 +1721,7 @@ index 29bea2d2475e91a51e79c37a2876d0f040e09fdd..7e7e426604521537f9e3f4ecd734ec96
// set color. alpha is hard coded to 1. animation can change this
- l_font->setForegroundColor(msg->color[R], msg->color[G], msg->color[B], 1.0);
- l_font->setBackgroundColor(0.0, 0.0, 0.0, 0.0);
-+ glPixelTransferf(GL_RED_BIAS, msg->color[R] - 1.0f);
-+ glPixelTransferf(GL_GREEN_BIAS, msg->color[G] - 1.0f);
-+ glPixelTransferf(GL_BLUE_BIAS, msg->color[B] - 1.0f);
-+ glPixelTransferf(GL_ALPHA_BIAS, 0.0f);
++ glColor4f(msg->color[R], msg->color[G], msg->color[B], 1.0);
+
+ // get the bounding box if invalid
+ if (msg->sizebox[0] == 0 && msg->sizebox[2] == 0) // xmin and xmax
@@ -1786,7 +1823,7 @@ index 29bea2d2475e91a51e79c37a2876d0f040e09fdd..7e7e426604521537f9e3f4ecd734ec96
break;
}
-@@ -148,18 +145,8 @@ static void draw_message(osd_message_t *msg, int width, int height)
+@@ -148,18 +142,9 @@ static void draw_message(osd_message_t *msg, int width, int height)
// yoffset moves message up
y += msg->yoffset;
@@ -1802,19 +1839,17 @@ index 29bea2d2475e91a51e79c37a2876d0f040e09fdd..7e7e426604521537f9e3f4ecd734ec96
-
// draw the text line
- l_font->draw(x, y, msg->text, msg->sizebox);
++ glRasterPos2i(0, 0);
+ l_font->Render(msg->text, -1, FTPoint(x + x_adjust, y + y_adjust, 0.0));
}
// null animation handler
-@@ -186,13 +173,16 @@ static void animation_fade(osd_message_t *msg)
+@@ -186,13 +171,13 @@ static void animation_fade(osd_message_t *msg)
if(total_frames != 0.)
alpha = elapsed_frames / total_frames;
- l_font->setForegroundColor(msg->color[R], msg->color[G], msg->color[B], alpha);
-+ glPixelTransferf(GL_RED_BIAS, msg->color[R] - 1.0f);
-+ glPixelTransferf(GL_GREEN_BIAS, msg->color[G] - 1.0f);
-+ glPixelTransferf(GL_BLUE_BIAS, msg->color[B] - 1.0f);
-+ glPixelTransferf(GL_ALPHA_BIAS, alpha - 1.0f);
++ glColor4f(msg->color[R], msg->color[G], msg->color[B], alpha);
}
// sets message Y offset depending on where they are in the message queue
@@ -1825,12 +1860,12 @@ index 29bea2d2475e91a51e79c37a2876d0f040e09fdd..7e7e426604521537f9e3f4ecd734ec96
switch(msg->corner)
{
-@@ -215,9 +205,10 @@ void osd_init(int width, int height)
+@@ -215,9 +200,10 @@ void osd_init(int width, int height)
fontpath = FONT_FILENAME;
- l_font = new OGLFT::Monochrome(fontpath, (float) height / 35.0f); // make font size proportional to screen height
-+ l_font = new FTGLPixmapFont(fontpath);
++ l_font = new FTBitmapFont(fontpath);
+ l_font->FaceSize(height / 25);
- if(!l_font || !l_font->isValid())
@@ -1838,7 +1873,7 @@ index 29bea2d2475e91a51e79c37a2876d0f040e09fdd..7e7e426604521537f9e3f4ecd734ec96
{
DebugMessage(M64MSG_ERROR, "Could not construct face from %s", fontpath);
return;
-@@ -256,6 +247,7 @@ void osd_exit(void)
+@@ -256,6 +242,7 @@ void osd_exit(void)
l_font = NULL;
}
@@ -1846,7 +1881,7 @@ index 29bea2d2475e91a51e79c37a2876d0f040e09fdd..7e7e426604521537f9e3f4ecd734ec96
// delete message queue
list_foreach(l_messageQueue, node)
{
-@@ -336,8 +328,7 @@ void osd_render()
+@@ -336,8 +323,7 @@ void osd_render()
// get line height if invalid
if (l_fLineHeight < 0.0)
{
@@ -1856,7 +1891,7 @@ index 29bea2d2475e91a51e79c37a2876d0f040e09fdd..7e7e426604521537f9e3f4ecd734ec96
}
// keeps track of next message position for each corner
-@@ -543,7 +534,7 @@ static void osd_remove_message(osd_message_t *msg)
+@@ -543,7 +529,7 @@ static void osd_remove_message(osd_message_t *msg)
if (msg->text) {
free(msg->text);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mupen64plus-core.git
More information about the Pkg-games-commits
mailing list