| 838 | // GridVolume |
| 839 | |
| 840 | void SceneCache::writeGridVolume(OutputStream& stream, const ref<GridVolume>& pGridVolume, const std::vector<ref<Grid>>& grids) |
| 841 | { |
| 842 | stream.write(pGridVolume->mHasAnimation); |
| 843 | stream.write(pGridVolume->mIsAnimated); |
| 844 | stream.write(pGridVolume->mNodeID); |
| 845 | |
| 846 | stream.write(pGridVolume->mName); |
| 847 | for (const auto& gridSequence : pGridVolume->mGrids) |
| 848 | { |
| 849 | stream.write((uint32_t)gridSequence.size()); |
| 850 | for (const auto& pGrid : gridSequence) |
| 851 | { |
| 852 | uint32_t id = pGrid ? (uint32_t)std::distance(grids.begin(), std::find(grids.begin(), grids.end(), pGrid)) : uint32_t(-1); |
| 853 | stream.write(id); |
| 854 | } |
| 855 | } |
| 856 | stream.write(pGridVolume->mGridFrame); |
| 857 | stream.write(pGridVolume->mGridFrameCount); |
| 858 | stream.write(pGridVolume->mBounds); |
| 859 | stream.write(pGridVolume->mData); |
| 860 | } |
| 861 | |
| 862 | ref<GridVolume> SceneCache::readGridVolume(InputStream& stream, const std::vector<ref<Grid>>& grids, ref<Device> pDevice) |
| 863 | { |