gnash-commit
[Top][All Lists]
Advanced

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

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


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/dlist.cpp server/dlist.h
Date: Fri, 16 Feb 2007 09:41:50 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/02/16 09:41:50

Modified files:
        .              : ChangeLog 
        server         : dlist.cpp dlist.h 

Log message:
                * server/dlist.{cpp,h}: add clear_except override taking
                  a DisplayList as argument. Add a call_unload argument
                  for both clear_except methods.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2372&r2=1.2373
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.cpp?cvsroot=gnash&r1=1.45&r2=1.46
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.h?cvsroot=gnash&r1=1.23&r2=1.24

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2372
retrieving revision 1.2373
diff -u -b -r1.2372 -r1.2373
--- ChangeLog   16 Feb 2007 09:32:27 -0000      1.2372
+++ ChangeLog   16 Feb 2007 09:41:49 -0000      1.2373
@@ -1,5 +1,8 @@
 2007-02-16 Sandro Santilli <address@hidden>
 
+       * server/dlist.{cpp,h}: add clear_except override taking
+         a DisplayList as argument. Add a call_unload argument
+         for both clear_except methods.
        * utilities/processor.cpp: add -f <frames> switch to control
          the number of "advance" calls on the top movie.
 

Index: server/dlist.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- server/dlist.cpp    3 Feb 2007 23:02:07 -0000       1.45
+++ server/dlist.cpp    16 Feb 2007 09:41:49 -0000      1.46
@@ -457,7 +457,7 @@
 }
 
 void
-DisplayList::clear_except(std::vector<character*>& exclude)
+DisplayList::clear_except(std::vector<character*>& exclude, bool call_unload)
 {
        //GNASH_REPORT_FUNCTION;
 
@@ -477,7 +477,38 @@
 
                if (is_affected == false)
                {
-                       di->on_event(event_id::UNLOAD);
+                       if ( call_unload ) di->on_event(event_id::UNLOAD);
+                       it = _characters.erase(it);
+                       continue;
+               }
+               it++;
+       }
+}
+
+void
+DisplayList::clear_except(const DisplayList& exclude, bool unload)
+{
+       //GNASH_REPORT_FUNCTION;
+
+       const container_type keepchars = exclude._characters;
+
+       for (iterator it = _characters.begin(), itEnd = _characters.end(); it 
!= itEnd; )
+       {
+               DisplayItem& di = *it;
+
+               bool is_affected = false;
+               for (const_iterator kit = keepchars.begin(), kitEnd = 
keepchars.end(); kit != kitEnd; )
+               {
+                       if ( *kit == di )
+                       {
+                               is_affected = true;
+                               break;
+                       }
+               }
+
+               if (is_affected == false)
+               {
+                       if ( unload ) di->on_event(event_id::UNLOAD);
                        it = _characters.erase(it);
                        continue;
                }

Index: server/dlist.h
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- server/dlist.h      24 Jan 2007 23:33:00 -0000      1.23
+++ server/dlist.h      16 Feb 2007 09:41:49 -0000      1.24
@@ -136,7 +136,26 @@
        ///     Any instance not found in the vector will be removed
        ///     from the displaylist.
        ///
-       void clear_except(std::vector<character*>& exclude);
+       /// @param call_unload
+       ///     If true, UNLOAD event will be invoked on the characters being
+       ///     removed.
+       ///
+       void clear_except(std::vector<character*>& exclude, bool 
call_unload=false);
+
+       /// \brief
+       /// Clear all characters in this DisplayList except the ones
+       /// contained in the given DisplayList
+       //
+       /// @param exclude
+       ///     A DisplayList containing character instances to keep.
+       ///     Any instance not found in in will be removed
+       ///     from the this DisplayList.
+       ///
+       /// @param call_unload
+       ///     If true, UNLOAD event will be invoked on the characters being
+       ///     removed.
+       ///
+       void clear_except(const DisplayList& exclude, bool call_unload=false);
 
        /// Add all chars in the list
        void addAll(std::vector<character*>& chars, bool replace);




reply via email to

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