gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/character.cpp testsuite/...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/character.cpp testsuite/...
Date: Wed, 11 Jul 2007 00:33:57 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/07/11 00:33:57

Modified files:
        .              : ChangeLog 
        server         : character.cpp 
        testsuite/swfdec: PASSING 

Log message:
                * testsuite/swfdec/PASSING: three more tests succeed (name
                  of loaded instances).
                * server/character.cpp (getTarget): remove the hard-coded
                  _level0 lead, substitute with a correct level number.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3707&r2=1.3708
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.cpp?cvsroot=gnash&r1=1.46&r2=1.47
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/swfdec/PASSING?cvsroot=gnash&r1=1.23&r2=1.24

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3707
retrieving revision 1.3708
diff -u -b -r1.3707 -r1.3708
--- ChangeLog   11 Jul 2007 00:16:37 -0000      1.3707
+++ ChangeLog   11 Jul 2007 00:33:56 -0000      1.3708
@@ -1,5 +1,9 @@
 2007-07-10 Sandro Santilli <address@hidden>
 
+       * testsuite/swfdec/PASSING: three more tests succeed (name
+         of loaded instances).
+       * server/character.cpp (getTarget): remove the hard-coded
+         _level0 lead, substitute with a correct level number.
        * server/: as_environment.cpp, character.cpp,
          sprite_instance.cpp: properly evaluate _level#
          path components.

Index: server/character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/character.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- server/character.cpp        11 Jul 2007 00:16:38 -0000      1.46
+++ server/character.cpp        11 Jul 2007 00:33:57 -0000      1.47
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 // 
 
-/* $Id: character.cpp,v 1.46 2007/07/11 00:16:38 strk Exp $ */
+/* $Id: character.cpp,v 1.47 2007/07/11 00:33:57 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -817,24 +817,49 @@
 character::getTarget() const
 {
 
-  // TODO: maybe cache computed target?
-
-       std::string target_dot;
+       // TODO: check what happens when this character
+       //       is a movie_instance loaded into another
+       //       running movie.
 
-       std::string levelString = "_level0"; // TODO: support real levels!
+       typedef std::vector<std::string> Path;
+       Path path;
 
-       const std::string& targetPath = getTargetPath();
-       if ( targetPath == "/" ) target_dot = levelString;
-       else
+       // Build parents stack
+       const character* ch = this;
+       for (;;)
        {
-               target_dot = levelString + targetPath;
-               for (std::string::size_type i=0; i<target_dot.length(); ++i)
+               const character* parent = ch->get_parent();
+
+               // Don't push the _root name on the stack
+               if ( ! parent )
                {
-                       if ( target_dot[i] == '/' ) target_dot[i] = '.';
+                       assert(dynamic_cast<const movie_instance*>(ch));
+                       std::stringstream ss;
+                       ss << "_level" << ch->get_depth();
+                       path.push_back(ss.str());
+                       // it is completely legal to set root's _name
+                       //assert(ch->get_name().empty());
+                       break;
+               }
+
+               path.push_back(ch->get_name());
+               ch = parent;
                }
+
+       assert ( ! path.empty() );
+
+       // Build the target string from the parents stack
+       std::string target;
+       for ( Path::reverse_iterator
+                       it=path.rbegin(), itEnd=path.rend();
+                       it != itEnd;
+                       ++it )
+       {
+               if ( ! target.empty() ) target += ".";
+               target += *it; 
        }
 
-       return target_dot;
+       return target;
 }
 
 /*public*/

Index: testsuite/swfdec/PASSING
===================================================================
RCS file: /sources/gnash/gnash/testsuite/swfdec/PASSING,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- testsuite/swfdec/PASSING    18 Jun 2007 00:27:44 -0000      1.23
+++ testsuite/swfdec/PASSING    11 Jul 2007 00:33:57 -0000      1.24
@@ -90,3 +90,6 @@
 with-prototypes-5.swf
 with-prototypes-6.swf
 with-prototypes-7.swf
+instance-name-loaded-5.swf
+instance-name-loaded-6.swf
+instance-name-loaded-7.swf




reply via email to

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