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

Function renderbatchedmodel

source/src/rendermodel.cpp:608–651  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

606}
607
608void renderbatchedmodel(model *m, batchedmodel &b)
609{
610 modelattach *a = NULL;
611 if(b.attached>=0) a = &modelattached[b.attached];
612
613 if(stenciling)
614 {
615 m->render(b.anim|ANIM_NOSKIN, b.varseed, b.speed, b.basetime, b.o, b.roll, b.yaw, b.pitch, b.d, a, b.scale);
616 return;
617 }
618
619 int x = (int)b.o.x, y = (int)b.o.y;
620 if(!OUTBORD(x, y))
621 {
622 sqr *s = S(x, y);
623 glColor3ub(s->r, s->g, s->b);
624 }
625 else glColor3f(1, 1, 1);
626
627 m->setskin(b.tex);
628
629 if(b.anim&ANIM_TRANSLUCENT)
630 {
631 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
632 m->render(b.anim|ANIM_NOSKIN, b.varseed, b.speed, b.basetime, b.o, b.roll, b.yaw, b.pitch, b.d, a, b.scale);
633 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
634
635 glDepthFunc(GL_LEQUAL);
636 glEnable(GL_BLEND);
637 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
638
639 GLfloat color[4];
640 glGetFloatv(GL_CURRENT_COLOR, color);
641 glColor4f(color[0], color[1], color[2], m->translucency);
642 }
643
644 m->render(b.anim, b.varseed, b.speed, b.basetime, b.o, b.roll, b.yaw, b.pitch, b.d, a, b.scale);
645
646 if(b.anim&ANIM_TRANSLUCENT)
647 {
648 glDepthFunc(GL_LESS);
649 glDisable(GL_BLEND);
650 }
651}
652
653void renderbatchedmodelshadow(model *m, batchedmodel &b)
654{

Callers 2

loopiFunction · 0.85
loopvFunction · 0.85

Calls 2

renderMethod · 0.45
setskinMethod · 0.45

Tested by

no test coverage detected