Debian Codegraph @

prboom2/src/g_overflow.h

raw
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 * Copyright 2005, 2006 by
12 * Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 * 02111-1307, USA.
28 *
29 * DESCRIPTION:
30 * System interface, sound.
31 *
32 *-----------------------------------------------------------------------------*/
33
34 #ifndef __G_OVERFLOW__
35 #define __G_OVERFLOW__
36
37 #include "doomtype.h"
38 #include "doomdata.h"
39 #include "p_maputl.h"
40
41 typedef struct overrun_param_s
42 {
43 int warn;
44 int emulate;
45 int footer;
46 int footer_emulate;
47 int promted;
48 int happened;
49 } overrun_param_t;
50
51 typedef enum overrun_list_s
52 {
53 OVERFLOW_SPECHIT,
54 OVERFLOW_REJECT,
55 OVERFLOW_INTERCEPT,
56 OVERFLOW_PLAYERINGAME,
57 OVERFLOW_DONUT,
58 OVERFLOW_MISSEDBACKSIDE,
59
60 OVERFLOW_MAX //last
61 } overrun_list_t;
62
63 extern int overflows_enabled;
64 extern overrun_param_t overflows[];
65 extern const char *overflow_cfgname[OVERFLOW_MAX];
66
67 #define EMULATE(overflow) (overflows_enabled && (overflows[overflow].footer ? overflows[overflow].footer_emulate : overflows[overflow].emulate))
68 #define PROCESS(overflow) (overflows_enabled && (overflows[overflow].warn || EMULATE(overflow)))
69
70 // e6y
71 //
72 // intercepts overrun emulation
73 // See more information on:
74 // doomworld.com/vb/doom-speed-demos/35214-spechits-reject-and-intercepts-overflow-lists
75 //
76 // Thanks to Simon Howard (fraggle) for refactor the intercepts
77 // overrun code so that it should work properly on big endian machines
78 // as well as little endian machines.
79
80 #define MAXINTERCEPTS_ORIGINAL 128
81
82 typedef struct
83 {
84 int len;
85 void *addr;
86 void *addr2;
87 } intercepts_overrun_t;
88
89 extern intercepts_overrun_t intercepts_overrun[];
90 void InterceptsOverrun(int num_intercepts, intercept_t *intercept);
91
92 //
93 // playeringame overrun emulation
94 //
95
96 int PlayeringameOverrun(const mapthing_t* mthing);
97
98 //
99 // spechit overrun emulation
100 //
101
102 // Spechit overrun magic value.
103 #define DEFAULT_SPECHIT_MAGIC 0x01C09C98
104
105 typedef struct spechit_overrun_param_s
106 {
107 line_t *line;
108
109 line_t ***spechit;
110 int *numspechit;
111
112 fixed_t *tmbbox;
113 fixed_t *tmfloorz;
114 fixed_t *tmceilingz;
115
116 int *crushchange;
117 dboolean *nofit;
118 } spechit_overrun_param_t;
119
120 extern unsigned int spechit_baseaddr;
121
122 void SpechitOverrun(spechit_overrun_param_t *params);
123
124 //
125 // reject overrun emulation
126 //
127
128 void RejectOverrun(unsigned int length, const byte **rejectmatrix, int totallines);
129
130 //
131 // donut overrun emulation (linedef action 9)
132 //
133
134 int DonutOverrun(fixed_t *pfloorheight, short *pfloorpic);
135
136 int MissedBackSideOverrun(line_t *line);
137 sector_t* GetSectorAtNullAddress(void);
138
139 #endif // __G_OVERFLOW__