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