Пример #1
0
        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)));
        }
Пример #2
0
        public static MixMap LoadMap(Stream stm, MixTemplate[] amixt)
        {
            MixReader mixr = new MixReader("general.mix");
            MixMap    map  = new MixMap(stm, amixt);

            mixr.Dispose();
            return(map);
        }
Пример #3
0
        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));
        }
Пример #4
0
 public static MixMap LoadMap(Stream stm, MixTemplate[] amixt)
 {
     MixReader mixr = new MixReader("general.mix");
     MixMap map = new MixMap(stm, amixt);
     mixr.Dispose();
     return map;
 }