| 860 | } |
| 861 | |
| 862 | ref<GridVolume> SceneCache::readGridVolume(InputStream& stream, const std::vector<ref<Grid>>& grids, ref<Device> pDevice) |
| 863 | { |
| 864 | ref<GridVolume> pGridVolume = GridVolume::create(pDevice, ""); |
| 865 | |
| 866 | stream.read(pGridVolume->mHasAnimation); |
| 867 | stream.read(pGridVolume->mIsAnimated); |
| 868 | stream.read(pGridVolume->mNodeID); |
| 869 | |
| 870 | stream.read(pGridVolume->mName); |
| 871 | for (auto& gridSequence : pGridVolume->mGrids) |
| 872 | { |
| 873 | gridSequence.resize(stream.read<uint32_t>()); |
| 874 | for (auto& pGrid : gridSequence) |
| 875 | { |
| 876 | auto id = stream.read<uint32_t>(); |
| 877 | pGrid = id == uint32_t(-1) ? nullptr : grids[id]; |
| 878 | } |
| 879 | } |
| 880 | stream.read(pGridVolume->mGridFrame); |
| 881 | stream.read(pGridVolume->mGridFrameCount); |
| 882 | stream.read(pGridVolume->mBounds); |
| 883 | stream.read(pGridVolume->mData); |
| 884 | |
| 885 | return pGridVolume; |
| 886 | } |
| 887 | |
| 888 | // Grid |
| 889 | |