mirror of
https://github.com/libAthena/athena.git
synced 2025-06-05 06:03:43 +00:00
fix for vector readers
This commit is contained in:
parent
7b1b027192
commit
fd3db3e1db
2
PKGBUILD
2
PKGBUILD
@ -1,7 +1,7 @@
|
||||
# PKGBUILD for libAthena
|
||||
_pkgname=libathena
|
||||
pkgname=$_pkgname-git
|
||||
pkgver=1.1.0.17.gfb722a9
|
||||
pkgver=1.1.0.34.g7b1b027
|
||||
pkgrel=1
|
||||
pkgdesc="Basic cross platform IO library"
|
||||
arch=('i686' 'x86_64')
|
||||
|
@ -303,11 +303,11 @@ bool FileReader::readBool()
|
||||
|
||||
atVec3f FileReader::readVec3f()
|
||||
{
|
||||
atVec3f val = {};
|
||||
if (!isOpen())
|
||||
THROW_INVALID_OPERATION_EXCEPTION_RETURN({}, "File not open for reading");
|
||||
THROW_INVALID_OPERATION_EXCEPTION_RETURN(val, "File not open for reading");
|
||||
|
||||
m_bitValid = false;
|
||||
atVec3f val = {};
|
||||
fread(&val, 1, 12, m_fileHandle);
|
||||
|
||||
if ((!utility::isSystemBigEndian() && isBigEndian()) || (utility::isSystemBigEndian() && isLittleEndian()))
|
||||
@ -322,11 +322,11 @@ atVec3f FileReader::readVec3f()
|
||||
|
||||
atVec4f FileReader::readVec4f()
|
||||
{
|
||||
atVec4f val = {};
|
||||
if (!isOpen())
|
||||
THROW_INVALID_OPERATION_EXCEPTION_RETURN({}, "File not open for reading");
|
||||
THROW_INVALID_OPERATION_EXCEPTION_RETURN(val, "File not open for reading");
|
||||
|
||||
m_bitValid = false;
|
||||
atVec4f val = {};
|
||||
fread(&val, 1, 16, m_fileHandle);
|
||||
|
||||
if ((!utility::isSystemBigEndian() && isBigEndian()) || (utility::isSystemBigEndian() && isLittleEndian()))
|
||||
|
@ -431,7 +431,10 @@ atVec3f MemoryReader::readVec3f()
|
||||
}
|
||||
|
||||
if (m_position + 12 > m_length)
|
||||
THROW_IO_EXCEPTION_RETURN({}, "Position %0.8X outside stream bounds ", m_position);
|
||||
{
|
||||
atVec3f zero = {};
|
||||
THROW_IO_EXCEPTION_RETURN(zero, "Position %0.8X outside stream bounds ", m_position);
|
||||
}
|
||||
|
||||
float* source = (float*)(m_data + m_position);
|
||||
atVec3f result = {source[0], source[1], source[2]};
|
||||
@ -464,7 +467,10 @@ atVec4f MemoryReader::readVec4f()
|
||||
}
|
||||
|
||||
if (m_position + 16 > m_length)
|
||||
THROW_IO_EXCEPTION_RETURN({}, "Position %0.8X outside stream bounds ", m_position);
|
||||
{
|
||||
atVec4f zero = {};
|
||||
THROW_IO_EXCEPTION_RETURN(zero, "Position %0.8X outside stream bounds ", m_position);
|
||||
}
|
||||
|
||||
float* source = (float*)(m_data + m_position);
|
||||
atVec4f result = {source[0], source[1], source[2], source[3]};
|
||||
|
Loading…
x
Reference in New Issue
Block a user