Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rwcore/loaders/LoaderDFF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ GeometryPtr LoaderDFF::readGeometry(const RWBStream &stream) {
std::vector<GeometryVertex> verts;
verts.resize(numVerts);

if (geomStream.getChunkVersion() < 0x1003FFFF) {
if (geomStream.getChunkVersion() < 0x34003) {
headerPtr += sizeof(RW::BSGeometryColor);
}

Expand Down
9 changes: 6 additions & 3 deletions rwcore/loaders/RWBinaryStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RWBStream {
std::ptrdiff_t _size;
char* _dataCur;
char* _nextChunk;
std::uint32_t _chunkVersion;
std::uint32_t _chunkStamp;
size_t _currChunkSz;

public:
Expand All @@ -50,7 +50,7 @@ class RWBStream {
_currChunkSz = bit_cast<std::uint32_t>(*_dataCur);
_dataCur += sizeof(std::uint32_t);

_chunkVersion = bit_cast<std::uint32_t>(*_dataCur);
_chunkStamp = bit_cast<std::uint32_t>(*_dataCur);
_dataCur += sizeof(std::uint32_t);

_nextChunk = _dataCur + _currChunkSz;
Expand All @@ -67,7 +67,10 @@ class RWBStream {
}

std::uint32_t getChunkVersion() const {
return _chunkVersion;
if (_chunkStamp & 0xFFFF0000)
return ((_chunkStamp >> 14 & 0x3FF00) + 0x30000) |
(_chunkStamp >> 16 & 0x3F);
return _chunkStamp << 8;
}

/**
Expand Down