Mercurial > hg > index.fcgi > lj > lj046
comparison src/pcdebrief.c @ 3:17286938e22a
change DS alt. rotate key to rotate twice
author | paulo@localhost |
---|---|
date | Wed, 08 Apr 2009 21:50:13 -0700 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:dfd0c366ebff |
---|---|
1 #include "ljpc.h" | |
2 | |
3 void debriefDrawPage(const char *page, size_t pageNumber) { | |
4 int y = 40; | |
5 char line[256]; | |
6 int linePos = 0; | |
7 int done = 0; | |
8 | |
9 acquire_screen(); | |
10 clear_to_color(screen, bgColor); | |
11 textout_centre_ex(screen, aver32, "GAME OVER", | |
12 SCREEN_W / 2, y, fgColor, -1); | |
13 textprintf_right_ex(screen, aver32, | |
14 SCREEN_W - 40, y, fgColor, -1, | |
15 "Page %u", (unsigned int)pageNumber + 1); | |
16 textout_centre_ex(screen, aver32, | |
17 "Left/Right: Change; Rotate: close", | |
18 SCREEN_W / 2, SCREEN_H - 40, fgColor, -1); | |
19 | |
20 while (!done) { | |
21 int c = *page++; | |
22 | |
23 // Break at newline and at end of text | |
24 if (c == '\n' || c == 0) { | |
25 | |
26 // Draw blank and parenthetical lines in smaller font | |
27 const FONT *f = (linePos == 0 || line[0] == '(') | |
28 ? aver16 | |
29 : aver32; | |
30 int lineH = text_height(f); | |
31 | |
32 // Terminate the line of text and print it | |
33 line[linePos] = 0; | |
34 textout_ex(screen, f, line, 40, y, fgColor, -1); | |
35 | |
36 linePos = 0; // Carriage return | |
37 y += lineH * 6 / 5; // Line feed | |
38 } else { | |
39 if (linePos + 2 < sizeof(line)) { | |
40 line[linePos++] = c; | |
41 } | |
42 } | |
43 if (c == 0) { | |
44 done = 1; | |
45 } | |
46 } | |
47 release_screen(); | |
48 } | |
49 | |
50 extern volatile char redrawWholeScreen; | |
51 | |
52 LJBits debriefHandleKeys(void) { | |
53 int keys = menuReadPad(); | |
54 | |
55 while (keypressed()) { | |
56 int scancode; | |
57 ureadkey(&scancode); | |
58 | |
59 if (scancode == KEY_PRTSCR) { | |
60 saveScreen(-1); | |
61 } | |
62 } | |
63 | |
64 if (wantsClose) { | |
65 keys |= VKEY_ROTL; | |
66 } | |
67 | |
68 if (!(keys & (VKEY_ROTL | VKEY_ROTR))) { | |
69 rest(30); | |
70 } | |
71 return keys; | |
72 } |