Exemple #1
0
 public static SHP LoadFile(String filename)
 {
     if (LoadedFiles.ContainsKey(filename)) {
         return LoadedFiles[filename];
     }
     var shp = FileSystem.LoadFile(filename);
     if (shp != null) {
         LoadedFiles[filename] = new SHP(shp);
         return LoadedFiles[filename];
     }
     return null;
 }
Exemple #2
0
        public static SHP LoadFile(String filename)
        {
            if (LoadedFiles.ContainsKey(filename))
            {
                return(LoadedFiles[filename]);
            }
            var shp = FileSystem.LoadFile(filename);

            if (shp != null)
            {
                LoadedFiles[filename] = new SHP(shp);
                return(LoadedFiles[filename]);
            }
            return(null);
        }
Exemple #3
0
        private void LoadGameFiles()
        {
            FileSystem.LoadMIX("LANGMD.MIX");
            FileSystem.LoadMIX("LANGUAGE.MIX");

            for (var ix = 99; ix > 0; --ix) {
                var pattern = String.Format("EXPANDMD{0:d2}.MIX", ix);
                FileSystem.LoadMIX(pattern);
            }

            FileSystem.LoadMIX("RA2MD.MIX");
            FileSystem.LoadMIX("RA2.MIX");
            FileSystem.LoadMIX("CACHEMD.MIX");
            FileSystem.LoadMIX("CACHE.MIX");
            FileSystem.LoadMIX("LOCALMD.MIX");
            FileSystem.LoadMIX("LOCAL.MIX");
            FileSystem.LoadMIX("AUDIOMD.MIX");

            foreach (var ecache in Directory.GetFiles(GameDir, "ECACHE*.MIX", SearchOption.TopDirectoryOnly)) {
                FileSystem.LoadMIX(ecache);
            }

            foreach (var elocal in Directory.GetFiles(GameDir, "ELOCAL*.MIX", SearchOption.TopDirectoryOnly)) {
                FileSystem.LoadMIX(elocal);
            }

            FileSystem.LoadMIX("CONQMD.MIX");
            FileSystem.LoadMIX("GENERMD.MIX");
            FileSystem.LoadMIX("GENERIC.MIX");
            FileSystem.LoadMIX("ISOGENMD.MIX");
            FileSystem.LoadMIX("ISOGEN.MIX");
            FileSystem.LoadMIX("CONQUER.MIX");
            FileSystem.LoadMIX("CAMEOMD.MIX");
            FileSystem.LoadMIX("CAMEO.MIX");
            FileSystem.LoadMIX("MAPSMD03.MIX");
            FileSystem.LoadMIX("MULTIMD.MIX");
            FileSystem.LoadMIX("THEMEMD.MIX");
            FileSystem.LoadMIX("MOVMD03.MIX");

            var str = FileSystem.LoadFile("RA2MD.CSF");
            if (str != null) {
                new CSF(str);
            }

            var m = FileSystem.LoadFile("MOUSE.SHA");
            if (m != null) {
                MouseTextures = new SHP(m);
                MouseFrame = 0;
                MouseFrameChanged = true;
            } else {
                throw new InvalidDataException();
            }

            var mp = FileSystem.LoadFile("MOUSEPAL.PAL");
            if (mp != null) {
                MousePalette = new PAL(mp);
                MouseTextures.Palette = MousePalette;
            } else {
                throw new InvalidDataException();
            }

            var p = FileSystem.LoadFile("ANIM.PAL");
            if (p != null) {
                AnimPalette = new PAL(p);
            } else {
                throw new InvalidDataException();
            }

            var rules = FileSystem.LoadFile("RULESMD.INI");
            if (rules != null) {
                INI.Rules_INI = new INI(rules);
            } else {
                throw new InvalidDataException();
            }

            var art = FileSystem.LoadFile("ARTMD.INI");
            if (art != null) {
                INI.Art_INI = new INI(art);
            } else {
                throw new InvalidDataException();
            }
        }