Skip to content

Commit

Permalink
fixed extra texture slots being made
Browse files Browse the repository at this point in the history
  • Loading branch information
hakasapl committed Dec 7, 2024
1 parent 2a870be commit f251cbc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 0 additions & 5 deletions ParallaxGenLib/src/ParallaxGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,6 @@ auto ParallaxGen::processShape(
unordered_map<wstring, tuple<set<NIFUtil::ShapeShader>, unordered_set<wstring>>> *ConflictMods,
mutex *ConflictModsMutex) -> ParallaxGenTask::PGResult {

if (boost::icontains(NIFPath.wstring(), L"dwemerlargedoor01")) {
// skip LOD meshes
spdlog::trace("HERE");
}

auto Result = ParallaxGenTask::PGResult::SUCCESS;

// Prep
Expand Down
9 changes: 6 additions & 3 deletions ParallaxGenLib/src/patchers/PatcherShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ auto PatcherShader::getTextureSet(nifly::NiShape &NIFShape) -> array<wstring, NU
}

// get the texture slots
const auto Slots = NIFUtil::getTextureSlots(getNIF(), &NIFShape);
PatchedTextureSets[NIFShapeKey].Original = Slots;
return Slots;
return NIFUtil::getTextureSlots(getNIF(), &NIFShape);
}

auto PatcherShader::setTextureSet(nifly::NiShape &NIFShape, const array<wstring, NUM_TEXTURE_SLOTS> &Textures, bool &NIFModified) -> void {
Expand All @@ -48,6 +46,7 @@ auto PatcherShader::setTextureSet(nifly::NiShape &NIFShape, const array<wstring,
const auto NIFShapeKey = make_tuple(getNIFPath(), TextureSetBlockID);

if (PatchedTextureSets.find(NIFShapeKey) != PatchedTextureSets.end()) {
// This texture set has been patched before
uint32_t NewBlockID = 0;

// already been patched, check if it is the same
Expand Down Expand Up @@ -84,6 +83,10 @@ auto PatcherShader::setTextureSet(nifly::NiShape &NIFShape, const array<wstring,
return;
}

// set original for future use
const auto Slots = NIFUtil::getTextureSlots(getNIF(), &NIFShape);
PatchedTextureSets[NIFShapeKey].Original = Slots;

// set the texture slots for the shape like normal
NIFUtil::setTextureSlots(getNIF(), &NIFShape, Textures, NIFModified);

Expand Down

0 comments on commit f251cbc

Please sign in to comment.