Exemplo n.º 1
0
 public Texture(Texture t)
 {
     _imageType = t.GetImageType();
     _scFile    = t.GetStorageObject();
     _textureId = (ushort)_scFile.GetTextures().Count();
     if (s_imageTypes.ContainsKey(_imageType))
     {
         _image = (ScImage)Activator.CreateInstance(s_imageTypes[_imageType]);
     }
     else
     {
         _image = new ScImage();
     }
     _image.SetBitmap(new Bitmap(t.Bitmap));
     _offset = t.GetOffset() > 0 ? -t.GetOffset() : -1 /*t.GetOffset()*/;
 }
Exemplo n.º 2
0
        public void Read(uint packetID, uint packetSize, BinaryReader br)
        {
            this.PacketId = packetID;
            _imageType    = br.ReadByte();

            if (s_imageTypes.ContainsKey(_imageType))
            {
                _image = (ScImage)Activator.CreateInstance(s_imageTypes[_imageType]);
            }
            else
            {
                _image = new ScImage();
            }

            _image.ReadImage(packetID, packetSize, br);
        }