dlightradius = max(dlightradius, e->state_current.glowsize * 4);
VectorMA(dlightcolor, (1.0f / 255.0f), (qbyte *)&palette_complete[e->state_current.glowcolor], dlightcolor);
}
- if (e->state_current.light[3])
+ if (e->state_current.lightpflags & PFLAGS_FULLDYNAMIC)
{
- dlightradius = max(dlightradius, e->state_current.light[3]);
+ if (e->state_current.light[3])
+ dlightradius = max(dlightradius, e->state_current.light[3]);
+ else
+ dlightradius = max(dlightradius, 350);
if (VectorLength2(dlightcolor) == 0)
(dlightcolor[0] += 1, dlightcolor[1] += 1, dlightcolor[2] += 1);
else
// hack to make glowing player light shine on their gun
if ((e - cl_entities) == cl.viewentity/* && !chase_active.integer*/)
dlightmatrix.m[2][3] += 30;
- CL_AllocDlight(&e->render, &dlightmatrix, dlightradius, dlightcolor[0], dlightcolor[1], dlightcolor[2], 0, 0, e->state_current.skin >= 16 ? e->state_current.skin : 0, e->state_current.lightstyle, !(e->state_current.lightpflags & 1), 1);
+ CL_AllocDlight(&e->render, &dlightmatrix, dlightradius, dlightcolor[0], dlightcolor[1], dlightcolor[2], 0, 0, e->state_current.skin >= 16 ? e->state_current.skin : 0, e->state_current.lightstyle, !(e->state_current.lightpflags & PFLAGS_NOSHADOW), (e->state_current.lightpflags & PFLAGS_FULLDYNAMIC) ? ((e->state_current.lightpflags & PFLAGS_CORONA) != 0) : 1);
}
// trails need the previous frame
if (e->state_previous.active && e->state_previous.modelindex == e->state_current.modelindex)
V_CalcRefdef();
if (e->render.model && e->render.model->name[0] == '*' && e->render.model->TraceBox)
cl_brushmodel_entities[cl_num_brushmodel_entities++] = &e->render;
+ if (gamemode == GAME_TENEBRAE && e->render.model && e->render.model->type == mod_sprite)
+ e->render.effects |= EF_ADDITIVE;
// don't show entities with no modelindex (note: this still shows
// entities which have a modelindex that resolved to a NULL model)
if (e->render.model && !(e->render.effects & EF_NODRAW) && r_refdef.numentities < r_refdef.maxentities)
#define EF_STEP 0x80000000 // internal client use only - present on MOVETYPE_STEP entities, not QC accessible (too many bits)
+// flags for the pflags field of entities
+#define PFLAGS_NOSHADOW 1
+#define PFLAGS_CORONA 2
+#define PFLAGS_FULLDYNAMIC 128 // must be set or the light fields are ignored
+
// if the high bit of the servercmd is set, the low bits are fast update flags:
#define U_MOREBITS (1<<0)
#define U_ORIGIN1 (1<<1)
void R_Shadow_LoadWorldLightsFromMap_LightArghliteTyrlite(void)
{
- int entnum, style, islight, skin, pflags;
+ int entnum, style, islight, skin, pflags, effects;
char key[256], value[1024];
float origin[3], angles[3], radius, color[3], light, fadescale, lightscale, originhack[3], overridecolor[3];
const char *data;
skin = (int)atof(value);
else if (!strcmp("pflags", key))
pflags = (int)atof(value);
+ else if (!strcmp("effects", key))
+ effects = (int)atof(value);
}
if (light <= 0 && islight)
light = 300;
lightscale = 1;
if (fadescale <= 0)
fadescale = 1;
+ if (gamemode == GAME_TENEBRAE)
+ {
+ if (effects & EF_NODRAW)
+ {
+ pflags |= PFLAGS_FULLDYNAMIC;
+ effects &= ~EF_NODRAW;
+ }
+ }
radius = min(light * r_editlights_quakelightsizescale.value * lightscale / fadescale, 1048576);
light = sqrt(bound(0, light, 1048576)) * (1.0f / 16.0f);
if (color[0] == 1 && color[1] == 1 && color[2] == 1)
VectorCopy(overridecolor, color);
VectorScale(color, light, color);
VectorAdd(origin, originhack, origin);
- if (radius >= 15)
- R_Shadow_NewWorldLight(origin, angles, color, radius, !!(pflags & 2), style, !(pflags & 1), skin >= 16 ? va("cubemaps/%i", skin) : NULL);
+ if (radius >= 15 && !(pflags & PFLAGS_FULLDYNAMIC))
+ R_Shadow_NewWorldLight(origin, angles, color, radius, (pflags & PFLAGS_CORONA) != 0, style, (pflags & PFLAGS_NOSHADOW) == 0, skin >= 16 ? va("cubemaps/%i", skin) : NULL);
}
}
cs.lightstyle = (qbyte)GETEDICTFIELDVALUE(ent, eval_style)->_float;
cs.lightpflags = (qbyte)GETEDICTFIELDVALUE(ent, eval_pflags)->_float;
- cs.specialvisibilityradius = cs.light[3];
+ if (gamemode == GAME_TENEBRAE)
+ {
+ // tenebrae's EF_FULLDYNAMIC conflicts with Q2's EF_NODRAW
+ if (cs.effects & 16)
+ {
+ cs.effects &= ~16;
+ cs.lightpflags |= PFLAGS_FULLDYNAMIC;
+ }
+ // tenebrae's EF_GREEN conflicts with DP's EF_ADDITIVE
+ if (cs.effects & 32)
+ {
+ cs.effects &= ~32;
+ cs.light[0] = 0.2;
+ cs.light[1] = 1;
+ cs.light[2] = 0.2;
+ cs.light[3] = 200;
+ cs.lightpflags |= PFLAGS_FULLDYNAMIC;
+ }
+ }
+
+ cs.specialvisibilityradius = 0;
+ if (cs.lightpflags & PFLAGS_FULLDYNAMIC)
+ cs.specialvisibilityradius = max(cs.specialvisibilityradius, cs.light[3]);
if (cs.glowsize)
cs.specialvisibilityradius = max(cs.specialvisibilityradius, cs.glowsize * 4);
if (cs.flags & RENDER_GLOWTRAIL)
-n darkplaces: net_slist should print out "No network." if networking is not initialized (yummyluv)
d darkplaces: noclipping out the ceiling of q3dm17 crashes (Static_Fiend)
-n darkplaces: remove dead master server from default masters list (yummyluv)
--n darkplaces: revert noclip movement to match nq for compatibility with mods that trap movement as input (MauveBib)
+d darkplaces: revert noclip movement to match nq for compatibility with mods that trap movement as input (MauveBib)
-n darkplaces: segfault reading memory in windows when starting a new server from menu (yummyluv)
-n darkplaces: server is starting before the "port" cvar is set by commandline and scripts? (yummyluv)
-n darkplaces: typing ip in join game menu should show 'trying' and 'no response' after a while, or 'no network' if networking is not initialized (yummyluv)
+d darkplaces: make light_lev dlights from qc require PFLAGS_FULLDYNAMIC flag
+d darkplaces: improve tenebrae compatibility by handling EF_FULLDYNAMIC flag in tenebrae mode, also make all sprites render additive
+0 darkplaces: figure out why bmodels aren't receiving lightmap dlights
d darkplaces: fixed SV_TouchAreaGrid to not crash if SV_IncreaseEdicts is called during a touch function, by making a list of edicts to touch and then running through the list afterward (KGB|romi)
d darkplaces: moved R_ShadowVolumeLighting to r_shadow.c
d darkplaces: added RENDER_LIGHT flag to entity_render_t to make rtlighting optional per entity
d darkplaces: cleaned up rtlight handling, merging most code between world rtlights and dlights
d darkplaces: safety checked lightmap access in Mod_Q1BSP_RecursiveLightPoint as one map Sajt uses was crashing (Sajt)
--n darkplaces: upgrade network protocol to send precise angles, and make EF_LOWPRECISION downgrade both origin and angles (-Urre, -Wazat for Battlemech, FrikaC, -mashakos, RenegadeC, Sajt)
+-n darkplaces: upgrade network protocol to send precise angles, and make EF_LOWPRECISION downgrade both origin and angles (-Urre, -Wazat for Battlemech, FrikaC, mashakos, RenegadeC, Sajt)
-n darkplaces: fix cubemap upload scaling crashes (Urre)
d darkplaces: make screenshots save to screenshots/fniggium%04i.tga in GAME_FNIGGIUM (Sajt)
d darkplaces: make screenshots save to screenshots directory (Sajt)