mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 16:10:14 +00:00
Harden transport updates and fix waterfall particle tint
This commit is contained in:
parent
ef6be2f186
commit
4a9c86b1e6
6 changed files with 137 additions and 100 deletions
|
|
@ -408,13 +408,15 @@ void parseFBlock(const std::vector<uint8_t>& data, uint32_t offset,
|
|||
uint32_t ofsKeys = disk.ofsKeys;
|
||||
|
||||
if (valueType == 0) {
|
||||
// Color: 3 bytes per key {r, g, b}
|
||||
// Color: 3 bytes per key.
|
||||
// WotLK particle FBlock color keys are stored as BGR in practice for many assets
|
||||
// (notably water/waterfall emitters). Decode to RGB explicitly.
|
||||
if (ofsKeys + nKeys * 3 > data.size()) return;
|
||||
fb.vec3Values.reserve(nKeys);
|
||||
for (uint32_t i = 0; i < nKeys; i++) {
|
||||
uint8_t r = data[ofsKeys + i * 3 + 0];
|
||||
uint8_t b = data[ofsKeys + i * 3 + 0];
|
||||
uint8_t g = data[ofsKeys + i * 3 + 1];
|
||||
uint8_t b = data[ofsKeys + i * 3 + 2];
|
||||
uint8_t r = data[ofsKeys + i * 3 + 2];
|
||||
fb.vec3Values.emplace_back(r / 255.0f, g / 255.0f, b / 255.0f);
|
||||
}
|
||||
} else if (valueType == 1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue