From ee534554603b2e59a95384eccaa9d0af94fa561c Mon Sep 17 00:00:00 2001 From: Montague <6136789+MontagueM@users.noreply.github.com> Date: Mon, 13 Sep 2021 21:44:36 +0100 Subject: [PATCH] Fixed art arrangement acquirement, fixed some texplates being too large --- api.cpp | 2 +- texplate.cpp | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/api.cpp b/api.cpp index b97b1a1..7d92011 100644 --- a/api.cpp +++ b/api.cpp @@ -81,7 +81,7 @@ std::vector getAPIModelHashes(uint32_t apiHash, std::string package uint32_t getArtArrangementHash(uint32_t apiHash, std::string packagesPath) { - File* dataTable = new File("26FCDD80", packagesPath); + File* dataTable = new File("AA3FE280", packagesPath); dataTable->getData(); File* arrangementTable = new File("137AD080", packagesPath); arrangementTable->getData(); diff --git a/texplate.cpp b/texplate.cpp index eb7fb41..d00065a 100644 --- a/texplate.cpp +++ b/texplate.cpp @@ -56,11 +56,32 @@ void TexturePlate::parsePlate() void TexturePlate::savePlate(std::string fullSavePath) { if (!textures.size()) return; + if (type == "Dyemap") { for (auto& val : dimensions) val /= 2; } + + // See if we need to shrink the texture by half + int maxValue = 0; + for (auto& tex : textures) + { + if (tex->offsetX + tex->scaleX > maxValue) + { + maxValue = tex->offsetX + tex->scaleX; + } + else if (tex->offsetY + tex->scaleY > maxValue) + { + maxValue = tex->offsetY + tex->scaleY; + } + } + if (maxValue <= dimensions[0] / 2 && maxValue <= dimensions[1] / 2) + { + for (auto& val : dimensions) + val /= 2; + } + // Extract every image on plate //std::vector cvIms; cv::Mat4b res(dimensions[0], dimensions[1], cv::Vec4b(0, 0, 0, 0));