1
diff -Nurwd orig/tuxtype-1.5.17.dfsg1/tuxtype/funcs.h tuxtype-1.5.17.dfsg1/tuxtype/funcs.h
2
--- orig/tuxtype-1.5.17.dfsg1/tuxtype/funcs.h 2008-07-05 14:19:19.000000000 +0200
3
+++ tuxtype-1.5.17.dfsg1/tuxtype/funcs.h 2008-07-05 14:19:30.000000000 +0200
5
/* In titlescreen.c: */
6
void SwitchScreenMode(void);
7
void TitleScreen(void);
8
+void error_occured(void);
10
diff -Nurwd orig/tuxtype-1.5.17.dfsg1/tuxtype/laser.c tuxtype-1.5.17.dfsg1/tuxtype/laser.c
11
--- orig/tuxtype-1.5.17.dfsg1/tuxtype/laser.c 2008-07-05 14:19:19.000000000 +0200
12
+++ tuxtype-1.5.17.dfsg1/tuxtype/laser.c 2008-07-05 14:19:30.000000000 +0200
15
comet_type* prev_comet = NULL;
17
+ /* Do nothing if word is a NULL pointer. This could happen for example if a char *
18
+ in a word is not listed keyboard.lst of this specific language. It would imho *
19
+ be nicer to get here a warning or a error and not a tux waiting for nothing. *
20
+ This have to be fixed later. */
22
DEBUGCODE {fprintf(stderr, "word is: %S\tlength is: %d\n", word, (int)wcslen(word));}
26
DEBUGCODE {fprintf(stderr, "Assigning letter to comet: %C\n", word[i]);}
30
+ DEBUGCODE {fprintf(stderr, "word was pointer to NULL, showing error dialog\n");}
34
LOG ("Leaving laser_add_comet()\n");
38
/* Draw numbers/symbols over the attacker: */
40
static void laser_draw_let(wchar_t c, int x, int y)
41
diff -Nurwd orig/tuxtype-1.5.17.dfsg1/tuxtype/titlescreen.c tuxtype-1.5.17.dfsg1/tuxtype/titlescreen.c
42
--- orig/tuxtype-1.5.17.dfsg1/tuxtype/titlescreen.c 2008-07-05 14:19:19.000000000 +0200
43
+++ tuxtype-1.5.17.dfsg1/tuxtype/titlescreen.c 2008-07-05 14:19:30.000000000 +0200
45
settings.fullscreen = !settings.fullscreen;
48
+/*Derived from not_implemented: should only be shown if an error occurs somewhere */
49
+void error_occured(void)
51
+ SDL_Surface* bk = NULL;
52
+ SDL_Surface *s1 = NULL, *s2 = NULL, *s3 = NULL, *s4 = NULL;
55
+ int finished = 0, i;
57
+ LOG( "ErrorOccured() - creating text\n" );
58
+ /* if no font is set, use default ones */
60
+ font = LoadFont(DEFAULT_MENU_FONT, MENU_FONT_SIZE);
62
+ s1 = BlackOutline( _("An error occured"), font, &white);
63
+ s2 = BlackOutline( _("This shouldn't happen, you'll found a bug"), font, &white);
64
+ s3 = BlackOutline( _("Please report this problem to"), font, &white);
66
+ /* we always want the URL in english */
67
+ /* NOTE: all fonts are almost certain to include glyphs for ASCII, */
68
+ /* so the following "english_font" hackery is probably unnecessary: */
69
+ if (!settings.use_english)
71
+ TTF_Font *english_font;
72
+ settings.use_english = 1;
73
+ english_font = LoadFont(DEFAULT_MENU_FONT, MENU_FONT_SIZE);
74
+ s4 = BlackOutline( "tux4kids-tuxtype-dev@lists.alioth.debian.org", english_font, &white);
75
+ TTF_CloseFont(english_font);
76
+ settings.use_english = 0;
79
+ s4 = BlackOutline( "tux4kids-tuxtype-dev@lists.alioth.debian.org", font, &white);
81
+ tux = LoadSprite("tux/tux-egypt", IMG_ALPHA);
82
+ bk = LoadImage("main_bkg.png", IMG_REGULAR);
84
+ if (s1 && s2 && s3 && s4 && tux && bk)
86
+ LOG( "ErrorOccured() - drawing screen\n" );
88
+ SDL_BlitSurface(bk, NULL, screen, NULL);
89
+ loc.x = 320-(s1->w/2); loc.y = 10;
90
+ SDL_BlitSurface( s1, NULL, screen, &loc);
91
+ loc.x = 320-(s2->w/2); loc.y = 60;
92
+ SDL_BlitSurface( s2, NULL, screen, &loc);
93
+ loc.x = 320-(s3->w/2); loc.y = 400;
94
+ SDL_BlitSurface( s3, NULL, screen, &loc);
95
+ loc.x = 320-(s4->w/2); loc.y = 440;
96
+ SDL_BlitSurface( s4, NULL, screen, &loc);
98
+ loc.x = 320-(tux->frame[0]->w/2);
100
+ loc.w = tux->frame[0]->w;
101
+ loc.h = tux->frame[0]->h;
102
+ SDL_BlitSurface( tux->frame[tux->cur], NULL, screen, &loc);
104
+ SDL_UpdateRect(screen, 0, 0, 0, 0);
110
+ while (SDL_PollEvent(&event))
112
+ switch (event.type)
116
+ case SDL_MOUSEBUTTONDOWN:
128
+ SDL_BlitSurface(bk, &loc, screen, &loc);
129
+ SDL_BlitSurface(tux->frame[tux->cur], NULL, screen, &loc);
130
+ SDL_UpdateRect(screen, loc.x, loc.y, loc.w, loc.h);
137
+ fprintf(stderr, "ErrorOccured() - could not load needed graphic\n");
139
+ SDL_FreeSurface(s1);
140
+ SDL_FreeSurface(s2);
141
+ SDL_FreeSurface(s3);
142
+ SDL_FreeSurface(s4);
143
+ SDL_FreeSurface(bk);
144
+ s1 = s2 = s3 = s4 = bk = NULL;
152
/************************************************************************/