diff options
author | Dave Chapman <dave@dchapman.com> | 2006-03-28 15:44:01 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2006-03-28 15:44:01 +0000 |
commit | 47f4a458d636a889e955e68f896708f1276febc0 (patch) | |
tree | 99f770c02ef606f0abbdcd332ac39e69830d8007 /apps/plugins/doom/st_lib.h | |
parent | fff7d6157d56f233cad5c2003475e47a5ff809a7 (diff) | |
download | rockbox-47f4a458d636a889e955e68f896708f1276febc0.tar.gz rockbox-47f4a458d636a889e955e68f896708f1276febc0.zip |
Patch #2969 - Doom! Currently only working on the H300.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9312 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/doom/st_lib.h')
-rw-r--r-- | apps/plugins/doom/st_lib.h | 207 |
1 files changed, 207 insertions, 0 deletions
diff --git a/apps/plugins/doom/st_lib.h b/apps/plugins/doom/st_lib.h new file mode 100644 index 0000000000..09e5faaf87 --- /dev/null +++ b/apps/plugins/doom/st_lib.h | |||
@@ -0,0 +1,207 @@ | |||
1 | /* Emacs style mode select -*- C++ -*- | ||
2 | *----------------------------------------------------------------------------- | ||
3 | * | ||
4 | * | ||
5 | * PrBoom a Doom port merged with LxDoom and LSDLDoom | ||
6 | * based on BOOM, a modified and improved DOOM engine | ||
7 | * Copyright (C) 1999 by | ||
8 | * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman | ||
9 | * Copyright (C) 1999-2000 by | ||
10 | * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This program is distributed in the hope that it will be useful, | ||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | * GNU General Public License for more details. | ||
21 | * | ||
22 | * You should have received a copy of the GNU General Public License | ||
23 | * along with this program; if not, write to the Free Software | ||
24 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | ||
25 | * 02111-1307, USA. | ||
26 | * | ||
27 | * DESCRIPTION: | ||
28 | * The status bar widget definitions and prototypes | ||
29 | * | ||
30 | *-----------------------------------------------------------------------------*/ | ||
31 | |||
32 | #ifndef __STLIB__ | ||
33 | #define __STLIB__ | ||
34 | |||
35 | // We are referring to patches. | ||
36 | #include "r_defs.h" | ||
37 | #include "v_video.h" // color ranges | ||
38 | |||
39 | // | ||
40 | // Background and foreground screen numbers | ||
41 | // | ||
42 | #define BG 4 | ||
43 | #define FG 0 | ||
44 | |||
45 | // | ||
46 | // Typedefs of widgets | ||
47 | // | ||
48 | |||
49 | // Number widget | ||
50 | |||
51 | typedef struct | ||
52 | { | ||
53 | // upper right-hand corner | ||
54 | // of the number (right-justified) | ||
55 | int x; | ||
56 | int y; | ||
57 | |||
58 | // max # of digits in number | ||
59 | int width; | ||
60 | |||
61 | // last number value | ||
62 | int oldnum; | ||
63 | |||
64 | // pointer to current value | ||
65 | int* num; | ||
66 | |||
67 | // pointer to boolean stating | ||
68 | // whether to update number | ||
69 | boolean* on; | ||
70 | |||
71 | // list of patches for 0-9 | ||
72 | const patchnum_t* p; | ||
73 | |||
74 | // user data | ||
75 | int data; | ||
76 | } st_number_t; | ||
77 | |||
78 | // Percent widget ("child" of number widget, | ||
79 | // or, more precisely, contains a number widget.) | ||
80 | typedef struct | ||
81 | { | ||
82 | // number information | ||
83 | st_number_t n; | ||
84 | |||
85 | // percent sign graphic | ||
86 | const patchnum_t* p; | ||
87 | } st_percent_t; | ||
88 | |||
89 | // Multiple Icon widget | ||
90 | typedef struct | ||
91 | { | ||
92 | // center-justified location of icons | ||
93 | int x; | ||
94 | int y; | ||
95 | |||
96 | // last icon number | ||
97 | int oldinum; | ||
98 | |||
99 | // pointer to current icon | ||
100 | int* inum; | ||
101 | |||
102 | // pointer to boolean stating | ||
103 | // whether to update icon | ||
104 | boolean* on; | ||
105 | |||
106 | // list of icons | ||
107 | const patchnum_t* p; | ||
108 | |||
109 | // user data | ||
110 | int data; | ||
111 | |||
112 | } st_multicon_t; | ||
113 | |||
114 | // Binary Icon widget | ||
115 | |||
116 | typedef struct | ||
117 | { | ||
118 | // center-justified location of icon | ||
119 | int x; | ||
120 | int y; | ||
121 | |||
122 | // last icon value | ||
123 | int oldval; | ||
124 | |||
125 | // pointer to current icon status | ||
126 | boolean* val; | ||
127 | |||
128 | // pointer to boolean | ||
129 | // stating whether to update icon | ||
130 | boolean* on; | ||
131 | |||
132 | const patchnum_t* p; // icon | ||
133 | int data; // user data | ||
134 | } st_binicon_t; | ||
135 | |||
136 | // | ||
137 | // Widget creation, access, and update routines | ||
138 | // | ||
139 | |||
140 | // Initializes widget library. | ||
141 | // More precisely, initialize STMINUS, | ||
142 | // everything else is done somewhere else. | ||
143 | // | ||
144 | void STlib_init(void); | ||
145 | |||
146 | // Number widget routines | ||
147 | void STlib_initNum | ||
148 | ( st_number_t* n, | ||
149 | int x, | ||
150 | int y, | ||
151 | const patchnum_t* pl, | ||
152 | int* num, | ||
153 | boolean* on, | ||
154 | int width ); | ||
155 | |||
156 | void STlib_updateNum | ||
157 | ( st_number_t* n, | ||
158 | int cm, | ||
159 | boolean refresh ); | ||
160 | |||
161 | |||
162 | // Percent widget routines | ||
163 | void STlib_initPercent | ||
164 | ( st_percent_t* p, | ||
165 | int x, | ||
166 | int y, | ||
167 | const patchnum_t* pl, | ||
168 | int* num, | ||
169 | boolean* on, | ||
170 | const patchnum_t* percent ); | ||
171 | |||
172 | |||
173 | void STlib_updatePercent | ||
174 | ( st_percent_t* per, | ||
175 | int cm, | ||
176 | int refresh ); | ||
177 | |||
178 | |||
179 | // Multiple Icon widget routines | ||
180 | void STlib_initMultIcon | ||
181 | ( st_multicon_t* mi, | ||
182 | int x, | ||
183 | int y, | ||
184 | const patchnum_t* il, | ||
185 | int* inum, | ||
186 | boolean* on ); | ||
187 | |||
188 | |||
189 | void STlib_updateMultIcon | ||
190 | ( st_multicon_t* mi, | ||
191 | boolean refresh ); | ||
192 | |||
193 | // Binary Icon widget routines | ||
194 | |||
195 | void STlib_initBinIcon | ||
196 | ( st_binicon_t* b, | ||
197 | int x, | ||
198 | int y, | ||
199 | const patchnum_t* i, | ||
200 | boolean* val, | ||
201 | boolean* on ); | ||
202 | |||
203 | void STlib_updateBinIcon | ||
204 | ( st_binicon_t* bi, | ||
205 | boolean refresh ); | ||
206 | |||
207 | #endif | ||