static void LoadVoxelsForUnit(VoxelLoader loader, string unit, MiniYaml sequences) { Game.ModData.LoadScreen.Display(); try { var seq = sequences.ToDictionary(my => LoadVoxel(loader, unit, my)); units.Add(unit, seq); } catch (FileNotFoundException) { } // Do nothing; we can crash later if we actually wanted art }
public static void Initialize(VoxelLoader loader, IReadOnlyFileSystem fileSystem, List <MiniYamlNode> sequences) { units = new Dictionary <string, Dictionary <string, Voxel> >(); foreach (var s in sequences) { LoadVoxelsForUnit(loader, s.Key, s.Value); } loader.RefreshBuffer(); }
public void InitializeLoaders() { // all this manipulation of static crap here is nasty and breaks // horribly when you use ModData in unexpected ways. ChromeMetrics.Initialize(Manifest.ChromeMetrics); ChromeProvider.Initialize(Manifest.Chrome); VoxelLoader = new VoxelLoader(); CursorProvider = new CursorProvider(this); }
public Voxel(VoxelLoader loader, VxlReader vxl, HvaReader hva) { if (vxl.LimbCount != hva.LimbCount) throw new InvalidOperationException("Voxel and hva limb counts don't match"); transforms = hva.Transforms; Frames = hva.FrameCount; Limbs = hva.LimbCount; limbData = new Limb[vxl.LimbCount]; for (var i = 0; i < vxl.LimbCount; i++) { var vl = vxl.Limbs[i]; var l = new Limb(); l.Scale = vl.Scale; l.Bounds = (float[])vl.Bounds.Clone(); l.Size = (byte[])vl.Size.Clone(); l.RenderData = loader.GenerateRenderData(vxl.Limbs[i]); limbData[i] = l; } }
static Voxel LoadVoxel(VoxelLoader voxelLoader, string unit, MiniYaml info) { var vxl = unit; var hva = unit; if (info.Value != null) { var fields = info.Value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (fields.Length >= 1) { vxl = hva = fields[0].Trim(); } if (fields.Length >= 2) { hva = fields[1].Trim(); } } return(voxelLoader.Load(vxl, hva)); }
public Voxel(VoxelLoader loader, VxlReader vxl, HvaReader hva) { if (vxl.LimbCount != hva.LimbCount) { throw new InvalidOperationException("Voxel and hva limb counts don't match"); } transforms = hva.Transforms; Frames = hva.FrameCount; Limbs = hva.LimbCount; limbData = new Limb[vxl.LimbCount]; for (var i = 0; i < vxl.LimbCount; i++) { var vl = vxl.Limbs[i]; var l = new Limb(); l.Scale = vl.Scale; l.Bounds = (float[])vl.Bounds.Clone(); l.Size = (byte[])vl.Size.Clone(); l.RenderData = loader.GenerateRenderData(vxl.Limbs[i]); limbData[i] = l; } }
public void InitializeLoaders() { // all this manipulation of static crap here is nasty and breaks // horribly when you use ModData in unexpected ways. ChromeMetrics.Initialize(Manifest.ChromeMetrics); ChromeProvider.Initialize(Manifest.Chrome); SheetBuilder = new SheetBuilder(SheetType.Indexed); SpriteLoader = new SpriteLoader(new string[] { ".shp" }, SheetBuilder); VoxelLoader = new VoxelLoader(); CursorProvider.Initialize(Manifest.Cursors); }