mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-06-05 22:54:35 -04: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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user