示例#1
0
        private void PrintScene(int sceneId, StringBuilder sb)
        {
            Scene       scene = null;
            List <Room> rooms = new List <Room>();

            //try
            //{
            scene = SceneRoomReader.InitializeScene(rom.Files.GetSceneFile(sceneId), sceneId);
            //}
            //catch { }
            if (scene == null)
            {
                sb.AppendFormat("Exception: Scene not found");
                sb.AppendLine();
                return;
            }

            var roomAddrs = scene.Header.GetRoomAddresses();

            for (int i = 0; i < roomAddrs.Count; i++)
            {
                FileAddress addr = roomAddrs[i];

                //if (scene.ID == 6 && rom.Version == ORom.Build.N0)
                //{
                //    rooms.Add(SceneRoomReader.LoadSpiritRoom(addr, i));
                //}
                //else

                try
                {
                    RomFile file = rom.Files.GetFile(addr);
                    rooms.Add(SceneRoomReader.InitializeRoom(file));
                }
                catch
                {
                    sb.AppendLine($"Exception: room {addr.Start:X8} not found");
                }
            }

            sb.Append(SceneRoomReader.ReadScene(scene));
            for (int i = 0; i < rooms.Count; i++)
            {
                sb.AppendLine($"Room {i}");
                sb.Append(SceneRoomReader.ReadRoom(rooms[i]));
            }
        }
示例#2
0
        private void GetMMSceneData()
        {
            List <string> file;

            if (!int.TryParse(inputTextBox.Text, out int sceneIndex))
            {
                return;
            }

            file = SingleDialog();
            if (file == null)
            {
                return;
            }

            Rom r = new MRom(file[0], MRom.Build.U0);

            mzxrules.OcaLib.SceneRoom.Scene scene = SceneRoomReader.InitializeScene(r.Files.GetSceneFile(sceneIndex), sceneIndex);
            outRichTextBox.Text = SceneRoomReader.ReadScene(scene);
        }