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 testsuite/ac...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/character.h testsuite/ac...
Date: Thu, 30 Aug 2007 13:32:06 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/08/30 13:32:06

Modified files:
        .              : ChangeLog 
        server         : character.h 
        testsuite/actionscript.all: MovieClip.as 

Log message:
                * server/character.h: add const for removed clips depth offset.
                * testsuite/actionscript.all/MovieClip.as: test for depth shift 
when
                  onUnload method is defined and a clip is removed.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4161&r2=1.4162
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.h?cvsroot=gnash&r1=1.89&r2=1.90
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/MovieClip.as?cvsroot=gnash&r1=1.84&r2=1.85

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4161
retrieving revision 1.4162
diff -u -b -r1.4161 -r1.4162
--- ChangeLog   30 Aug 2007 12:58:28 -0000      1.4161
+++ ChangeLog   30 Aug 2007 13:32:05 -0000      1.4162
@@ -1,5 +1,8 @@
 2007-08-30 Sandro Santilli <address@hidden>
 
+       * server/character.h: add const for removed clips depth offset.
+       * testsuite/actionscript.all/MovieClip.as: test for depth shift when
+         onUnload method is defined and a clip is removed.
        * testsuite/misc-swfc.all/movieclip_destruction_test1.sc: expect
          gnash failures.
        * testsuite/actionscript.all/: Makefile.am, AsBroadcaster.as:

Index: server/character.h
===================================================================
RCS file: /sources/gnash/gnash/server/character.h,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -b -r1.89 -r1.90
--- server/character.h  23 Aug 2007 16:50:56 -0000      1.89
+++ server/character.h  30 Aug 2007 13:32:05 -0000      1.90
@@ -19,7 +19,7 @@
 //
 //
 
-/* $Id: character.h,v 1.89 2007/08/23 16:50:56 strk Exp $ */
+/* $Id: character.h,v 1.90 2007/08/30 13:32:05 strk Exp $ */
 
 #ifndef GNASH_CHARACTER_H
 #define GNASH_CHARACTER_H
@@ -342,6 +342,16 @@
     ///
     static const int staticDepthOffset = -16384;
     
+    /// This is the offset at which character's depth is
+    /// shifted when a character is removed from stage but
+    /// an onUnload event handler is defined.
+    ///
+    /// Example: a character at depth 60 gets moved to
+    ///          depth -32829 (-32769-60) when unloaded and
+    ///          an onUnload event handler is defined for it.
+    ///
+    static const int removedDepthOffset = -32769; // -32769;
+    
     /// This value is used for m_clip_depth when the value has no meaning, ie.
     /// the character is not a mask. Depths below -16384 are illegal, so this
     /// value should not collide with real depths.  

Index: testsuite/actionscript.all/MovieClip.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/MovieClip.as,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -b -r1.84 -r1.85
--- testsuite/actionscript.all/MovieClip.as     24 Aug 2007 16:07:27 -0000      
1.84
+++ testsuite/actionscript.all/MovieClip.as     30 Aug 2007 13:32:05 -0000      
1.85
@@ -20,7 +20,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.84 2007/08/24 16:07:27 strk Exp $";
+rcsid="$Id: MovieClip.as,v 1.85 2007/08/30 13:32:05 strk Exp $";
 
 #include "check.as"
 
@@ -418,25 +418,45 @@
 #if OUTPUT_VERSION >= 6
 
 softref = _root.createEmptyMovieClip("hardref", 60);
+softref2 = _root.createEmptyMovieClip("hardref2", 70);
+hardref2.onUnload = function() { /*note(this+".onUnload called");*/ };
 check_equals(typeof(hardref), 'movieclip');
 check_equals(typeof(softref), 'movieclip');
+check_equals(typeof(hardref2), 'movieclip');
+check_equals(typeof(softref2), 'movieclip');
 softref.member = 1;
+softref2.member = 2;
 check_equals(typeof(softref.member), 'number');
+check_equals(typeof(softref2.member), 'number');
 check_equals(softref.member, 1);
+check_equals(softref2.member, 2);
 check_equals(softref._target, "/hardref");
+check_equals(softref2._target, "/hardref2");
 #if OUTPUT_VERSION > 6
-check_equals(getInstanceAtDepth(60), hardref);
-removeMovieClip(hardref); // using ActionRemoveClip (0x25)
-check_equals(getInstanceAtDepth(60), undefined);
+ check_equals(getInstanceAtDepth(60), hardref);
+ check_equals(getInstanceAtDepth(70), hardref2);
+ check_equals(hardref.getDepth(), 60);
+ check_equals(hardref2.getDepth(), 70);
+ removeMovieClip(hardref); // using ActionRemoveClip (0x25)
+ removeMovieClip(hardref2); // using ActionRemoveClip (0x25)
+ check_equals(getInstanceAtDepth(60), undefined);
+ check_equals(getInstanceAtDepth(-32839), hardref2);
 #else
-// just to test another way, ActionRemoveClip in SWF6 will work as well
-hardref.removeMovieClip(); // using the sprite's removeMovieClip 
-//softref.removeMovieClip(); // use the softref's removeMovieClip 
+ // just to test another way, ActionRemoveClip in SWF6 will work as well
+ hardref.removeMovieClip(); // using the sprite's removeMovieClip 
+ hardref2.removeMovieClip(); // using the sprite's removeMovieClip
+ //softref.removeMovieClip(); // use the softref's removeMovieClip 
 #endif
+
 check_equals(typeof(hardref), 'undefined');
+xcheck_equals(typeof(hardref2), 'movieclip');
+xcheck_equals(hardref2.getDepth(), -32839);
 check_equals(typeof(softref), 'movieclip');
+check_equals(typeof(softref2), 'movieclip');
 check_equals(typeof(softref.member), 'undefined');
 check_equals(typeof(softref._target), 'undefined');
+xcheck_equals(softref2.member, 2);
+xcheck_equals(softref2._target, '/hardref2');
 hardref = 4;
 check_equals(typeof(softref), 'movieclip'); // hardref doesn't hide this
 // Delete is needed, or further inspection functions will hit the variable 
before the character




reply via email to

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