From: vortex Date: Sun, 17 Oct 2010 22:26:24 +0000 (+0000) Subject: Fix sprites whose name begins from ! (assumed lit sprites) to be actually lit with... X-Git-Tag: xonotic-v0.1.0preview~56^2~72 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6ce1bf66db6a9a49886ce9b929bedbb89841cebd;p=xonotic%2Fdarkplaces.git Fix sprites whose name begins from ! (assumed lit sprites) to be actually lit with modellight/lightgrid, they are still not lit by realtime lightning at all. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10545 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/r_sprites.c b/r_sprites.c index 64401e40..fbcd8b36 100644 --- a/r_sprites.c +++ b/r_sprites.c @@ -384,6 +384,10 @@ void R_Model_Sprite_Draw_TransparentCallback(const entity_render_t *ent, const r frame = model->sprite.sprdata_frames + ent->frameblend[i].subframe; texture = R_GetCurrentTexture(model->data_textures + ent->frameblend[i].subframe); + // lit sprite by lightgrid if it is not fullbright, lit only ambient + if (!(texture->currentmaterialflags & MATERIALFLAG_FULLBRIGHT)) + VectorAdd(ent->modellight_ambient, ent->modellight_diffuse, rsurface.modellight_ambient); + // SPR_LABEL should not use depth test AT ALL if(model->sprite.sprnum_type == SPR_LABEL || model->sprite.sprnum_type == SPR_LABEL_SCALE) if(texture->currentmaterialflags & MATERIALFLAG_SHORTDEPTHRANGE)