diff --git a/README.md b/README.md index 2b351db12..13dcf60a7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,7 @@ # studiomodelpp -A modern C++ library for sanely parsing Valve's studiomodel formats +A modern C++ library for sanely parsing Valve's studiomodel formats. + +Currently supports: +- MDL v44-v49 +- VTX v7 +- VVD v4 diff --git a/src/structs/VTX.cpp b/src/structs/VTX.cpp index 3938f86c8..d137217b8 100644 --- a/src/structs/VTX.cpp +++ b/src/structs/VTX.cpp @@ -9,6 +9,10 @@ bool VTX::open(const std::byte* data, std::size_t size, const MDL::MDL& mdl) { BufferStream stream{data, size}; stream.read(this->version); + if (this->version != 7) { + return false; + } + stream.read(this->vertexCacheSize); stream.read(this->maxBonesPerStrip); stream.read(this->maxBonesPerTriangle); diff --git a/src/structs/VVD.cpp b/src/structs/VVD.cpp index c029de1c1..9b0ab6eab 100644 --- a/src/structs/VVD.cpp +++ b/src/structs/VVD.cpp @@ -16,6 +16,9 @@ bool VVD::open(const std::byte* data, std::size_t size, const MDL::MDL& mdl) { } stream.read(this->version); + if (this->version != 4) { + return false; + } int checksum = stream.read(); if (checksum != mdl.checksum) {