| 700 | } |
| 701 | |
| 702 | void 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 | |
| 754 | VARP(popdeadplayers, 0, 0, 1); |
| 755 | void 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) |
no test coverage detected