Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Commit

Permalink
Fixed art arrangement acquirement, fixed some texplates being too large
Browse files Browse the repository at this point in the history
  • Loading branch information
MontagueM committed Sep 13, 2021
1 parent 6fd83b9 commit ee53455
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ std::vector<std::string> 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();
Expand Down
21 changes: 21 additions & 0 deletions texplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<cv::Mat> cvIms;
cv::Mat4b res(dimensions[0], dimensions[1], cv::Vec4b(0, 0, 0, 0));
Expand Down

0 comments on commit ee53455

Please sign in to comment.