A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita
audio
rust
zig
deno
mpris
rockbox
mpd
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//
61enum
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};
71typedef unsigned playerstate_t;
72
73
74//
75// Player internal flags, for cheats and debug.
76//
77enum
78{
79 // No clipping, walk through barriers.
80 CF_NOCLIP = 1,
81 // No damage, no health loss.
82 CF_GODMODE = 2,
83 // Not really a cheat, just a debug aid.
84 CF_NOMOMENTUM = 4
85
86};
87typedef unsigned cheat_t;
88
89
90//
91// Extended player object info: player_t
92//
93typedef struct player_s
94{
95 mobj_t* mo;
96 playerstate_t playerstate;
97 ticcmd_t cmd;
98
99 // Determine POV,
100 // including viewpoint bobbing during movement.
101 // Focal origin above r.z
102 fixed_t viewz;
103 // Base height above floor for viewz.
104 fixed_t viewheight;
105 // Bob/squat speed.
106 fixed_t deltaviewheight;
107 // bounded/scaled total momentum.
108 fixed_t bob;
109
110 /* killough 10/98: used for realistic bobbing (i.e. not simply overall speed)
111 * mo->momx and mo->momy represent true momenta experienced by player.
112 * This only represents the thrust that the player applies himself.
113 * This avoids anomolies with such things as Boom ice and conveyors.
114 */
115 fixed_t momx, momy; // killough 10/98
116
117 // This is only used between levels,
118 // mo->health is used during levels.
119 int health;
120 int armorpoints;
121 // Armor type is 0-2.
122 int armortype;
123
124 // Power ups. invinc and invis are tic counters.
125 int powers[NUMPOWERS];
126 boolean cards[NUMCARDS];
127 boolean backpack;
128
129 // Frags, kills of other players.
130 int frags[MAXPLAYERS];
131 weapontype_t readyweapon;
132
133 // Is wp_nochange if not changing.
134 weapontype_t pendingweapon;
135
136 boolean weaponowned[NUMWEAPONS];
137 int ammo[NUMAMMO];
138 int maxammo[NUMAMMO];
139
140 // True if button down last tic.
141 int attackdown;
142 int usedown;
143
144 // Bit flags, for cheats and debug.
145 // See cheat_t, above.
146 int cheats;
147
148 // Refired shots are less accurate.
149 int refire;
150
151 // For intermission stats.
152 int killcount;
153 int itemcount;
154 int secretcount;
155
156 // Hint messages. // CPhipps - const
157 const char* message;
158
159 // For screen flashing (red or bright).
160 int damagecount;
161 int bonuscount;
162
163 // Who did damage (NULL for floors/ceilings).
164 mobj_t* attacker;
165
166 // So gun flashes light up areas.
167 int extralight;
168
169 // Current PLAYPAL, ???
170 // can be set to REDCOLORMAP for pain, etc.
171 int fixedcolormap;
172
173 // Player skin colorshift,
174 // 0-3 for which color to draw player.
175 int colormap;
176
177 // Overlay view sprites (gun, etc).
178 pspdef_t psprites[NUMPSPRITES];
179
180 // True if secret level has been done.
181 boolean didsecret;
182
183} player_t;
184
185
186//
187// INTERMISSION
188// Structure passed e.g. to WI_Start(wb)
189//
190typedef struct
191{
192 boolean in; // whether the player is in game
193
194 // Player stats, kills, collected items etc.
195 int skills;
196 int sitems;
197 int ssecret;
198 int stime;
199 int frags[4];
200 int score; // current score on entry, modified on return
201
202} wbplayerstruct_t;
203
204typedef struct
205{
206 int epsd; // episode # (0-2)
207
208 // if true, splash the secret level
209 boolean didsecret;
210
211 // previous and next levels, origin 0
212 int last;
213 int next;
214
215 int maxkills;
216 int maxitems;
217 int maxsecret;
218 int maxfrags;
219
220 // the par time
221 int partime;
222
223 // index of this player in game
224 int pnum;
225
226 wbplayerstruct_t plyr[MAXPLAYERS];
227
228 // CPhipps - total game time for completed levels so far
229 int totaltimes;
230
231} wbstartstruct_t;
232
233
234#endif