private static uint GenerateTextureIndex(MyLiveData emitter) { if (emitter.GPUEmitter.AtlasDimension.X >= MAX_ATLAS_DIMENSION) { MyRenderProxy.Error("emitter.AtlasDimension.X < " + MAX_ATLAS_DIMENSION); } if (emitter.GPUEmitter.AtlasDimension.Y >= MAX_ATLAS_DIMENSION) { MyRenderProxy.Error("emitter.AtlasDimension.Y < " + MAX_ATLAS_DIMENSION); } uint atlasOffset = (uint)emitter.GPUEmitter.AtlasFrameOffset; if (atlasOffset >= MAX_ATLAS_INDEX) { MyRenderProxy.Error("atlasOffset < " + MAX_ATLAS_INDEX); } if (emitter.GPUEmitter.AtlasFrameModulo >= ((1 << ATLAS_INDEX_BITS) - 1)) { MyRenderProxy.Error("emitter.AtlasFrameModulo < " + ((1 << ATLAS_INDEX_BITS) - 1)); } if ((emitter.GPUEmitter.AtlasFrameOffset + emitter.GPUEmitter.AtlasFrameModulo - 1) >= (emitter.GPUEmitter.AtlasDimension.X * emitter.GPUEmitter.AtlasDimension.Y)) { MyRenderProxy.Error("Emitter animation is out of bounds. (emitter.AtlasFrameOffset + emitter.AtlasFrameModulo - 1) < (emitter.AtlasDimension.X * emitter.AtlasDimension.Y)"); } return(atlasOffset | ((uint)emitter.GPUEmitter.AtlasDimension.X << (ATLAS_INDEX_BITS + ATLAS_DIMENSION_BITS)) | ((uint)emitter.GPUEmitter.AtlasDimension.Y << (ATLAS_INDEX_BITS))); }
private static void Remove(MyLiveData emitter) { if (emitter.BufferIndex != -1) { m_freeBufferIndices.Push(emitter.BufferIndex); } m_emitters.Remove(emitter.GPUEmitter.GID); MarkTextureUnused(emitter.GPUEmitter.AtlasTexture); }
private static void Remove(MyLiveData emitter) { if (emitter.BufferIndex != -1) { m_freeBufferIndices.Push(emitter.BufferIndex); } m_emitters.Remove(emitter.GPUEmitter.GID); RemoveTexture(emitter.TextureId); }
private static uint GenerateTextureIndex(MyLiveData emitter) { if (emitter.GPUEmitter.AtlasDimension.X >= MAX_ATLAS_DIMENSION) MyRenderProxy.Error("emitter.AtlasDimension.X < " + MAX_ATLAS_DIMENSION); if (emitter.GPUEmitter.AtlasDimension.Y >= MAX_ATLAS_DIMENSION) MyRenderProxy.Error("emitter.AtlasDimension.Y < " + MAX_ATLAS_DIMENSION); uint atlasOffset = (uint)emitter.GPUEmitter.AtlasFrameOffset; if (atlasOffset >= MAX_ATLAS_INDEX) MyRenderProxy.Error("atlasOffset < " + MAX_ATLAS_INDEX); if (emitter.GPUEmitter.AtlasFrameModulo >= ((1 << ATLAS_INDEX_BITS) - 1)) MyRenderProxy.Error("emitter.AtlasFrameModulo < " + ((1 << ATLAS_INDEX_BITS) - 1)); if ((emitter.GPUEmitter.AtlasFrameOffset + emitter.GPUEmitter.AtlasFrameModulo - 1) >= (emitter.GPUEmitter.AtlasDimension.X * emitter.GPUEmitter.AtlasDimension.Y)) MyRenderProxy.Error("Emitter animation is out of bounds. (emitter.AtlasFrameOffset + emitter.AtlasFrameModulo - 1) < (emitter.AtlasDimension.X * emitter.AtlasDimension.Y)"); return atlasOffset | ((uint)emitter.GPUEmitter.AtlasDimension.X << (ATLAS_INDEX_BITS + ATLAS_DIMENSION_BITS)) | ((uint)emitter.GPUEmitter.AtlasDimension.Y << (ATLAS_INDEX_BITS)); }
private static void Remove(MyLiveData emitter) { if (emitter.BufferIndex != -1) m_freeBufferIndices.Push(emitter.BufferIndex); m_emitters.Remove(emitter.GPUEmitter.GID); RemoveTexture(emitter.TextureId); }
private static void Remove(MyLiveData emitter) { if (emitter.BufferIndex != -1) m_freeBufferIndices.Push(emitter.BufferIndex); m_emitters.Remove(emitter.GPUEmitter.GID); MarkTextureUnused(emitter.GPUEmitter.AtlasTexture); }