mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 08:00:14 +00:00
Add loading screen to online mode, fix ImGui frame conflict, truncate log on start
Online world entry now shows a progress bar during character model, terrain, and tile streaming. Fixed loading screen crash from calling ImGui::NewFrame while a frame was already in progress. Log file is now truncated on each launch instead of appending.
This commit is contained in:
parent
6f33392155
commit
81d712121e
3 changed files with 138 additions and 29 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#include "rendering/loading_screen.hpp"
|
||||
#include "core/logger.hpp"
|
||||
#include <imgui.h>
|
||||
#include <imgui_internal.h>
|
||||
#include <imgui_impl_opengl3.h>
|
||||
#include <imgui_impl_sdl2.h>
|
||||
#include <random>
|
||||
|
|
@ -352,6 +353,13 @@ void LoadingScreen::render() {
|
|||
|
||||
// Draw status text and percentage with ImGui overlay
|
||||
{
|
||||
// If a frame is already in progress (e.g. called from a UI callback),
|
||||
// end it before starting our own
|
||||
ImGuiContext* ctx = ImGui::GetCurrentContext();
|
||||
if (ctx && ctx->FrameCount >= 0 && ctx->WithinFrameScope) {
|
||||
ImGui::EndFrame();
|
||||
}
|
||||
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
float screenW = io.DisplaySize.x;
|
||||
float screenH = io.DisplaySize.y;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue