R_DrawBrushModel
(entity_t e)
| 658 | * R_DrawBrushModel |
| 659 | */ |
| 660 | void R_DrawBrushModel(entity_t e) |
| 661 | { |
| 662 | if (currentmodel.nummodelsurfaces == 0) |
| 663 | return; |
| 664 | |
| 665 | currententity = e; |
| 666 | gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; |
| 667 | |
| 668 | boolean rotated; |
| 669 | if (e.angles[0] != 0 || e.angles[1] != 0 || e.angles[2] != 0) |
| 670 | { |
| 671 | rotated = true; |
| 672 | for (int i=0 ; i<3 ; i++) |
| 673 | { |
| 674 | mins[i] = e.origin[i] - currentmodel.radius; |
| 675 | maxs[i] = e.origin[i] + currentmodel.radius; |
| 676 | } |
| 677 | } |
| 678 | else |
| 679 | { |
| 680 | rotated = false; |
| 681 | Math3D.VectorAdd(e.origin, currentmodel.mins, mins); |
| 682 | Math3D.VectorAdd(e.origin, currentmodel.maxs, maxs); |
| 683 | } |
| 684 | |
| 685 | if (R_CullBox(mins, maxs)) return; |
| 686 | |
| 687 | gl.glColor3f (1,1,1); |
| 688 | |
| 689 | // memset (gl_lms.lightmap_surfaces, 0, sizeof(gl_lms.lightmap_surfaces)); |
| 690 | |
| 691 | // TODO wird beim multitexturing nicht gebraucht |
| 692 | //gl_lms.clearLightmapSurfaces(); |
| 693 | |
| 694 | Math3D.VectorSubtract (r_newrefdef.vieworg, e.origin, modelorg); |
| 695 | if (rotated) |
| 696 | { |
| 697 | Math3D.VectorCopy (modelorg, org); |
| 698 | Math3D.AngleVectors (e.angles, forward, right, up); |
| 699 | modelorg[0] = Math3D.DotProduct (org, forward); |
| 700 | modelorg[1] = -Math3D.DotProduct (org, right); |
| 701 | modelorg[2] = Math3D.DotProduct (org, up); |
| 702 | } |
| 703 | |
| 704 | gl.glPushMatrix(); |
| 705 | |
| 706 | e.angles[0] = -e.angles[0]; // stupid quake bug |
| 707 | e.angles[2] = -e.angles[2]; // stupid quake bug |
| 708 | R_RotateForEntity(e); |
| 709 | e.angles[0] = -e.angles[0]; // stupid quake bug |
| 710 | e.angles[2] = -e.angles[2]; // stupid quake bug |
| 711 | |
| 712 | GL_EnableMultitexture( true ); |
| 713 | GL_SelectTexture(TEXTURE0); |
| 714 | GL_TexEnv( GL_REPLACE ); |
| 715 | gl.glInterleavedArrays(GL_T2F_V3F, glpoly_t.BYTE_STRIDE, globalPolygonInterleavedBuf); |
| 716 | GL_SelectTexture(TEXTURE1); |
| 717 | GL_TexEnv( GL_MODULATE ); |
nothing calls this directly
no test coverage detected