bool ProjectAnimData::readMotionOnly(QFile *file){ if (!file || !file->isOpen()){ return false; } QByteArray line; auto ok = false; auto lineCount = 0UL; if (!chopLine(file, line, lineCount)){ return false; } auto blocksize = line.toULong(&ok); if (!ok){ return false; } animationMotionDataLines = blocksize; while (!file->atEnd()){ //Read individual projects... lineCount = 0; for (; lineCount < blocksize;){ //Get animation motion data... animationMotionData.append(new SkyrimAnimationMotionData(this)); if (!animationMotionData.last()->read(file, lineCount)){ return false; } } return true; } return false; }
bool ProjectAnimData::read(QFile *file){ QByteArray line; auto ok = false; auto lineCount = 0UL; if (file && file->isOpen()){ if (!chopLine(file, line, lineCount)){ return false; } auto blocksize = line.toULong(&ok); if (!ok){ return false; } animationDataLines = blocksize; while (!file->atEnd()){ //Read individual projects... lineCount = 0; if (!chopLine(file, line, lineCount)){ //Read project filepaths... return false; } auto count = line.toULong(&ok); if (!ok || !chopLine(file, line, lineCount)){ return false; } auto numFiles = line.toULong(&ok); if (!ok || numFiles <= 2){ return false; } for (auto j = 0UL; j < numFiles; j++){ if (!chopLine(file, line, lineCount) || (!line.contains(".hkx") && !line.contains(".HKX"))){ return false; } projectFiles.append(line); } if (!chopLine(file, line, lineCount)){ return false; } count = line.toULong(&ok); if (!ok){ return false; } if (count > 0){ for (; lineCount < blocksize;){ //Read animation data... animationData.append(new SkyrimClipGeneratoData(this, "")); if (!animationData.last()->read(file, lineCount)){ return false; } } if (!chopLine(file, line, lineCount)){ return false; } blocksize = line.toULong(&ok); if (!ok){ return false; } lineCount = 0; animationMotionDataLines = blocksize; for (; lineCount < blocksize;){ //Get animation motion data... animationMotionData.append(new SkyrimAnimationMotionData(this)); if (!animationMotionData.last()->read(file, lineCount)){ return false; } } } return true; } } return false; }