MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / Render

Method Render

editor/TextureGrWnd.cpp:626–720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

624}
625
626void CTextureGrWnd::Render() {
627 if (first_time) {
628 first_time = 0;
629 if (FindArg("-WindowGL"))
630 DoOpenGL = 1;
631 }
632
633 if (DoOpenGL) {
634 if (Just_returned_from_game) {
635 Successive_count++;
636 if (Successive_count < 2) {
637 mprintf(0, "Not doing opengl!\n");
638 DoOpenGL = 0;
639 first_time = 1;
640 } else {
641 Just_returned_from_game = 0;
642 Successive_count = 0;
643 }
644 }
645 }
646
647 if (Disable_editor_rendering)
648 return;
649
650 FrameCount++;
651
652 if (m_grScreen == NULL)
653 return;
654 if (m_grViewport == NULL)
655 return;
656
657 rad_Viewport = m_grViewport;
658
659 TexGrStartOpenGL();
660
661 ResetPostrenderList();
662 // Reset fog
663 Num_fogged_rooms_this_frame = 0;
664 if (Editor_view_mode == VM_ROOM) {
665 if ((D3EditState.current_room == -1) || (Rooms[D3EditState.current_room].used < 1)) {
666 TexGrStopOpenGL();
667 return;
668 }
669
670 // Disable render-all-rooms in room view
671 bool save_RAER = Render_all_external_rooms;
672 Render_all_external_rooms = 0;
673
674 // Render
675 TGWRenderMine(&Viewer_object->pos, &Viewer_object->orient, D3_DEFAULT_ZOOM, D3EditState.current_room);
676
677 // Restore render-all-rooms state
678 Render_all_external_rooms = save_RAER;
679 } else if (Editor_view_mode == VM_TERRAIN) {
680
681 if (GetFunctionMode() == EDITOR_MODE) {
682 DrawPlayerOnWireframe();
683 if (!Flat_terrain && (Viewer_object->pos.y < GetTerrainGroundPoint(&Viewer_object->pos) + 5))

Callers 2

OnIdleMethod · 0.45
OnDrawMethod · 0.45

Calls 15

ResetPostrenderListFunction · 0.85
GetFunctionModeFunction · 0.85
DrawPlayerOnWireframeFunction · 0.85
GetTerrainGroundPointFunction · 0.85
StartEditorFrameFunction · 0.85
RenderTerrainFunction · 0.85
g3_GetViewPositionFunction · 0.85
g3_GetViewMatrixFunction · 0.85
EndEditorFrameFunction · 0.85
ObjSetOrientFunction · 0.85
PostRenderFunction · 0.85

Tested by

no test coverage detected