mirror of
https://github.com/nzp-team/quakec.git
synced 2024-11-26 05:41:20 +00:00
SERVER/PC: Add New Light_Custom() function for dynamic lights.
This commit is contained in:
parent
934e4bacce
commit
5bee39d063
2 changed files with 23 additions and 22 deletions
|
@ -95,4 +95,26 @@ void() light_torch_small_yellow = // Light with small flame & fire sound
|
||||||
void() light_torch_large_yellow = // Light with larger flame & fire sound
|
void() light_torch_large_yellow = // Light with larger flame & fire sound
|
||||||
{ Precache_Set("progs/flame2.mdl"); self.frame = 1; makestatic(self); }
|
{ Precache_Set("progs/flame2.mdl"); self.frame = 1; makestatic(self); }
|
||||||
void() light_flame_small_white = // Light with small flame & fire sound
|
void() light_flame_small_white = // Light with small flame & fire sound
|
||||||
{ Precache_Set("progs/flame2.mdl"); makestatic(self); }
|
{ Precache_Set("progs/flame2.mdl"); makestatic(self); }
|
||||||
|
|
||||||
|
//
|
||||||
|
// --------------------
|
||||||
|
// Spawnable Dynamic Lights
|
||||||
|
// --------------------
|
||||||
|
//
|
||||||
|
#ifdef PC
|
||||||
|
void(entity what, float fullbright, float light_level,
|
||||||
|
float red, float green, float blue) Light_Custom =
|
||||||
|
{
|
||||||
|
if (fullbright)
|
||||||
|
what.effects = what.effects | EF_FULLBRIGHT;
|
||||||
|
|
||||||
|
{
|
||||||
|
what.pflags = PFLAGS_FULLDYNAMIC;
|
||||||
|
what.light_lev = light_level;
|
||||||
|
what.color_x = red;
|
||||||
|
what.color_y = green;
|
||||||
|
what.color_z = blue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -155,27 +155,6 @@ void(entity e) Light_None =
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Light_Custom(e, r, g, b)
|
|
||||||
// For custom Perk Light Effects, generally not recommended
|
|
||||||
// unless you're testing a cool selection of colors and do not
|
|
||||||
// want to constantly recompile the client, or the client is
|
|
||||||
// inaccessible. Only functional on PC/FTE atm (TODO?)
|
|
||||||
//
|
|
||||||
void(entity e, float r, float g, float b) Light_Custom =
|
|
||||||
{
|
|
||||||
e.effects = e.effects | EF_FULLBRIGHT;
|
|
||||||
#ifdef PC
|
|
||||||
{
|
|
||||||
e.pflags = PFLAGS_FULLDYNAMIC;
|
|
||||||
e.light_lev = 100;
|
|
||||||
e.color_x = r/255;
|
|
||||||
e.color_y = g/255;
|
|
||||||
e.color_z = b/255;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// --------------------
|
// --------------------
|
||||||
// Core Perk System
|
// Core Perk System
|
||||||
|
|
Loading…
Reference in a new issue