UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
client.h
Go to the documentation of this file.
1 
6 /*
7 All original material Copyright (C) 2002-2020 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 */
69  char serverport[16];
75 
77  int team;
85 
87 #ifndef NO_HTTP
90  CURL* curl;
91 #endif
92  char downloadServer[512];
93  char downloadReferer[32];
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);
int currentSelectedMap
Definition: client.h:80
keydest_t
Definition: cl_keys.h:181
Video driver defs.
InventoryInterface i
Definition: client.h:101
int teamSaveSlotIndex
Definition: client.h:78
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
Definition: cvar.h:71
bool isOurRound() const
Definition: client.h:106
int nextUniqueCharacterNumber
Definition: client.h:99
bool downloadMaps
Definition: client.h:86
void CL_Disconnect(void)
Sets the cls.state to ca_disconnected and informs the server.
Definition: cl_main.cpp:257
cvar_t * cl_teamnum
Definition: cl_main.cpp:81
void CL_SetClientState(connstate_t state)
Sets the client state.
Definition: cl_main.cpp:1016
char downloadServer[512]
Definition: client.h:92
dlqueue_t * downloadQueue
Definition: client.h:88
const struct cgame_export_s * gametype
Definition: client.h:65
#define MAX_OSPATH
Definition: filesys.h:44
connstate_t
Definition: cl_shared.h:74
int connectTime
Definition: client.h:70
Share stuff between the different cgame implementations.
Header file for keyboard handler.
cvar_t * cl_fps
Definition: cl_main.cpp:71
cvar_t * cl_selected
Definition: cl_main.cpp:73
float frametime
Definition: client.h:59
Definition: http.h:40
char serverport[16]
Definition: client.h:69
model_t * modelPool[MAX_OBJDEFS]
Definition: client.h:96
#define MAX_VAR
Definition: shared.h:36
dlhandle_t HTTPHandles[4]
Definition: client.h:89
External (non-keyboard) input devices.
int reconnectTime
Definition: client.h:71
size_t downloadPosition
Definition: client.h:83
#define MAX_OBJDEFS
Definition: inv_shared.h:37
#define MAX_ACTORSKINNAME
Definition: r_model.h:66
clientBattleScape_t cl
char downloadReferer[32]
Definition: client.h:93
struct net_stream * netStream
Definition: client.h:74
int waitingForStart
Definition: client.h:72
int disableScreen
Definition: client.h:63
cvar_t * s_language
Definition: common.cpp:54
client_static_t cls
Definition: cl_main.cpp:83
Not cleared on a map change (static data)
Definition: client.h:54
int CL_GetClientState(void)
Definition: cl_main.cpp:1008
void * cgameLibrary
Definition: client.h:112
actorSkin_t actorSkins[MAX_ACTORSKINNAME]
Definition: client.h:103
unsigned int numActorSkins
Definition: client.h:104
void CL_Init(void)
Definition: cl_main.cpp:1142
float framerate
Definition: client.h:60
CURL * curl
Definition: client.h:90
Specifies sound API?
int downloadPercent
Definition: client.h:84
struct client_static_s client_static_t
Not cleared on a map change (static data)
connstate_t state
Definition: client.h:55
Brush model header file.
char servername[MAX_VAR]
Definition: client.h:68
int realtime
Definition: client.h:58
char downloadName[MAX_OSPATH]
Definition: client.h:82
keydest_t keyDest
Definition: client.h:56