/// <summary> /// Stars loading all roomtextures in a background thread. /// </summary> protected void LoadThreadRoomTextures() { IEnumerator <KeyValuePair <string, BgfFile> > it = RoomTextures.GetEnumerator(); BgfFile file; while (it.MoveNext()) { // load file = new BgfFile(Path.Combine(RoomTexturesFolder, it.Current.Key)); file.DecompressAll(); // update RoomTextures.TryUpdate(it.Current.Key, file, null); queueAsyncFilesLoaded.Enqueue(it.Current.Key); } }
/// <summary> /// Preloads all elements in the RoomTextures dictionary. /// </summary> public void PreloadRoomTextures() { IEnumerator <KeyValuePair <string, BgfFile> > it = RoomTextures.GetEnumerator(); BgfFile file; while (it.MoveNext()) { // load file = new BgfFile(Path.Combine(Config.RoomTexturesFolder, it.Current.Key)); file.DecompressAll(); // update RoomTextures.TryUpdate(it.Current.Key, file, null); } GC.Collect(2); }