| 1316 | } |
| 1317 | |
| 1318 | void CFileManager::UopReadAnimationFrameInfo( |
| 1319 | AnimationFrameInfo &result, |
| 1320 | AnimationDirection &direction, |
| 1321 | const UopFileEntry *block, |
| 1322 | bool isCorpse) |
| 1323 | { |
| 1324 | if (block == nullptr || block->Hash == 0) |
| 1325 | { |
| 1326 | return; |
| 1327 | } |
| 1328 | |
| 1329 | std::vector<uint8_t> scratchBuffer; |
| 1330 | scratchBuffer.reserve(block->DecompressedSize); |
| 1331 | if (!UopDecompressBlock(block, scratchBuffer.data(), direction.FileIndex)) |
| 1332 | { |
| 1333 | return; |
| 1334 | } |
| 1335 | // FIXME: CFileManager SHOULD not be a DataReader! In fact, no class need to be. Clean up! |
| 1336 | SetData(scratchBuffer.data(), block->DecompressedSize); |
| 1337 | const auto _header = UopReadAnimationHeader(); |
| 1338 | (void)_header; |
| 1339 | auto frame = UopReadAnimationFrame(); // read only first frame to get image dimensions |
| 1340 | Ptr = frame.DataStart + frame.PixelDataOffset + PALETTE_SIZE; |
| 1341 | auto frameInfo = (AnimationFrameInfo *)Ptr; |
| 1342 | result = *frameInfo; |
| 1343 | Move(sizeof(AnimationFrameInfo)); |
| 1344 | } |
| 1345 | |
| 1346 | inline bool |
| 1347 | CFileManager::UopReadAnimationFrames(const AnimationState &anim, LoadPixelData16Cb pLoadFunc) |
nothing calls this directly
no test coverage detected