public static MixTemplate[] LoadTemplates(Theater theater) { ArrayList alMagicTable = GetTemplateList(); MixReader mixr = new MixReader(s_astrTheaterFileNames[(int)theater]); // Load palette Stream stm = mixr.GetFileStream(s_idePalette[(int)theater] - 1); Color[] aclrPalette = LoadPalette(stm); stm.Close(); // Load templates ArrayList alsTemplates = new ArrayList(); foreach (MagicEntry me in alMagicTable) { if (me.aiTheater[(int)theater] == 0xff) { alsTemplates.Add(null); continue; } stm = mixr.GetFileStream(me.aiTheater[(int)theater] - 1); alsTemplates.Add(new MixTemplate(stm, me.ctx, me.cty, aclrPalette, me.index)); stm.Close(); } mixr.Dispose(); return((MixTemplate[])alsTemplates.ToArray(typeof(MixTemplate))); }
public static MixMap LoadMap(Stream stm, MixTemplate[] amixt) { MixReader mixr = new MixReader("general.mix"); MixMap map = new MixMap(stm, amixt); mixr.Dispose(); return(map); }
public static MixTemplate[] LoadTemplates(Theater theater) { ArrayList alMagicTable = GetTemplateList(); MixReader mixr = new MixReader(s_astrTheaterFileNames[(int)theater]); // Load palette Stream stm = mixr.GetFileStream(s_idePalette[(int)theater] - 1); Color[] aclrPalette = LoadPalette(stm); stm.Close(); // Load templates ArrayList alsTemplates = new ArrayList(); foreach (MagicEntry me in alMagicTable) { if (me.aiTheater[(int)theater] == 0xff) { alsTemplates.Add(null); continue; } stm = mixr.GetFileStream(me.aiTheater[(int)theater] - 1); alsTemplates.Add(new MixTemplate(stm, me.ctx, me.cty, aclrPalette, me.index)); stm.Close(); } mixr.Dispose(); return (MixTemplate[])alsTemplates.ToArray(typeof(MixTemplate)); }
public static MixMap LoadMap(Stream stm, MixTemplate[] amixt) { MixReader mixr = new MixReader("general.mix"); MixMap map = new MixMap(stm, amixt); mixr.Dispose(); return map; }