A corrupt mesh file could cause the warning to be logged up to uint32_t max times.
We cannot log four billion warnings without a large performance cost.
According to https://gitlab.com/OpenMW/openmw/-/work_items/9024, a corrupt mesh in BCOM could trigger this at least four million times, which triggered the freeze catcher.
This is completely untested, but at least it compiles and I remembered to run the formatter.
This is basically a MR description but this commit covers a lot of things so I'll include it so you don't have to look at the MR:
This allows us to use BC6H and BC7 textures as is, provided the used OSG revision and hardware support them
DDS images are unflipped by default, non-DDS bottom-left convention images are flipped (TGA, BMP, PNG, JPG)
3D DDS images always used top-left convention if they were used in post-processing
Numerous things flipped in this commit to guarantee the same visual results are:
- Terrain UV and blend maps
- Water UV, normal map and simple water ripple alignment
- NiTriShapeData and BSTriShape UV (unflipped), NiUVController vertical offset
- NIF particles are NOT flipped, they remain flipped for Morrowind compatibility
- GUI widget texture UV and convention
- Cursor
- Character preview inventory doll and race menu head UV and display
- Loading screen scene image UV
- Local and global map UVs (fog of war, unexplored and explored maps)
- Saved game screenshot UV
- Video widget UV
- Rain particle alignment
- Sun and moon UV
- Tangent space handedness (bitangent direction)
- Parallax vertical offset
Things where this is a breaking change
- Collada geometry UV (Example Suite and anything else affected must adopt the changes)
- Compressed non-S3TC images that should but can't be flipped (this is KTX which we don't technically support yet)
- Any forward pass shader replacements that currently still use the original tangent space handedness and parallax convention
But do not initialize. If the meta information is invalid and has a big
value, initialization will take significant amount of time but there
might be no actual data in the file because it's too small.
If there is a failure to read the file like incomplete read, bad returns
false, but fail returns true. This is important for reading number of
items more than the file actually has.
bhkListShape contains a list of subshape references that need to be
resolved after initial parsing. Without calling postRecordList(), the
mSubshapes list would contain unresolved RecordPtrs.
This adds the missing post() override to properly load subshape data,
consistent with other NIF record types that contain RecordPtr lists.