|
|
|
@ -392,4 +392,29 @@ void NiPalette::read(NIFStream *nif)
|
|
|
|
|
colors[i] = nif->getUInt() | alphaMask;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NiStringPalette::read(NIFStream *nif)
|
|
|
|
|
{
|
|
|
|
|
unsigned int size = nif->getUInt();
|
|
|
|
|
if (!size)
|
|
|
|
|
return;
|
|
|
|
|
std::vector<char> source;
|
|
|
|
|
nif->getChars(source, size);
|
|
|
|
|
if (nif->getUInt() != size)
|
|
|
|
|
nif->file->warn("Failed size check in NiStringPalette");
|
|
|
|
|
if (source[source.size()-1] != '\0')
|
|
|
|
|
source.emplace_back('\0');
|
|
|
|
|
const char* buffer = source.data();
|
|
|
|
|
while (static_cast<size_t>(buffer - source.data()) < source.size())
|
|
|
|
|
{
|
|
|
|
|
palette.emplace_back(buffer);
|
|
|
|
|
buffer += palette.back().size() + 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NiBoolData::read(NIFStream *nif)
|
|
|
|
|
{
|
|
|
|
|
mKeyList = std::make_shared<ByteKeyMap>();
|
|
|
|
|
mKeyList->read(nif);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // Namespace
|
|
|
|
|