e_event_particleappear.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 #include "../../../../client.h"
00026 #include "../../../cl_localentity.h"
00027 #include "../../../cl_particle.h"
00028 #include "e_event_particleappear.h"
00029 
00037 void CL_ParticleAppear (const eventRegister_t *self, struct dbuffer *msg)
00038 {
00039     char particle[MAX_VAR];
00040     int entnum, levelflags;
00041     le_t* le;
00042 
00043     /* read data */
00044     NET_ReadFormat(msg, self->formatString, &entnum, &levelflags, particle, sizeof(particle));
00045 
00046     le = LE_Get(entnum);
00047     if (!le)
00048         LE_NotFoundError(entnum);
00049 
00050     /* particles don't have a model to add to the scene - we mark them as invisible and
00051      * only render the particle */
00052     le->invis = !cl_leshowinvis->integer;
00053     le->levelflags = levelflags;
00054     le->particleID = Mem_PoolStrDup(particle, cl_genericPool, 0);
00055     le->ptl = CL_ParticleSpawn(le->particleID, le->levelflags, le->origin, NULL, NULL);
00056     if (!le->ptl)
00057         Com_Printf("Could not spawn particle: '%s'\n", le->particleID);
00058 }

Generated by  doxygen 1.6.2