Ejemplo n.º 1
0
            private bool TryCancelMergeJob(int divideIndex, MeshId meshIdToRemove)
            {
                bool canceled = false;

                if (m_mergeJobs[divideIndex].LodMeshesBeingMerged.Count > 0)
                {
                    // Send the cancel message
                    MyRenderProxy.CancelVoxelMeshMerge(m_parentClipmap.Id, m_mergeJobs[divideIndex].CurrentWorkId);

                    if (meshIdToRemove != MeshId.NULL)
                    {
                        m_mergeJobs[divideIndex].LodMeshesBeingMerged.Remove(MyMeshes.GetLodMesh(meshIdToRemove, 0));
                    }

                    // Put the canceled meshes back into the correct pending queue
                    var mergedId = MyMeshes.GetMergedLodMesh(m_mergedLodMeshProxies[divideIndex].MeshId, 0);
                    mergedId.Info.PendingLodMeshes.UnionWith(m_mergeJobs[divideIndex].LodMeshesBeingMerged);

                    ResetMerge(divideIndex);
                    canceled = true;
                }
                return(canceled);
            }