UFO: Alien Invasion
Doxygen documentation generating
client.h
Go to the documentation of this file.
1 
6 /*
7 All original material Copyright (C) 2002-2023 UFO: Alien Invasion.
8 
9 Original file from Quake 2 v3.21: quake2-2.31/client/client.h
10 Copyright (C) 1997-2001 Id Software, Inc.
11 
12 This program is free software; you can redistribute it and/or
13 modify it under the terms of the GNU General Public License
14 as published by the Free Software Foundation; either version 2
15 of the License, or (at your option) any later version.
16 
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 
21 See the GNU General Public License for more details.
22 
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 
27 */
28 
29 #pragma once
30 
31 #include "cl_shared.h"
32 #include "cl_renderer.h"
33 #include "cl_video.h"
34 #include "cl_team.h"
35 #include "sound/s_main.h"
36 #include "input/cl_input.h"
37 #include "input/cl_keys.h"
38 #include "battlescape/cl_camera.h"
41 #include "../game/inventory.h"
42 #include "renderer/r_model.h"
43 #include "../common/http.h"
44 
45 struct cgame_export_s;
46 
54 typedef struct client_static_s {
57 
58  int realtime;
59  float frametime;
60  float framerate;
61 
64 
65  const struct cgame_export_s* gametype;
67  /* connection information */
68  char servername[MAX_VAR];
69  char serverport[16];
75 
77  int team;
82  char downloadName[MAX_OSPATH];
85 
87 #ifndef NO_HTTP
89  dlhandle_t HTTPHandles[4];
90  CURL* curl;
91 #endif
92  char downloadServer[512];
93  char downloadReferer[32];
96  model_t* modelPool[MAX_OBJDEFS];
97 
98  /* unique character id */
100 
102 
104  unsigned int numActorSkins;
105 
106  inline bool isOurRound () const
107  {
108  return team == cl.actTeam;
109  }
110 
111 #ifndef HARD_LINKED_CGAME
113 #endif
114 
115 #if SDL_VERSION_ATLEAST(2,0,0)
116  SDL_Window* window;
117  SDL_GLContext context;
118 #endif
120 
121 extern client_static_t cls;
122 
123 /*============================================================================= */
124 
125 /* cvars */
126 extern cvar_t* cl_fps;
127 extern cvar_t* cl_selected;
128 extern cvar_t* cl_teamnum;
129 
130 extern cvar_t* s_language;
131 
132 /* cl_main.c */
133 int CL_GetClientState(void);
134 void CL_SetClientState(connstate_t state);
135 void CL_Disconnect(void);
136 void CL_Init(void);
keydest_t
Definition: cl_keys.h:181
Video driver defs.
CURL * curl
Definition: client.h:90
float framerate
Definition: client.h:60
int teamSaveSlotIndex
Definition: client.h:78
const struct cgame_export_s * gametype
Definition: client.h:65
Definition: http.h:40
void CL_Disconnect(void)
Sets the cls.state to ca_disconnected and informs the server.
Definition: cl_main.cpp:256
cvar_t * cl_teamnum
Definition: cl_main.cpp:81
void CL_SetClientState(connstate_t state)
Sets the client state.
Definition: cl_main.cpp:1015
unsigned int numActorSkins
Definition: client.h:104
struct net_stream * netStream
Definition: client.h:74
InventoryInterface i
Definition: client.h:101
#define MAX_OSPATH
Definition: filesys.h:44
int currentSelectedMap
Definition: client.h:80
dlqueue_t * downloadQueue
Definition: client.h:88
keydest_t keyDest
Definition: client.h:56
connstate_t
Definition: cl_shared.h:75
Share stuff between the different cgame implementations.
Header file for keyboard handler.
bool isOurRound() const
Definition: client.h:106
cvar_t * cl_fps
Definition: cl_main.cpp:71
cvar_t * cl_selected
Definition: cl_main.cpp:73
int realtime
Definition: client.h:58
#define MAX_VAR
Definition: shared.h:36
External (non-keyboard) input devices.
#define MAX_OBJDEFS
Definition: inv_shared.h:37
float frametime
Definition: client.h:59
#define MAX_ACTORSKINNAME
Definition: r_model.h:66
clientBattleScape_t cl
int waitingForStart
Definition: client.h:72
int disableScreen
Definition: client.h:63
int downloadPercent
Definition: client.h:84
size_t downloadPosition
Definition: client.h:83
cvar_t * s_language
Definition: common.cpp:54
int connectTime
Definition: client.h:70
client_static_t cls
Definition: cl_main.cpp:83
int CL_GetClientState(void)
Definition: cl_main.cpp:1007
void CL_Init(void)
Definition: cl_main.cpp:1141
int nextUniqueCharacterNumber
Definition: client.h:99
void * cgameLibrary
Definition: client.h:112
Specifies sound API?
Brush model header file.
Not cleared on a map change (static data)
Definition: client.h:54
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
Definition: cvar.h:71
bool downloadMaps
Definition: client.h:86
connstate_t state
Definition: client.h:55
int reconnectTime
Definition: client.h:71