MCPcopy Create free account
hub / github.com/assaultcube/AC / renderbatchedmodelshadow

Function renderbatchedmodelshadow

source/src/rendermodel.cpp:653–674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

651}
652
653void renderbatchedmodelshadow(model *m, batchedmodel &b)
654{
655 int x = (int)b.o.x, y = (int)b.o.y;
656 if(OUTBORD(x, y)) return;
657 sqr *s = S(x, y);
658 vec center(b.o.x, b.o.y, s->floor);
659 if(s->type==FHF) center.z -= s->vdelta/4.0f;
660 if(dynshadowquad && center.z-0.1f>b.o.z) return;
661 center.z += 0.1f;
662 modelattach *a = NULL;
663 if(b.attached>=0) a = &modelattached[b.attached];
664 float intensity = dynshadow/100.0f;
665 if(dynshadowdecay) switch(b.anim&ANIM_INDEX)
666 {
667 case ANIM_DECAY:
668 case ANIM_LYING_DEAD:
669 intensity *= max(1.0f - float(lastmillis - b.basetime)/dynshadowdecay, 0.0f);
670 break;
671 }
672 glColor4f(0, 0, 0, intensity);
673 m->rendershadow(b.anim, b.varseed, b.speed, b.basetime, dynshadowquad ? center : b.o, b.yaw, a);
674}
675
676static int sortbatchedmodels(const batchedmodel *x, const batchedmodel *y)
677{

Callers 1

loopiFunction · 0.85

Calls 2

maxFunction · 0.85
rendershadowMethod · 0.45

Tested by

no test coverage detected