| 627 | } |
| 628 | |
| 629 | int seek(int64_t offset) |
| 630 | { |
| 631 | if (offset > length) |
| 632 | { |
| 633 | return 0; |
| 634 | } |
| 635 | // FIXME: This assumes the offset is more or less *sane* |
| 636 | uint32_t blockOffset = offset / blockSize(); |
| 637 | uint32_t posInBlock = offset % blockSize(); |
| 638 | |
| 639 | lbaCurrent = lbaStart + blockOffset; |
| 640 | posInLba = posInBlock; |
| 641 | uint64_t binOffset = lbaToByteOffset(lbaCurrent) + posInLba; |
| 642 | fileStream.seekg(binOffset, std::ios::beg); |
| 643 | return fileStream.good(); |
| 644 | } |
| 645 | |
| 646 | PHYSFS_sint64 tell() |
| 647 | { |
no outgoing calls
no test coverage detected