/
wi_stuff.h
148 lines (124 loc) · 3.94 KB
/
wi_stuff.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/** @file wi_stuff.h DOOM specific intermission screens.
*
* @authors Copyright © 2003-2014 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2005-2014 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 1993-1996 id Software, Inc.
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA</small>
*/
#ifndef LIBDOOM_WI_STUFF_H
#define LIBDOOM_WI_STUFF_H
#ifndef __JDOOM__
# error "Using jDoom headers without __JDOOM__"
#endif
#include "d_player.h"
// Global locations
#define WI_TITLEY (2)
#define WI_SPACINGY (33)
// Single-player stuff
#define SP_STATSX (50)
#define SP_STATSY (50)
#define SP_TIMEX (16)
#define SP_TIMEY (SCREENHEIGHT-32)
// Net game stuff
#define NG_STATSY (50)
#define NG_STATSX (32)
#define NG_SPACINGX (64)
// Deathmatch stuff
#define DM_MATRIXX (42)
#define DM_MATRIXY (68)
#define DM_SPACINGX (40)
#define DM_TOTALSX (269)
#define DM_KILLERSX (10)
#define DM_KILLERSY (100)
#define DM_VICTIMSX (5)
#define DM_VICTIMSY (50)
// States for single-player
#define SP_KILLS (0)
#define SP_ITEMS (2)
#define SP_SECRET (4)
#define SP_FRAGS (6)
#define SP_TIME (8)
#define SP_PAR (ST_TIME)
#define SP_PAUSE (1)
#define SHOWNEXTLOCDELAY (4) // In seconds.
// States for the intermission
typedef enum {
ILS_NONE = -1,
ILS_SHOW_STATS,
ILS_SHOW_NEXTMAP
} interludestate_t;
//
// INTERMISSION
// Structure passed e.g. to WI_Init(wb)
//
typedef struct {
dd_bool inGame; // Whether the player is in game.
// Player stats, kills, collected items etc.
int kills;
int items;
int secret;
int time;
int frags[MAXPLAYERS];
int score; // Current score on entry, modified on return.
} wbplayerstruct_t;
typedef struct {
uint episode;
dd_bool didSecret; // If true, splash the secret level.
uint currentMap, nextMap; // This and next maps.
int maxKills;
int maxItems;
int maxSecret;
int maxFrags;
int parTime;
int pNum; // Index of this player in game.
wbplayerstruct_t plyr[MAXPLAYERS];
} wbstartstruct_t;
#ifdef __cplusplus
extern "C" {
#endif
/// To be called to register the console commands and variables of this module.
void WI_Register(void);
/**
* Perform setup for an intermission.
*/
void WI_Init(wbstartstruct_t *wbstartstruct);
void WI_Shutdown(void);
/**
* Process game tic for the intermission.
*
* @note Handles user input due to timing issues in netgames.
*/
void WI_Ticker(void);
/**
* Draw the intermission.
*/
void WI_Drawer(void);
/**
* Change the current intermission state.
*/
void WI_SetState(interludestate_t st);
/**
* End the current intermission.
*/
void WI_End(void);
/**
* Skip to the next state in the intermission.
*/
void IN_SkipToNext(void);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // LIBDOOM_WI_STUFF_H