| 3741 | } |
| 3742 | |
| 3743 | void TCSSSCallback(void) { |
| 3744 | if (TCShipSelect.ship_model == -1) { |
| 3745 | // no ship selected yet |
| 3746 | return; |
| 3747 | } |
| 3748 | |
| 3749 | vector viewer_eye = {0, 0, 0}; |
| 3750 | matrix viewer_orient = IDENTITY_MATRIX; |
| 3751 | viewer_eye.z = -TCShipSelect.cam_dist; |
| 3752 | |
| 3753 | grtext_Flush(); |
| 3754 | StartFrame(325, 142, 535, 280); |
| 3755 | |
| 3756 | // backup user-specified aspect ratio, than disable it for ship select screen |
| 3757 | float aspect = g3_GetAspectRatio(); |
| 3758 | g3_SetAspectRatio(0.0f); |
| 3759 | |
| 3760 | g3_StartFrame(&viewer_eye, &viewer_orient, D3_DEFAULT_ZOOM); |
| 3761 | rend_SetFlatColor(0); |
| 3762 | |
| 3763 | float normalized_time[MAX_SUBOBJECTS]; |
| 3764 | float light_scalar, size; |
| 3765 | PageInPolymodel(TCShipSelect.ship_model, OBJ_PLAYER, &size); |
| 3766 | poly_model *pm = GetPolymodelPointer(TCShipSelect.ship_model); |
| 3767 | vector view_pos; |
| 3768 | vector light_vec; |
| 3769 | matrix view_orient = IDENTITY_MATRIX; |
| 3770 | matrix final_mat = IDENTITY_MATRIX; |
| 3771 | matrix rot_mat; |
| 3772 | |
| 3773 | // draw model. |
| 3774 | SetNormalizedTimeAnim(0, normalized_time, pm); |
| 3775 | |
| 3776 | view_pos = pm->anim_size_offset; |
| 3777 | |
| 3778 | // move 30 degrees a sec |
| 3779 | vm_AnglesToMatrix(&rot_mat, 0, (last_frametime) * (65535 / 360) * 30, 0); |
| 3780 | |
| 3781 | vm_MatrixMul(&view_orient, &rot_mat, &TCShipSelect.orient); |
| 3782 | vm_Orthogonalize(&view_orient); |
| 3783 | TCShipSelect.orient = view_orient; |
| 3784 | |
| 3785 | light_vec.x = 0.0f; |
| 3786 | light_vec.y = -1.0f; |
| 3787 | light_vec.z = -1.0f; |
| 3788 | light_scalar = 0.8f; |
| 3789 | vm_NormalizeVector(&light_vec); |
| 3790 | |
| 3791 | rend_SetZBufferState(1); |
| 3792 | rend_SetAlphaType(AT_CONSTANT_TEXTURE); |
| 3793 | rend_SetAlphaValue(255); |
| 3794 | rend_SetLighting(LS_NONE); |
| 3795 | rend_SetColorModel(CM_MONO); |
| 3796 | rend_SetOverlayType(OT_NONE); |
| 3797 | |
| 3798 | DrawPolygonModel(&view_pos, &view_orient, TCShipSelect.ship_model, normalized_time, 0, &light_vec, light_scalar, |
| 3799 | light_scalar, light_scalar); |
| 3800 |
nothing calls this directly
no test coverage detected