示例#1
0
        public HITThread(HITFile Src, HITVM VM)
        {
            this.Src  = Src;
            this.VM   = VM;
            Registers = new int[16];
            LocalVar  = new int[54];
            ObjectVar = new int[29];

            Notes          = new List <HITNoteEntry>();
            NotesByChannel = new Dictionary <int, HITNoteEntry>();
            Owners         = new List <int>();

            Stack      = new Stack <int>();
            audContent = Content.Content.Get().Audio;
        }
示例#2
0
        public HITThread(HITFile Src, HITVM VM)
        {
            this.Src     = Src;
            this.VM      = VM;
            Registers    = new int[16];
            Registers[1] = 12; //gender (offset into object var table)
            LocalVar     = new int[54];
            ObjectVar    = new int[29];

            Notes          = new List <HITNoteEntry>();
            NotesByChannel = new Dictionary <SoundEffectInstance, HITNoteEntry>();
            Owners         = new List <int>();

            Stack      = new Stack <int>();
            audContent = Content.Content.Get().Audio;
        }
示例#3
0
        private HITResourceGroup LoadHitGroup(string HITPath, string EVTPath, string HSMPath)
        {
            var events  = new EVT(EVTPath);
            var hitfile = new HITFile(HITPath);
            HSM hsmfile = null;

            if (HSMPath != null)
            {
                hsmfile = new HSM(HSMPath);
            }

            return(new HITResourceGroup()
            {
                evt = events,
                hit = hitfile,
                hsm = hsmfile
            });
        }
示例#4
0
        public void Init()
        {
            //somewhat different from TSO audio - need to scan content for .hot files, then load them all
            //hot contains EVT, tracks, hitlists and patches...
            //...which are added to our global database.

            WAVSounds.Init();
            MP3Sounds.Init();
            XASounds.Init();
            UTKSounds.Init();

            var FilePattern = new Regex(@".*\.hot");

            List <string> matchedFiles = new List <string>();

            foreach (var file in ContentManager.TS1AllFiles)
            {
                if (FilePattern.IsMatch(file.Replace('\\', '/')))
                {
                    matchedFiles.Add(file);
                }
            }
            foreach (var file in matchedFiles)
            {
                //load associated HIT, HSM
                var cFile = Path.Combine(ContentManager.TS1BasePath, file);
                var bPath = cFile.Substring(0, cFile.Length - 4); //path without .hot extension

                var hsm = new HSM(PathCaseTools.Insensitive(bPath + ".hsm"));
                var hit = new HITFile(PathCaseTools.Insensitive(bPath + ".hit"));
                var hot = new Hot(cFile, hsm);

                var group = new HITResourceGroup()
                {
                    hsm = hsm, hit = hit, hot = hot
                };

                foreach (var trk in hot.Tracks)
                {
                    if (TracksById.ContainsKey(trk.Key) && TracksById[trk.Key].SubroutineID != trk.Value.SubroutineID)
                    {
                    }
                    TracksById[trk.Key] = trk.Value;
                }

                foreach (var patch in hot.Patches)
                {
                    if (PatchesById.ContainsKey(patch.Key) && patch.Value.Filename != PatchesById[patch.Key].Filename)
                    {
                    }
                    PatchesById[patch.Key] = patch.Value;
                }

                foreach (var hls in hot.Hitlists)
                {
                    if (HitlistsById.ContainsKey(hls.Key) && HitlistsById[hls.Key].IDs.Count != hls.Value.IDs.Count)
                    {
                    }
                    HitlistsById[hls.Key] = hls.Value;
                }

                foreach (var evt in hot.Events)
                {
                    _Events[evt.Key] = new HITEventRegistration()
                    {
                        Name      = evt.Value.Name,
                        EventType = (FSO.Files.HIT.HITEvents)evt.Value.EventType,
                        TrackID   = evt.Value.TrackID,
                        ResGroup  = group
                    };
                }
            }
            var musics   = Events.Where(x => x.Value.EventType == HITEvents.kSetMusicMode).Select(x => x.Key + ": " + x.Value.TrackID).ToList();
            var stations = Events.Where(x => x.Value.EventType == HITEvents.kTurnOnTV).Select(x => x.Key + ": " + x.Value.TrackID.ToString()).ToList();
            //.Select(x => x.Key + ": " + new string(new char[] { (char)(x.Value.TrackID & 0xFF), (char)((x.Value.TrackID >> 8) & 0xFF), (char)((x.Value.TrackID >> 16) & 0xFF), (char)((x.Value.TrackID >> 24) & 0xFF) })).ToList();
        }