gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/as_environment.cpp serve...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/as_environment.cpp serve...
Date: Tue, 10 Apr 2007 17:41:43 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/04/10 17:41:42

Modified files:
        .              : ChangeLog 
        server         : as_environment.cpp as_environment.h 
        server/vm      : ASHandlers.cpp 

Log message:
                * server/as_environment.{cpp,h}: add the concept
                  of a default target to support setTarget() calls
                  (null target spec meaning will to reset the target
                   to its original value).
                * server/vm/ASHandlers.cpp (CommonSetTarget):
                  When target specification is an empty string
                  reset the target to its original value.
                  Use find_target rather then find_object to avoid
                  variables and character names clashes.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2827&r2=1.2828
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.cpp?cvsroot=gnash&r1=1.65&r2=1.66
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.h?cvsroot=gnash&r1=1.43&r2=1.44
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.84&r2=1.85

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2827
retrieving revision 1.2828
diff -u -b -r1.2827 -r1.2828
--- ChangeLog   10 Apr 2007 16:17:54 -0000      1.2827
+++ ChangeLog   10 Apr 2007 17:41:42 -0000      1.2828
@@ -1,5 +1,17 @@
 2007-04-10 Sandro Santilli <address@hidden>
 
+       * server/as_environment.{cpp,h}: add the concept
+         of a default target to support setTarget() calls
+         (null target spec meaning will to reset the target
+          to its original value).
+       * server/vm/ASHandlers.cpp (CommonSetTarget):
+         When target specification is an empty string
+         reset the target to its original value.
+         Use find_target rather then find_object to avoid
+         variables and character names clashes.
+
+2007-04-10 Sandro Santilli <address@hidden>
+
        * server/parser/movie_def_impl.cpp (read_all_swf): at
          end of parsing, check consistency of number of frames 
          advertised in header and number of frames read from the

Index: server/as_environment.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -b -r1.65 -r1.66
--- server/as_environment.cpp   10 Apr 2007 17:12:36 -0000      1.65
+++ server/as_environment.cpp   10 Apr 2007 17:41:42 -0000      1.66
@@ -16,7 +16,7 @@
 
 //
 
-/* $Id: as_environment.cpp,v 1.65 2007/04/10 17:12:36 strk Exp $ */
+/* $Id: as_environment.cpp,v 1.66 2007/04/10 17:41:42 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1036,6 +1036,14 @@
        _localFrames.push_back(CallFrame(func));
 }
 
+void
+as_environment::set_target(character* target)
+{
+       assert(target);
+       if ( ! m_target ) _original_target = target;
+       m_target = target;
+}
+
 } // end of gnash namespace
 
 

Index: server/as_environment.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- server/as_environment.h     28 Mar 2007 16:24:39 -0000      1.43
+++ server/as_environment.h     10 Apr 2007 17:41:42 -0000      1.44
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: as_environment.h,v 1.43 2007/03/28 16:24:39 strk Exp $ */
+/* $Id: as_environment.h,v 1.44 2007/04/10 17:41:42 strk Exp $ */
 
 #ifndef GNASH_AS_ENVIRONMENT_H
 #define GNASH_AS_ENVIRONMENT_H
@@ -74,7 +74,10 @@
        }
 
        character* get_target() { return m_target; }
-       void set_target(character* target) { m_target = target; }
+       void set_target(character* target);
+
+       // Reset target to its original value
+       void reset_target() { m_target = _original_target; }
 
        /// @{ Stack access/manipulation
 
@@ -486,6 +489,9 @@
        /// Movie target. 
        character* m_target;
 
+       /// Movie target. 
+       character* _original_target;
+
        /// Given a variable name, set its value (no support for path)
        void set_variable_raw(const std::string& path, const as_value& val,
                const ScopeStack& with_stack);

Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -b -r1.84 -r1.85
--- server/vm/ASHandlers.cpp    7 Apr 2007 11:32:35 -0000       1.84
+++ server/vm/ASHandlers.cpp    10 Apr 2007 17:41:42 -0000      1.85
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: ASHandlers.cpp,v 1.84 2007/04/07 11:32:35 strk Exp $ */
+/* $Id: ASHandlers.cpp,v 1.85 2007/04/10 17:41:42 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1885,15 +1885,14 @@
 {
        character *new_target;
     
-       // if the string is blank, we set target to the root movie
-       // TODO - double check this is correct?
-       if ( target_name.empty() ) {
-               new_target = env.find_target(string("/"));
-       } else {
-               as_value target_val = env.get_variable(target_name);
-               new_target = target_val.to_sprite();
+       // if the string is blank, we reset the target to its original value
+       if ( target_name.empty() )
+       {
+               env.reset_target();
+               return;
        }
 
+       new_target = env.find_target(target_name);
        if (new_target == NULL)
        {
                IF_VERBOSE_ASCODING_ERRORS (




reply via email to

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