r9831 - packages/trunk/ceferino/debian/patches

Roland Clobus rclobus-guest at alioth.debian.org
Tue Jun 9 10:16:07 UTC 2009


Author: rclobus-guest
Date: 2009-06-09 10:16:07 +0000 (Tue, 09 Jun 2009)
New Revision: 9831

Added:
   packages/trunk/ceferino/debian/patches/05_force_latin1.patch
Modified:
   packages/trunk/ceferino/debian/patches/series
Log:
Explicitly force the encoding of the translated text to latin1.
The supplied font (a bitmap) only contains the latin1 characters.


Added: packages/trunk/ceferino/debian/patches/05_force_latin1.patch
===================================================================
--- packages/trunk/ceferino/debian/patches/05_force_latin1.patch	                        (rev 0)
+++ packages/trunk/ceferino/debian/patches/05_force_latin1.patch	2009-06-09 10:16:07 UTC (rev 9831)
@@ -0,0 +1,69 @@
+diff -u ceferino-0.97.8.orig/src/fuente2.cc ceferino-0.97.8/src/fuente2.cc
+--- ceferino-0.97.8.orig/src/fuente2.cc	2009-02-10 13:02:36.000000000 +0100
++++ ceferino-0.97.8/src/fuente2.cc	2009-03-23 08:05:18.000000000 +0100
+@@ -173,14 +173,7 @@
+ SDL_Rect fuente2 :: obtener_referencia (char letra, bool transparente)
+ {
+ 	static SDL_Rect src;
+-	static char letras [] = \
+-				"!\"#$%&'()*+,-./0123456789:;<=>?" \
+-				"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`" \
+-				"abcdefghijklmnopqrstuvwxyz" \
+-				"{|}~¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿" \
+-				"ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäå" \
+-				"æçèéêëìíîïðñòóôõö÷øùúûüýþÿ";
+-				"àèìòùâêîôû";
++	unsigned char l = (unsigned char)letra;
+ 
+ 	if (letra == ' ' || letra == '\0' || letra == '\n')
+ 	{
+@@ -188,26 +181,18 @@
+ 		return src;
+ 	}
+ 
+-	for (int i = 0; letras [i] != '\0'; i ++)
+-	{
+-		if (letras [i] == letra)
+-		{
+-			if (transparente)
+-			{
+-				src = rects [i];
+-				src.y += src.h;
+-				return src;
+-			}
+-			else
+-			{
+-				src = rects [i];
+-				return src;
+-			}
+-		}
++	/* latin1: 0x21-0x7E, 0xA1-0xFF */
++	if (l >= 33 && l <= 126) {
++		src = rects[l - 33];
++	} else if (l >= 161) {
++		src = rects[l - 67];
++	} else {
++		src = rects[0];
++		printf (_("Character %u not found in font tiles\n"), (unsigned)l);
++	}
++	if (transparente) {
++		src.y += src.h;
+ 	}
+-
+-	printf (_("'%c' not found in font tiles\n"), letra);
+-	src = rects [0];
+ 	return src;
+ }
+
+diff -u ceferino-0.97.8.orig/src/main.cc ceferino-0.97.8/src/main.cc
+--- ceferino-0.97.8.orig/src/main.cc	2006-01-14 21:04:13.000000000 +0100
++++ ceferino-0.97.8/src/main.cc	2009-03-12 07:55:30.000000000 +0100
+@@ -42,7 +42,7 @@
+ #ifdef ENABLE_NLS
+ 	printf ("Locale: %s\n", setlocale (LC_ALL, ""));
+ 	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+-	bind_textdomain_codeset (GETTEXT_PACKAGE, "");
++	bind_textdomain_codeset (GETTEXT_PACKAGE, "latin1");
+ 	textdomain (GETTEXT_PACKAGE);
+ #else
+ 	printf ("Locale: disabled\n");

Modified: packages/trunk/ceferino/debian/patches/series
===================================================================
--- packages/trunk/ceferino/debian/patches/series	2009-06-09 09:42:48 UTC (rev 9830)
+++ packages/trunk/ceferino/debian/patches/series	2009-06-09 10:16:07 UTC (rev 9831)
@@ -1,4 +1,4 @@
-#01_es_translation.patch -p1
 02_configure.patch
 03_english_texts.patch
 04_align_high_scores.patch
+05_force_latin1.patch




More information about the Pkg-games-commits mailing list