UFO: Alien Invasion
cl_battlescape.h
Go to the documentation of this file.
1 
5 /*
6 Copyright (C) 2002-2022 UFO: Alien Invasion.
7 
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 
17 See the GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 
23 */
24 
25 #pragma once
26 
27 #include "../../common/grid.h"
28 
29 typedef struct {
30  char name[MAX_VAR];
31 } clientinfo_t;
32 
38 typedef struct clientBattleScape_s {
39  int time;
42 
43  le_t* teamList[MAX_ACTIVETEAM];
46 
50  int pnum;
51  int actTeam;
53  char configstrings[MAX_CONFIGSTRINGS][MAX_TOKEN_CHARS];
54 
56  model_t* model_draw[MAX_MODELS];
57  const struct cBspModel_s* model_clip[MAX_MODELS];
58 
61  clientinfo_t clientinfo[MAX_CLIENTS];
64 
67 
68  int numLMs;
70 
71  int numLEs;
73 
74  const char* leInlineModelList[MAX_EDICTS + 1];
75 
76  bool spawned;
78  bool started;
81 
85 
88  inline clientBattleScape_s () :
89  time(0),
90  cam(camera_t()),
91  numTeamList(0),
92  numEnemiesSpotted(0),
93  eventsBlocked(false),
94  pnum(0),
95  actTeam(0),
96  radarInitialized(false),
97  mapMaxLevel(0),
98  numMapParticles(0),
99  numLMs(0),
100  numLEs(0),
101  spawned(false),
102  started(false),
103  mapData(nullptr),
104  mapTiles(nullptr),
105  chrList(nullptr)
106  {
107  for (int i = 0; i < MAX_ACTIVETEAM; i++)
108  teamList[i] = nullptr;
109  for (int i = 0; i < MAX_CONFIGSTRINGS; i++)
110  configstrings[i][0] = '\0';
111  for (int i = 0; i < MAX_MODELS; i++) {
112  model_draw[i] = nullptr;
113  model_clip[i] = nullptr;
114  }
115  for (int i = 0; i < MAX_EDICTS + 1; i++) {
116  leInlineModelList[i] = nullptr;
117  if (i < MAX_EDICTS)
118  LEs[i] = le_t();
119  }
120  for (int i = 0; i < MAX_CLIENTS; i++)
121  clientinfo[i] = clientinfo_t();
122  for (int i = 0; i < MAX_LOCALMODELS; i++)
123  LMs[i] = localModel_t();
124  pathMap = pathing_t();
125  }
127 
128 extern clientBattleScape_t cl;
129 
130 le_t* CL_BattlescapeSearchAtGridPos(const pos3_t pos, bool includingStunned, const le_t* actor);
131 bool CL_OnBattlescape(void);
132 bool CL_BattlescapeRunning(void);
133 int CL_GetHitProbability(const le_t* actor);
134 bool CL_OutsideMap(const vec3_t impact, const float delta);
135 int CL_CountVisibleEnemies(void);
136 char* CL_GetConfigString(int index);
138 char* CL_SetConfigString(int index, dbuffer* msg);
139 #ifdef DEBUG
140 void Grid_DumpWholeClientMap_f(void);
141 void Grid_DumpClientRoutes_f(void);
142 #endif
mapTiles_t * mapTiles
int CL_GetHitProbability(const le_t *actor)
Calculates chance to hit if the actor has a fire mode activated.
char * CL_GetConfigString(int index)
local models
bool CL_OutsideMap(const vec3_t impact, const float delta)
Checks whether give position is still inside the map borders.
clientBattleScape_t cl
bool CL_BattlescapeRunning(void)
Check whether we already have actors spawned on the battlefield.
#define nullptr
Definition: cxx.h:53
linkedList_t * chrList
le_t * CL_BattlescapeSearchAtGridPos(const pos3_t pos, bool includingStunned, const le_t *actor)
Searches a local entity at the given position.
This is the structure that should be used for data that is needed for tactical missions only...
bool CL_OnBattlescape(void)
Check whether we are in a tactical mission as server or as client. But this only means that we are ab...
#define MAX_CLIENTS
Definition: q_shared.h:299
a local entity
#define MAX_VAR
Definition: shared.h:36
int CL_CountVisibleEnemies(void)
Counts visible enemies on the battlescape.
#define MAX_TOKEN_CHARS
Definition: defines.h:372
#define MAX_LOCALMODELS
#define MAX_CONFIGSTRINGS
Definition: q_shared.h:330
int CL_GetConfigStringInteger(int index)
pos_t pos3_t[3]
Definition: ufotypes.h:58
QGL_EXTERN GLuint index
Definition: r_gl.h:110
#define MAX_MODELS
Definition: defines.h:100
QGL_EXTERN GLint i
Definition: r_gl.h:113
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition: r_gl.h:110
Definition: grid.h:83
#define MAX_ACTIVETEAM
Definition: defines.h:41
vec_t vec3_t[3]
Definition: ufotypes.h:39
static mapData_t mapData
char * CL_SetConfigString(int index, dbuffer *msg)
static mapTiles_t mapTiles
#define MAX_EDICTS
Definition: defines.h:99