[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [REQUEST] Package for newly open sourced linux game, Beret



Hi,

> Indeed it would be better. Are you offering yourself to provide
> such patch ? :)

see below for some inspiration ...

meanwhile, the git sources changed not to use Tahoma, but I've
tried anyways - the package would need to depend on wine-tahoma-
fonts where I've found tahoma.ttf

I've compiled with

CFLAGS='-I/usr/include/SDL -DFONT_PATH=\"/usr/share/fonts/wine-
tahoma-fonts/\"' make

you'd use %{_includedir} instead of "/usr/include" and
%{_datadir} instead of "/usr/share" in .spec

(note that keeping double quotation marks around the path string
is important)

also RESOURCE_PATH needs to be handled in a similar way ...


--- Makefile~   2011-12-20 13:07:29.000000000 +0100
+++ Makefile    2011-12-20 14:17:28.095829521 +0100
@@ -1,6 +1,6 @@
 CC= gcc
-CFLAGS= -Wall -g
-LFLAGS= -lSDLmain -lSDL -lSDL_image -lSDL_ttf -lSDL_mixer
+CFLAGS+=-Wall -g
+LFLAGS=-lSDL -lSDL_image -lSDL_ttf -lSDL_mixer -lm

 default: beret

--- game.c~     2011-12-20 13:07:29.000000000 +0100
+++ game.c      2011-12-20 14:48:21.639827082 +0100
@@ -91,10 +91,17 @@
 #ifdef __APPLE__
 #define SUPPORT_PATH "Library/Application Support/Beret/"
 #define RESOURCE_PATH "Beret.app/Contents/Resources/"
-#else
+#define FONT_PATH RESOURCE_PATH
+#endif
+
+#ifndef RESOURCE_PATH
 #define RESOURCE_PATH ""
 #endif

+#ifndef FONT_PATH
+#define FONT_PATH RESOURCE_PATH
+#endif
+
 #define QUITMOD_WIN KMOD_ALT
 #define QUITKEY_WIN SDLK_F4
 #define QUITMOD_LIN KMOD_CTRL
@@ -894,9 +901,12 @@
   }

   // Load fonts
-  font = TTF_OpenFont(RESOURCE_PATH "AveriaSans-Regular.ttf",
24);
-  smfont = TTF_OpenFont(RESOURCE_PATH "AveriaSans-Regular.ttf",
9);
-  medfont = TTF_OpenFont(RESOURCE_PATH "AveriaSans-Regular.ttf",
16);
+  font = TTF_OpenFont(FONT_PATH "tahoma.ttf", 24);
+  smfont = TTF_OpenFont(FONT_PATH "tahoma.ttf", 9);
+  medfont = TTF_OpenFont(FONT_PATH "tahoma.ttf", 16);
+  if ((font == NULL) || (smfont == NULL) || (medfont = NULL)) {
+    fprintf(stderr,"We're going to segfault due to null pointer,
as there's no error handling for opening the fonts :-)\n");
+  }

   // Load music
   for (i=0; i<MUSIC_MAX; i++) {

--
Karel Volný
QE BaseOs/Daemons Team
Red Hat Czech, Brno
tel. +420 532294274
(RH: +420 532294111 ext. 8262074)
xmpp kavol jabber cz
:: "Never attribute to malice what can
::  easily be explained by stupidity."

Attachment: signature.asc
Description: This is a digitally signed message part.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]