4jcraft/Minecraft.Client/Rendering/EntityRenderers/ProgressRenderer.h
MatthewBeshay bc6013ab70 Replace all CRITICAL_SECTION usage with std::mutex and std::lock_guard
Migrates 59 files from WinAPI CRITICAL_SECTION to portable C++ std::mutex/std::lock_guard/std::unique_lock. Removes Linux CRITICAL_SECTION shims from winapi_stubs.h.
2026-03-30 18:45:55 +11:00

43 lines
1.1 KiB
C++

#pragma once
#include <mutex>
#include "../../../Minecraft.World/Util/ProgressListener.h"
class ProgressRenderer : public ProgressListener {
public:
enum eProgressStringType {
eProgressStringType_ID,
eProgressStringType_String, // 4J-PB added for updating the bytes read
// on a save transfer
};
static std::mutex s_progress;
int getCurrentPercent();
int getCurrentTitle();
int getCurrentStatus();
std::wstring& getProgressString(void);
ProgressRenderer::eProgressStringType getType();
private:
int lastPercent;
private:
int status;
Minecraft* minecraft;
int title;
int64_t lastTime;
bool noAbort;
std::wstring m_wstrText;
eProgressStringType m_eType;
void setType(eProgressStringType eType);
public:
ProgressRenderer(Minecraft* minecraft);
virtual void progressStart(int title);
virtual void progressStartNoAbort(int string);
void _progressStart(int title);
virtual void progressStage(int status);
virtual void progressStage(std::wstring& wstrText);
virtual void progressStagePercentage(int i);
};