@@ -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);
|
||||
|
||||
@@ -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)); }
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user