UFO: Alien Invasion
cl_spawn.cpp File Reference

Client side entity spawning from map entity string. More...

#include "cl_spawn.h"
#include "../client.h"
#include "../cgame/cl_game.h"
#include "cl_particle.h"
#include "../../shared/parse.h"
Include dependency graph for cl_spawn.cpp:

Go to the source code of this file.

Data Structures

struct  localEntityParse_t
 
struct  spawn_t
 

Macros

#define MISC_MODEL_GLOW   9
 
#define SPAWNFLAG_NO_DAY   8
 
#define MIN_AMBIENT_COMPONENT   0.1
 
#define MIN_AMBIENT_SUM   0.50
 

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. More...
 
void CL_SpawnParseEntitystring (void)
 Parse the map entity string and spawns those entities that are client-side only. More...
 

Variables

static const value_t localEntityValues []
 
static const spawn_t spawns []
 

Detailed Description

Client side entity spawning from map entity string.

Definition in file cl_spawn.cpp.

Macro Definition Documentation

◆ MIN_AMBIENT_COMPONENT

#define MIN_AMBIENT_COMPONENT   0.1

Definition at line 110 of file cl_spawn.cpp.

◆ MIN_AMBIENT_SUM

#define MIN_AMBIENT_SUM   0.50

Definition at line 111 of file cl_spawn.cpp.

◆ MISC_MODEL_GLOW

#define MISC_MODEL_GLOW   9

Definition at line 32 of file cl_spawn.cpp.

◆ SPAWNFLAG_NO_DAY

#define SPAWNFLAG_NO_DAY   8

Definition at line 33 of file cl_spawn.cpp.

Function Documentation

◆ CL_SpawnCall()

static void CL_SpawnCall ( const localEntityParse_t entData)
static

Finds the spawn function for the entity and calls it.

Definition at line 288 of file cl_spawn.cpp.

References localEntityParse_t::classname, spawn_t::name, Q_streq, and spawns.

Referenced by CL_SpawnParseEntitystring().

◆ CL_SpawnParseEntitystring()

◆ SP_light()

static void SP_light ( const localEntityParse_t entData)
static
Parameters
entDataThe structure that holds the data we parsed from the script

Definition at line 259 of file cl_spawn.cpp.

References CL_GetConfigStringInteger(), localEntityParse_t::color, CS_LIGHTMAP, localEntityParse_t::light, localEntityParse_t::origin, R_AddStaticLight(), SPAWNFLAG_NO_DAY, and localEntityParse_t::spawnflags.

◆ SP_misc_model()

◆ SP_misc_particle()

◆ SP_misc_sound()

◆ SP_worldspawn()

Variable Documentation

◆ localEntityValues

const value_t localEntityValues[]
static

Definition at line 73 of file cl_spawn.cpp.

Referenced by CL_SpawnParseEntitystring().

◆ spawns

const spawn_t spawns[]
static
Initial value:
= {
{"worldspawn", SP_worldspawn},
{"misc_model", SP_misc_model},
{"misc_particle", SP_misc_particle},
{"misc_sound", SP_misc_sound},
{"light", SP_light},
{nullptr, nullptr}
}
static void SP_light(const localEntityParse_t *entData)
Definition: cl_spawn.cpp:259
static void SP_misc_particle(const localEntityParse_t *entData)
Definition: cl_spawn.cpp:242
static void SP_worldspawn(const localEntityParse_t *entData)
Definition: cl_spawn.cpp:114
static void SP_misc_model(const localEntityParse_t *entData)
Definition: cl_spawn.cpp:203
static void SP_misc_sound(const localEntityParse_t *entData)
Definition: cl_spawn.cpp:249

Definition at line 275 of file cl_spawn.cpp.

Referenced by CL_SpawnCall().