示例#1
0
/**
 * @brief Activates the map render screen (ca_active)
 * @sa SCR_EndLoadingPlaque
 * @sa G_ClientBegin
 * @note EV_START
 */
void CL_StartGame (const eventRegister_t* self, dbuffer* msg)
{
	const int isTeamPlay = NET_ReadByte(msg);

	/* init camera position and angles */
	OBJZERO(cl.cam);
	VectorSet(cl.cam.angles, 60.0, 60.0, 0.0);
	VectorSet(cl.cam.omega, 0.0, 0.0, 0.0);
	cl.cam.zoom = 1.25;
	CL_ViewCalcFieldOfViewX();

	Com_Printf("Starting the game...\n");

	/* make sure selActor is null (after reconnect or server change this is needed) */
	CL_ActorSelect(nullptr);

	/* center on first actor */
	cl_worldlevel->modified = true;
	if (cl.numTeamList) {
		const le_t* le = cl.teamList[0];
		CL_ViewCenterAtGridPosition(le->pos);
	}

	/* activate the renderer */
	CL_SetClientState(ca_active);

	GAME_StartBattlescape(isTeamPlay);
}
void CL_CenterView (const eventRegister_t *self, dbuffer *msg)
{
	pos3_t pos;

	NET_ReadFormat(msg, self->formatString, &pos);
	CL_ViewCenterAtGridPosition(pos);
}