summaryrefslogtreecommitdiff
path: root/apps/plugins/doom/d_player.h
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-03-28 15:44:01 +0000
committerDave Chapman <dave@dchapman.com>2006-03-28 15:44:01 +0000
commit47f4a458d636a889e955e68f896708f1276febc0 (patch)
tree99f770c02ef606f0abbdcd332ac39e69830d8007 /apps/plugins/doom/d_player.h
parentfff7d6157d56f233cad5c2003475e47a5ff809a7 (diff)
downloadrockbox-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/d_player.h')
-rw-r--r--apps/plugins/doom/d_player.h232
1 files changed, 232 insertions, 0 deletions
diff --git a/apps/plugins/doom/d_player.h b/apps/plugins/doom/d_player.h
new file mode 100644
index 0000000000..f86b68f9be
--- /dev/null
+++ b/apps/plugins/doom/d_player.h
@@ -0,0 +1,232 @@
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 * Player state structure.
29 *
30 *-----------------------------------------------------------------------------*/
31
32
33#ifndef __D_PLAYER__
34#define __D_PLAYER__
35
36
37// The player data structure depends on a number
38// of other structs: items (internal inventory),
39// animation states (closely tied to the sprites
40// used to represent them, unfortunately).
41#include "d_items.h"
42#include "p_pspr.h"
43
44// In addition, the player is just a special
45// case of the generic moving object/actor.
46#include "p_mobj.h"
47
48// Finally, for odd reasons, the player input
49// is buffered within the player data struct,
50// as commands per game tick.
51#include "d_ticcmd.h"
52
53#ifdef __GNUG__
54#pragma interface
55#endif
56
57
58//
59// Player states.
60//
61typedef enum
62{
63 // Playing or camping.
64 PST_LIVE,
65 // Dead on the ground, view follows killer.
66 PST_DEAD,
67 // Ready to restart/respawn???
68 PST_REBORN
69
70} playerstate_t;
71
72
73//
74// Player internal flags, for cheats and debug.
75//
76typedef enum
77{
78 // No clipping, walk through barriers.
79 CF_NOCLIP = 1,
80 // No damage, no health loss.
81 CF_GODMODE = 2,
82 // Not really a cheat, just a debug aid.
83 CF_NOMOMENTUM = 4
84
85} cheat_t;
86
87
88//
89// Extended player object info: player_t
90//
91typedef struct player_s
92{
93 mobj_t* mo;
94 playerstate_t playerstate;
95 ticcmd_t cmd;
96
97 // Determine POV,
98 // including viewpoint bobbing during movement.
99 // Focal origin above r.z
100 fixed_t viewz;
101 // Base height above floor for viewz.
102 fixed_t viewheight;
103 // Bob/squat speed.
104 fixed_t deltaviewheight;
105 // bounded/scaled total momentum.
106 fixed_t bob;
107
108 /* killough 10/98: used for realistic bobbing (i.e. not simply overall speed)
109 * mo->momx and mo->momy represent true momenta experienced by player.
110 * This only represents the thrust that the player applies himself.
111 * This avoids anomolies with such things as Boom ice and conveyors.
112 */
113 fixed_t momx, momy; // killough 10/98
114
115 // This is only used between levels,
116 // mo->health is used during levels.
117 int health;
118 int armorpoints;
119 // Armor type is 0-2.
120 int armortype;
121
122 // Power ups. invinc and invis are tic counters.
123 int powers[NUMPOWERS];
124 boolean cards[NUMCARDS];
125 boolean backpack;
126
127 // Frags, kills of other players.
128 int frags[MAXPLAYERS];
129 weapontype_t readyweapon;
130
131 // Is wp_nochange if not changing.
132 weapontype_t pendingweapon;
133
134 boolean weaponowned[NUMWEAPONS];
135 int ammo[NUMAMMO];
136 int maxammo[NUMAMMO];
137
138 // True if button down last tic.
139 int attackdown;
140 int usedown;
141
142 // Bit flags, for cheats and debug.
143 // See cheat_t, above.
144 int cheats;
145
146 // Refired shots are less accurate.
147 int refire;
148
149 // For intermission stats.
150 int killcount;
151 int itemcount;
152 int secretcount;
153
154 // Hint messages. // CPhipps - const
155 const char* message;
156
157 // For screen flashing (red or bright).
158 int damagecount;
159 int bonuscount;
160
161 // Who did damage (NULL for floors/ceilings).
162 mobj_t* attacker;
163
164 // So gun flashes light up areas.
165 int extralight;
166
167 // Current PLAYPAL, ???
168 // can be set to REDCOLORMAP for pain, etc.
169 int fixedcolormap;
170
171 // Player skin colorshift,
172 // 0-3 for which color to draw player.
173 int colormap;
174
175 // Overlay view sprites (gun, etc).
176 pspdef_t psprites[NUMPSPRITES];
177
178 // True if secret level has been done.
179 boolean didsecret;
180
181} player_t;
182
183
184//
185// INTERMISSION
186// Structure passed e.g. to WI_Start(wb)
187//
188typedef struct
189{
190 boolean in; // whether the player is in game
191
192 // Player stats, kills, collected items etc.
193 int skills;
194 int sitems;
195 int ssecret;
196 int stime;
197 int frags[4];
198 int score; // current score on entry, modified on return
199
200} wbplayerstruct_t;
201
202typedef struct
203{
204 int epsd; // episode # (0-2)
205
206 // if true, splash the secret level
207 boolean didsecret;
208
209 // previous and next levels, origin 0
210 int last;
211 int next;
212
213 int maxkills;
214 int maxitems;
215 int maxsecret;
216 int maxfrags;
217
218 // the par time
219 int partime;
220
221 // index of this player in game
222 int pnum;
223
224 wbplayerstruct_t plyr[MAXPLAYERS];
225
226 // CPhipps - total game time for completed levels so far
227 int totaltimes;
228
229} wbstartstruct_t;
230
231
232#endif