e_event_startgame.c

Go to the documentation of this file.
00001 
00005 /*
00006 Copyright (C) 2002-2010 UFO: Alien Invasion.
00007 
00008 This program is free software; you can redistribute it and/or
00009 modify it under the terms of the GNU General Public License
00010 as published by the Free Software Foundation; either version 2
00011 of the License, or (at your option) any later version.
00012 
00013 This program is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016 
00017 See the GNU General Public License for more details.
00018 
00019 You should have received a copy of the GNU General Public License
00020 along with this program; if not, write to the Free Software
00021 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00023 */
00024 
00025 
00026 #include "../../../../client.h"
00027 #include "../../../../ui/ui_main.h"
00028 #include "../../../cl_view.h"
00029 #include "../../../cl_hud.h"
00030 #include "../../../../cl_game.h"
00031 #include "../../../cl_localentity.h"
00032 #include "../../../cl_actor.h"
00033 #include "e_event_startgame.h"
00034 
00041 void CL_StartGame (const eventRegister_t *self, struct dbuffer *msg)
00042 {
00043     const int isTeamPlay = NET_ReadByte(msg);
00044 
00045     /* init camera position and angles */
00046     memset(&cl.cam, 0, sizeof(cl.cam));
00047     VectorSet(cl.cam.angles, 60.0, 60.0, 0.0);
00048     VectorSet(cl.cam.omega, 0.0, 0.0, 0.0);
00049     cl.cam.zoom = 1.25;
00050     CL_ViewCalcFieldOfViewX();
00051 
00052     Com_Printf("Starting the game...\n");
00053 
00054     /* make sure selActor is null (after reconnect or server change this is needed) */
00055     CL_ActorSelect(NULL);
00056 
00057     /* center on first actor */
00058     cl_worldlevel->modified = qtrue;
00059     if (cl.numTeamList) {
00060         const le_t *le = cl.teamList[0];
00061         CL_ViewCenterAtGridPosition(le->pos);
00062     }
00063 
00064     /* activate the renderer */
00065     CL_SetClientState(ca_active);
00066 
00067     GAME_StartBattlescape(isTeamPlay);
00068 
00069     /* get rid of loading plaque */
00070     SCR_EndLoadingPlaque();
00071 }
00072 

Generated by  doxygen 1.6.2