Client side entity spawning from map entity string. More...
#include "../client.h"
#include "../cl_game.h"
#include "cl_particle.h"
#include "cl_spawn.h"
#include "../../shared/parse.h"
Go to the source code of this file.
Data Structures | |
struct | localEntityParse_t |
struct | spawn_t |
Defines | |
#define | MISC_MODEL_GLOW 9 |
#define | SPAWNFLAG_NO_DAY 8 |
#define | MIN_AMBIENT_COMPONENT 0.1 |
#define | MIN_AMBIENT_SUM 1.25 |
Functions | |
static void | SP_worldspawn (const localEntityParse_t *entData) |
static void | SP_misc_model (const localEntityParse_t *entData) |
static void | SP_misc_particle (const localEntityParse_t *entData) |
static void | SP_misc_sound (const localEntityParse_t *entData) |
static void | SP_light (const localEntityParse_t *entData) |
static void | CL_SpawnCall (const localEntityParse_t *entData) |
Finds the spawn function for the entity and calls it. | |
void | CL_SpawnParseEntitystring (void) |
Parse the map entity string and spawns those entities that are client-side only. | |
Variables | |
static r_light_t | sun |
static const value_t | localEntityValues [] |
static const spawn_t | spawns [] |
Client side entity spawning from map entity string.
Definition in file cl_spawn.c.
#define MIN_AMBIENT_COMPONENT 0.1 |
Definition at line 216 of file cl_spawn.c.
Referenced by SP_worldspawn().
#define MIN_AMBIENT_SUM 1.25 |
Definition at line 217 of file cl_spawn.c.
Referenced by SP_worldspawn().
#define MISC_MODEL_GLOW 9 |
#define SPAWNFLAG_NO_DAY 8 |
Definition at line 35 of file cl_spawn.c.
Referenced by SP_misc_particle(), and SP_misc_sound().
static void CL_SpawnCall | ( | const localEntityParse_t * | entData | ) | [static] |
Finds the spawn function for the entity and calls it.
Definition at line 123 of file cl_spawn.c.
References localEntityParse_t::classname, spawn_t::name, and spawn_t::spawn.
Referenced by CL_SpawnParseEntitystring().
void CL_SpawnParseEntitystring | ( | void | ) |
Parse the map entity string and spawns those entities that are client-side only.
Definition at line 145 of file cl_spawn.c.
References localEntityParse_t::attenuation, cl, CL_SpawnCall(), Com_EParseValue(), Com_Error(), Com_Parse(), localEntityParse_t::entnum, localEntityParse_t::entStringPos, ERR_DROP, LM_Think(), localEntityParse_t::maxLevel, localEntityParse_t::maxMultiplayerTeams, value_s::ofs, PATHFINDING_HEIGHT, R_AddLightsource(), localEntityParse_t::scale, value_s::size, SND_VOLUME_DEFAULT, SOUND_ATTN_IDLE, value_s::string, TEAM_MAX_HUMAN, value_s::type, VectorSet, and localEntityParse_t::volume.
Referenced by CL_ViewLoadMedia().
static void SP_light | ( | const localEntityParse_t * | entData | ) | [static] |
entData |
Definition at line 327 of file cl_spawn.c.
References localEntityParse_t::color, r_light_s::diffuseColor, r_light_s::enabled, r_light_s::loc, localEntityParse_t::origin, qtrue, R_AddLightsource(), and VectorCopy.
static void SP_misc_model | ( | const localEntityParse_t * | entData | ) | [static] |
Definition at line 268 of file cl_spawn.c.
References localEntityParse_t::angles, localEntityParse_t::anim, localModel_s::animname, Com_Error(), Com_Printf(), localEntityParse_t::entnum, ERR_DROP, localEntityParse_t::frame, localModel_s::frame, localModel_s::id, LM_AddModel(), LM_GetByID(), LMT_Init(), MISC_MODEL_GLOW, localEntityParse_t::model, localEntityParse_t::origin, Q_strncpyz(), RF_PULSE, localEntityParse_t::scale, localEntityParse_t::skin, localModel_s::skin, localEntityParse_t::spawnflags, localEntityParse_t::tagname, localModel_s::tagname, localEntityParse_t::target, localModel_s::target, localEntityParse_t::targetname, and localModel_s::think.
static void SP_misc_particle | ( | const localEntityParse_t * | entData | ) | [static] |
Definition at line 309 of file cl_spawn.c.
References CL_AddMapParticle(), CL_GetConfigStringInteger(), CS_LIGHTMAP, localEntityParse_t::entStringPos, localEntityParse_t::origin, localEntityParse_t::particle, SPAWNFLAG_NO_DAY, localEntityParse_t::spawnflags, and localEntityParse_t::wait.
static void SP_misc_sound | ( | const localEntityParse_t * | entData | ) | [static] |
Definition at line 316 of file cl_spawn.c.
References localEntityParse_t::attenuation, CL_GetConfigStringInteger(), CS_LIGHTMAP, LE_AddAmbientSound(), localEntityParse_t::noise, localEntityParse_t::origin, SPAWNFLAG_NO_DAY, localEntityParse_t::spawnflags, and localEntityParse_t::volume.
static void SP_worldspawn | ( | const localEntityParse_t * | entData | ) | [static] |
Definition at line 219 of file cl_spawn.c.
References r_light_s::ambientColor, localEntityParse_t::ambientDayColor, localEntityParse_t::ambientNightColor, cl, CL_GetConfigStringInteger(), cl_teamnum, Com_Printf(), r_light_s::constantAttenuation, CS_LIGHTMAP, Cvar_SetValue(), r_light_s::diffuseColor, r_light_s::enabled, GAME_IsMultiplayer, i, cvar_s::integer, r_light_s::linearAttenuation, r_light_s::loc, localEntityParse_t::maxLevel, localEntityParse_t::maxMultiplayerTeams, MIN_AMBIENT_COMPONENT, MIN_AMBIENT_SUM, qtrue, r_light_s::quadraticAttenuation, r_light_s::specularColor, TEAM_CIVILIAN, TEAM_DEFAULT, Vector4Set, VectorCopy, VectorScale, and VectorSum.
const value_t localEntityValues[] [static] |
{ {"skin", V_INT, offsetof(localEntityParse_t, skin), MEMBER_SIZEOF(localEntityParse_t, skin)}, {"maxteams", V_INT, offsetof(localEntityParse_t, maxteams), MEMBER_SIZEOF(localEntityParse_t, maxteams)}, {"spawnflags", V_INT, offsetof(localEntityParse_t, spawnflags), MEMBER_SIZEOF(localEntityParse_t, spawnflags)}, {"maxlevel", V_INT, offsetof(localEntityParse_t, maxLevel), MEMBER_SIZEOF(localEntityParse_t, maxLevel)}, {"attenuation", V_FLOAT, offsetof(localEntityParse_t, attenuation), MEMBER_SIZEOF(localEntityParse_t, attenuation)}, {"volume", V_FLOAT, offsetof(localEntityParse_t, volume), MEMBER_SIZEOF(localEntityParse_t, volume)}, {"frame", V_INT, offsetof(localEntityParse_t, frame), MEMBER_SIZEOF(localEntityParse_t, frame)}, {"angle", V_FLOAT, offsetof(localEntityParse_t, angle), MEMBER_SIZEOF(localEntityParse_t, angle)}, {"wait", V_POS, offsetof(localEntityParse_t, wait), MEMBER_SIZEOF(localEntityParse_t, wait)}, {"angles", V_VECTOR, offsetof(localEntityParse_t, angles), MEMBER_SIZEOF(localEntityParse_t, angles)}, {"origin", V_VECTOR, offsetof(localEntityParse_t, origin), MEMBER_SIZEOF(localEntityParse_t, origin)}, {"color", V_VECTOR, offsetof(localEntityParse_t, color), MEMBER_SIZEOF(localEntityParse_t, color)}, {"modelscale_vec", V_VECTOR, offsetof(localEntityParse_t, scale), MEMBER_SIZEOF(localEntityParse_t, scale)}, {"wait", V_POS, offsetof(localEntityParse_t, wait), MEMBER_SIZEOF(localEntityParse_t, wait)}, {"classname", V_STRING, offsetof(localEntityParse_t, classname), 0}, {"model", V_STRING, offsetof(localEntityParse_t, model), 0}, {"anim", V_STRING, offsetof(localEntityParse_t, anim), 0}, {"particle", V_STRING, offsetof(localEntityParse_t, particle), 0}, {"noise", V_STRING, offsetof(localEntityParse_t, noise), 0}, {"tag", V_STRING, offsetof(localEntityParse_t, tagname), 0}, {"target", V_STRING, offsetof(localEntityParse_t, target), 0}, {"targetname", V_STRING, offsetof(localEntityParse_t, targetname), 0}, {"light", V_INT, offsetof(localEntityParse_t, light), MEMBER_SIZEOF(localEntityParse_t, light)}, {"ambient_day", V_VECTOR, offsetof(localEntityParse_t, ambientDayColor), MEMBER_SIZEOF(localEntityParse_t, ambientDayColor)}, {"ambient_night", V_VECTOR, offsetof(localEntityParse_t, ambientNightColor), MEMBER_SIZEOF(localEntityParse_t, ambientNightColor)}, {NULL, 0, 0, 0} }
Definition at line 69 of file cl_spawn.c.
{ {"worldspawn", SP_worldspawn}, {"misc_model", SP_misc_model}, {"misc_particle", SP_misc_particle}, {"misc_sound", SP_misc_sound}, {"light", SP_light}, {NULL, NULL} }
Definition at line 110 of file cl_spawn.c.
Definition at line 31 of file cl_spawn.c.
Referenced by R_Draw3DGlobe().