diff --git a/libsave/include/SatisfactorySave/GameTypes/MapTypes/Base/MapTypeListImpl.h b/libsave/include/SatisfactorySave/GameTypes/MapTypes/Base/MapTypeListImpl.h index 3a00967..c6d7594 100644 --- a/libsave/include/SatisfactorySave/GameTypes/MapTypes/Base/MapTypeListImpl.h +++ b/libsave/include/SatisfactorySave/GameTypes/MapTypes/Base/MapTypeListImpl.h @@ -21,7 +21,7 @@ namespace SatisfactorySave { MapTypeListImplBase(const MapTypeListImplBase& other) requires IsSharedPtr : MapTypeList(other) { List.reserve(other.List.size()); for (const auto& l : other.List) { - List.push_back(std::move(l->clone())); + List.push_back(l->clone()); } } @@ -32,7 +32,7 @@ namespace SatisfactorySave { List.clear(); List.reserve(other.List.size()); for (const auto& l : other.List) { - List.push_back(std::move(l->clone())); + List.push_back(l->clone()); } } return *this; diff --git a/libsave/include/SatisfactorySave/GameTypes/Sets/Base/SetImpl.h b/libsave/include/SatisfactorySave/GameTypes/Sets/Base/SetImpl.h index d8d81ec..83778f8 100644 --- a/libsave/include/SatisfactorySave/GameTypes/Sets/Base/SetImpl.h +++ b/libsave/include/SatisfactorySave/GameTypes/Sets/Base/SetImpl.h @@ -21,7 +21,7 @@ namespace SatisfactorySave { SetImplBase(const SetImplBase& other) requires IsSharedPtr : Set(other) { Values.reserve(other.Values.size()); for (const auto& s : other.Values) { - Values.push_back(std::move(s->clone())); + Values.push_back(s->clone()); } } @@ -32,7 +32,7 @@ namespace SatisfactorySave { Values.clear(); Values.reserve(other.Values.size()); for (const auto& s : other.Values) { - Values.push_back(std::move(s->clone())); + Values.push_back(s->clone()); } } return *this; diff --git a/libsave/include/SatisfactorySave/IO/Archive/Archive.h b/libsave/include/SatisfactorySave/IO/Archive/Archive.h index ecd1e92..e5114ff 100644 --- a/libsave/include/SatisfactorySave/IO/Archive/Archive.h +++ b/libsave/include/SatisfactorySave/IO/Archive/Archive.h @@ -128,7 +128,7 @@ namespace SatisfactorySave { protected: Archive() = default; - ~Archive() = default; + virtual ~Archive() = default; virtual void serialize(void* data, std::size_t size) = 0; virtual void serializeString(std::string& s) = 0; diff --git a/libsave/src/GameTypes/Arrays/StructArray.cpp b/libsave/src/GameTypes/Arrays/StructArray.cpp index 6a25b96..999d64f 100644 --- a/libsave/src/GameTypes/Arrays/StructArray.cpp +++ b/libsave/src/GameTypes/Arrays/StructArray.cpp @@ -12,7 +12,7 @@ SatisfactorySave::StructArray::StructArray() { SatisfactorySave::StructArray::StructArray(const StructArray& other) : Array(other) { Values.reserve(other.Values.size()); for (const auto& v : other.Values) { - Values.push_back(std::move(v->clone())); + Values.push_back(v->clone()); } inner_tag_ = other.inner_tag_; } @@ -23,7 +23,7 @@ SatisfactorySave::StructArray& SatisfactorySave::StructArray::operator=(const St Values.clear(); Values.reserve(other.Values.size()); for (const auto& v : other.Values) { - Values.push_back(std::move(v->clone())); + Values.push_back(v->clone()); } inner_tag_ = other.inner_tag_; } diff --git a/libsave/src/GameTypes/Properties/Base/PropertyList.cpp b/libsave/src/GameTypes/Properties/Base/PropertyList.cpp index fe05d57..56f7c25 100644 --- a/libsave/src/GameTypes/Properties/Base/PropertyList.cpp +++ b/libsave/src/GameTypes/Properties/Base/PropertyList.cpp @@ -3,10 +3,10 @@ #include "IO/Archive/IStreamArchive.h" #include "IO/Archive/OStreamArchive.h" -SatisfactorySave::PropertyList::PropertyList(const PropertyList& other) { +SatisfactorySave::PropertyList::PropertyList(const PropertyList& other) : std::vector>() { this->reserve(other.size()); for (const auto& p : other) { - this->push_back(std::move(p->clone())); + this->push_back(p->clone()); } } @@ -15,7 +15,7 @@ SatisfactorySave::PropertyList& SatisfactorySave::PropertyList::operator=(const this->clear(); this->reserve(other.size()); for (const auto& p : other) { - this->push_back(std::move(p->clone())); + this->push_back(p->clone()); } } return *this; @@ -31,7 +31,7 @@ void SatisfactorySave::PropertyList::serialize(Archive& ar) { if (property == nullptr) { done = true; } else { - this->emplace_back(std::move(property)); + this->push_back(std::move(property)); } } while (!done); } else { diff --git a/libsave/src/GameTypes/Save/ChunkHeader.cpp b/libsave/src/GameTypes/Save/ChunkHeader.cpp index f285b29..8c1174c 100644 --- a/libsave/src/GameTypes/Save/ChunkHeader.cpp +++ b/libsave/src/GameTypes/Save/ChunkHeader.cpp @@ -19,7 +19,7 @@ void SatisfactorySave::ChunkHeader::serialize(Archive& ar) { if (archive_header_ != ARCHIVE_V2_HEADER) { throw std::runtime_error("Invalid package format!"); } - if (compression_chunk_size_ != 131072) { + if (compression_chunk_size_ != COMPRESSION_CHUNK_SIZE) { throw std::runtime_error("Invalid compression chunk size!"); } diff --git a/map/src/MapWindow/AboutWindow.cpp b/map/src/MapWindow/AboutWindow.cpp index b0c6d1b..9165794 100644 --- a/map/src/MapWindow/AboutWindow.cpp +++ b/map/src/MapWindow/AboutWindow.cpp @@ -11,7 +11,7 @@ namespace { using namespace Satisfactory3DMap; - void parseCopyright(std::map& licenseMap, const std::string& prefix) { + void parseCopyright(std::map& licenseMap) { const std::string copyrightDir("copyright"); for (const auto& entry : resourceDirContent(copyrightDir)) { const auto entryDir = copyrightDir + "/" + entry; @@ -26,7 +26,7 @@ namespace { Satisfactory3DMap::AboutWindow::AboutWindow() : show_(false) { try { - parseCopyright(licenseMap_, "library"); + parseCopyright(licenseMap_); } catch (const std::exception& ex) { spdlog::error("Error initializing about window: {}", ex.what()); } @@ -46,11 +46,11 @@ void Satisfactory3DMap::AboutWindow::renderGui() { const auto& size = ImGui::GetIO().DisplaySize; ImGui::SetNextWindowPos(ImVec2(size.x * 0.5f, size.y * 0.5f), ImGuiCond_Appearing, ImVec2(0.5f, 0.5f)); ImGui::Begin("About", &show_); - ImGui::Text("Satisfactory 3D Map"); + ImGui::TextUnformatted("Satisfactory 3D Map"); ImGui::Text("Version: %s (Git: %s)", versionFull.c_str(), gitVersion.c_str()); - ImGui::Text(""); - ImGui::Text("Copyright (C) 2021 - 2024 Moritz Heinemann"); - ImGui::Text("Homepage:"); + ImGui::TextUnformatted(""); + ImGui::TextUnformatted("Copyright (C) 2021 - 2024 Moritz Heinemann"); + ImGui::TextUnformatted("Homepage:"); ImGui::SameLine(); if (ImGui::SmallButton(githubUrl.c_str())) { openLink(githubUrl); @@ -59,10 +59,10 @@ void Satisfactory3DMap::AboutWindow::renderGui() { ImGui::Text("%s", licenseText.c_str()); ImGui::TreePop(); } - ImGui::Text(""); + ImGui::TextUnformatted(""); ImGui::Separator(); - ImGui::Text("Third-party software and resources:"); + ImGui::TextUnformatted("Third-party software and resources:"); for (const auto& entry : licenseMap_) { if (ImGui::CollapsingHeader(entry.first.c_str(), ImGuiTreeNodeFlags_None)) { ImGui::Text("%s", entry.second.c_str()); diff --git a/map/src/MapWindow/Pak/AssetWindow.cpp b/map/src/MapWindow/Pak/AssetWindow.cpp index d32ef23..0a3c814 100644 --- a/map/src/MapWindow/Pak/AssetWindow.cpp +++ b/map/src/MapWindow/Pak/AssetWindow.cpp @@ -1,5 +1,7 @@ #include "AssetWindow.h" +#include + #include #include @@ -59,13 +61,13 @@ void Satisfactory3DMap::AssetWindow::renderGui() { ImGui::Text("CompressionFlags: %i", sum.CompressionFlags); ImGui::Text("PackageSource: %i", sum.PackageSource); ImGui::Text("AssetRegistryDataOffset: %i", sum.AssetRegistryDataOffset); - ImGui::Text("BulkDataStartOffset: %lli", sum.BulkDataStartOffset); + ImGui::Text("BulkDataStartOffset: %" PRIi64, sum.BulkDataStartOffset); ImGui::Text("WorldTileInfoDataOffset: %i", sum.WorldTileInfoDataOffset); ImGui::Text("ChunkIDs: TODO"); // std::vector ChunkIDs; ImGui::Text("PreloadDependencyCount: %i", sum.PreloadDependencyCount); ImGui::Text("PreloadDependencyOffset: %i", sum.PreloadDependencyOffset); ImGui::Text("NamesReferencedFromExportDataCount: %i", sum.NamesReferencedFromExportDataCount); - ImGui::Text("PayloadTocOffset: %lli", sum.PayloadTocOffset); + ImGui::Text("PayloadTocOffset: %" PRIi64, sum.PayloadTocOffset); } if (ImGui::CollapsingHeader("Name Map")) { if (ImGui::Button("Copy")) { @@ -138,8 +140,8 @@ void Satisfactory3DMap::AssetWindow::renderGui() { ImGui::Text("OuterIndex: %i", exportEntry.OuterIndex); ImGui::Text("ObjectName: %s", exportEntry.ObjectName.toString().c_str()); ImGui::Text("Save: %i", exportEntry.Save); - ImGui::Text("SerialSize: %lli", exportEntry.SerialSize); - ImGui::Text("SerialOffset: %lli", exportEntry.SerialOffset); + ImGui::Text("SerialSize: %" PRIi64, exportEntry.SerialSize); + ImGui::Text("SerialOffset: %" PRIi64, exportEntry.SerialOffset); ImGui::Text("bForcedExport: %i", exportEntry.bForcedExport); ImGui::Text("bNotForClient: %i", exportEntry.bNotForClient); ImGui::Text("bNotForServer: %i", exportEntry.bNotForServer); diff --git a/map/src/MapWindow/UI/ObjectWidgets.h b/map/src/MapWindow/UI/ObjectWidgets.h index ed1d4b4..9841710 100644 --- a/map/src/MapWindow/UI/ObjectWidgets.h +++ b/map/src/MapWindow/UI/ObjectWidgets.h @@ -239,7 +239,7 @@ namespace Satisfactory3DMap::UI { } EditorTreeEndLeaf(); EditorTreeStartLeaf("Rotation"); - ImGui::SetItemTooltip(glm::to_string(glmCast(t.Rotation)).c_str()); + ImGui::SetItemTooltip("%s", glm::to_string(glmCast(t.Rotation)).c_str()); ImGui::TableNextColumn(); ImGui::SetNextItemWidth(-FLT_MIN); if (ImGui::DragFloat3("##rot", glm::value_ptr(eulerAngels), 1.0f, 0.0f, 360.0f, "%.3f", diff --git a/map/src/MapWindow/UI/PropertyEditor.cpp b/map/src/MapWindow/UI/PropertyEditor.cpp index 6802cdc..8a9c0af 100644 --- a/map/src/MapWindow/UI/PropertyEditor.cpp +++ b/map/src/MapWindow/UI/PropertyEditor.cpp @@ -380,8 +380,8 @@ void Satisfactory3DMap::UI::PropertyEditor::StructEditor::visit(s::InventoryItem void Satisfactory3DMap::UI::PropertyEditor::StructEditor::visit(s::LBBalancerIndexingStruct& s) { if (EditorTreeNode("Data", ImGuiTreeNodeFlags_DefaultOpen)) { - static constexpr int32_t step = 1.0f; - static constexpr int32_t step_fast = 100.0f; + static constexpr int32_t step = 1; + static constexpr int32_t step_fast = 100; parent_.changed_ |= EditorScalar("mNormalIndex", ImGuiDataType_S32, &s.Data.mNormalIndex, &step, &step_fast); parent_.changed_ |= EditorScalar("mOverflowIndex", ImGuiDataType_S32, &s.Data.mOverflowIndex, &step, &step_fast); diff --git a/map/src/Utils/GLMUtil.h b/map/src/Utils/GLMUtil.h index a1f611f..5c3fb06 100644 --- a/map/src/Utils/GLMUtil.h +++ b/map/src/Utils/GLMUtil.h @@ -14,12 +14,13 @@ namespace Satisfactory3DMap { template inline glm::vec3 glmCast(const SatisfactorySave::TVector& vec) { - return {vec.X, vec.Y, vec.Z}; + return {static_cast(vec.X), static_cast(vec.Y), static_cast(vec.Z)}; } template inline glm::quat glmCast(const SatisfactorySave::TQuat& quat) { - return glm::quat(quat.W, quat.X, quat.Y, quat.Z); + return glm::quat(static_cast(quat.W), static_cast(quat.X), static_cast(quat.Y), + static_cast(quat.Z)); } template