gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog server/button_character_instanc...


From: Zou Lunkai
Subject: [Gnash-commit] gnash ChangeLog server/button_character_instanc...
Date: Wed, 12 Dec 2007 06:16:31 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Zou Lunkai <zoulunkai>  07/12/12 06:16:31

Modified files:
        .              : ChangeLog 
        server         : button_character_instance.cpp 
        server/swf     : PlaceObject2Tag.cpp 

Log message:
        * server/button_character_instance.cpp: stagePlacementCallback(), don't 
          forget to set charcter depth and id.
        * server/swf/PlaceObject2Tag.cpp: readPlaceObject2() and 
readPlaceObject3(),
          replace 8 read_bit() with one read_u8().

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5139&r2=1.5140
http://cvs.savannah.gnu.org/viewcvs/gnash/server/button_character_instance.cpp?cvsroot=gnash&r1=1.67&r2=1.68
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/PlaceObject2Tag.cpp?cvsroot=gnash&r1=1.25&r2=1.26

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5139
retrieving revision 1.5140
diff -u -b -r1.5139 -r1.5140
--- ChangeLog   12 Dec 2007 04:31:04 -0000      1.5139
+++ ChangeLog   12 Dec 2007 06:16:30 -0000      1.5140
@@ -1,3 +1,10 @@
+2007-12-12 Zou Lunkai <address@hidden>
+
+       * server/button_character_instance.cpp: stagePlacementCallback(), don't 
+         forget to set charcter depth and id.
+       * server/swf/PlaceObject2Tag.cpp: readPlaceObject2() and 
readPlaceObject3(),
+         replace 8 read_bit() with one read_u8().
+         
 2007-12-12 Sandro Santilli <address@hidden>
 
        * server/asobj/System.cpp: add System.capabilities properties

Index: server/button_character_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/button_character_instance.cpp,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -b -r1.67 -r1.68
--- server/button_character_instance.cpp        10 Dec 2007 20:17:16 -0000      
1.67
+++ server/button_character_instance.cpp        12 Dec 2007 06:16:31 -0000      
1.68
@@ -801,6 +801,7 @@
 button_character_instance::stagePlacementCallback()
 {
        // Register this button instance as a live character
+       // do we need this???
        _vm.getRoot().addLiveChar(this);
 
        size_t r, r_num =  m_def->m_button_records.size();
@@ -810,26 +811,29 @@
        {
                button_record& bdef = m_def->m_button_records[r];
 
-               const matrix&   mat = 
m_def->m_button_records[r].m_button_matrix;
-               const cxform&   cx = m_def->m_button_records[r].m_button_cxform;
+               const matrix&   mat = bdef.m_button_matrix;
+               const cxform&   cx = bdef.m_button_cxform;
+               int ch_depth = bdef.m_button_layer;
+               int ch_id = bdef.m_character_id;
 
-               // we don't need an id here, do we ?
-               boost::intrusive_ptr<character> ch = 
bdef.m_character_def->create_character_instance(this, 0);
-               ch->stagePlacementCallback(); // give this character life 
(TODO: they aren't on stage, are them ?)
-               m_record_character[r] = ch;
+               boost::intrusive_ptr<character> ch = 
bdef.m_character_def->create_character_instance(this, ch_id);
                ch->set_matrix(mat);
                ch->set_cxform(cx);
+               ch->set_depth(ch_depth);
                ch->set_parent(this);
                
-               if (ch->get_name().empty() && ch->wantsInstanceName()) {
+               if (ch->get_name().empty() && ch->wantsInstanceName()) 
+               {
                        std::string instance_name = 
getNextUnnamedInstanceName();
                        ch->set_name(instance_name.c_str());
                }
 
+               m_record_character[r] = ch;
+
+               ch->stagePlacementCallback(); // give this character life 
(TODO: they aren't on stage, are them ?)
        }
 
-       // does a CONSTRUCT event even exist ?
-       // We'll not call it here..
+       // there's no INITIALIZE/CONSTRUCT/LOAD/ENTERFRAME/UNLOAD events for 
buttons
 }
 
 #ifdef GNASH_USE_GC

Index: server/swf/PlaceObject2Tag.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/PlaceObject2Tag.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- server/swf/PlaceObject2Tag.cpp      11 Dec 2007 15:33:10 -0000      1.25
+++ server/swf/PlaceObject2Tag.cpp      12 Dec 2007 06:16:31 -0000      1.26
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: PlaceObject2Tag.cpp,v 1.25 2007/12/11 15:33:10 strk Exp $ */
+/* $Id: PlaceObject2Tag.cpp,v 1.26 2007/12/12 06:16:31 zoulunkai Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -219,14 +219,17 @@
 {
        in->align();
 
-       bool    has_actions = in->read_bit(); 
-       bool    has_clip_bracket = in->read_bit(); 
-       bool    has_name = in->read_bit();
-       bool    has_ratio = in->read_bit();
-       bool    has_cxform = in->read_bit();
-       bool    has_matrix = in->read_bit(); 
-       bool    has_char = in->read_bit(); 
-       bool    flag_move = in->read_bit(); 
+    // PlaceObject2 specific flags
+    uint8_t has_flags2 = in->read_u8();
+
+    bool    has_actions    = has_flags2 & (1 << 7); 
+    bool    has_clip_depth = has_flags2 & (1 << 6); 
+    bool    has_name       = has_flags2 & (1 << 5); 
+    bool    has_ratio      = has_flags2 & (1 << 4); 
+    bool    has_cxform     = has_flags2 & (1 << 3); 
+    bool    has_matrix     = has_flags2 & (1 << 2);
+    bool    has_char       = has_flags2 & (1 << 1);
+    bool    flag_move      = has_flags2 & (1 << 0); 
 
        m_depth = in->read_u16()+character::staticDepthOffset;
 
@@ -251,7 +254,7 @@
 
        if (has_name) m_name = in->read_string();
 
-       if (has_clip_bracket)
+    if (has_clip_depth)
                m_clip_depth = in->read_u16()+character::staticDepthOffset;
        else
                m_clip_depth = character::noClipDepthValue;
@@ -296,43 +299,44 @@
                }
                if ( has_ratio ) log_parse(_("  ratio: %d"), m_ratio);
                if ( has_name ) log_parse(_("  name = %s"), m_name ? m_name : 
"<null>");
-               if ( has_clip_bracket ) log_parse(_("  clip_depth = %d (%d)"), 
m_clip_depth, m_clip_depth-character::staticDepthOffset);
+        if ( has_clip_depth ) log_parse(_("  clip_depth = %d (%d)"), 
m_clip_depth, m_clip_depth-character::staticDepthOffset);
                log_parse(_(" m_place_type: %d"), m_place_type);
        );
 
        //log_msg("place object at depth %i", m_depth);
 }
 
-// read SWF::PLACEOBJECT4
+// read SWF::PLACEOBJECT3
 void
 PlaceObject2Tag::readPlaceObject3(stream* in, int movie_version)
 {
        in->align();
 
+    // PlaceObject2 specific flags
+    uint8_t has_flags2 = in->read_u8();
+
+    bool    has_actions    = has_flags2 & (1 << 7); 
+    bool    has_clip_depth = has_flags2 & (1 << 6); 
+    bool    has_name       = has_flags2 & (1 << 5); 
+    bool    has_ratio      = has_flags2 & (1 << 4); 
+    bool    has_cxform     = has_flags2 & (1 << 3); 
+    bool    has_matrix     = has_flags2 & (1 << 2);
+    bool    has_char       = has_flags2 & (1 << 1);
+    bool    flag_move      = has_flags2 & (1 << 0); 
+
+    // PlaceObject3 specific flags, first 3 bits are unused
+    uint8_t has_flags3 = in->read_u8();
+
+    bool    hasImage           = has_flags3 & (1 << 4); 
+    bool    hasClassName       = has_flags3 & (1 << 3); 
+    bool    has_bitmap_caching = has_flags3 & (1 << 2); 
+    bool    has_blend_mode     = has_flags3 & (1 << 1); 
+    bool    has_filters        = has_flags3 & (1 << 0);
+
         uint8_t blend_mode = 0;
         uint8_t bitmask = 0;
-        bool has_bitmap_caching = false;
-        bool has_blend_mode = false;
-        bool has_filters = false;
        std::string className;
 
-       bool    has_actions = in->read_bit(); 
-       bool    has_clip_bracket = in->read_bit(); 
-       bool    has_name = in->read_bit();
-       bool    has_ratio = in->read_bit();
-       bool    has_cxform = in->read_bit();
-       bool    has_matrix = in->read_bit(); 
-       bool    has_char = in->read_bit(); 
-       bool    flag_move = in->read_bit(); 
-
-       in->align();
-        in->read_uint(3); // Ignore on purpose.
-       bool    hasImage = in->read_bit();
-       bool    hasClassName = in->read_bit();
-        has_bitmap_caching = in->read_bit(); 
-        has_blend_mode = in->read_bit(); 
-        has_filters = in->read_bit(); 
-
        m_depth = in->read_u16()+character::staticDepthOffset;
 
        if (has_char)
@@ -365,7 +369,7 @@
 
        if (has_name) m_name = in->read_string();
 
-       if (has_clip_bracket)
+    if (has_clip_depth)
                m_clip_depth = in->read_u16()+character::staticDepthOffset;
        else
                m_clip_depth = character::noClipDepthValue;
@@ -429,7 +433,7 @@
                if ( has_ratio ) log_parse(_("  ratio: %d"), m_ratio);
                if ( has_name ) log_parse(_("  name = %s"), m_name ? m_name : 
"<null>");
                if ( hasClassName ) log_parse(_("  class name = %s"), 
className.c_str());
-               if ( has_clip_bracket ) log_parse(_("  clip_depth = %d (%d)"), 
m_clip_depth, m_clip_depth-character::staticDepthOffset);
+        if ( has_clip_depth ) log_parse(_("  clip_depth = %d (%d)"), 
m_clip_depth, m_clip_depth-character::staticDepthOffset);
                log_parse(_(" m_place_type: %d"), m_place_type);
        );
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]