public static bool UpdateModels(this Map map, Document document) { if (Sledge.Settings.View.DisableModelRendering) return false; var cache = document.GetMemory<Dictionary<string, ModelReference>>("ModelCache"); if (cache == null) { cache = new Dictionary<string, ModelReference>(); document.SetMemory("ModelCache", cache); } return UpdateModels(document, map.WorldSpawn, cache); }
public static bool UpdateModels(this Map map, Document document, IEnumerable<MapObject> objects) { if (Sledge.Settings.View.DisableModelRendering) return false; var cache = document.GetMemory<Dictionary<string, ModelReference>>("ModelCache"); if (cache == null) { cache = new Dictionary<string, ModelReference>(); document.SetMemory("ModelCache", cache); } var updated = false; foreach (var mo in objects) updated |= UpdateModels(document, mo, cache); return updated; }