mirror of
https://github.com/OpenMW/openmw.git
synced 2025-11-30 20:04:33 +00:00
Use proper naming for Nif::RecordPtrT index
This commit is contained in:
parent
e882c1c722
commit
aa4caae2bf
1 changed files with 7 additions and 7 deletions
|
|
@ -18,13 +18,13 @@ namespace Nif
|
||||||
{
|
{
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
intptr_t index;
|
intptr_t mIndex;
|
||||||
X* mPtr;
|
X* mPtr;
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RecordPtrT()
|
RecordPtrT()
|
||||||
: index(-2)
|
: mIndex(-2)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -37,21 +37,21 @@ namespace Nif
|
||||||
void read(NIFStream* nif)
|
void read(NIFStream* nif)
|
||||||
{
|
{
|
||||||
// Can only read the index once
|
// Can only read the index once
|
||||||
assert(index == -2);
|
assert(mIndex == -2);
|
||||||
|
|
||||||
// Store the index for later
|
// Store the index for later
|
||||||
index = nif->get<int32_t>();
|
mIndex = nif->get<int32_t>();
|
||||||
assert(index >= -1);
|
assert(mIndex >= -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Resolve index to pointer
|
/// Resolve index to pointer
|
||||||
void post(Reader& nif)
|
void post(Reader& nif)
|
||||||
{
|
{
|
||||||
if (index < 0)
|
if (mIndex < 0)
|
||||||
mPtr = nullptr;
|
mPtr = nullptr;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Record* r = nif.getRecord(index);
|
Record* r = nif.getRecord(mIndex);
|
||||||
// And cast it
|
// And cast it
|
||||||
mPtr = dynamic_cast<X*>(r);
|
mPtr = dynamic_cast<X*>(r);
|
||||||
assert(mPtr != nullptr);
|
assert(mPtr != nullptr);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue