Skip to content

Commit

Permalink
Fixed wilderness texture mapping endian issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
afritz1 committed Dec 21, 2024
1 parent 841a395 commit 7e22e17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions OpenTESArena/src/Assets/ExeData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ bool ExeData::RaisedPlatforms::init(const char *data, const KeyValueFile &keyVal
initInt16Array(this->boxArraysCopy, data + boxArraysCopyOffset);
initInt16Array(this->box3a, data + box3aOffset);
initInt16Array(this->box3b, data + box3bOffset);
initInt8Array(this->box4, data + box4Offset);
initInt16Array(this->box4, data + box4Offset);

this->heightsInterior.init(this->boxArrays.data(), 8);
this->heightsCity.init(this->boxArrays.data() + 8, 8);
Expand All @@ -739,7 +739,7 @@ bool ExeData::RaisedPlatforms::init(const char *data, const KeyValueFile &keyVal
this->thicknessesWild = this->thicknessesCity;
this->texMappingInterior.init(this->box3a);
this->texMappingCity.init(this->box3b);
this->texMappingWild.init(reinterpret_cast<uint16_t*>(this->box4.data()), 8); // Treat Box4 as a Box3C.
this->texMappingWild.init(this->box4); // Treat Box4 as a Box3C.

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion OpenTESArena/src/Assets/ExeData.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ class ExeData
std::array<uint16_t, 8> box3a, box3b;

// Number of texels tall a 64x64 texture is rendered as, also used with calculation for starting row in texture.
std::array<uint8_t, 16> box4;
std::array<uint16_t, 8> box4;

BufferView<uint16_t> heightsInterior, heightsCity, heightsWild;
BufferView<uint16_t> thicknessesInterior, thicknessesCity, thicknessesWild;
Expand Down

0 comments on commit 7e22e17

Please sign in to comment.