UFO: Alien Invasion
Loading...
Searching...
No Matches
e_event_startgame.cpp
Go to the documentation of this file.
1
4
5/*
6Copyright (C) 2002-2025 UFO: Alien Invasion.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, 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"
31#include "../../../cl_actor.h"
32#include "e_event_startgame.h"
33
40void 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;
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];
61 }
62
63 /* activate the renderer */
65
66 GAME_StartBattlescape(isTeamPlay);
67}
bool CL_ActorSelect(le_t *le)
Selects an actor.
Definition cl_actor.cpp:440
clientBattleScape_t cl
void GAME_StartBattlescape(bool isTeamPlay)
Called when the server sends the EV_START event.
Definition cl_game.cpp:1296
Shared game type headers.
cvar_t * cl_worldlevel
Definition cl_hud.cpp:46
HUD related routines.
void CL_SetClientState(connstate_t state)
Sets the client state.
Definition cl_main.cpp:1015
@ ca_active
Definition cl_shared.h:80
void CL_ViewCenterAtGridPosition(const pos3_t pos)
Centers the camera on a given grid field.
Definition cl_view.cpp:289
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
Primary header for client.
void Com_Printf(const char *const fmt,...)
Definition common.cpp:428
void CL_StartGame(const eventRegister_t *self, dbuffer *msg)
Activates the map render screen (ca_active).
int NET_ReadByte(dbuffer *buf)
Reads a byte from the netchannel.
Definition netpack.cpp:234
#define OBJZERO(obj)
Definition shared.h:178
Struct that defines one particular event with all its callbacks and data.
Definition e_main.h:42
a local entity
pos3_t pos
#define VectorSet(v, x, y, z)
Definition vector.h:59