don't self-shadow dynamic entities

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4029 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2008-12-16 18:12:12 +00:00
parent 287f6ae331
commit d65c8efd8d
4 changed files with 24 additions and 9 deletions
+15 -7
View File
@@ -56,6 +56,20 @@ void renderclip(entity &e)
glEnable(GL_TEXTURE_2D);
}
void rendermapmodels()
{
loopv(ents)
{
entity &e = ents[i];
if(e.type==MAPMODEL)
{
mapmodelinfo &mmi = getmminfo(e.attr2);
if(!&mmi) continue;
rendermodel(mmi.name, ANIM_MAPMODEL|ANIM_LOOP, e.attr4, 0, vec(e.x, e.y, (float)S(e.x, e.y)->floor+mmi.zoff+e.attr3), (float)((e.attr1+7)-(e.attr1+7)%15), 0, 10.0f);
}
}
}
void renderentities()
{
if(editmode && !reflecting && !refracting && !stenciling)
@@ -78,13 +92,7 @@ void renderentities()
loopv(ents)
{
entity &e = ents[i];
if(e.type==MAPMODEL)
{
mapmodelinfo &mmi = getmminfo(e.attr2);
if(!&mmi) continue;
rendermodel(mmi.name, ANIM_MAPMODEL|ANIM_LOOP, e.attr4, 0, vec(e.x, e.y, (float)S(e.x, e.y)->floor+mmi.zoff+e.attr3), (float)((e.attr1+7)-(e.attr1+7)%15), 0, 10.0f);
}
else if(isitem(e.type))
if(isitem(e.type))
{
if((!OUTBORD(e.x, e.y) && e.spawned) || editmode)
{
+1
View File
@@ -641,6 +641,7 @@ extern const char *entnames[];
extern void putitems(ucharbuf &p);
extern void pickupeffects(int n, playerent *d);
extern void renderentities();
extern void rendermapmodels();
extern void resetspawns();
extern void setspawn(int i, bool on);
extern void checkitems(playerent *d);
+6 -2
View File
@@ -978,6 +978,12 @@ void gl_drawframe(int w, int h, float changelod, float curfps)
xtraverts = 0;
startmodelbatches();
rendermapmodels();
endmodelbatches();
if(stencilshadow && hasstencil && stencilbits >= 8) drawstencilshadows();
startmodelbatches();
renderentities();
endmodelbatches();
@@ -992,8 +998,6 @@ void gl_drawframe(int w, int h, float changelod, float curfps)
renderbounceents();
endmodelbatches();
if(stencilshadow && hasstencil && stencilbits >= 8) drawstencilshadows();
// Added by Rick: Need todo here because of drawing the waypoints
WaypointClass.Think();
// end add
+2
View File
@@ -355,6 +355,7 @@ void drawstencilshadows()
}
startmodelbatches();
rendermapmodels();
renderentities();
renderclients();
renderbounceents();
@@ -369,6 +370,7 @@ void drawstencilshadows()
glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
startmodelbatches();
rendermapmodels();
renderentities();
renderclients();
renderbounceents();