UFO: Alien Invasion
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
e_event_startgame.cpp
Go to the documentation of this file.
1
5
/*
6
Copyright (C) 2002-2020 UFO: Alien Invasion.
7
8
This program is free software; you can redistribute it and/or
9
modify it under the terms of the GNU General Public License
10
as published by the Free Software Foundation; either version 2
11
of the License, or (at your option) any later version.
12
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17
See the GNU General Public License for more details.
18
19
You should have received a copy of the GNU General Public License
20
along with this program; if not, write to the Free Software
21
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23
*/
24
25
26
#include "../../../../client.h"
27
#include "../../../cl_view.h"
28
#include "../../../cl_hud.h"
29
#include "../../../../cgame/cl_game.h"
30
#include "../../../cl_localentity.h"
31
#include "../../../cl_actor.h"
32
#include "
e_event_startgame.h
"
33
40
void
CL_StartGame
(
const
eventRegister_t
*
self
,
dbuffer
* msg)
41
{
42
const
int
isTeamPlay =
NET_ReadByte
(msg);
43
44
/* init camera position and angles */
45
OBJZERO
(
cl
.
cam
);
46
VectorSet
(
cl
.
cam
.
angles
, 60.0, 60.0, 0.0);
47
VectorSet
(
cl
.
cam
.
omega
, 0.0, 0.0, 0.0);
48
cl
.
cam
.
zoom
= 1.25;
49
CL_ViewCalcFieldOfViewX
();
50
51
Com_Printf
(
"Starting the game...\n"
);
52
53
/* make sure selActor is null (after reconnect or server change this is needed) */
54
CL_ActorSelect
(
nullptr
);
55
56
/* center on first actor */
57
cl_worldlevel
->
modified
=
true
;
58
if
(
cl
.
numTeamList
) {
59
const
le_t
* le =
cl
.
teamList
[0];
60
CL_ViewCenterAtGridPosition
(le->
pos
);
61
}
62
63
/* activate the renderer */
64
CL_SetClientState
(
ca_active
);
65
66
GAME_StartBattlescape
(isTeamPlay);
67
}
VectorSet
#define VectorSet(v, x, y, z)
Definition:
vector.h:59
clientBattleScape_s::cam
camera_t cam
Definition:
cl_battlescape.h:41
le_s::pos
pos3_t pos
Definition:
cl_localentity.h:72
CL_ViewCenterAtGridPosition
void CL_ViewCenterAtGridPosition(const pos3_t pos)
Centers the camera on a given grid field.
Definition:
cl_view.cpp:289
GAME_StartBattlescape
void GAME_StartBattlescape(bool isTeamPlay)
Called when the server sends the EV_START event.
Definition:
cl_game.cpp:1487
e_event_startgame.h
Com_Printf
void Com_Printf(const char *const fmt,...)
Definition:
common.cpp:386
dbuffer
Definition:
dbuffer.h:19
ca_active
Definition:
cl_shared.h:79
clientBattleScape_s::numTeamList
int numTeamList
Definition:
cl_battlescape.h:44
cl_worldlevel
cvar_t * cl_worldlevel
Definition:
cl_hud.cpp:46
OBJZERO
#define OBJZERO(obj)
Definition:
shared.h:178
cl
clientBattleScape_t cl
Definition:
cl_battlescape.cpp:29
CL_ActorSelect
bool CL_ActorSelect(le_t *le)
Selects an actor.
Definition:
cl_actor.cpp:440
CL_ViewCalcFieldOfViewX
void CL_ViewCalcFieldOfViewX(void)
Calculates refdef's FOV_X. Should generally be called after any changes are made to the zoom level (v...
Definition:
cl_view.cpp:189
eventRegister_s
Struct that defines one particular event with all its callbacks and data.
Definition:
e_main.h:42
le_s
a local entity
Definition:
cl_localentity.h:66
CL_SetClientState
void CL_SetClientState(connstate_t state)
Sets the client state.
Definition:
cl_main.cpp:1016
camera_s::angles
vec3_t angles
Definition:
cl_camera.h:34
camera_s::zoom
float zoom
Definition:
cl_camera.h:39
clientBattleScape_s::teamList
le_t * teamList[MAX_ACTIVETEAM]
Definition:
cl_battlescape.h:43
cvar_s::modified
bool modified
Definition:
cvar.h:79
camera_s::omega
vec3_t omega
Definition:
cl_camera.h:35
NET_ReadByte
int NET_ReadByte(dbuffer *buf)
Reads a byte from the netchannel.
Definition:
netpack.cpp:234
CL_StartGame
void CL_StartGame(const eventRegister_t *self, dbuffer *msg)
Activates the map render screen (ca_active)
Definition:
e_event_startgame.cpp:40
src
client
battlescape
events
event
player
e_event_startgame.cpp
Generated on Mon Feb 24 2020 05:28:03 for UFO: Alien Invasion by
1.8.8