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

Function GameRenderFrame

Descent3/GameLoop.cpp:2570–2685  ·  view source on GitHub ↗

Draw a frame of the game

Source from the content-addressed store, hash-verified

2568
2569// Draw a frame of the game
2570void GameRenderFrame(void) {
2571 bool no_render = false;
2572 AI_NumRendered = 0;
2573 AI_NumHostileAlert = 0;
2574
2575 if (Dedicated_server)
2576 return;
2577
2578#ifndef RELEASE
2579 Mine_depth = 0;
2580#endif
2581
2582 // increase our timing for the powerup sparkles, used globally by all
2583 Last_powerup_sparkle_time += Frametime;
2584
2585 PreUpdateAllLightGlows();
2586
2587 // Don't render if receiving data
2588 if ((Game_mode & GM_MULTI) && NetPlayers[Player_num].sequence != NETSEQ_PLAYING) {
2589 no_render = true;
2590 ShowProgressScreen(TXT_RECEIVINGDATA, NULL, 0);
2591 }
2592
2593 // Generate "shaken" view for player
2594 if (!Game_paused)
2595 ShakePlayer();
2596
2597 rend_SetZBufferState(1);
2598 rend_SetZBufferWriteMask(1);
2599
2600 // clear screen if needed
2601 if (Clear_screen) {
2602 StartFrame(0, 0, Max_window_w, Max_window_h, false);
2603 rend_ClearScreen(GR_BLACK);
2604 EndFrame();
2605 Clear_screen--;
2606 }
2607
2608 // Render the mine
2609 if (!no_render) {
2610 // render preliminary hud view (for dirty rectangles)
2611 if (Small_hud_flag) { // small hud flag is set in RenderHUDFrame in GameDrawHud.
2612 StartFrame(0, 0, Max_window_w, Max_window_h, false);
2613 RenderPreHUDFrame();
2614 EndFrame();
2615 }
2616
2617 // Draw the big 3d view
2618 GameDrawMainView();
2619
2620 // Do the small views. These should be before GameDrawHUD() for the small windows
2621 DrawSmallViews();
2622
2623 // Do Cockpit/Hud
2624 if (!HUD_disabled)
2625 GameDrawHud();
2626
2627 // Render Ingame Cinematics

Callers 1

GameFrameFunction · 0.85

Calls 15

PreUpdateAllLightGlowsFunction · 0.85
ShowProgressScreenFunction · 0.85
ShakePlayerFunction · 0.85
StartFrameFunction · 0.85
EndFrameFunction · 0.85
RenderPreHUDFrameFunction · 0.85
GameDrawMainViewFunction · 0.85
DrawSmallViewsFunction · 0.85
GameDrawHudFunction · 0.85
Cinematic_RenderFrameFunction · 0.85
DebugGraph_RenderFunction · 0.85
grtext_SetFontFunction · 0.85

Tested by

no test coverage detected