UFO: Alien Invasion
Loading...
Searching...
No Matches
e_event_startgame.cpp
Go to the documentation of this file.
1
4
5
/*
6
Copyright (C) 2002-2025 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
}
CL_ActorSelect
bool CL_ActorSelect(le_t *le)
Selects an actor.
Definition
cl_actor.cpp:440
cl_actor.h
cl
clientBattleScape_t cl
Definition
cl_battlescape.cpp:29
GAME_StartBattlescape
void GAME_StartBattlescape(bool isTeamPlay)
Called when the server sends the EV_START event.
Definition
cl_game.cpp:1296
cl_game.h
Shared game type headers.
cl_worldlevel
cvar_t * cl_worldlevel
Definition
cl_hud.cpp:46
cl_hud.h
HUD related routines.
cl_localentity.h
CL_SetClientState
void CL_SetClientState(connstate_t state)
Sets the client state.
Definition
cl_main.cpp:1015
ca_active
@ ca_active
Definition
cl_shared.h:80
CL_ViewCenterAtGridPosition
void CL_ViewCenterAtGridPosition(const pos3_t pos)
Centers the camera on a given grid field.
Definition
cl_view.cpp:289
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
cl_view.h
dbuffer
Definition
dbuffer.h:20
client.h
Primary header for client.
Com_Printf
void Com_Printf(const char *const fmt,...)
Definition
common.cpp:428
CL_StartGame
void CL_StartGame(const eventRegister_t *self, dbuffer *msg)
Activates the map render screen (ca_active).
Definition
e_event_startgame.cpp:40
e_event_startgame.h
NET_ReadByte
int NET_ReadByte(dbuffer *buf)
Reads a byte from the netchannel.
Definition
netpack.cpp:234
OBJZERO
#define OBJZERO(obj)
Definition
shared.h:178
eventRegister_t
Struct that defines one particular event with all its callbacks and data.
Definition
e_main.h:42
le_t
a local entity
Definition
cl_localentity.h:65
le_t::pos
pos3_t pos
Definition
cl_localentity.h:71
VectorSet
#define VectorSet(v, x, y, z)
Definition
vector.h:59
src
client
battlescape
events
event
player
e_event_startgame.cpp
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.16.1