fix the errors. ArgumentException: Value does not fall within the expected range.…
- User
fix the errors. ArgumentException: Value does not fall within the expected range.
IEnumerator TextureRequests() { while (true) { var totalAllowedInOneFrame = 10; while (_readyTextureQueue.TryDequeue(out var textureItem) && textureItem is not null && totalAllowedInOneFrame-- > 0) { ClientManager.assetManager.MainThreadTextureReinitialize(textureItem.Data, textureItem.UUID, textureItem.Width, textureItem.Height, textureItem.Components); } yield return Wait100ms; } }
void AllTextureRequests() { var totalAllowedInOneFrame = 10; while (_readyTextureQueue.TryDequeue(out var textureItem) && textureItem is not null && totalAllowedInOneFrame-- > 0) { ClientManager.assetManager.MainThreadTextureReinitialize(textureItem.Data, textureItem.UUID, textureItem.Width, textureItem.Height, textureItem.Components); } }
void ServiceReadyAnimationQueue() { if (UseAnims) { ServiceQueueRepeatedly(_decodedAnimationQueue, this.meshObjectManager.SetupAnimation);
while (_loadedAnimationRequest.TryDequeue(out var animationItem) && animationItem is not null) { this.meshObjectManager.SetupAnimation(animationItem.Item2, animationItem.Item1); } }}
void ServiceReadyMeshQueue() { ServiceQueueRepeatedly(_decodedMeshQueue, this.meshObjectManager.SetupMeshObject); }
private void ServiceQueueRepeatedly(IConcurrentQueue queue, Action action) { uint limit = _config.LimitQueueItemsPerUpdateTo; uint count = 0; do { if (!queue.TryDequeue(out var item) || item is null) return; action(item); } while (count++ < limit); }
bool DoOneDecodedMesh() { if (!_decodedMeshQueue.TryDequeue(out var item) || item is null) return false; // DoDecodedMesh(item); this.meshObjectManager.SetupMeshObject(item); return true; }
public ConcurrentQueue unTexturedPrims = new();
void AllObjectsUpdate(float t) { while (objectUpdates.TryDequeue(out var update) && update is not null) { if (update.IsNew && !scenePrims.ContainsKey(update.Prim.LocalID)) { MkOBJ.NewObject(update.Prim); continue; } else if (scenePrims.ContainsKey(update.Prim.LocalID)) { scenePrims[update.Prim.LocalID].UpdateObject(update, t); } }
}
void ObjectBlockUpdates(float t) { while (objectDataBlockUpdates.TryDequeue(out var update) && update is not null) { if (scenePrims.ContainsKey(update.Prim.LocalID)) { scenePrims[update.Prim.LocalID].ObjectBlockUpdate(update, t); } } }
- Assistant