The callback function that the telcom calls every frame
| 785 | |
| 786 | // The callback function that the telcom calls every frame |
| 787 | void TCAMCallback(void) { |
| 788 | StartFrame(Telcom_system.Monitor_coords[MONITOR_MAIN].left, Telcom_system.Monitor_coords[MONITOR_MAIN].top, |
| 789 | Telcom_system.Monitor_coords[MONITOR_MAIN].right, Telcom_system.Monitor_coords[MONITOR_MAIN].bottom); |
| 790 | |
| 791 | // Start a 3d frame |
| 792 | g3_StartFrame(&AM_view_pos, &AM_view_orient, Render_zoom); |
| 793 | |
| 794 | if (AM_center_on_player) { |
| 795 | TCAMCenterOnPlayer(); |
| 796 | AM_center_on_player = 0; |
| 797 | } |
| 798 | |
| 799 | if (AM_realign) { |
| 800 | AM_pitch = 0; |
| 801 | AM_realign = 0; |
| 802 | } |
| 803 | |
| 804 | rend_SetFiltering(1); |
| 805 | rend_SetAlphaType(AT_VERTEX); |
| 806 | rend_SetTextureType(TT_FLAT); |
| 807 | rend_SetLighting(LS_GOURAUD); |
| 808 | rend_SetColorModel(CM_RGB); |
| 809 | rend_SetOverlayType(OT_NONE); |
| 810 | rend_SetZBufferState(1); |
| 811 | |
| 812 | if (AM_terrain) |
| 813 | rend_SetZValues(0, VisibleTerrainZ); |
| 814 | |
| 815 | TCAMBuildRoomList(Viewer_object->roomnum); |
| 816 | // Render all rooms in view |
| 817 | for (int i = 0; i < Num_AM_rooms; i++) { |
| 818 | TCAMRenderRoom(AM_room_list[i]); |
| 819 | } |
| 820 | |
| 821 | // Render terrain |
| 822 | if (AM_terrain) |
| 823 | TCAMRenderTerrain(); |
| 824 | |
| 825 | g3_EndFrame(); |
| 826 | |
| 827 | rend_SetFiltering(1); |
| 828 | |
| 829 | TCAMDrawObjects(); |
| 830 | EndFrame(); |
| 831 | |
| 832 | rend_SetFiltering(0); |
| 833 | |
| 834 | TCAMDrawMenu(); |
| 835 | |
| 836 | TCAMReadControls(); |
| 837 | } |
nothing calls this directly
no test coverage detected