Debian Codegraph @

src/nortvars.c

raw symbols SCIP
1 /*
2 * OpenTyrian: A modern cross-platform port of Tyrian
3 * Copyright (C) 2007-2009 The OpenTyrian Development Team
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19 #include "nortvars.h"
20
21 #include "file.h"
22 #include "joystick.h"
23 #include "keyboard.h"
24 #include "opentyr.h"
25 #include "vga256d.h"
26 #include "video.h"
27
28 #include <assert.h>
29 #include <ctype.h>
30
31 JE_boolean inputDetected;
32
33 JE_boolean JE_anyButton(void)
34 {
35 poll_joysticks();
36 service_SDL_events(true);
37 return newkey || mousedown || joydown;
38 }
39
40 void JE_dBar3(SDL_Surface *surface, JE_integer x, JE_integer y, JE_integer num, JE_integer col)
41 {
42 JE_byte z;
43 JE_byte zWait = 2;
44
45 col += 2;
46
47 for (z = 0; z <= num; z++)
48 {
49 JE_rectangle(surface, x, y - 1, x + 8, y, col); /* <MXD> SEGa000 */
50 if (zWait > 0)
51 {
52 zWait--;
53 }
54 else
55 {
56 col++;
57 zWait = 1;
58 }
59 y -= 2;
60 }
61 }
62
63 void JE_barDrawShadow(SDL_Surface *surface, JE_word x, JE_word y, JE_word res, JE_word col, JE_word amt, JE_word xsize, JE_word ysize)
64 {
65 xsize--;
66 ysize--;
67
68 for (int z = 1; z <= amt / res; z++)
69 {
70 JE_barShade(surface, x+2, y+2, x+xsize+2, y+ysize+2);
71 fill_rectangle_xy(surface, x, y, x+xsize, y+ysize, col+12);
72 fill_rectangle_xy(surface, x, y, x+xsize, y, col+13);
73 JE_pix(surface, x, y, col+15);
74 fill_rectangle_xy(surface, x, y+ysize, x+xsize, y+ysize, col+11);
75 x += xsize + 2;
76 }
77
78 amt %= res;
79 if (amt > 0)
80 {
81 JE_barShade(surface, x+2, y+2, x+xsize+2, y+ysize+2);
82 fill_rectangle_xy(surface, x,y, x+xsize, y+ysize, col+(12 / res * amt));
83 }
84 }
85
86 void JE_wipeKey(void)
87 {
88 // /!\ Doesn't seems to affect anything.
89 }