Beispiel #1
0
        private LotThumbEntry GetLotEntryForFrame(uint shardID, uint location)
        {
            LotThumbEntry result = null;
            var           key    = (((ulong)shardID) << 32) | location;

            if (!Entries.TryGetValue(key, out result))
            {
                result = new LotThumbEntry()
                {
                    Location = location
                };
                result.LotTexture = DefaultThumb;
                Client.GetThumbnailAsync(shardID, location, (data) =>
                {
                    if (data != null && !result.Dead && !result.Loaded)
                    {
                        using (var mem = new MemoryStream(data))
                        {
                            result.Loaded = true;
                            try
                            {
                                result.LotTexture = ImageLoader.FromStream(GameFacade.GraphicsDevice, mem);
                            } catch
                            {
                                result.LotTexture = new Texture2D(GameFacade.GraphicsDevice, 1, 1);
                            }
                        }
                    }
                });
                Entries[key] = result;
            }
            result.LastDrawSecond = Second;
            return(result);
        }
Beispiel #2
0
        public void ReleaseLotThumb(uint shardID, uint location)
        {
            LotThumbEntry result = null;
            var           key    = (((ulong)shardID) << 32) | location;

            if (Entries.TryGetValue(key, out result))
            {
                result.Held--;
            }
        }