From 3e701313dc506f24a8d82d13dd23236c67d3b1df Mon Sep 17 00:00:00 2001 From: RaveYard Date: Fri, 24 Jun 2022 14:00:15 +0200 Subject: [PATCH] Fix printf and conversion warnings --- src/level/level_light.cpp | 2 +- src/lightmap/gpuraytracer.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/level/level_light.cpp b/src/level/level_light.cpp index c823a5b..5fc57fd 100644 --- a/src/level/level_light.cpp +++ b/src/level/level_light.cpp @@ -78,7 +78,7 @@ void FLevel::SetupLights() { FString hex = FString("0x") + FString(key.value); hex.StripChars("\""); - printf("Sun color: %s\n", hex); + printf("Sun color: %s\n", hex.GetChars()); int rgb = hex.ToULong(); lightcolor = (uint32_t)rgb; } diff --git a/src/lightmap/gpuraytracer.cpp b/src/lightmap/gpuraytracer.cpp index cdeec99..333fce2 100644 --- a/src/lightmap/gpuraytracer.cpp +++ b/src/lightmap/gpuraytracer.cpp @@ -97,7 +97,7 @@ void GPURaytracer::Raytrace(LevelMesh* level) size_t maxTasks = (size_t)rayTraceImageSize * rayTraceImageSize; for (size_t startTask = 0; startTask < tasks.size(); startTask += maxTasks) { - printf("\r%.1f%%\t%d/%d", double(startTask) / double(tasks.size()) * 100, startTask, tasks.size()); + printf("\r%.1f%%\t%llu/%llu", double(startTask) / double(tasks.size()) * 100, startTask, tasks.size()); size_t numTasks = std::min(tasks.size() - startTask, maxTasks); UploadTasks(tasks.data() + startTask, numTasks); @@ -145,7 +145,7 @@ void GPURaytracer::Raytrace(LevelMesh* level) EndTracing(); DownloadTasks(tasks.data() + startTask, numTasks); } - printf("\r%.1f%%\t%d/%d\n", 100.0, tasks.size(), tasks.size()); + printf("\r%.1f%%\t%llu/%llu\n", 100.0, tasks.size(), tasks.size()); }); if (device->renderdoc) @@ -405,7 +405,7 @@ void GPURaytracer::CreateVertexAndIndexBuffers() info.EmissiveColor = vec3(0.0f, 0.0f, 0.0f); } - info.SamplingDistance = surface->sampleDimension; + info.SamplingDistance = float(surface->sampleDimension); surfaces.push_back(info); }