Tests for Pfm.hpp, Pfm bugfix related to the endian swapping
This commit is contained in:
@@ -96,6 +96,10 @@ namespace OpenVulkano
|
||||
inStream >> header;
|
||||
size_t size = header.GetElementCount();
|
||||
|
||||
image = std::make_unique<float[]>(size);
|
||||
|
||||
inStream.read(reinterpret_cast<char*>(image.get()), size * sizeof(float));
|
||||
|
||||
if ((std::endian::native == std::endian::little) != header.littleEndian)
|
||||
{
|
||||
char* data = reinterpret_cast<char*>(image.get());
|
||||
@@ -105,9 +109,6 @@ namespace OpenVulkano
|
||||
std::reverse(&data[idx], &data[idx + sizeof(float)]);
|
||||
}
|
||||
}
|
||||
|
||||
image = std::make_unique<float[]>(size);
|
||||
inStream.read(reinterpret_cast<char*>(image.get()), size * sizeof(float));
|
||||
}
|
||||
|
||||
static PfmImage ReadImage(std::istream& inStream)
|
||||
|
||||
Reference in New Issue
Block a user