gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/character.h server/dlist...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/character.h server/dlist...
Date: Fri, 06 Apr 2007 11:43:45 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/04/06 11:43:44

Modified files:
        .              : ChangeLog 
        server         : character.h dlist.cpp dlist.h 
                         sprite_instance.cpp sprite_instance.h 
        server/swf     : tag_loaders.cpp 
        testsuite/actionscript.all: MovieClip.as 
        testsuite/misc-ming.all: ButtonEventsTest-Runner.cpp 
                                 loop_test-Runner.cpp 
                                 simple_loop_testrunner.cpp 
        testsuite/movies.all: gravity_embedded-TestRunner.cpp 
        testsuite/samples: clip_as_button2-TestRunner.cpp 

Log message:
                * server/: character.h, dlist.{cpp,h}, sprite_instance.{cpp,h}:
                  Character instance depth is a _signed_ value !
                  Add a character::staticDepthOffset constant to use for 
converting
                  displaylist tag defined depths to negative values.
                * server/swf/tag_loaders.cpp: convert displaylist tag defined 
depths
                  to negative values by adding character::staticDepthOffset
                * testsuite/misc-ming.all/: ButtonEventsTest-Runner.cpp,
                  testsuite/samples/clip_as_button2-TestRunner.cpp,
                  testsuite/movies.all/gravity_embedded-TestRunner.cpp:
                  loop_test-Runner.cpp, simple_loop_testrunner.cpp: fix the
                  test runners to take staticDepthOffset into account.
                * testsuite/actionscript.all/MovieClip.as: getNextHighestDepth()
                  test now succeeds.
        
        For more info, See:
        http://www.senocular.com/flash/tutorials/depths/?page=2

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2797&r2=1.2798
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.h?cvsroot=gnash&r1=1.61&r2=1.62
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.cpp?cvsroot=gnash&r1=1.56&r2=1.57
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.h?cvsroot=gnash&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.224&r2=1.225
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.h?cvsroot=gnash&r1=1.88&r2=1.89
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/tag_loaders.cpp?cvsroot=gnash&r1=1.84&r2=1.85
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/MovieClip.as?cvsroot=gnash&r1=1.45&r2=1.46
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/ButtonEventsTest-Runner.cpp?cvsroot=gnash&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/loop_test-Runner.cpp?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/simple_loop_testrunner.cpp?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/movies.all/gravity_embedded-TestRunner.cpp?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/samples/clip_as_button2-TestRunner.cpp?cvsroot=gnash&r1=1.5&r2=1.6

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2797
retrieving revision 1.2798
diff -u -b -r1.2797 -r1.2798
--- ChangeLog   6 Apr 2007 09:56:00 -0000       1.2797
+++ ChangeLog   6 Apr 2007 11:43:44 -0000       1.2798
@@ -1,5 +1,22 @@
 2007-04-06 Sandro Santilli <address@hidden>
 
+       * server/: character.h, dlist.{cpp,h}, sprite_instance.{cpp,h}:
+         Character instance depth is a _signed_ value !
+         Add a character::staticDepthOffset constant to use for converting
+         displaylist tag defined depths to negative values.
+       * server/swf/tag_loaders.cpp: convert displaylist tag defined depths
+         to negative values by adding character::staticDepthOffset
+       * testsuite/misc-ming.all/: ButtonEventsTest-Runner.cpp,
+         testsuite/samples/clip_as_button2-TestRunner.cpp,
+         testsuite/movies.all/gravity_embedded-TestRunner.cpp:
+         loop_test-Runner.cpp, simple_loop_testrunner.cpp: fix the
+         test runners to take staticDepthOffset into account.
+       * testsuite/actionscript.all/MovieClip.as: getNextHighestDepth()
+         test now succeeds.
+
+
+2007-04-06 Sandro Santilli <address@hidden>
+
        * testsuite/misc-ming.all/: Makefile.am, displaylist_depths_test.c:
          Add a new interesting (failing) test showing that static characters
          and dynamic characters use a completely different range

Index: server/character.h
===================================================================
RCS file: /sources/gnash/gnash/server/character.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -b -r1.61 -r1.62
--- server/character.h  2 Apr 2007 15:45:22 -0000       1.61
+++ server/character.h  6 Apr 2007 11:43:44 -0000       1.62
@@ -18,7 +18,7 @@
 //
 //
 
-/* $Id: character.h,v 1.61 2007/04/02 15:45:22 strk Exp $ */
+/* $Id: character.h,v 1.62 2007/04/06 11:43:44 strk Exp $ */
 
 #ifndef GNASH_CHARACTER_H
 #define GNASH_CHARACTER_H
@@ -72,7 +72,7 @@
        cxform  m_color_transform;
        matrix  m_matrix;
        float   m_ratio;
-       uint16_t        m_clip_depth;
+       int     m_clip_depth;
        Events _event_handlers;
        void    (*m_display_callback)(void*);
        void*   m_display_callback_user_ptr;
@@ -193,10 +193,20 @@
 
 public:
 
+    /// This is the amount substracted from displaylist tag defined depths.
+    /// Character placed by tags (vs. characters instantiated by ActionScript)
+    /// always have negative depths by effect of this offset.
+    //
+    /// Macromedia Flash help says: depth starts at -16383 (0x3FFF)
+    ///
+    /// See: http://www.senocular.com/flash/tutorials/depths/?page=2
+    ///
+    static const int staticDepthOffset = -16384;
+
     character(character* parent, int id)
        :
        m_id(id),
-       m_depth(-1),
+       m_depth(0),
        m_ratio(0.0f),
        m_clip_depth(0),
        m_display_callback(NULL),
@@ -264,8 +274,9 @@
       if (f!=m_ratio) set_invalidated(); 
       m_ratio = f;       
     }
-    uint16_t   get_clip_depth() const { return m_clip_depth; }
-    void       set_clip_depth(uint16_t d) { m_clip_depth = d; }
+
+    int get_clip_depth() const { return m_clip_depth; }
+    void set_clip_depth(int d) { m_clip_depth = d; }
 
     virtual void set_name(const char* name) { _name = name; }
 
@@ -473,6 +484,7 @@
        ///
        void setDynamic() {
                _dynamicallyCreated = true;
+               //assert(get_depth() > 0);
        }
 
        /// \brief

Index: server/dlist.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.cpp,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -b -r1.56 -r1.57
--- server/dlist.cpp    2 Apr 2007 16:25:25 -0000       1.56
+++ server/dlist.cpp    6 Apr 2007 11:43:44 -0000       1.57
@@ -101,7 +101,7 @@
 int
 DisplayList::getNextHighestDepth() const
 {
-       unsigned int nexthighestdepth=0;
+       int nexthighestdepth=0;
        for (const_iterator it = _characters.begin(),
                        itEnd = _characters.end();
                it != itEnd; ++it)
@@ -109,7 +109,7 @@
                character* ch = it->get();
                assert(ch); // is this really needed ?
 
-               unsigned int chdepth = ch->get_depth();
+               int chdepth = ch->get_depth();
                if ( chdepth >= nexthighestdepth )
                {
                        nexthighestdepth = chdepth+1;
@@ -172,11 +172,11 @@
 void
 DisplayList::place_character(
        character* ch, 
-       uint16_t depth,
+       int depth,
        const cxform& color_xform, 
        const matrix& mat, 
        float ratio,
-       uint16_t clip_depth)
+       int clip_depth)
 {
 //     GNASH_REPORT_FUNCTION;
        //IF_VERBOSE_DEBUG(log_msg("dl::add(%d, '%s')\n", depth, 
ch->get_name()));//xxxxx
@@ -185,7 +185,6 @@
        //dump(std::cout);
 
        assert(ch);
-       
        ch->set_invalidated();
        ch->set_depth(depth);
        ch->set_cxform(color_xform);
@@ -247,13 +246,13 @@
 void
 DisplayList::replace_character(
        character* ch,
-       uint16_t depth,
+       int depth,
        bool use_cxform,
        const cxform& color_xform,
        bool use_matrix,
        const matrix& mat,
        float ratio,
-       uint16_t clip_depth)
+       int clip_depth)
 {
        //GNASH_REPORT_FUNCTION;
 
@@ -314,13 +313,13 @@
 // the specified depth.
 void
 DisplayList::move_display_object(
-       uint16_t depth,
+       int depth,
        bool use_cxform,
        const cxform& color_xform,
        bool use_matrix,
        const matrix& mat,
        float ratio,
-       uint16_t /* clip_depth */)
+       int /* clip_depth */)
 {
        //GNASH_REPORT_FUNCTION;
        //IF_VERBOSE_DEBUG(log_msg("dl::move(%d)\n", depth));//xxxxx
@@ -336,6 +335,7 @@
                return;
        }
 
+       // TODO: is sign of depth related to accepting anim moves ?
        if (ch->get_accept_anim_moves() == false)
        {
                // This character is rejecting anim moves.  This happens after 
it
@@ -357,7 +357,7 @@
        
 // Removes the object at the specified depth.
 void
-DisplayList::remove_display_object(uint16_t depth)
+DisplayList::remove_display_object(int depth)
 {
        //GNASH_REPORT_FUNCTION;
 
@@ -423,7 +423,7 @@
        }
 }
        
-void DisplayList::clear_unaffected(std::vector<uint16>& affected_depths, bool 
call_unload)
+void DisplayList::clear_unaffected(std::vector<int>& affected_depths, bool 
call_unload)
 {
        //GNASH_REPORT_FUNCTION;
 
@@ -632,11 +632,6 @@
                        continue;
                }
 
-               if (ch->get_clip_depth() > 0)
-               {
-//                             log_msg("depth %i, clip_depth %i\n", 
dobj.m_depth, dobj.m_clip_depth);
-               }
-
                // check whether a previous mask should be disabled
                if (masked)
                {
@@ -658,11 +653,6 @@
                
                ch->display();
 
-               if (ch->get_clip_depth() > 0)
-               {
-//                             log_msg("object drawn\n");
-               }
-               
                // if this object should have become a mask,
                // inform the renderer that it now has all
                // information about it

Index: server/dlist.h
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- server/dlist.h      2 Apr 2007 16:25:25 -0000       1.31
+++ server/dlist.h      6 Apr 2007 11:43:44 -0000       1.32
@@ -87,11 +87,11 @@
        ///
        void    place_character(
                character* ch,
-               uint16_t depth,
+               int depth,
                const cxform& color_xform,
                const matrix& mat,
                float ratio,
-               uint16_t clip_depth);
+               int clip_depth);
 
        /// \brief
        /// Puts a new character at the specified depth, replacing any
@@ -106,32 +106,32 @@
        ///
        void replace_character(
                character* ch,
-               uint16_t depth,
+               int depth,
                bool use_cxform,
                const cxform& color_xform,
                bool use_matrix,
                const matrix& mat,
                float ratio,
-               uint16_t clip_depth);
+               int clip_depth);
 
        void swap_characters(character* ch, character* ch2);
 
        /// Updates the transform properties of the object at
        /// the specified depth.
        void    move_display_object(
-               uint16_t depth,
+               int depth,
                bool use_cxform,
                const cxform& color_xform,
                bool use_matrix,
                const matrix& mat,
                float ratio,
-               uint16_t clip_depth);
+               int clip_depth);
 
        /// Removes the object at the specified depth.
        //
        /// Calls unload on the removed character.
        ///
-       void    remove_display_object(uint16_t depth);
+       void    remove_display_object(int depth);
 
        /// Clear the display list.
        //
@@ -207,7 +207,7 @@
        ///     If true, UNLOAD event will be invoked on the characters being
        ///     removed. False by default.
        ///
-       void clear_unaffected(std::vector<uint16>& affected_depths, bool 
call_unload=false);
+       void clear_unaffected(std::vector<int>& affected_depths, bool 
call_unload=false);
 
        /// Just an alias for clear()
        void reset() {
@@ -332,10 +332,7 @@
                it != itEnd; ++it)
        {
                DisplayItem& di = *it;
-               if ( ! visitor(di.get()) )
-               {
-                       break;
-               }
+               if ( ! visitor(di.get()) ) break;
        }
 }
 
@@ -348,26 +345,7 @@
                it != itEnd; ++it)
        {
                DisplayItem& di = *it;
-
-               //if ( ! di.get() ) continue;
-
-               if ( ! visitor(di.get()) )
-               {
-                       break;
-
-// The following logic must be implemented in the VISITOR,
-// not in the visiting function !!
-// (Vitaly, did you mean to do this in the MouseEntityFinder?)
-#if 0
-                       // Can so happens that the uppermost depth contains 
shape
-                       // and under it the button lays
-                       // therefore we skip empty(no events) depth
-                       if (di->can_handle_mouse_event())
-                       {
-                               break;
-                       }
-#endif
-               }
+               if ( ! visitor(di.get()) ) break;
        }
 }
 

Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.224
retrieving revision 1.225
diff -u -b -r1.224 -r1.225
--- server/sprite_instance.cpp  6 Apr 2007 09:23:20 -0000       1.224
+++ server/sprite_instance.cpp  6 Apr 2007 11:43:44 -0000       1.225
@@ -184,8 +184,8 @@
 
        std::string newname = fn.arg(1).to_std_string();
 
-       // should we support negative depths ?
-       uint16_t depth_val = uint16_t(fn.arg(2).to_number());
+       // should we support negative depths ? YES !
+       int depth_val = uint16_t(fn.arg(2).to_number());
 
        boost::intrusive_ptr<character> newch = 
exported_movie->create_character_instance(sprite.get(), depth_val);
        assert( dynamic_cast<sprite_instance*>(newch.get()) );
@@ -280,13 +280,6 @@
 
        int n = sprite->get_depth();
 
-       if ( ! sprite->isDynamic() )
-       {
-               // Macromedia Flash help says: depth starts at -16383 (0x3FFF)
-               //n = - (n+16383-1);
-               n += -16384; 
-       }
-
        return as_value(n);
 }
 
@@ -776,7 +769,7 @@
 {
        boost::intrusive_ptr<sprite_instance> sprite = 
ensureType<sprite_instance>(fn.this_ptr);
 
-       unsigned int nextdepth = sprite->getNextHighestDepth();
+       int nextdepth = sprite->getNextHighestDepth();
        return as_value(static_cast<double>(nextdepth));
 }
 
@@ -1858,7 +1851,7 @@
 }
 
 void sprite_instance::clone_display_object(const std::string& name,
-       const std::string& newname, uint16_t depth)
+       const std::string& newname, int depth)
 {
 //            GNASH_REPORT_FUNCTION;
 
@@ -2600,7 +2593,7 @@
 }
 
 bool
-sprite_instance::attachCharacter(character& newch, uint16_t depth)
+sprite_instance::attachCharacter(character& newch, int depth)
 {
 
        // place_character() will set depth on newch
@@ -2620,10 +2613,10 @@
                uint16_t character_id,
                const char* name,
                const std::vector<swf_event*>& event_handlers,
-               uint16_t depth, 
+               int depth, 
                bool replace_if_depth_is_occupied,
                const cxform& color_transform, const matrix& matrix,
-               float ratio, uint16_t clip_depth)
+               float ratio, int clip_depth)
 {
 //         GNASH_REPORT_FUNCTION;
        assert(m_def != NULL);
@@ -2702,13 +2695,13 @@
 sprite_instance::replace_display_object(
                uint16_t character_id,
                const char* name,
-               uint16_t depth,
+               int depth,
                bool use_cxform,
                const cxform& color_transform,
                bool use_matrix,
                const matrix& mat,
                float ratio,
-               uint16_t clip_depth)
+               int clip_depth)
 {
        assert(m_def != NULL);
        // log_msg("%s: character %s, id is %d", __FUNCTION__, name, 
character_id); // FIXME: debugging crap
@@ -2735,13 +2728,13 @@
 void sprite_instance::replace_display_object(
                character* ch,
                const char* name,
-               uint16_t depth,
+               int depth,
                bool use_cxform,
                const cxform& color_transform,
                bool use_matrix,
                const matrix& mat,
                float ratio,
-               uint16_t clip_depth)
+               int clip_depth)
 {
     //printf("%s: character %s, id is %d\n", __FUNCTION__, name, 
ch->get_id()); // FIXME:
 
@@ -3328,13 +3321,13 @@
        save_extern_movie(extern_movie.get());
 
        const char* name = get_name().c_str();
-       uint16_t depth = get_depth();
+       int depth = get_depth();
        bool use_cxform = false;
        cxform color_transform = get_cxform();
        bool use_matrix = false;
        matrix mat = get_matrix();
        float ratio = get_ratio();
-       uint16_t clip_depth = get_clip_depth();
+       int clip_depth = get_clip_depth();
        //character* new_movie = extern_movie->get_root_movie();
 
        // Get a pointer to our own parent 

Index: server/sprite_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.h,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -b -r1.88 -r1.89
--- server/sprite_instance.h    5 Apr 2007 11:16:11 -0000       1.88
+++ server/sprite_instance.h    6 Apr 2007 11:43:44 -0000       1.89
@@ -17,7 +17,7 @@
 // 
 //
 
-/* $Id: sprite_instance.h,v 1.88 2007/04/05 11:16:11 strk Exp $ */
+/* $Id: sprite_instance.h,v 1.89 2007/04/06 11:43:44 strk Exp $ */
 
 // Stateful live Sprite instance
 
@@ -357,12 +357,12 @@
                uint16_t character_id,
                const char* name,
                const SWFEventsVector& event_handlers,
-               uint16_t depth,
+               int depth,
                bool replace_if_depth_is_occupied,
                const cxform& color_transform,
                const matrix& matrix,
                float ratio,
-               uint16_t clip_depth);
+               int clip_depth);
 
        /// Attach the given character instance to current display list
        //
@@ -375,7 +375,7 @@
        /// @return true on success, false on failure
        ///     FIXME: currently never returns false !
        ///
-       bool attachCharacter(character& newch, uint16_t depth);
+       bool attachCharacter(character& newch, int depth);
 
        /// Construct this instance as an ActionScript object.
        //
@@ -401,13 +401,13 @@
        /// Updates the transform properties of the object at
        /// the specified depth.
        void    move_display_object(
-                       uint16_t depth,
+                       int depth,
                        bool use_cxform,
                        const cxform& color_xform,
                        bool use_matrix,
                        const matrix& mat,
                        float ratio,
-                       uint16_t clip_depth)
+                       int clip_depth)
        {
            m_display_list.move_display_object(depth, use_cxform, color_xform, 
use_matrix, mat, ratio, clip_depth);
        }
@@ -416,25 +416,25 @@
        void    replace_display_object(
                        uint16_t character_id,
                        const char* name,
-                       uint16_t depth,
+                       int depth,
                        bool use_cxform,
                        const cxform& color_transform,
                        bool use_matrix,
                        const matrix& mat,
                        float ratio,
-                       uint16_t clip_depth);
+                       int clip_depth);
 
 
        void    replace_display_object(
                        character* ch,
                        const char* name,
-                       uint16_t depth,
+                       int depth,
                        bool use_cxform,
                        const cxform& color_transform,
                        bool use_matrix,
                        const matrix& mat,
                        float ratio,
-                       uint16_t clip_depth);
+                       int clip_depth);
 
 
        /// \brief
@@ -443,7 +443,7 @@
        /// NOTE: the id parameter is unused, but currently
        /// required to avoid break of inheritance from movie.h
        ///
-       void    remove_display_object(uint16_t depth, int /* id */)
+       void    remove_display_object(int depth, int /* id */)
        {
            set_invalidated();
            m_display_list.remove_display_object(depth);
@@ -536,7 +536,7 @@
        /// Duplicate the object with the specified name
        /// and add it with a new name  at a new depth.
        void clone_display_object(const std::string& name,
-               const std::string& newname, uint16_t depth);
+               const std::string& newname, int depth);
 
        /// Remove the object with the specified name.
        //
@@ -858,9 +858,9 @@
 
 protected:
 
-       void place_character(character* ch, uint16_t depth,
+       void place_character(character* ch, int depth,
                        const cxform& color_transform, const matrix& mat,
-                       float ratio, uint16_t clip_depth)
+                       float ratio, int clip_depth)
        {
                m_display_list.place_character(ch, depth, color_transform, mat, 
ratio, clip_depth);
        }

Index: server/swf/tag_loaders.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/tag_loaders.cpp,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -b -r1.84 -r1.85
--- server/swf/tag_loaders.cpp  2 Apr 2007 06:18:41 -0000       1.84
+++ server/swf/tag_loaders.cpp  6 Apr 2007 11:43:44 -0000       1.85
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: tag_loaders.cpp,v 1.84 2007/04/02 06:18:41 zoulunkai Exp $ */
+/* $Id: tag_loaders.cpp,v 1.85 2007/04/06 11:43:44 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -777,9 +777,9 @@
     matrix     m_matrix;
     bool       m_has_matrix;
     bool       m_has_cxform;
-    uint16_t   m_depth;
+    int                m_depth;
     uint16_t   m_character_id;
-    uint16_t   m_clip_depth;
+    int        m_clip_depth;
     enum place_type {
        PLACE,
        MOVE,
@@ -819,13 +819,13 @@
        {
                // Original place_object tag; very simple.
                m_character_id = in->read_u16();
-               m_depth = in->read_u16();
+               m_depth = in->read_u16()+character::staticDepthOffset;
                m_matrix.read(in);
 
                IF_VERBOSE_PARSE
                (
                        log_parse("  char_id = %d", m_character_id);
-                       log_parse("  depth = %d", m_depth);
+                       log_parse("  depth = %d (%d)", m_depth, 
m_depth-character::staticDepthOffset);
                        m_matrix.print();
                );
 
@@ -1000,11 +1000,11 @@
                bool    has_char = in->read_uint(1) ? true : false;
                bool    flag_move = in->read_uint(1) ? true : false;
 
-               m_depth = in->read_u16();
+               m_depth = in->read_u16()+character::staticDepthOffset;
 
                IF_VERBOSE_PARSE
                (
-                   log_parse("  depth = %d", m_depth);
+                    log_parse("  depth = %d (%d)", m_depth, 
m_depth-character::staticDepthOffset);
                );
 
                if (has_char)
@@ -1053,9 +1053,9 @@
 
                if (has_clip_bracket)
                {
-                       m_clip_depth = in->read_u16(); 
+                       m_clip_depth = 
in->read_u16()+character::staticDepthOffset; 
                        IF_VERBOSE_PARSE (
-                               log_parse("  clip_depth = %d", m_clip_depth);
+                               log_parse("  clip_depth = %d (%d)", 
m_clip_depth, m_clip_depth-character::staticDepthOffset);
                        );
                }
 
@@ -1284,7 +1284,7 @@
                    // object per depth.
                    m_id = in->read_u16();
                }
-           m_depth = in->read_u16();
+           m_depth = in->read_u16()+character::staticDepthOffset;
        }
 
     virtual void       execute(sprite_instance* m)

Index: testsuite/actionscript.all/MovieClip.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/MovieClip.as,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- testsuite/actionscript.all/MovieClip.as     6 Apr 2007 09:27:25 -0000       
1.45
+++ testsuite/actionscript.all/MovieClip.as     6 Apr 2007 11:43:44 -0000       
1.46
@@ -22,7 +22,7 @@
 // compile this test case with Ming makeswf, and then
 // execute it like this gnash -1 -r 0 -v out.swf
 
-rcsid="$Id: MovieClip.as,v 1.45 2007/04/06 09:27:25 strk Exp $";
+rcsid="$Id: MovieClip.as,v 1.46 2007/04/06 11:43:44 strk Exp $";
 
 #include "check.as"
 
@@ -140,7 +140,7 @@
     check_equals(mc.hitArea, undefined);
     check_equals(mc.menu, undefined);
 
-    xcheck_equals(mc.getNextHighestDepth(), 0);
+    check_equals(mc.getNextHighestDepth(), 0);
 #else
     check_equals(mc.getNextHighestDepth(), undefined);
 #endif

Index: testsuite/misc-ming.all/ButtonEventsTest-Runner.cpp
===================================================================
RCS file: 
/sources/gnash/gnash/testsuite/misc-ming.all/ButtonEventsTest-Runner.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- testsuite/misc-ming.all/ButtonEventsTest-Runner.cpp 31 Jan 2007 15:11:58 
-0000      1.10
+++ testsuite/misc-ming.all/ButtonEventsTest-Runner.cpp 6 Apr 2007 11:43:44 
-0000       1.11
@@ -120,7 +120,7 @@
 
        const character* mc1 = tester.findDisplayItemByName(*root, "square1");
        check(mc1);
-       check_equals(mc1->get_depth(), 2);
+       check_equals(mc1->get_depth(), 2+character::staticDepthOffset);
 
        const character* text = tester.findDisplayItemByName(*root, 
"textfield");
        check(text);
@@ -139,8 +139,8 @@
 
        for (size_t fno=0; fno<root->get_frame_count(); fno++)
        {
-               const character* square_back = 
tester.findDisplayItemByDepth(*root, 1);
-               const character* square_front = 
tester.findDisplayItemByDepth(*root, 3);
+               const character* square_back = 
tester.findDisplayItemByDepth(*root, 1+character::staticDepthOffset);
+               const character* square_front = 
tester.findDisplayItemByDepth(*root, 3+character::staticDepthOffset);
 
                switch (fno)
                {

Index: testsuite/misc-ming.all/loop_test-Runner.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/loop_test-Runner.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- testsuite/misc-ming.all/loop_test-Runner.cpp        24 Jan 2007 10:11:54 
-0000      1.3
+++ testsuite/misc-ming.all/loop_test-Runner.cpp        6 Apr 2007 11:43:44 
-0000       1.4
@@ -70,11 +70,11 @@
 
        const character* movieClip1 = tester.findDisplayItemByName(*root, 
"movieClip1");
        check(movieClip1);
-       check_equals(movieClip1->get_depth(), 1);
+       check_equals(movieClip1->get_depth(), 1+character::staticDepthOffset);
 
        const character* movieClip2 = tester.findDisplayItemByName(*root, 
"movieClip2");
        check(movieClip2);
-       check_equals(movieClip2->get_depth(), 2);
+       check_equals(movieClip2->get_depth(), 2+character::staticDepthOffset);
 
        // Advance to frame 27
        for (int i=root->get_current_frame(); i<28; ++i) {
@@ -85,8 +85,8 @@
        // change the characters depth
        tester.advance();
        check_equals(root->get_current_frame(), 29);
-       check_equals(movieClip1->get_depth(), 2);
-       check_equals(movieClip2->get_depth(), 1);
+       check_equals(movieClip1->get_depth(), 2+character::staticDepthOffset);
+       check_equals(movieClip2->get_depth(), 1+character::staticDepthOffset);
 
        // Now keep advancing until last frame is reached
        // (29, as framecount is 0-based)
@@ -95,8 +95,8 @@
        }
 
        check_equals(root->get_current_frame(), 29);
-       check_equals(movieClip1->get_depth(), 2);
-       check_equals(movieClip2->get_depth(), 1);
+       check_equals(movieClip1->get_depth(), 2+character::staticDepthOffset);
+       check_equals(movieClip2->get_depth(), 1+character::staticDepthOffset);
 
 
        // Next advance will make the movie restart
@@ -104,8 +104,8 @@
        check_equals(root->get_current_frame(), 0);
 
        // We expect the depth to be kept on restart
-       check_equals(movieClip1->get_depth(), 2);
-       check_equals(movieClip2->get_depth(), 1);
+       check_equals(movieClip1->get_depth(), 2+character::staticDepthOffset);
+       check_equals(movieClip2->get_depth(), 1+character::staticDepthOffset);
 
        // ... until next SwapDepth ...
 
@@ -113,19 +113,19 @@
                tester.advance();
        }
 
-       check_equals(movieClip1->get_depth(), 2);
-       check_equals(movieClip2->get_depth(), 1);
+       check_equals(movieClip1->get_depth(), 2+character::staticDepthOffset);
+       check_equals(movieClip2->get_depth(), 1+character::staticDepthOffset);
 
        // we expect depths to be swapped again 
        tester.advance();
        check_equals(root->get_current_frame(), 29);
-       check_equals(movieClip1->get_depth(), 1);
-       check_equals(movieClip2->get_depth(), 2);
+       check_equals(movieClip1->get_depth(), 1+character::staticDepthOffset);
+       check_equals(movieClip2->get_depth(), 2+character::staticDepthOffset);
 
        // .. and the new deptsh to be kept at restart
        tester.advance();
        check_equals(root->get_current_frame(), 0);
-       check_equals(movieClip1->get_depth(), 1);
-       check_equals(movieClip2->get_depth(), 2);
+       check_equals(movieClip1->get_depth(), 1+character::staticDepthOffset);
+       check_equals(movieClip2->get_depth(), 2+character::staticDepthOffset);
 }
 

Index: testsuite/misc-ming.all/simple_loop_testrunner.cpp
===================================================================
RCS file: 
/sources/gnash/gnash/testsuite/misc-ming.all/simple_loop_testrunner.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- testsuite/misc-ming.all/simple_loop_testrunner.cpp  26 Jan 2007 10:51:52 
-0000      1.3
+++ testsuite/misc-ming.all/simple_loop_testrunner.cpp  6 Apr 2007 11:43:44 
-0000       1.4
@@ -64,7 +64,7 @@
        check_equals(root->get_play_state(), sprite_instance::PLAY);
        check_equals(root->get_current_frame(), 1);
        check_equals(root->getDisplayList().size(), 1);
-       check( tester.findDisplayItemByDepth(*root, 2) );
+       check( tester.findDisplayItemByDepth(*root, 
2+character::staticDepthOffset) );
        invalidated = tester.getInvalidatedBounds();
        check( invalidated.intersects(Bounds(0, 0, 60, 60)) );
 
@@ -73,8 +73,8 @@
        check_equals(root->get_play_state(), sprite_instance::PLAY);
        check_equals(root->get_current_frame(), 2);
        check_equals(root->getDisplayList().size(), 2);
-       check( tester.findDisplayItemByDepth(*root, 2) );
-       check( tester.findDisplayItemByDepth(*root, 3) );
+       check( tester.findDisplayItemByDepth(*root, 
2+character::staticDepthOffset) );
+       check( tester.findDisplayItemByDepth(*root, 
3+character::staticDepthOffset) );
        invalidated = tester.getInvalidatedBounds();
        check( invalidated.intersects(Bounds(60, 0, 120, 60)) );
 
@@ -83,9 +83,9 @@
        check_equals(root->get_play_state(), sprite_instance::PLAY);
        check_equals(root->get_current_frame(), 3);
        check_equals(root->getDisplayList().size(), 3);
-       check( tester.findDisplayItemByDepth(*root, 2) );
-       check( tester.findDisplayItemByDepth(*root, 3) );
-       check( tester.findDisplayItemByDepth(*root, 4) );
+       check( tester.findDisplayItemByDepth(*root, 
2+character::staticDepthOffset) );
+       check( tester.findDisplayItemByDepth(*root, 
3+character::staticDepthOffset) );
+       check( tester.findDisplayItemByDepth(*root, 
4+character::staticDepthOffset) );
        invalidated = tester.getInvalidatedBounds();
        check( invalidated.intersects(Bounds(120, 0, 180, 60)) );
 
@@ -102,7 +102,7 @@
        check_equals(root->get_play_state(), sprite_instance::PLAY);
        check_equals(root->get_current_frame(), 1);
        check_equals(root->getDisplayList().size(), 1);
-       check( tester.findDisplayItemByDepth(*root, 2) );
+       check( tester.findDisplayItemByDepth(*root, 
2+character::staticDepthOffset) );
        invalidated = tester.getInvalidatedBounds();
        check( invalidated.intersects(Bounds(0, 0, 60, 60)) );
 
@@ -111,8 +111,8 @@
        check_equals(root->get_play_state(), sprite_instance::PLAY);
        check_equals(root->get_current_frame(), 2);
        check_equals(root->getDisplayList().size(), 2);
-       check( tester.findDisplayItemByDepth(*root, 2) );
-       check( tester.findDisplayItemByDepth(*root, 3) );
+       check( tester.findDisplayItemByDepth(*root, 
2+character::staticDepthOffset) );
+       check( tester.findDisplayItemByDepth(*root, 
3+character::staticDepthOffset) );
        invalidated = tester.getInvalidatedBounds();
        check( invalidated.intersects(Bounds(60, 0, 120, 60)) );
 
@@ -121,9 +121,9 @@
        check_equals(root->get_play_state(), sprite_instance::PLAY);
        check_equals(root->get_current_frame(), 3);
        check_equals(root->getDisplayList().size(), 3);
-       check( tester.findDisplayItemByDepth(*root, 2) );
-       check( tester.findDisplayItemByDepth(*root, 3) );
-       check( tester.findDisplayItemByDepth(*root, 4) );
+       check( tester.findDisplayItemByDepth(*root, 
2+character::staticDepthOffset) );
+       check( tester.findDisplayItemByDepth(*root, 
3+character::staticDepthOffset) );
+       check( tester.findDisplayItemByDepth(*root, 
4+character::staticDepthOffset) );
        invalidated = tester.getInvalidatedBounds();
        check( invalidated.intersects(Bounds(120, 0, 180, 60)) );
 

Index: testsuite/movies.all/gravity_embedded-TestRunner.cpp
===================================================================
RCS file: 
/sources/gnash/gnash/testsuite/movies.all/gravity_embedded-TestRunner.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- testsuite/movies.all/gravity_embedded-TestRunner.cpp        11 Nov 2006 
14:36:33 -0000      1.3
+++ testsuite/movies.all/gravity_embedded-TestRunner.cpp        6 Apr 2007 
11:43:44 -0000       1.4
@@ -1,5 +1,5 @@
 /* 
- *   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+ *   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -60,7 +60,7 @@
        // used to get members
        as_value tmp;
 
-       const character* loaded = tester.findDisplayItemByDepth(*root, 8);
+       const character* loaded = tester.findDisplayItemByDepth(*root, 0); // 
depends on getNextHighestDepth
        check(loaded);
        check_equals(loaded->get_parent(), root);
 
@@ -72,7 +72,7 @@
        check_equals(loaded->get_height(), 2056);
        check_equals(loaded->get_width(), 2056);
 
-       const character* text = tester.findDisplayItemByDepth(*root, 7);
+       const character* text = tester.findDisplayItemByDepth(*root, 
7+character::staticDepthOffset);
        check(text);
        
        check_equals(string(text->get_text_value()), "50");

Index: testsuite/samples/clip_as_button2-TestRunner.cpp
===================================================================
RCS file: 
/sources/gnash/gnash/testsuite/samples/clip_as_button2-TestRunner.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- testsuite/samples/clip_as_button2-TestRunner.cpp    17 Jan 2007 09:53:23 
-0000      1.5
+++ testsuite/samples/clip_as_button2-TestRunner.cpp    6 Apr 2007 11:43:44 
-0000       1.6
@@ -70,7 +70,7 @@
        string msg_botleft = "big movie clip pressed";
        string msg_botright = "small movie clip pressed";
 
-       const character* text = tester.findDisplayItemByDepth(*root, 3);
+       const character* text = tester.findDisplayItemByDepth(*root, 
3+character::staticDepthOffset);
        check(text);
        check_equals(string(text->get_text_value()), msg_empty);
        check(!tester.isMouseOverMouseEntity());




reply via email to

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