WIP, commit to be able to pull stuff down

This commit is contained in:
Teejoon
2016-02-04 14:58:46 +01:00
parent da49dc35ee
commit 336b058c9f
8 changed files with 188 additions and 89 deletions
+3 -3
View File
@@ -40,9 +40,9 @@ void RawModelCustom::ReadMeshFile(std::string filePath)
void RawModelCustom::ReadMeshFileHeader(unsigned int& offset, char* fileData, unsigned int& fileByteSize)
{
#ifdef BOOST_LITTLE_ENDIAN
isSkined = *(unsigned int*)(fileData + offset);
hasSkin = *(bool*)(fileData + offset);
offset += sizeof(bool);
if (isSkined) {
if (hasSkin) {
m_SkinedVertices.resize(*(unsigned int*)(fileData + offset));
}
else {
@@ -64,7 +64,7 @@ void RawModelCustom::ReadMesh(unsigned int& offset, char* fileData, unsigned int
void RawModelCustom::ReadVertices(unsigned int& offset, char* fileData, unsigned int& fileByteSize)
{
#ifdef BOOST_LITTLE_ENDIAN
if (isSkined) {
if (hasSkin) {
if (offset + m_SkinedVertices.size() * sizeof(SkinedVertex) > fileByteSize) {
throw Resource::FailedLoadingException("Reading skined vertices failed");
}