1 /*
2 ** gi.h
3 **
4 **---------------------------------------------------------------------------
5 ** Copyright 1998-2006 Randy Heit
6 ** All rights reserved.
7 **
8 ** Redistribution and use in source and binary forms, with or without
9 ** modification, are permitted provided that the following conditions
10 ** are met:
11 **
12 ** 1. Redistributions of source code must retain the above copyright
13 **    notice, this list of conditions and the following disclaimer.
14 ** 2. Redistributions in binary form must reproduce the above copyright
15 **    notice, this list of conditions and the following disclaimer in the
16 **    documentation and/or other materials provided with the distribution.
17 ** 3. The name of the author may not be used to endorse or promote products
18 **    derived from this software without specific prior written permission.
19 **
20 ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 **---------------------------------------------------------------------------
31 **
32 */
33 
34 #ifndef __GI_H__
35 #define __GI_H__
36 
37 #include "basictypes.h"
38 #include "zstring.h"
39 
40 // Flags are not user configurable and only depend on the standard IWADs
41 #define GI_MAPxx				0x00000001
42 #define GI_SHAREWARE			0x00000002
43 #define GI_MENUHACK_EXTENDED	0x00000004	// (Heretic)
44 #define GI_TEASER2				0x00000008	// Alternate version of the Strife Teaser
45 #define GI_COMPATSHORTTEX		0x00000010	// always force COMPAT_SHORTTEX for IWAD maps.
46 #define GI_COMPATSTAIRS			0x00000020	// same for stairbuilding
47 #define GI_COMPATPOLY1			0x00000040	// Hexen's MAP36 needs old polyobject drawing
48 #define GI_COMPATPOLY2			0x00000080	// so does HEXDD's MAP47
49 #define GI_NOTEXTCOLOR			0x00000100	// Chex Quest 3 would have everything green
50 
51 #include "gametype.h"
52 
53 extern const char *GameNames[17];
54 
55 struct staticgameborder_t
56 {
57 	BYTE offset;
58 	BYTE size;
59 	char tl[8];
60 	char t[8];
61 	char tr[8];
62 	char l[8];
63 	char r[8];
64 	char bl[8];
65 	char b[8];
66 	char br[8];
67 };
68 
69 struct gameborder_t
70 {
71 	BYTE offset;
72 	BYTE size;
73 	FString tl;
74 	FString t;
75 	FString tr;
76 	FString l;
77 	FString r;
78 	FString bl;
79 	FString b;
80 	FString br;
81 
82 	gameborder_t &operator=(staticgameborder_t &other)
83 	{
84 		offset = other.offset;
85 		size = other.size;
86 		tl = other.tl;
87 		t = other.t;
88 		tr = other.tr;
89 		l = other.l;
90 		r = other.r;
91 		bl = other.bl;
92 		b = other.b;
93 		br = other.br;
94 		return *this;
95 	}
96 };
97 
98 struct FGIFont
99 {
100 	FName fontname;
101 	FName color;
102 };
103 
104 struct gameinfo_t
105 {
106 	int flags;
107 	EGameType gametype;
108 	FString ConfigName;
109 
110 	FString TitlePage;
111 	bool drawreadthis;
112 	bool noloopfinalemusic;
113 	bool intermissioncounter;
114 	bool nightmarefast;
115 	bool swapmenu;
116 	bool dontcrunchcorpses;
117 	TArray<FName> creditPages;
118 	TArray<FName> finalePages;
119 	TArray<FName> infoPages;
120 	TArray<FName> DefaultWeaponSlots[10];
121 	TArray<FName> PlayerClasses;
122 
123 	FString titleMusic;
124 	int titleOrder;
125 	float titleTime;
126 	float advisoryTime;
127 	float pageTime;
128 	FString chatSound;
129 	FString finaleMusic;
130 	int finaleOrder;
131 	FString FinaleFlat;
132 	FString BorderFlat;
133 	FString SkyFlatName;
134 	FString ArmorIcon1;
135 	FString ArmorIcon2;
136 	FString PauseSign;
137 	FString Endoom;
138 	fixed_t Armor2Percent;
139 	FString quitSound;
140 	gameborder_t Border;
141 	int telefogheight;
142 	int defKickback;
143 	FString translator;
144 	DWORD defaultbloodcolor;
145 	DWORD defaultbloodparticlecolor;
146 	FString backpacktype;
147 	FString statusbar;
148 	FString intermissionMusic;
149 	int intermissionOrder;
150 	FString CursorPic;
151 	DWORD dimcolor;
152 	float dimamount;
153 	int definventorymaxamount;
154 	int defaultrespawntime;
155 	int defaultdropstyle;
156 	DWORD pickupcolor;
157 	TArray<FString> quitmessages;
158 	FName mTitleColor;
159 	FName mFontColor;
160 	FName mFontColorValue;
161 	FName mFontColorMore;
162 	FName mFontColorHeader;
163 	FName mFontColorHighlight;
164 	FName mFontColorSelection;
165 	FString mBackButton;
166 	fixed_t gibfactor;
167 	int TextScreenX;
168 	int TextScreenY;
169 	FName DefaultEndSequence;
170 	FString mMapArrow, mCheatMapArrow;
171 	FString mEasyKey, mCheatKey;
172 	FGIFont mStatscreenMapNameFont;
173 	FGIFont mStatscreenFinishedFont;
174 	FGIFont mStatscreenEnteringFont;
175 	bool norandomplayerclass;
176 
177 	const char *GetFinalePage(unsigned int num) const;
178 };
179 
180 
181 extern gameinfo_t gameinfo;
182 
GameTypeName()183 inline const char *GameTypeName()
184 {
185 	return GameNames[gameinfo.gametype];
186 }
187 
CheckGame(const char * string,bool chexisdoom)188 inline bool CheckGame(const char *string, bool chexisdoom)
189 {
190 	int test = gameinfo.gametype;
191 	if (test == GAME_Chex && chexisdoom) test = GAME_Doom;
192 	return !stricmp(string, GameNames[test]);
193 }
194 
195 #endif //__GI_H__
196