Skip to content

Commit 69733cc

Browse files
committed
Remove fmt
1 parent 788c938 commit 69733cc

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 4.0)
22

33
message(STATUS " CMakeLists: Zest")
44

src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ target_link_libraries(Zest
8989
PUBLIC
9090
glm::glm
9191
concurrentqueue::concurrentqueue
92-
fmt::fmt
9392
Vulkan::Vulkan
9493
SDL3::SDL3
9594
)

src/settings/settings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <fmt/format.h>
1+
#include <format>
22
#include <zest/file/toml_utils.h>
33
#include <zest/logger/logger.h>
44

src/time/profiler.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <zest/time/profiler.h>
1212

1313
#include "imgui_internal.h"
14-
#include <fmt/format.h>
14+
#include <format>
1515

1616
using namespace std::chrono;
1717
using namespace Zest;
@@ -456,7 +456,7 @@ void EndRegion()
456456

457457
auto& region = gProfilerData->regionData[gProfilerData->currentRegion];
458458
region.endTime = timer_get_elapsed(gTimer).count();
459-
region.name = fmt::format("{:.2f}ms", float(timer_to_ms(nanoseconds(region.endTime - region.startTime))));
459+
region.name = std::format("{:.2f}ms", float(timer_to_ms(nanoseconds(region.endTime - region.startTime))));
460460

461461
gProfilerData->currentRegion++;
462462
}
@@ -497,7 +497,7 @@ void NewFrame()
497497
if (gProfilerData->currentFrame > 0)
498498
{
499499
gProfilerData->frameData[gProfilerData->currentFrame - 1].endTime = frame.startTime;
500-
gProfilerData->frameData[gProfilerData->currentFrame - 1].name = fmt::format("{:.2f}ms", float(timer_to_ms(nanoseconds(frame.startTime - gProfilerData->frameData[gProfilerData->currentFrame - 1].startTime))));
500+
gProfilerData->frameData[gProfilerData->currentFrame - 1].name = std::format("{:.2f}ms", float(timer_to_ms(nanoseconds(frame.startTime - gProfilerData->frameData[gProfilerData->currentFrame - 1].startTime))));
501501
}
502502
gProfilerData->currentFrame++;
503503
}
@@ -813,7 +813,7 @@ glm::u64vec2 ShowCandles(glm::vec2& regionMin, glm::vec2& regionMax)
813813

814814
if (ImGui::IsMouseHoveringRect(minRect, maxRect))
815815
{
816-
auto tip = fmt::format("{}: {:.4f}%", currentRegion, ((maxRect.y - minRect.y) / region.Height()) * 100.0f);
816+
auto tip = std::format("{}: {:.4f}%", currentRegion, ((maxRect.y - minRect.y) / region.Height()) * 100.0f);
817817
ImGui::SetTooltip("%s", tip.c_str());
818818
}
819819

@@ -857,7 +857,7 @@ glm::u64vec2 ShowCandles(glm::vec2& regionMin, glm::vec2& regionMax)
857857
drawRegions(gProfilerData->currentFrame, regionFrames, framesStartTime, framesDuration, gProfilerData->frameData, gFrameDisplayStart, gProfilerData->maxFrameTime, gProfilerData->maxFrameTime, FrameCandleColor, FrameCandleAltColor);
858858
regionMin.y += CandleHeight + 2.0f * dpi.scaleFactorXY.y;
859859

860-
drawRegions(gProfilerData->currentRegion, regionRegion, framesStartTime, framesDuration, gProfilerData->regionData, gRegionDisplayStart, gRegionTimeLimit, gRegionTimeLimit, RegionCandleColor, RegionCandleAltColor);
860+
drawRegions(gProfilerData->currentRegion, regionRegion, framesStartTime, framesDuration, gProfilerData->regionData, gRegionDisplayStart, gProfilerData->regionTimeLimit, gProfilerData->regionTimeLimit, RegionCandleColor, RegionCandleAltColor);
861861
regionMin.y += CandleHeight;
862862

863863
if (dragTimeRange.x > dragTimeRange.y)
@@ -911,7 +911,7 @@ void ShowProfile()
911911

912912
ImGui::SameLine();
913913

914-
ImGui::TextUnformatted(fmt::format(" UI FPS {:.1f}", ImGui::GetIO().Framerate).c_str());
914+
ImGui::TextUnformatted(std::format(" UI FPS {:.1f}", ImGui::GetIO().Framerate).c_str());
915915

916916
// Ignore the first frame, which is likely a long delay due to
917917
// the time that expires after this profiler is created and the first
@@ -1139,7 +1139,7 @@ void ShowProfile()
11391139

11401140
if (ImGui::IsMouseHoveringRect(rectMin, rectMax))
11411141
{
1142-
auto tip = fmt::format("{}: {:.4f}ms ({:.2f}us)\nRange: {:.4f}ms - {:.4f}ms\n\n{} (Ln {})", entry.szSection, timer_to_ms(nanoseconds(std::min(entry.endTime, threadData.maxTime) - entry.startTime)), (std::min(entry.endTime, threadData.maxTime) - entry.startTime) / 1000.0f, timer_to_ms(nanoseconds(entry.startTime)), timer_to_ms(nanoseconds(entry.endTime)), entry.szFile, entry.line);
1142+
auto tip = std::format("{}: {:.4f}ms ({:.2f}us)\nRange: {:.4f}ms - {:.4f}ms\n\n{} (Ln {})", entry.szSection, timer_to_ms(nanoseconds(std::min(entry.endTime, threadData.maxTime) - entry.startTime)), (std::min(entry.endTime, threadData.maxTime) - entry.startTime) / 1000.0f, timer_to_ms(nanoseconds(entry.startTime)), timer_to_ms(nanoseconds(entry.endTime)), entry.szFile, entry.line);
11431143
ImGui::SetTooltip("%s", tip.c_str());
11441144
}
11451145

src/ui/layout_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <zest/ui/layout_manager.h>
77
#include <zest/math/imgui_glm.h>
88

9-
#include <fmt/format.h>
9+
#include <format>
1010

1111
#include <cppcodec/base64_default_rfc4648.hpp>
1212

0 commit comments

Comments
 (0)