コード例 #1
0
        public MxeIndexEntry(int position)
        {
            _position = position;

            _index    = new MxeWord(position, "iIndex");
            _vm       = new MxeWord(position + 0x4, "pVm");
            _typeCode = new MxeWord(position + 0x8, "iType");
            _address  = new MxeWord(position + 0xC, "hAddress");
        }
コード例 #2
0
ファイル: MxeIndexEntry.cs プロジェクト: dhavard/ValkyrieEdit
        public MxeIndexEntry(int position)
        {
            _position = position;

            _index = new MxeWord(position, "iIndex");
            _vm = new MxeWord(position + 0x4, "pVm");
            _typeCode = new MxeWord(position + 0x8, "iType");
            _address = new MxeWord(position + 0xC, "hAddress");
        }
コード例 #3
0
ファイル: MtpIndexEntry.cs プロジェクト: dhavard/ValkyrieEdit
        public MtpIndexEntry(int position, MtpParser parser, MtpIndexEntry prev)
        {
            _position = position;
            _parser = parser;
            _previous = prev;

            _id = new MxeWord(position, "hId");
            _actor = new MxeWord(position + 0x4, "hActor");
            _start = new MxeWord(position + 0x8, "hStart");
            _unknown = new MxeWord(position + 0xC, "hUnknown");
        }
コード例 #4
0
        public MtpTimingEntry( FileStream fs, int pos )
        {
            _filename = fs.Name;

            _id = new MxeWord(pos, "hTimingId");
            _frames = new MxeWord(pos, "hStartframeCountframes");
            _unknown1 = new MxeWord(pos, "hUnknown1");
            _unknown2 = new MxeWord(pos, "hUnknown2");

            _id.ReadFromFile(fs);
            _frames.ReadFromFile(fs);
            _unknown1.ReadFromFile(fs);
            _unknown2.ReadFromFile(fs);
        }
コード例 #5
0
ファイル: MtpSentence.cs プロジェクト: dhavard/ValkyrieEdit
 public MtpSentence(int pos)
 {
     _size = new MxeWord(pos, "iSize");
     //_sentence = new MxeWord(Int32.MaxValue, "pSenetence");
     //_sentence.SetBytes(BitConverter.GetBytes(pos + 4));
 }
コード例 #6
0
ファイル: MtpParser.cs プロジェクト: dhavard/ValkyrieEdit
        private bool ReadCsvLines(StreamReader stream, string filename)
        {
            bool foundAChange = false;
            int lineNum = 0;
            string line = stream.ReadLine();
            if (line != null)
            {
                lineNum++;
                //List<string> headers = GetCsvHeaders(line);

                while ((line = stream.ReadLine()) != null)
                {
                    lineNum++;
                    string[] info = line.Split(',');
                    MxeWord tempWord = new MxeWord(Int16.MinValue, "hId");
                    tempWord.CheckOriginal = false;
                    tempWord.SetValue(tempWord.Header, info[0]);
                    int indexId = tempWord.GetValueAsRawInt();
                    if (!_indexes.ContainsKey(indexId))
                    {
                        Console.Out.WriteLine(String.Format(CSV_MATCH_ERROR, filename, indexId));
                        continue;
                    }
                    List<string> data = info.ToList();

                    MtpIndexEntry index = _indexes[indexId];
                    bool thisOneChanged = HandleSentenceLengthChanges(data, index);
                    foundAChange = thisOneChanged || foundAChange;
                }
            }

            return foundAChange;
        }
コード例 #7
0
ファイル: MtpParser.cs プロジェクト: dhavard/ValkyrieEdit
        protected override void ReadTableMeta(FileStream stream)
        {
            _sentenceCount = new MxeWord(_sentenceCountPos, "i");
            _aCount = new MxeWord(_aCountPos, "i");
            _bCount = new MxeWord(_bCountPos, "i");
            _eofcOne = new MxeWord(_eofcOnePos, "i");
            _eofcTwo = new MxeWord(_eofcTwoPos, "i");

            _sentenceCount.ReadFromFile(stream);
            _aCount.ReadFromFile(stream);
            _bCount.ReadFromFile(stream);
            _eofcOne.ReadFromFile(stream);
            _eofcTwo.ReadFromFile(stream);

            int sc = (int)_sentenceCount.GetValueAsRawInt();
            int ac = (int)_aCount.GetValueAsRawInt(); // this is also the size of the index entries
            int bc = (int)_bCount.GetValueAsRawInt();
            int pos = _aBlockPos + _aCount.Length * ac + _bCount.Length * bc;

            Console.Out.WriteLine("Sentence count: " + sc);

            _indexesStart = pos;

            List<MtpIndexEntry> entries = new List<MtpIndexEntry>();
            MtpIndexEntry prevE = null;
            for (int i = 0; i < sc; i++)
            {
                MtpIndexEntry e = new MtpIndexEntry(pos, this, prevE);
                if (ac == 0x14)
                {
                    e = new MtpIndexExtendedEntry(pos, this, prevE);
                }
                entries.Add(e);

                prevE = e;
                pos += _sentenceCount.Length * ac;
            }

            _sentencesStart = pos;

            //can't read or setup all this stuff until after _sentencesStart is set.
            foreach (MtpIndexEntry e in entries)
            {
                e.ReadEntry(stream);
                _indexes.Add(e.Id.GetValueAsRawInt(), e);
            }

            int endingLoc = prevE.Sentence.Sentence.Position + prevE.Sentence.Sentence.Length;
            _restOfIt = new ByteString(endingLoc, (int)stream.Length - endingLoc);
            _restOfIt.ReadFromFile(stream);
        }