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

Method render

source/src/vertmodel.h:439–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437 }
438
439 void render(animstate &as, anpos &cur, anpos *prev, float ai_t)
440 {
441 if(!(as.anim&ANIM_NOSKIN))
442 {
443 GLuint id = tex < 0 ? -tex : skin->id;
444 if(tex > 0) id = lookuptexture(tex)->id;
445 if(id != lasttex)
446 {
447 glBindTexture(GL_TEXTURE_2D, id);
448 lasttex = id;
449 }
450 if(enablealphablend) { glDisable(GL_BLEND); enablealphablend = false; }
451 if(skin->bpp == 32 && owner->model->alphatest > 0)
452 {
453 if(!enablealphatest) { glEnable(GL_ALPHA_TEST); enablealphatest = true; }
454 if(lastalphatest != owner->model->alphatest)
455 {
456 glAlphaFunc(GL_GREATER, owner->model->alphatest);
457 lastalphatest = owner->model->alphatest;
458 }
459 }
460 else if(enablealphatest) { glDisable(GL_ALPHA_TEST); enablealphatest = false; }
461 if(!enabledepthmask) { glDepthMask(GL_TRUE); enabledepthmask = true; }
462 }
463
464 if(enableoffset)
465 {
466 disablepolygonoffset(GL_POLYGON_OFFSET_FILL);
467 enableoffset = false;
468 }
469
470 bool isstat = as.frame==0 && as.range==1;
471 if(isstat && statlist && !stenciling)
472 {
473 glCallList(statlist);
474 xtraverts += statlen;
475 return;
476 }
477 else if(stenciling==1)
478 {
479 bb curbb;
480 getcurbb(curbb, as, cur, prev, ai_t);
481 glmatrixf mat;
482 mat.mul(mvpmatrix, matrixstack[matrixpos]);
483 if(!addshadowbox(curbb.low, curbb.high, shadowpos, mat)) return;
484 }
485
486 vec *buf = verts;
487 dyncacheentry *d = NULL;
488 if(!isstat)
489 {
490 d = gendynverts(as, cur, prev, ai_t);
491 if(!d) return;
492 buf = d->verts();
493 }
494 if(lastvertexarray != buf)
495 {
496 if(!lastvertexarray) glEnableClientState(GL_VERTEX_ARRAY);

Callers 2

renderMethod · 0.45
loopiMethod · 0.45

Calls 7

lookuptextureFunction · 0.85
disablepolygonoffsetFunction · 0.85
addshadowboxFunction · 0.85
mulMethod · 0.80
numidxsMethod · 0.80
idxsMethod · 0.80
vertsMethod · 0.45

Tested by

no test coverage detected