Draw a frame of the game
| 2568 | |
| 2569 | // Draw a frame of the game |
| 2570 | void 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 |
no test coverage detected