From b0dfd7456210ea52e98fc9c809c8865fa5eaa045 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Thu, 14 Sep 2023 01:54:27 +0300 Subject: [PATCH] NIFStream: remove getBoolean, getString --- components/nif/nifstream.hpp | 2 -- components/nif/node.cpp | 8 ++++---- components/nif/property.cpp | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/components/nif/nifstream.hpp b/components/nif/nifstream.hpp index c1f7cfdf12..8a4ec847fc 100644 --- a/components/nif/nifstream.hpp +++ b/components/nif/nifstream.hpp @@ -156,8 +156,6 @@ namespace Nif osg::Vec2f getVector2() { return get(); } osg::Vec3f getVector3() { return get(); } osg::Vec4f getVector4() { return get(); } - bool getBoolean() { return get(); } - std::string getString() { return get(); } }; template <> diff --git a/components/nif/node.cpp b/components/nif/node.cpp index ad966097b0..a9e4f183b2 100644 --- a/components/nif/node.cpp +++ b/components/nif/node.cpp @@ -153,8 +153,8 @@ namespace Nif if (nif->getVersion() < NIFStream::generateVersion(10, 0, 1, 0)) return; unsigned int num = 0; - if (nif->getVersion() <= NIFStream::generateVersion(20, 1, 0, 3)) - num = nif->getBoolean(); // Has Shader + if (nif->getVersion() <= NIFStream::generateVersion(20, 1, 0, 3) && nif->get()) + num = 1; else if (nif->getVersion() >= NIFStream::generateVersion(20, 2, 0, 5)) num = nif->getUInt(); @@ -163,7 +163,7 @@ namespace Nif if (nif->getVersion() >= NIFStream::generateVersion(20, 2, 0, 5)) active = nif->getUInt(); if (nif->getVersion() >= NIFFile::NIFVersion::VER_BGS) - needsUpdate = nif->getBoolean(); + nif->read(needsUpdate); } void NiGeometry::read(NIFStream* nif) @@ -210,7 +210,7 @@ namespace Nif nearDist = nif->getFloat(); farDist = nif->getFloat(); if (nif->getVersion() >= NIFStream::generateVersion(10, 1, 0, 0)) - orthographic = nif->getBoolean(); + nif->read(orthographic); vleft = nif->getFloat(); vright = nif->getFloat(); vtop = nif->getFloat(); diff --git a/components/nif/property.cpp b/components/nif/property.cpp index 39a7cbff23..3569fd55cc 100644 --- a/components/nif/property.cpp +++ b/components/nif/property.cpp @@ -8,7 +8,7 @@ namespace Nif void NiTexturingProperty::Texture::read(NIFStream* nif) { - inUse = nif->getBoolean(); + nif->read(inUse); if (!inUse) return; @@ -36,7 +36,7 @@ namespace Nif nif->skip(2); // Unknown short else if (nif->getVersion() >= NIFStream::generateVersion(10, 1, 0, 0)) { - if (nif->getBoolean()) // Has texture transform + if (nif->get()) // Has texture transform { nif->getVector2(); // UV translation nif->getVector2(); // UV scale