Exemplo n.º 1
0
        private void LoadLevelFromBig(int absId)
        {
            if (big == null)
            {
                if (File.Exists("bigfile.big"))
                {
                    big = new BigFileReader(File.OpenRead("bigfile.big"));
                }
                else
                {
                    return;
                }
            }

            big.FileCursor = absId;

            if (Path.GetExtension(big.GetFilename()) != ".vrm")
            {
                return;
            }

            Helpers.WriteToFile(Path.Combine(Meta.BasePath, big.GetFilename()), big.ReadFile());

            big.NextFile();

            if (Path.GetExtension(big.GetFilename()) != ".lev")
            {
                return;
            }

            Helpers.WriteToFile(Path.Combine(Meta.BasePath, big.GetFilename()), big.ReadFile());

            LoadStuff(new string[] { Path.Combine(Meta.BasePath, big.GetFilename()) });
        }
Exemplo n.º 2
0
        /// <summary>
        /// Loads scenes from BIG file.
        /// </summary>
        /// <param name="absId">Array of absolute file indices.</param>
        private void LoadLevelsFromBig(params int[] absId)
        {
            //test whether big file is ready
            if (big == null && !FindBigFile())
            {
                GameConsole.Write("Missing BIGFILE!");
                return;
            }

            List <Scene> scenes = new List <Scene>();

            for (int i = 0; i < absId.Length; i++)
            {
                //if it's a level, consider level type to load (1p, 2p, 4p, tt)
                if (absId[i] < 200)
                {
                    absId[i] += (int)levelType * 2;
                }

                big.FileCursor = absId[i];

                if (Path.GetExtension(big.GetFilename()) != ".vrm")
                {
                    return;
                }

                CtrVrm vrm = big.ReadEntry().ParseAs <CtrVrm>();

                big.NextFile();

                if (Path.GetExtension(big.GetFilename()) != ".lev")
                {
                    return;
                }

                Scene scene = big.ReadEntry().ParseAs <Scene>();
                scene.SetVram(vrm);

                scenes.Add(scene);
            }

            LoadStuff(scenes);
        }