Example #1
0
 /**
  * Process the raw data from a binary stream
  * 
  * @return  void
  */
 public function processData(Woops_Swf_Binary_Stream $stream)
 {
     // Gets the raw data
     $data = $stream->littleEndianUnsignedLong();
     // Sets the flags
     $this->_useDirectBlit = (bool) ($data & 0x2);
     $this->_useGpu = (bool) ($data & 0x4);
     $this->_hasMetadata = (bool) ($data & 0x8);
     $this->_useActionScript3 = (bool) ($data & 0x10);
     $this->_useNetwork = (bool) ($data & 0x80);
 }
Example #2
0
 /**
  * Process the raw data from a binary stream
  * 
  * @return  void
  */
 public function processData(Woops_Swf_Binary_Stream $stream)
 {
     // Gets the sprite ID and the frame count
     $this->_spriteId = $stream->littleEndianUnsignedShort();
     $this->_frameCount = $stream->littleEndianUnsignedShort();
     // Resets the tag array
     $this->_tags = array();
     // Process the tags
     while (!$stream->endOfStream()) {
         // Gets thge tag record header
         $tagHeader = $stream->littleEndianUnsignedShort();
         // Gets the tag type
         $tagType = $tagHeader >> 6;
         // Gets the tag length
         $tagLength = $tagHeader & 0x3f;
         // Checks for a 32bit length
         if ($tagLength === 0x3f) {
             // Tag is long
             $tagLength = $stream->littleEndianUnsignedLong();
         }
         // Creates the tag
         $tag = $this->newTag($tagType);
         // Creates a binary stream with the tag data
         $tagData = new Woops_Swf_Binary_Stream($stream->read($tagLength));
         // Processes the tag data
         $tag->processData($tagData);
     }
 }