mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-09 12:07:51 +03:00
Modernize NiTriStripsData
This commit is contained in:
parent
fda6b0b4f8
commit
eba0ab444b
5 changed files with 19 additions and 20 deletions
|
@ -1,10 +1,11 @@
|
|||
#include "data.hpp"
|
||||
|
||||
#include <components/debug/debuglog.hpp>
|
||||
|
||||
#include "exception.hpp"
|
||||
#include "nifkey.hpp"
|
||||
#include "node.hpp"
|
||||
|
||||
#include <components/debug/debuglog.hpp>
|
||||
|
||||
namespace Nif
|
||||
{
|
||||
void NiGeometryData::read(NIFStream* nif)
|
||||
|
@ -117,22 +118,20 @@ namespace Nif
|
|||
{
|
||||
NiTriBasedGeomData::read(nif);
|
||||
|
||||
// Number of triangle strips
|
||||
int numStrips = nif->getUShort();
|
||||
|
||||
std::vector<unsigned short> lengths;
|
||||
uint16_t numStrips;
|
||||
nif->read(numStrips);
|
||||
std::vector<uint16_t> lengths;
|
||||
nif->readVector(lengths, numStrips);
|
||||
|
||||
// "Has Strips" flag. Exceptionally useful.
|
||||
bool hasStrips = true;
|
||||
if (nif->getVersion() > NIFFile::NIFVersion::VER_OB_OLD)
|
||||
hasStrips = nif->getBoolean();
|
||||
nif->read(hasStrips);
|
||||
if (!hasStrips || !numStrips)
|
||||
return;
|
||||
|
||||
strips.resize(numStrips);
|
||||
mStrips.resize(numStrips);
|
||||
for (int i = 0; i < numStrips; i++)
|
||||
nif->readVector(strips[i], lengths[i]);
|
||||
nif->readVector(mStrips[i], lengths[i]);
|
||||
}
|
||||
|
||||
void NiLinesData::read(NIFStream* nif)
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace Nif
|
|||
struct NiTriStripsData : public NiTriBasedGeomData
|
||||
{
|
||||
// Triangle strips, series of vertex indices.
|
||||
std::vector<std::vector<unsigned short>> strips;
|
||||
std::vector<std::vector<unsigned short>> mStrips;
|
||||
|
||||
void read(NIFStream* nif) override;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue