1 //**************************************************************************
2 //**
3 //**	##   ##    ##    ##   ##   ####     ####   ###     ###
4 //**	##   ##  ##  ##  ##   ##  ##  ##   ##  ##  ####   ####
5 //**	 ## ##  ##    ##  ## ##  ##    ## ##    ## ## ## ## ##
6 //**	 ## ##  ########  ## ##  ##    ## ##    ## ##  ###  ##
7 //**	  ###   ##    ##   ###    ##  ##   ##  ##  ##       ##
8 //**	   #    ##    ##    #      ####     ####   ##       ##
9 //**
10 //**	$Id: p_gameinfo.h 4110 2009-11-13 21:54:07Z dj_jl $
11 //**
12 //**	Copyright (C) 1999-2006 Jānis Legzdiņš
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 //**************************************************************************
25 
26 //
27 //	Network mode.
28 //
29 enum
30 {
31 	//	Not running a game.
32 	NM_None,
33 	//	Playing a titlemap.
34 	NM_TitleMap,
35 	//	Standalone single player game.
36 	NM_Standalone,
37 	//	Dedicated server, no local client.
38 	NM_DedicatedServer,
39 	//	Server with local client.
40 	NM_ListenServer,
41 	//	Client only, no local server.
42 	NM_Client,
43 };
44 
45 class VGameInfo : public VGameObject
46 {
47 	DECLARE_CLASS(VGameInfo, VGameObject, 0)
48 
49 	VName			AcsHelper;
50 	VName			GenericConScript;
51 
52 	vuint8			NetMode;
53 	vuint8			deathmatch;
54 	vuint8			respawn;
55 	vuint8			nomonsters;
56 	vuint8			fastparm;
57 
58 	vint32*			validcount;
59 	vint32			skyflatnum;
60 
61 	VWorldInfo*		WorldInfo;
62 
63 	VBasePlayer*	Players[MAXPLAYERS]; // Bookkeeping on players - state.
64 
65 	vint32			RebornPosition;
66 
67 	float			frametime;
68 
69 	float			FloatBobOffsets[64];
70 	vint32			PhaseTable[64];
71 
72 	VClass*			LevelInfoClass;
73 	VClass*			PlayerReplicationInfoClass;
74 
75 	vint32			GameFilterFlag;
76 
77 	TArray<VClass*>	PlayerClasses;
78 
79 	enum
80 	{
81 		GIF_DefaultLaxMonsterActivation	= 0x00000001,
82 		GIF_DefaultBloodSplatter		= 0x00000002,
83 		GIF_Paused						= 0x00000004,
84 	};
85 	vuint32			Flags;
86 
87 	VGameInfo();
88 
89 	bool IsPaused();
90 
eventInit()91 	void eventInit()
92 	{
93 		P_PASS_SELF;
94 		EV_RET_VOID("Init");
95 	}
eventInitNewGame(int skill)96 	void eventInitNewGame(int skill)
97 	{
98 		P_PASS_SELF;
99 		P_PASS_INT(skill);
100 		EV_RET_VOID("InitNewGame");
101 	}
eventCreateWorldInfo()102 	VWorldInfo* eventCreateWorldInfo()
103 	{
104 		P_PASS_SELF;
105 		EV_RET_REF(VWorldInfo, "CreateWorldInfo");
106 	}
eventTranslateLevel(VLevel * InLevel)107 	void eventTranslateLevel(VLevel* InLevel)
108 	{
109 		P_PASS_SELF;
110 		P_PASS_REF(InLevel);
111 		EV_RET_VOID("TranslateLevel");
112 	}
eventSpawnWorld(VLevel * InLevel)113 	void eventSpawnWorld(VLevel* InLevel)
114 	{
115 		P_PASS_SELF;
116 		P_PASS_REF(InLevel);
117 		EV_RET_VOID("SpawnWorld");
118 	}
eventGetConScriptName(VName LevelName)119 	VName eventGetConScriptName(VName LevelName)
120 	{
121 		P_PASS_SELF;
122 		P_PASS_NAME(LevelName);
123 		EV_RET_NAME("GetConScriptName");
124 	}
eventCmdWeaponSection(const VStr & Section)125 	void eventCmdWeaponSection(const VStr& Section)
126 	{
127 		P_PASS_SELF;
128 		P_PASS_STR(Section);
129 		EV_RET_VOID("CmdWeaponSection");
130 	}
eventCmdSetSlot(TArray<VStr> * Args)131 	void eventCmdSetSlot(TArray<VStr>* Args)
132 	{
133 		P_PASS_SELF;
134 		P_PASS_PTR(Args);
135 		EV_RET_VOID("CmdSetSlot");
136 	}
eventCmdAddSlotDefault(TArray<VStr> * Args)137 	void eventCmdAddSlotDefault(TArray<VStr>* Args)
138 	{
139 		P_PASS_SELF;
140 		P_PASS_PTR(Args);
141 		EV_RET_VOID("CmdAddSlotDefault");
142 	}
143 };
144 
145 extern VGameInfo*		GGameInfo;
146