Have fun :)

Greetings
Winnie
diff -u tuxtype-1.5.17.dfsg1/debian/patches/series tuxtype-1.5.17.dfsg1/debian/patches/series
--- tuxtype-1.5.17.dfsg1/debian/patches/series
+++ tuxtype-1.5.17.dfsg1/debian/patches/series
@@ -2,0 +3,2 @@
+120_fix-null-pointer.patch  
+130_fix_german_keyboard-lst.patch
only in patch2:
unchanged:
--- tuxtype-1.5.17.dfsg1.orig/debian/patches/120_fix-null-pointer.patch
+++ tuxtype-1.5.17.dfsg1/debian/patches/120_fix-null-pointer.patch
@@ -0,0 +1,153 @@
+diff -Nurwd orig/tuxtype-1.5.17.dfsg1/tuxtype/funcs.h tuxtype-1.5.17.dfsg1/tuxtype/funcs.h
+--- orig/tuxtype-1.5.17.dfsg1/tuxtype/funcs.h	2008-07-05 14:19:19.000000000 +0200
++++ tuxtype-1.5.17.dfsg1/tuxtype/funcs.h	2008-07-05 14:19:30.000000000 +0200
+@@ -119,4 +119,5 @@
+ /* In titlescreen.c: */
+ void SwitchScreenMode(void);
+ void TitleScreen(void);
++void error_occured(void);
+ 
+diff -Nurwd orig/tuxtype-1.5.17.dfsg1/tuxtype/laser.c tuxtype-1.5.17.dfsg1/tuxtype/laser.c
+--- orig/tuxtype-1.5.17.dfsg1/tuxtype/laser.c	2008-07-05 14:19:19.000000000 +0200
++++ tuxtype-1.5.17.dfsg1/tuxtype/laser.c	2008-07-05 14:19:30.000000000 +0200
+@@ -829,6 +829,11 @@
+           int i = 0;
+           comet_type* prev_comet = NULL;
+ 
++          /* Do nothing if word is a NULL pointer. This could happen for example if a char  *
++             in a word is not listed keyboard.lst of this specific language. It would imho  *
++             be nicer to get here a warning or a error and not a tux waiting for nothing.   *
++             This have to be fixed later.                                                   */
++          if (word != NULL) {
+           DEBUGCODE {fprintf(stderr, "word is: %S\tlength is: %d\n", word, (int)wcslen(word));}
+           do
+           { 
+@@ -865,11 +870,14 @@
+ 				DEBUGCODE {fprintf(stderr, "Assigning letter to comet: %C\n", word[i]);}
+ 			}
+ 		}
++		} else {
++			DEBUGCODE {fprintf(stderr, "word was pointer to NULL, showing error dialog\n");}
++			error_occured();
++		}
+ 	}
+ 	LOG ("Leaving laser_add_comet()\n");
+ }
+ 
+-
+ /* Draw numbers/symbols over the attacker: */
+ 
+ static void laser_draw_let(wchar_t c, int x, int y)
+diff -Nurwd orig/tuxtype-1.5.17.dfsg1/tuxtype/titlescreen.c tuxtype-1.5.17.dfsg1/tuxtype/titlescreen.c
+--- orig/tuxtype-1.5.17.dfsg1/tuxtype/titlescreen.c	2008-07-05 14:19:19.000000000 +0200
++++ tuxtype-1.5.17.dfsg1/tuxtype/titlescreen.c	2008-07-05 14:19:30.000000000 +0200
+@@ -867,6 +867,109 @@
+   settings.fullscreen = !settings.fullscreen;
+ }
+ 
++/*Derived from not_implemented: should only be shown if an error occurs somewhere */
++void error_occured(void)
++{
++	SDL_Surface* bk = NULL;
++	SDL_Surface *s1 = NULL, *s2 = NULL, *s3 = NULL, *s4 = NULL;
++	sprite* tux = NULL;
++	SDL_Rect loc;
++	int finished = 0, i;
++
++	LOG( "ErrorOccured() - creating text\n" );
++	/* if no font is set, use default ones */
++	if (!font) 
++		font = LoadFont(DEFAULT_MENU_FONT, MENU_FONT_SIZE);
++
++	s1 = BlackOutline( _("An error occured"), font, &white);
++	s2 = BlackOutline( _("This shouldn't happen, you'll found a bug"), font, &white);
++	s3 = BlackOutline( _("Please report this problem to"), font, &white);
++
++	/* we always want the URL in english */
++	/* NOTE: all fonts are almost certain to include glyphs for ASCII, */
++	/* so the following "english_font" hackery is probably unnecessary: */
++	if (!settings.use_english)
++	{
++		TTF_Font *english_font;
++		settings.use_english = 1;
++		english_font = LoadFont(DEFAULT_MENU_FONT, MENU_FONT_SIZE);
++		s4 = BlackOutline( "[EMAIL PROTECTED]", english_font, &white);
++		TTF_CloseFont(english_font);
++		settings.use_english = 0;
++	}
++	else 
++		s4 = BlackOutline( "[EMAIL PROTECTED]", font, &white);
++
++	tux = LoadSprite("tux/tux-egypt", IMG_ALPHA);
++	bk = LoadImage("main_bkg.png", IMG_REGULAR);
++
++	if (s1 && s2 && s3 && s4 && tux && bk)
++	{
++		LOG( "ErrorOccured() - drawing screen\n" );
++
++		SDL_BlitSurface(bk, NULL, screen, NULL);
++		loc.x = 320-(s1->w/2); loc.y = 10;
++		SDL_BlitSurface( s1, NULL, screen, &loc);
++		loc.x = 320-(s2->w/2); loc.y = 60;
++		SDL_BlitSurface( s2, NULL, screen, &loc);
++		loc.x = 320-(s3->w/2); loc.y = 400;
++		SDL_BlitSurface( s3, NULL, screen, &loc);
++		loc.x = 320-(s4->w/2); loc.y = 440;
++		SDL_BlitSurface( s4, NULL, screen, &loc);
++
++		loc.x = 320-(tux->frame[0]->w/2);
++		loc.y = 200;
++		loc.w = tux->frame[0]->w;
++		loc.h = tux->frame[0]->h;
++		SDL_BlitSurface( tux->frame[tux->cur], NULL, screen, &loc);
++
++		SDL_UpdateRect(screen, 0, 0, 0, 0);
++
++		i = 0;
++
++		while (!finished)
++		{
++			while (SDL_PollEvent(&event)) 
++			{
++				switch (event.type)
++				{
++					case SDL_QUIT:
++						exit(0);
++					case SDL_MOUSEBUTTONDOWN:
++					case SDL_KEYDOWN:
++						TitleScreen();
++						exit(0);
++				}
++			}
++
++			i++;
++
++			if (i %5 == 0)
++			{
++				NEXT_FRAME(tux);
++				SDL_BlitSurface(bk, &loc, screen, &loc);
++				SDL_BlitSurface(tux->frame[tux->cur], NULL, screen, &loc);
++				SDL_UpdateRect(screen, loc.x, loc.y, loc.w, loc.h);
++			}
++
++			SDL_Delay(40);
++		}
++	}
++	else
++		fprintf(stderr, "ErrorOccured() - could not load needed graphic\n");
++
++	SDL_FreeSurface(s1);
++	SDL_FreeSurface(s2);
++	SDL_FreeSurface(s3);
++	SDL_FreeSurface(s4);
++	SDL_FreeSurface(bk);
++	s1 = s2 = s3 = s4 = bk = NULL;
++	FreeSprite(tux);
++	tux = NULL;
++}
++
++
++
+ 
+ /************************************************************************/
+ /*                                                                      */ 
only in patch2:
unchanged:
--- tuxtype-1.5.17.dfsg1.orig/debian/patches/130_fix_german_keyboard-lst.patch
+++ tuxtype-1.5.17.dfsg1/debian/patches/130_fix_german_keyboard-lst.patch
@@ -0,0 +1,26 @@
+diff -Nurwd orig/tuxtype-1.5.17.dfsg1/tuxtype/data/themes/deutsch/keyboard.lst tuxtype-1.5.17.dfsg1/tuxtype/data/themes/deutsch/keyboard.lst
+--- orig/tuxtype-1.5.17.dfsg1/tuxtype/data/themes/deutsch/keyboard.lst	2008-07-05 14:19:19.000000000 +0200
++++ tuxtype-1.5.17.dfsg1/tuxtype/data/themes/deutsch/keyboard.lst	2008-07-05 14:26:36.000000000 +0200
+@@ -54,7 +54,7 @@
+ 5| 
+ 0|!
+ 0|@
+-0|#
++9|#
+ 0|1
+ 0|2
+ 0|3
+@@ -67,5 +67,12 @@
+ 0|0
+ 7|,
+ 8|.
+-9|;
++7|;
++8|:
++9|ö
++9|Ö
++9|ü
++9|Ü
++9|ä
++9|Ä
+ 9|ß

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



Reply via email to