void AddRenderObjectId(uint renderObjectId, bool forPositionUpdates) { var list = forPositionUpdates ? m_gridRenderComponent.RenderObjectIDs : m_gridRenderComponent.AdditionalRenderObjects; for (int i = 0; i < list.Length; i++) { if (list[i] == MyRenderProxy.RENDER_ID_UNASSIGNED) { list[i] = renderObjectId; MyEntities.AddRenderObjectToMap(renderObjectId, m_gridRenderComponent.Container.Entity); return; } } // When list is full int pos = list.Length; if (forPositionUpdates) { m_gridRenderComponent.ResizeRenderObjectArray(list.Length + 3); } else { var oldSize = m_gridRenderComponent.AdditionalRenderObjects.Length; Array.Resize(ref m_gridRenderComponent.AdditionalRenderObjects, list.Length + 3); for (int i = oldSize; i < list.Length + 3; i++) { m_gridRenderComponent.AdditionalRenderObjects[i] = MyRenderProxy.RENDER_ID_UNASSIGNED; } } list = forPositionUpdates ? m_gridRenderComponent.RenderObjectIDs : m_gridRenderComponent.AdditionalRenderObjects; list[pos] = renderObjectId; MyEntities.AddRenderObjectToMap(renderObjectId, m_gridRenderComponent.Container.Entity); }
public override void SetRenderObjectID(int index, uint ID) { System.Diagnostics.Debug.Assert(m_renderObjectIDs[index] == VRageRender.MyRenderProxy.RENDER_ID_UNASSIGNED); m_renderObjectIDs[index] = ID; MyEntities.AddRenderObjectToMap(ID, Container.Entity); }
public override void SetRenderObjectID(int index, uint ID) { base.m_renderObjectIDs[index] = ID; MyEntities.AddRenderObjectToMap(ID, base.Container.Entity); base.PropagateVisibilityUpdates(false); }