Skip to content

Commit 852960f

Browse files
vtfpp: remove no_mip flag on load if vtf has multiple mips
1 parent 46593bd commit 852960f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/vtfpp/VTF.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,11 @@ VTF::VTF(std::vector<std::byte>&& vtfData, bool parseHeaderOnly)
399399
if (this->version < 5 && (this->format == ImageFormat::RGBA1010102 || this->format == ImageFormat::BGRA1010102 || this->format == ImageFormat::R16F)) {
400400
this->format = static_cast<ImageFormat>(static_cast<int32_t>(this->format) - 3);
401401
}
402+
// We need to apply this transform because of the broken Borealis skybox in HL2.
403+
// Thanks Valve! If this transform isn't applied it breaks conversion to console formats.
404+
if (this->flags & FLAG_V0_NO_MIP && this->mipCount > 1) {
405+
this->removeFlags(FLAG_V0_NO_MIP);
406+
}
402407
};
403408

404409
switch (this->platform) {
@@ -1963,11 +1968,6 @@ void VTF::computeFallback(ImageConversion::ResizeFilter filter) {
19631968
return;
19641969
}
19651970

1966-
const auto* imageResource = this->getResourceInternal(Resource::TYPE_IMAGE_DATA);
1967-
if (!imageResource) {
1968-
return;
1969-
}
1970-
19711971
const auto faceCount = this->getFaceCount();
19721972

19731973
this->fallbackWidth = 8;

0 commit comments

Comments
 (0)