/** * Write a voxel to the save game. * @param svr Output stream to write. */ void Voxel::Save(Saver &svr) const { svr.PutLong(this->ground); if (this->instance >= SRI_RIDES_START && this->instance < SRI_FULL_RIDES) { svr.PutByte(this->instance); svr.PutWord(this->instance_data); } else { svr.PutByte(SRI_FREE); // Full rides save their own data from the world. } svr.PutWord(this->fences); }
/** * Save a voxel stack to the save game file. * @param svr Output stream to write. */ void VoxelStack::Save(Saver &svr) const { svr.StartBlock("VSTK", 3); svr.PutWord(this->base); svr.PutWord(this->height); svr.PutByte(this->owner); for (uint i = 0; i < this->height; i++) this->voxels[i].Save(svr); svr.EndBlock(); }