1 /**
2  * @file def_share.h
3  * Shared definition data structures and constants. @ingroup defs
4  *
5  * @authors Copyright © 2003-2017 Jaakko Keränen <jaakko.keranen@iki.fi>
6  * @authors Copyright © 2005-2014 Daniel Swanson <danij@dengine.net>
7  *
8  * @par License
9  * GPL: http://www.gnu.org/licenses/gpl.html
10  *
11  * <small>This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by the
13  * Free Software Foundation; either version 2 of the License, or (at your
14  * option) any later version. This program is distributed in the hope that it
15  * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
16  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
17  * Public License for more details. You should have received a copy of the GNU
18  * General Public License along with this program; if not, write to the Free
19  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA</small>
21  */
22 
23 #ifndef LIBDENG_SHARED_GAME_DEFINITIONS_H
24 #define LIBDENG_SHARED_GAME_DEFINITIONS_H
25 
26 #include "dd_types.h"
27 #include <doomsday/world/actions.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /// @addtogroup defs
34 ///@{
35 
36 #define NUM_MOBJ_FLAGS          3
37 #define NUM_MOBJ_MISC           4
38 #define NUM_STATE_MISC          3
39 
40 typedef struct {
41     char            name[5];
42 } sprname_t;
43 
44 typedef struct state_s {
45     spritenum_t     sprite;
46     int             flags;
47     int             frame;
48     int             tics;
49     acfnptr_t       action;
50     int             nextState;
51     int             misc[NUM_STATE_MISC];
52 } state_t;
53 
54 typedef enum {
55     STATENAMES_FIRST,
56     SN_SPAWN = STATENAMES_FIRST,
57     SN_SEE,
58     SN_PAIN,
59     SN_MELEE,
60     SN_MISSILE,
61     SN_CRASH,
62     SN_DEATH,
63     SN_XDEATH,
64     SN_RAISE,
65     STATENAMES_COUNT
66 } statename_t;
67 
68 typedef enum {
69     SOUNDNAMES_FIRST,
70     SDN_PAIN = SOUNDNAMES_FIRST,
71     SDN_DEATH,
72     SDN_ACTIVE,
73     SDN_ATTACK,
74     SDN_SEE,
75     SOUNDNAMES_COUNT
76 } soundname_t;
77 
78 typedef struct {
79     int             doomEdNum;
80     int             spawnHealth;
81     float           speed;
82     float           radius;
83     float           height;
84     int             mass;
85     int             damage;
86     int             flags;
87     int             flags2;
88     int             flags3;
89     int             reactionTime;
90     int             painChance;
91     int             states[STATENAMES_COUNT];
92     int             painSound;
93     int             deathSound;
94     int             activeSound;
95     int             attackSound;
96     int             seeSound;
97     int             misc[NUM_MOBJ_MISC];
98 } mobjinfo_t;
99 
100 typedef struct {
101     char            lumpName[9];
102     int             lumpNum;
103     char*           extFile;
104     void*           data;
105 } musicinfo_t;
106 
107 typedef struct {
108     char*           text; ///< Pointer to the text (don't modify).
109 } ddtext_t;
110 
111 /**
112  * @defgroup mapInfoFlags Map Info Flags
113  * @ingroup defs apiFlags
114  */
115 ///@{
116 #define MIF_FOG                 0x1  ///< Fog is used in the map.
117 #define MIF_DRAW_SPHERE         0x2  ///< Always draw the sky sphere.
118 #define MIF_NO_INTERMISSION     0x4  ///< Skip any intermission between maps.
119 #define MIF_LIGHTNING           0x8  ///< Lightning is used in the map.
120 #define MIF_SPAWN_ALL_FIREMACES 0x10 ///< Heretic: Spawn all firemaces (disable randomness).
121 #define MIF_DIM_TORCH           0x20 ///< Heretic: Use the attenuated torch (not fullbright).
122 ///@}
123 
124 #define DDLT_MAX_APARAMS    10
125 #define DDLT_MAX_PARAMS     20
126 #define DDLT_MAX_SPARAMS    5
127 
128 typedef struct {
129     int             id;
130     int             flags;
131     int             flags2;
132     int             flags3;
133     int             lineClass;
134     int             actType;
135     int             actCount;
136     float           actTime;
137     int             actTag;
138     int             aparm[DDLT_MAX_APARAMS];
139     float           tickerStart, tickerEnd;
140     int             tickerInterval;
141     int             actSound, deactSound;
142     int             evChain, actChain, deactChain;
143     int             wallSection;
144     materialid_t    actMaterial, deactMaterial;
145     int             actLineType, deactLineType;
146     char*           actMsg, *deactMsg;
147     float           materialMoveAngle;
148     float           materialMoveSpeed;
149     int             iparm[DDLT_MAX_PARAMS];
150     float           fparm[DDLT_MAX_PARAMS];
151     char*           sparm[DDLT_MAX_SPARAMS];
152 } linetype_t;
153 
154 #define DDLT_MAX_CHAINS     5
155 
156 typedef struct {
157     int             id;
158     int             flags;
159     int             actTag;
160     int             chain[DDLT_MAX_CHAINS];
161     int             chainFlags[DDLT_MAX_CHAINS];
162     float           start[DDLT_MAX_CHAINS];
163     float           end[DDLT_MAX_CHAINS];
164     float           interval[DDLT_MAX_CHAINS][2];
165     int             count[DDLT_MAX_CHAINS];
166     int             ambientSound;
167     float           soundInterval[2]; ///< min,max
168     float           materialMoveAngle[2]; ///< floor, ceil
169     float           materialMoveSpeed[2]; ///< floor, ceil
170     float           windAngle;
171     float           windSpeed;
172     float           verticalWind;
173     float           gravity;
174     float           friction;
175     char*           lightFunc;
176     int             lightInterval[2];
177     char*           colFunc[3]; ///< RGB
178     int             colInterval[3][2];
179     char*           floorFunc;
180     float           floorMul, floorOff;
181     int             floorInterval[2];
182     char*           ceilFunc;
183     float           ceilMul, ceilOff;
184     int             ceilInterval[2];
185 } sectortype_t;
186 
187 ///@}
188 
189 #ifdef __cplusplus
190 } // extern "C"
191 #endif
192 
193 #endif // LIBDENG_SHARED_GAME_DEFINITIONS_H
194