wowie
Some checks failed
Build / Build Game (push) Has been cancelled

This commit is contained in:
2026-02-28 22:24:06 -05:00
parent 3817f1cc39
commit bc8fe78fce
14 changed files with 102 additions and 42 deletions

View File

@@ -43,7 +43,7 @@ namespace game::util::imgui::widget
auto min = ImGui::GetItemRectMin();
auto max = ImGui::GetItemRectMax();
auto time = ImGui::GetTime();
auto period = sinf(time * FREQUENCY);
auto period = sinf((float)(time * FREQUENCY));
auto thickness = THICKNESS_MIN + (THICKNESS_MAX * period);
auto colorBorder = ImGui::GetStyleColorVec4(ImGuiCol_CheckMark);
colorBorder.w = ALPHA_MIN + (ALPHA_MAX * period);

View File

@@ -47,5 +47,5 @@ namespace game::util::math
float random_max(float max) { return random_in_range(0, max); }
float random_roll(float value) { return random() * value; }
bool random_bool() { return random() < 0.5f; };
void random_seed_set() { srand(std::time(nullptr)); }
void random_seed_set() { srand((unsigned int)std::time(nullptr)); }
}

View File

@@ -67,9 +67,10 @@ namespace game::util::physfs
Archive::Archive(const std::filesystem::path& path, const std::string& mount)
{
if (!PHYSFS_mount(path.c_str(), mount.c_str(), 0))
auto pathString = path.string();
if (!PHYSFS_mount(pathString.c_str(), mount.c_str(), 0))
{
logger.error(std::format("Failed to mount archive: {} ({})", path.c_str(), error_get()));
logger.error(std::format("Failed to mount archive: {} ({})", pathString, error_get()));
return;
}

View File

@@ -8,8 +8,13 @@ namespace game::util::time
std::string get(const char* format)
{
auto now = std::chrono::system_clock::now();
auto time = std::chrono::system_clock::to_time_t(now);
auto localTime = *std::localtime(&time);
auto nowTime = std::chrono::system_clock::to_time_t(now);
std::tm localTime{};
#ifdef _WIN32
localtime_s(&localTime, &nowTime);
#else
localtime_r(&nowTime, &localTime);
#endif
std::ostringstream timeString;
timeString << std::put_time(&localTime, format);
return timeString.str();