[Top][All Lists]
[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 10:36:21 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/02/16 10:36:21
Modified files:
. : ChangeLog
server : dlist.cpp dlist.h
Log message:
Fix a bug in clear_except(DisplayList&), add clear(DisplayList&).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2374&r2=1.2375
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.cpp?cvsroot=gnash&r1=1.46&r2=1.47
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.h?cvsroot=gnash&r1=1.25&r2=1.26
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2374
retrieving revision 1.2375
diff -u -b -r1.2374 -r1.2375
--- ChangeLog 16 Feb 2007 09:51:47 -0000 1.2374
+++ ChangeLog 16 Feb 2007 10:36:20 -0000 1.2375
@@ -2,7 +2,8 @@
* server/dlist.{cpp,h}: add clear_except() override taking
a DisplayList as argument. Add a call_unload argument
- for both clear_except() methods; add empty() method.
+ for both clear_except() methods; add empty() method;
+ add clear() override taking a DisplayList as argument.
* 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.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- server/dlist.cpp 16 Feb 2007 09:41:49 -0000 1.46
+++ server/dlist.cpp 16 Feb 2007 10:36:21 -0000 1.47
@@ -497,7 +497,38 @@
DisplayItem& di = *it;
bool is_affected = false;
- for (const_iterator kit = keepchars.begin(), kitEnd =
keepchars.end(); kit != kitEnd; )
+ for (const_iterator kit = keepchars.begin(), kitEnd =
keepchars.end(); kit != kitEnd; ++kit)
+ {
+ if ( *kit == di )
+ {
+ is_affected = true;
+ break;
+ }
+ }
+
+ if (is_affected == false)
+ {
+ if ( unload ) di->on_event(event_id::UNLOAD);
+ it = _characters.erase(it);
+ continue;
+ }
+ it++;
+ }
+}
+
+void
+DisplayList::clear(const DisplayList& from, bool unload)
+{
+ //GNASH_REPORT_FUNCTION;
+
+ const container_type dropchars = from._characters;
+
+ for (iterator it = _characters.begin(), itEnd = _characters.end(); it
!= itEnd; )
+ {
+ DisplayItem& di = *it;
+
+ bool is_affected = false;
+ for (const_iterator kit = dropchars.begin(), kitEnd =
dropchars.end(); kit != kitEnd; ++kit)
{
if ( *kit == di )
{
Index: server/dlist.h
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- server/dlist.h 16 Feb 2007 09:51:48 -0000 1.25
+++ server/dlist.h 16 Feb 2007 10:36:21 -0000 1.26
@@ -128,17 +128,31 @@
void clear();
/// \brief
+ /// Clear all characters in this DisplayList that are also found
+ /// in the given DisplayList
+ //
+ /// @param from
+ /// A DisplayList containing character instances to clear.
+ /// Any instance found in in will be removed from this DisplayList.
+ ///
+ /// @param call_unload
+ /// If true, UNLOAD event will be invoked on the characters being
+ /// removed. False by default.
+ ///
+ void clear(const DisplayList& from, bool call_unload=false);
+
+ /// \brief
/// Clear all characters in the display list except the ones
/// contained in the given vector.
//
/// @param exclude
/// A vector containing character instances to keep.
/// Any instance not found in the vector will be removed
- /// from the displaylist.
+ /// from this DisplayList.
///
/// @param call_unload
/// If true, UNLOAD event will be invoked on the characters being
- /// removed.
+ /// removed. False by default.
///
void clear_except(std::vector<character*>& exclude, bool
call_unload=false);
@@ -149,11 +163,11 @@
/// @param exclude
/// A DisplayList containing character instances to keep.
/// Any instance not found in in will be removed
- /// from the this DisplayList.
+ /// from this DisplayList.
///
/// @param call_unload
/// If true, UNLOAD event will be invoked on the characters being
- /// removed.
+ /// removed. False by default.
///
void clear_except(const DisplayList& exclude, bool call_unload=false);