-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathg_overflow.h
139 lines (112 loc) · 3.59 KB
/
g_overflow.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
/* Emacs style mode select -*- C++ -*-
*-----------------------------------------------------------------------------
*
*
* PrBoom: a Doom port merged with LxDoom and LSDLDoom
* based on BOOM, a modified and improved DOOM engine
* Copyright (C) 1999 by
* id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
* Copyright (C) 1999-2000 by
* Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
* Copyright 2005, 2006 by
* Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko
*
* 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., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* DESCRIPTION:
* System interface, sound.
*
*-----------------------------------------------------------------------------*/
#ifndef __G_OVERFLOW__
#define __G_OVERFLOW__
#include "doomtype.h"
#include "doomdata.h"
#include "p_maputl.h"
typedef struct overrun_param_s
{
int warn;
int emulate;
int footer;
int footer_emulate;
int promted;
int shit_happens;
} overrun_param_t;
typedef enum overrun_list_s
{
OVERFLOW_SPECHIT,
OVERFLOW_REJECT,
OVERFLOW_INTERCEPT,
OVERFLOW_PLYERINGAME,
OVERFLOW_DONUT,
OVERFLOW_MISSEDBACKSIDE,
OVERFLOW_MAX //last
} overrun_list_t;
extern int overflows_enabled;
extern overrun_param_t overflows[];
extern const char *overflow_cfgname[OVERFLOW_MAX];
#define EMULATE(overflow) (overflows_enabled && (overflows[overflow].footer ? overflows[overflow].footer_emulate : overflows[overflow].emulate))
#define PROCESS(overflow) (overflows_enabled && (overflows[overflow].warn || EMULATE(overflow)))
// e6y
//
// intercepts overrun emulation
// See more information on:
// doomworld.com/vb/doom-speed-demos/35214-spechits-reject-and-intercepts-overflow-lists
//
// Thanks to Simon Howard (fraggle) for refactor the intercepts
// overrun code so that it should work properly on big endian machines
// as well as little endian machines.
#define MAXINTERCEPTS_ORIGINAL 128
typedef struct
{
int len;
void *addr;
dboolean int16_array;
} intercepts_overrun_t;
extern intercepts_overrun_t intercepts_overrun[];
void InterceptsOverrun(int num_intercepts, intercept_t *intercept);
//
// playeringame overrun emulation
//
int PlayeringameOverrun(const mapthing_t* mthing);
//
// spechit overrun emulation
//
// Spechit overrun magic value.
#define DEFAULT_SPECHIT_MAGIC 0x01C09C98
typedef struct spechit_overrun_param_s
{
line_t *line;
line_t ***spechit;
int *numspechit;
fixed_t *tmbbox;
fixed_t *tmfloorz;
fixed_t *tmceilingz;
dboolean *crushchange;
dboolean *nofit;
} spechit_overrun_param_t;
extern unsigned int spechit_baseaddr;
void SpechitOverrun(spechit_overrun_param_t *params);
//
// reject overrun emulation
//
void RejectOverrun(int rejectlump, const byte **rejectmatrix, int totallines);
//
// donut overrun emulation (linedef action 9)
//
int DonutOverrun(fixed_t *pfloorheight, short *pfloorpic);
int MissedBackSideOverrun(line_t *line);
sector_t* GetSectorAtNullAddress(void);
#endif // __G_OVERFLOW__