UFO: Alien Invasion
client.h
Go to the documentation of this file.
1
6/*
7All original material Copyright (C) 2002-2022 UFO: Alien Invasion.
8
9Original file from Quake 2 v3.21: quake2-2.31/client/client.h
10Copyright (C) 1997-2001 Id Software, Inc.
11
12This program is free software; you can redistribute it and/or
13modify it under the terms of the GNU General Public License
14as published by the Free Software Foundation; either version 2
15of the License, or (at your option) any later version.
16
17This program is distributed in the hope that it will be useful,
18but WITHOUT ANY WARRANTY; without even the implied warranty of
19MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
21See the GNU General Public License for more details.
22
23You should have received a copy of the GNU General Public License
24along with this program; if not, write to the Free Software
25Foundation, 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"
41#include "../game/inventory.h"
42#include "renderer/r_model.h"
43#include "../common/http.h"
44
45struct cgame_export_s;
46
54typedef struct client_static_s {
57
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
121extern client_static_t cls;
122
123/*============================================================================= */
124
125/* cvars */
126extern cvar_t* cl_fps;
127extern cvar_t* cl_selected;
128extern cvar_t* cl_teamnum;
129
130extern cvar_t* s_language;
131
132/* cl_main.c */
133int CL_GetClientState(void);
135void CL_Disconnect(void);
136void CL_Init(void);
clientBattleScape_t cl
External (non-keyboard) input devices.
Header file for keyboard handler.
keydest_t
Definition: cl_keys.h:181
Share stuff between the different cgame implementations.
connstate_t
Definition: cl_shared.h:75
Video driver defs.
int CL_GetClientState(void)
Definition: cl_main.cpp:1007
cvar_t * s_language
Definition: common.cpp:54
cvar_t * cl_fps
Definition: cl_main.cpp:71
void CL_SetClientState(connstate_t state)
Sets the client state.
Definition: cl_main.cpp:1015
client_static_t cls
Definition: cl_main.cpp:83
cvar_t * cl_selected
Definition: cl_main.cpp:73
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_Init(void)
Definition: cl_main.cpp:1141
#define MAX_OSPATH
Definition: filesys.h:44
#define MAX_OBJDEFS
Definition: inv_shared.h:37
Brush model header file.
#define MAX_ACTORSKINNAME
Definition: r_model.h:66
Specifies sound API?
#define MAX_VAR
Definition: shared.h:36
Not cleared on a map change (static data)
Definition: client.h:54
float frametime
Definition: client.h:59
int waitingForStart
Definition: client.h:72
size_t downloadPosition
Definition: client.h:83
int reconnectTime
Definition: client.h:71
keydest_t keyDest
Definition: client.h:56
connstate_t state
Definition: client.h:55
int nextUniqueCharacterNumber
Definition: client.h:99
struct net_stream * netStream
Definition: client.h:74
int downloadPercent
Definition: client.h:84
int connectTime
Definition: client.h:70
bool isOurRound() const
Definition: client.h:106
const struct cgame_export_s * gametype
Definition: client.h:65
dlqueue_t * downloadQueue
Definition: client.h:88
unsigned int numActorSkins
Definition: client.h:104
int teamSaveSlotIndex
Definition: client.h:78
int currentSelectedMap
Definition: client.h:80
int disableScreen
Definition: client.h:63
int realtime
Definition: client.h:58
void * cgameLibrary
Definition: client.h:112
InventoryInterface i
Definition: client.h:101
CURL * curl
Definition: client.h:90
float framerate
Definition: client.h:60
bool downloadMaps
Definition: client.h:86
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
Definition: cvar.h:71
Definition: http.h:40