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

Function endmodelbatches

source/src/rendermodel.cpp:702–752  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

700}
701
702void endmodelbatches(bool flush)
703{
704 vector<translucentmodel> translucent;
705 loopi(numbatches)
706 {
707 modelbatch &b = *batches[i];
708 if(b.batched.empty()) continue;
709 loopvj(b.batched) if(b.batched[j].tex) { b.batched.sort(sortbatchedmodels); break; }
710 b.m->startrender();
711 loopvj(b.batched)
712 {
713 batchedmodel &bm = b.batched[j];
714 if(bm.anim&ANIM_TRANSLUCENT)
715 {
716 translucentmodel &tm = translucent.add();
717 tm.m = b.m;
718 tm.batched = &bm;
719 tm.dist = camera1->o.dist(bm.o);
720 continue;
721 }
722 renderbatchedmodel(b.m, bm);
723 }
724 if(dynshadow && b.m->hasshadows() && (!reflecting || refracting) && (!effective_stencilshadow || !hasstencil || stencilbits < 8))
725 {
726 loopvj(b.batched)
727 {
728 batchedmodel &bm = b.batched[j];
729 if(bm.anim&ANIM_TRANSLUCENT) continue;
730 renderbatchedmodelshadow(b.m, bm);
731 }
732 }
733 b.m->endrender();
734 }
735 if(translucent.length())
736 {
737 translucent.sort(sorttranslucentmodels);
738 model *lastmodel = NULL;
739 loopv(translucent)
740 {
741 translucentmodel &tm = translucent[i];
742 if(lastmodel!=tm.m)
743 {
744 if(lastmodel) lastmodel->endrender();
745 (lastmodel = tm.m)->startrender();
746 }
747 renderbatchedmodel(tm.m, *tm.batched);
748 }
749 if(lastmodel) lastmodel->endrender();
750 }
751 if(flush) clearmodelbatches();
752}
753
754VARP(popdeadplayers, 0, 0, 1);
755void rendermodel(const char *mdl, int anim, int tex, float rad, const vec &o, float roll, float yaw, float pitch, float speed, int basetime, playerent *d, modelattach *a, float scale)

Callers 2

gl_drawframeFunction · 0.85
drawstencilshadowsFunction · 0.85

Calls 4

clearmodelbatchesFunction · 0.85
sortMethod · 0.80
lengthMethod · 0.45
endrenderMethod · 0.45

Tested by

no test coverage detected