Exemple #1
0
 public unsafe Apt(string name)
 {
     byte[] buffer = FileLoader.GetFileBuffer(out _name, "Data", "AptUI", name, "$NAME$.apt".FormatNamed("name", name));
     if (buffer == null)
     {
         return;
     }
     _loadedApts.Add(name, this);
     _aptConst = new AptConst();
     _aptConst.Load(FileLoader.GetFileBuffer("Data", "AptUI", name, "$NAME$.const".FormatNamed("name", name)));
     _aptDat = new AptDat();
     _aptDat.Load(FileLoader.GetFileBuffer("Data", "AptUI", name, "$NAME$.dat".FormatNamed("name", name)));
     fixed (byte* pBufferF = &buffer[0])
     {
         byte* pBuffer = pBufferF;
         string header = BufferReader.ReadString(&pBuffer);
         header = header.Substring(0, header.Length - 1);
         header = header.Substring(_aptHeader.Length);
         switch (header)
         {
             case "6":
                 _version = AptVersion.VERSION_6;
                 break;
             case "64":
                 _version = AptVersion.VERSION_64;
                 break;
             case "7":
                 _version = AptVersion.VERSION_7;
                 break;
             case "74":
                 _version = AptVersion.VERSION_74;
                 break;
         }
         if (*(int*)pBuffer == 0)
         {
             pBuffer += 4;
         }
         pBuffer = pBufferF + _aptConst.AptDataOffset;
         _window = new MovieClip(pBuffer, pBufferF);
     }
     //
     // LOAD GEOMETRY
     //
     _aptGeometries = new SortedDictionary<uint, AptGeometry>();
     AptGeometry geometry = new AptGeometry(5);
     geometry.Load(FileLoader.GetFileBuffer("Data", "AptUI", name, "$NAME$_geometry".FormatNamed("name", name), "$ID$.ru".FormatNamed("id", geometry.Id)));
 }
Exemple #2
0
 public unsafe MovieClip(byte* pBuffer, byte* pBufferStart)
     : base(&pBuffer)
 {
     _frames = new Frame[*(int*)pBuffer];
     pBuffer += 4;
     byte* pFramesBuffer = pBufferStart + *(uint*)pBuffer;
     pBuffer += 4;
     for (int idx = 0; idx < _frames.Length; ++idx)
     {
         _frames[idx] = new Frame(&pFramesBuffer, pBufferStart);
     }
     _pointer = *(uint*)pBuffer;
     pBuffer += 4;
     _characters = new ACharacter[*(int*)pBuffer];
     pBuffer += 4;
     byte* pCharactersBuffer = pBufferStart + *(uint*)pBuffer;
     pBuffer += 4;
     _characters[0] = this;
     pCharactersBuffer += 4;
     for (int idx = 1; idx < _characters.Length; ++idx)
     {
         if (*(int*)pCharactersBuffer == 0)
         {
             pCharactersBuffer += 4;
             continue;
         }
         byte* pCharacterBuffer = pBufferStart + *(uint*)pCharactersBuffer;
         pCharactersBuffer += 4;
         CharacterType type = (CharacterType)(*(uint*)pCharacterBuffer);
         switch (type)
         {
             case CharacterType.SHAPE:
                 break;
             case CharacterType.MOVIE_CLIP:
                 _characters[idx] = new MovieClip(pCharacterBuffer, pBufferStart);
                 break;
         }
     }
     _creationResolution = new IntVector2(&pBuffer);
     _unkown = *(uint*)pBuffer;
     pBuffer += 4;
     _imports = new Import[*(uint*)pBuffer];
     pBuffer += 4;
     byte* pImportsBuffer = pBufferStart + *(uint*)pBuffer;
     pBuffer += 4;
     for (int idx = 0; idx < _imports.Length; ++idx)
     {
         _imports[idx] = new Import(&pImportsBuffer, pBufferStart);
     }
     _exports = new Export[*(uint*)pBuffer];
     pBuffer += 4;
     byte* pExportsBuffer = pBufferStart + *(uint*)pBuffer;
     pBuffer += 4;
     for (int idx = 0; idx < _exports.Length; ++idx)
     {
         _exports[idx] = new Export(&pExportsBuffer, pBufferStart);
     }
     _count = *(uint*)pBuffer;
 }