00001 00006 /* 00007 All original material Copyright (C) 2002-2010 UFO: Alien Invasion. 00008 00009 Original file from Quake 2 v3.21: quake2-2.31/client/client.h 00010 Copyright (C) 1997-2001 Id Software, Inc. 00011 00012 This program is free software; you can redistribute it and/or 00013 modify it under the terms of the GNU General Public License 00014 as published by the Free Software Foundation; either version 2 00015 of the License, or (at your option) any later version. 00016 00017 This program is distributed in the hope that it will be useful, 00018 but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00020 00021 See the GNU General Public License for more details. 00022 00023 You should have received a copy of the GNU General Public License 00024 along with this program; if not, write to the Free Software 00025 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00026 00027 */ 00028 00029 #ifndef CLIENT_CLIENT_H 00030 #define CLIENT_CLIENT_H 00031 00032 #include "cl_shared.h" 00033 #include "cl_renderer.h" 00034 #include "cl_video.h" 00035 #include "cl_team.h" 00036 #include "sound/s_main.h" 00037 #include "input/cl_input.h" 00038 #include "input/cl_keys.h" 00039 #include "battlescape/cl_camera.h" 00040 #include "battlescape/cl_localentity.h" 00041 #include "battlescape/cl_battlescape.h" 00042 #include "../game/inventory.h" 00043 00044 typedef enum { 00045 ca_uninitialized, 00046 ca_disconnected, 00047 ca_sequence, 00048 ca_connecting, 00049 ca_connected, 00050 ca_active 00051 } connstate_t; 00052 00060 typedef struct client_static_s { 00061 connstate_t state; 00062 keydest_t keyDest; 00063 00064 int realtime; 00065 float frametime; 00066 float framerate; 00067 00069 float disableScreen; 00070 00071 int gametype; 00073 /* connection information */ 00074 char servername[MAX_VAR]; 00075 char serverport[16]; 00076 int connectTime; 00077 int waitingForStart; 00079 struct datagram_socket *netDatagramSocket; 00080 struct net_stream *netStream; 00081 00082 int challenge; 00085 int team; 00087 float loadingPercent; 00088 char loadingMessages[96]; 00089 00090 int currentSelectedMap; 00092 char downloadName[MAX_OSPATH]; 00093 size_t downloadPosition; 00094 int downloadPercent; 00095 00096 qboolean downloadMaps; 00097 dlqueue_t downloadQueue; 00098 dlhandle_t HTTPHandles[4]; 00099 char downloadServer[512]; 00100 char downloadReferer[32]; 00101 CURL *curl; 00102 00104 struct model_s *modelPool[MAX_OBJDEFS]; 00105 00107 s_sample_t *soundPool[MAX_SOUNDIDS]; 00108 00109 /* unique character id */ 00110 int nextUniqueCharacterNumber; 00111 00112 inventoryInterface_t i; 00113 00114 customSkin_t customSkins[MAX_CUSTOMSKIN]; 00115 int numCustomSkins; 00116 00118 mapDef_t mds[MAX_MAPDEFS]; 00119 int numMDs; 00120 mapDef_t *currentMD; 00121 } client_static_t; 00122 00123 extern client_static_t cls; 00124 00125 extern memPool_t *cl_genericPool; 00126 extern memPool_t *cl_ircSysPool; 00127 extern memPool_t *cl_soundSysPool; 00128 00129 /*============================================================================= */ 00130 00131 /* cvars */ 00132 extern cvar_t *cl_fps; 00133 extern cvar_t *cl_selected; 00134 extern cvar_t *cl_team; 00135 extern cvar_t *cl_teamnum; 00136 00137 extern cvar_t *s_language; 00138 00139 /* cl_main.c */ 00140 void CL_SetClientState(int state); 00141 void CL_Disconnect(void); 00142 void CL_Init(void); 00143 00144 #endif /* CLIENT_CLIENT_H */