MCPcopy Create free account
hub / github.com/demoth/jake2 / R_DrawAliasModel

Method R_DrawAliasModel

client/src/main/java/jake2/client/render/fast/Mesh.java:577–864  ·  view source on GitHub ↗

R_DrawAliasModel

(entity_t e)

Source from the content-addressed store, hash-verified

575 * R_DrawAliasModel
576 */
577 void R_DrawAliasModel(entity_t e) {
578 if ((e.flags & Defines.RF_WEAPONMODEL) == 0) {
579 if (R_CullAliasModel(e))
580 return;
581 }
582
583 if ((e.flags & Defines.RF_WEAPONMODEL) != 0) {
584 if (r_lefthand.value == 2.0f)
585 return;
586 }
587
588 qfiles.Md2Model paliashdr = (qfiles.Md2Model) currentmodel.extradata;
589
590 //
591 // get lighting information
592 //
593 // PMM - rewrote, reordered to handle new shells & mixing
594 // PMM - 3.20 code .. replaced with original way of doing it to keep mod
595 // authors happy
596 //
597 int i;
598 if ((currententity.flags & (Defines.RF_SHELL_HALF_DAM
599 | Defines.RF_SHELL_GREEN | Defines.RF_SHELL_RED
600 | Defines.RF_SHELL_BLUE | Defines.RF_SHELL_DOUBLE)) != 0) {
601 Math3D.VectorClear(shadelight);
602 if ((currententity.flags & Defines.RF_SHELL_HALF_DAM) != 0) {
603 shadelight[0] = 0.56f;
604 shadelight[1] = 0.59f;
605 shadelight[2] = 0.45f;
606 }
607 if ((currententity.flags & Defines.RF_SHELL_DOUBLE) != 0) {
608 shadelight[0] = 0.9f;
609 shadelight[1] = 0.7f;
610 }
611 if ((currententity.flags & Defines.RF_SHELL_RED) != 0)
612 shadelight[0] = 1.0f;
613 if ((currententity.flags & Defines.RF_SHELL_GREEN) != 0)
614 shadelight[1] = 1.0f;
615 if ((currententity.flags & Defines.RF_SHELL_BLUE) != 0)
616 shadelight[2] = 1.0f;
617 }
618
619 else if ((currententity.flags & Defines.RF_FULLBRIGHT) != 0) {
620 for (i = 0; i < 3; i++)
621 shadelight[i] = 1.0f;
622 } else {
623 R_LightPoint(currententity.origin, shadelight);
624
625 // player lighting hack for communication back to server
626 // big hack!
627 if ((currententity.flags & Defines.RF_WEAPONMODEL) != 0) {
628 // pick the greatest component, which should be the same
629 // as the mono value returned by software
630 if (shadelight[0] > shadelight[1]) {
631 if (shadelight[0] > shadelight[2])
632 r_lightlevel.value = 150 * shadelight[0];
633 else
634 r_lightlevel.value = 150 * shadelight[2];

Callers

nothing calls this directly

Calls 15

R_CullAliasModelMethod · 0.95
VectorClearMethod · 0.95
VectorNormalizeMethod · 0.95
PrintfMethod · 0.95
GL_DrawAliasFrameLerpMethod · 0.95
GL_DrawAliasShadowMethod · 0.95
MYgluPerspectiveMethod · 0.80
R_RotateForEntityMethod · 0.80
glDepthRangeMethod · 0.65
glMatrixModeMethod · 0.65
glPushMatrixMethod · 0.65
glLoadIdentityMethod · 0.65

Tested by

no test coverage detected