gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/sprite_instance.cpp serv...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/sprite_instance.cpp serv...
Date: Thu, 30 Aug 2007 18:19:16 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/08/30 18:19:16

Modified files:
        .              : ChangeLog 
        server         : sprite_instance.cpp sprite_instance.h 
        server/swf     : PlaceObject2Tag.cpp 

Log message:
                * server/sprite_instance.{cpp,h}: cleanups:
                  drop resetDisplayList, _frame0 and 
replace_if_depth_is_occupied
                  parameter of add_display_object.
                * server/swf/PlaceObject2Tag.cpp: update call to 
add_display_object

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4164&r2=1.4165
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.315&r2=1.316
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.h?cvsroot=gnash&r1=1.132&r2=1.133
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/PlaceObject2Tag.cpp?cvsroot=gnash&r1=1.21&r2=1.22

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4164
retrieving revision 1.4165
diff -u -b -r1.4164 -r1.4165
--- ChangeLog   30 Aug 2007 14:14:38 -0000      1.4164
+++ ChangeLog   30 Aug 2007 18:19:15 -0000      1.4165
@@ -1,5 +1,12 @@
 2007-08-30 Sandro Santilli <address@hidden>
 
+       * server/sprite_instance.{cpp,h}: cleanups: 
+         drop resetDisplayList, _frame0 and replace_if_depth_is_occupied
+         parameter of add_display_object.
+       * server/swf/PlaceObject2Tag.cpp: update call to add_display_object
+
+2007-08-30 Sandro Santilli <address@hidden>
+
        * testsuite/misc-ming.all/Makefile.am: don't try to build
          DefineEditTextVariableNameTest2-Runner from an non-existent .c
          file (fixes 'make dist').

Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.315
retrieving revision 1.316
diff -u -b -r1.315 -r1.316
--- server/sprite_instance.cpp  30 Aug 2007 14:13:07 -0000      1.315
+++ server/sprite_instance.cpp  30 Aug 2007 18:19:15 -0000      1.316
@@ -2119,7 +2119,6 @@
                newname.c_str(),
                dummy_event_handlers,
                depth,
-               true, // replace if depth is occupied (to drop)
                ch->get_cxform(),
                ch->get_matrix(),
                ch->get_ratio(),
@@ -2311,7 +2310,6 @@
                                // TODO: check why this would be any different
                                //       then calling restoreDisplayList(0) 
instead..
                                //       Ah! I think I know..
-                               //resetDisplayList();
                                restoreDisplayList(0); // seems OK to me.
                        }
 
@@ -2356,8 +2354,8 @@
        do_actions();
 
        // Call UNLOAD event of just removed chars !
-       DisplayList justRemoved = oldDisplayList;
-       justRemoved.clear_except(m_display_list, false); // true;
+       //DisplayList justRemoved = oldDisplayList;
+       //justRemoved.clear_except(m_display_list, false); // true;
        // No, dont' call UNLOAD event, as it should be called by 
remove_display_object!
 
        // Finally, execute actions in newly added childs
@@ -2437,43 +2435,6 @@
        //env.set_local_frame_top(local_stack_top);
 }
 
-void
-sprite_instance::resetDisplayList()
-{
-       // TODO: see if/how this can be merged with restoreDisplayList !
-
-       assert(m_current_frame == 0);
-
-       // Add script objects in current DisplayList
-       std::vector<character*> charsToAdd; 
-       std::vector<character*> charsToKeep; 
-       ScriptObjectsFinder scriptObjFinder(charsToAdd, charsToKeep);
-       m_display_list.visitAll(scriptObjFinder);
-
-       // Resort frame0 DisplayList as depth of
-       // characters in it might have been
-       // externally changed.
-       _frame0_chars.sort();
-
-       // Remove characters which have been removed
-       _frame0_chars.clear_except(charsToKeep);
-
-       // NOTE: script objects are *not* allowed to replace depths
-       //       of static objects (change second argument to switch)
-       _frame0_chars.addAll(charsToAdd, false);
-       
-       if ( ! (m_display_list == _frame0_chars) )
-       {
-
-               // Set this character as invalidated *before*
-               // actually updating the displaylist !
-               set_invalidated(); 
-
-               //m_display_list = _frame0_chars;       
-               m_display_list.clear_except(_frame0_chars, true); // call unload
-       };
-}
-
 /*private*/
 void
 sprite_instance::restoreDisplayList(size_t tgtFrame)
@@ -2577,14 +2538,6 @@
                if ( typeflags & TAG_ACTION ) tag->execute_action(this);
        }
 
-       // TODO: do _frame0_chars still make sense ?
-       //       Should we use the same algorithm in restoreDisplayList instead 
?
-       if ( frame == 0 && ! has_looped() )
-       {
-               // Save DisplayList state
-               _frame0_chars = m_display_list;
-       }
-
        testInvariant();
 }
 
@@ -2666,7 +2619,7 @@
        // redraw. Consider a static graphic that stays at it's position all
        // the time. When looping betwen two frames 
        // gotoAndPlay(_currentframe-1);
-       // then resetDisplayList() will remove that character and 
+       // then restoreDisplayList() will remove that character and 
        // execute_frame_tags() will insert it again. So the next 
        // set_invalidated() call (which currently *is* correct) will cause
        // redraw of the whole sprite even if it doesn't change visually
@@ -2806,7 +2759,6 @@
     const char* name,
     const std::vector<swf_event*>& event_handlers,
     int depth, 
-    bool /*replace_if_depth_is_occupied*/,
     const cxform& color_transform, const matrix& mat,
     int ratio, int clip_depth)
 {
@@ -3713,8 +3665,6 @@
 
        oldDisplayList.visitAll(marker);
 
-       _frame0_chars.visitAll(marker);
-
        _drawable->setReachable();
 
        _drawable_inst->setReachable();

Index: server/sprite_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.h,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -b -r1.132 -r1.133
--- server/sprite_instance.h    30 Aug 2007 14:13:07 -0000      1.132
+++ server/sprite_instance.h    30 Aug 2007 18:19:16 -0000      1.133
@@ -314,10 +314,10 @@
        ///
        /// If the specified depth is already occupied by an instance of a 
different
        /// character (including any dynamically-created instance), the 
behaviour is
-       /// controlled by the replace_if_depth_is_occupied parameter. If false, 
this
+       /// controlled by the is_jumping_back flag. If false, this
        /// call will result in a no-op. If true, the previously existing 
character
        /// will be replaced by the new one, with unload() method invoked on the
-       /// removed character.
+       /// removed character. (zou: correct?)
        ///
        /// Any successful new placement triggers invokation of the newly 
created
        /// instance's LOAD event.
@@ -338,12 +338,6 @@
        /// @param depth
        ///     The depth to assign to the newly created instance.
        ///
-       /// @param replace_if_depth_is_occupied
-       ///     This parameter control behaviour in case an existing instance 
is found at
-       ///     the given depth but is NOT an instance of the given 
character_id.
-       ///     In this case: if this paremeter is true, the old instance will 
be replaced by
-       ///     the new one, otherwise nothing happens and this function 
returns NULL.
-       ///
        /// @param color_transform
        ///     The color transform to apply to the newly created instance.
        ///
@@ -361,15 +355,14 @@
        /// @return 
        ///     A pointer to the character being added or NULL
        ///     if this call results in a move of an existing character 
-       ///     or in a no-op due to replace_if_depth_is_occupied being
-       ///     false.
+       ///     or in a no-op due to is_jumping_back being
+       ///     false. (zou: correct?)
        ///       
        character* add_display_object(
                uint16_t character_id,
                const char* name,
                const SWFEventsVector& event_handlers,
                int depth,
-               bool replace_if_depth_is_occupied,
                const cxform& color_transform,
                const matrix& matrix,
                int ratio,
@@ -797,11 +790,6 @@
        void clone_display_object(const std::string& name,
                const std::string& newname, int depth);
 #endif
-       /// Reset the DisplayList for proper loop-back or goto_frame
-       //
-       /// The DisplayList is cleared by all but dynamic characters
-       ///
-       void resetDisplayList();
 
        /// Reconstruct the DisplayList for proper loop-back operations
        //
@@ -933,14 +921,6 @@
        /// soundid for current playing stream. If no stream set to -1
        int m_sound_stream_id;
 
-
-       /// The DisplayList resulting by execution of tags in first frame.
-       //
-       /// It will be used to reinitialized actual DisplayList on restart.
-       /// See execute_frame_tags.
-       ///
-       DisplayList _frame0_chars;
-
        std::string _origTarget;
 
 protected:
@@ -953,14 +933,6 @@
        }
 
        /// Execute the tags associated with the specified frame.
-       //
-       /// Execution of 1st frame tags is specially handled:
-       ///
-       /// - After executing them for the first time
-       ///   the DisplayList state is saved into the _frame0_chars
-       ///   member, which is used by resetDisplayList() on loop-back
-       ///   TODO: drop this _frame0_chars thing ? See comments in
-       ///   resetDisplayList()
        ///
        /// @param frame
        ///     Frame number. 0-based
@@ -969,7 +941,7 @@
        ///     Which kind of control tags we want to execute. 
        ///     See control_tag_type enum.
        ///
-       void execute_frame_tags(size_t frame, int 
typeflags=TAG_DLIST|TAG_ACTION); // bool state_only = false;
+       void execute_frame_tags(size_t frame, int 
typeflags=TAG_DLIST|TAG_ACTION); 
 
        /// \brief
        /// This is either sprite_definition (for sprites defined by

Index: server/swf/PlaceObject2Tag.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/PlaceObject2Tag.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- server/swf/PlaceObject2Tag.cpp      27 Aug 2007 12:44:29 -0000      1.21
+++ server/swf/PlaceObject2Tag.cpp      30 Aug 2007 18:19:16 -0000      1.22
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: PlaceObject2Tag.cpp,v 1.21 2007/08/27 12:44:29 strk Exp $ */
+/* $Id: PlaceObject2Tag.cpp,v 1.22 2007/08/30 18:19:16 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -359,7 +359,6 @@
              m_name,
              m_event_handlers,
              m_depth,
-             false, // don't replace characters at target depth (TODO: check 
if a general rule!)
              m_color_transform,
              m_matrix,
              m_ratio,




reply via email to

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