gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/avm2 r9456: Add execute function to Symbol


From: Tom Stellard
Subject: [Gnash-commit] /srv/bzr/gnash/avm2 r9456: Add execute function to SymbolClassTag, so it can instantiate the main class.
Date: Wed, 13 Aug 2008 00:29:48 +0800
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9456
committer: Tom Stellard <address@hidden>
branch nick: gnash_dev
timestamp: Wed 2008-08-13 00:29:48 +0800
message:
  Add execute function to SymbolClassTag, so it can instantiate the main class.
modified:
  libcore/swf/SymbolClassTag.h
=== modified file 'libcore/swf/SymbolClassTag.h'
--- a/libcore/swf/SymbolClassTag.h      2008-08-12 03:53:53 +0000
+++ b/libcore/swf/SymbolClassTag.h      2008-08-12 16:29:48 +0000
@@ -38,10 +38,25 @@
 {
 public:
 
-       SymbolClassTag()
+       SymbolClassTag(std::string name):rootClass(name)
 
        {}
 
+       virtual void execute(sprite_instance* m, DisplayList& /* dlist */) const
+       {
+               VM& vm = VM::get();
+               Machine *mach = vm.getMachine();
+
+               mach->instantiateClass(rootClass);
+               log_debug("Executing machine...");
+               mach->execute();
+       }
+
+       // Tell the caller that we are an action tag.
+       virtual bool is_action_tag() const
+       {
+           return true;
+       }
        static void loader(SWFStream& in,tag_type tag, movie_definition* m)
        {
                assert(tag == SYMBOLCLASS); //76
@@ -56,9 +71,15 @@
                        std::string name;
                        in.read_string(name);
                        log_debug("Symbol %u name=%s tag=%u",i,name,character);
+                       if(character == 0){
+                               SymbolClassTag *symbolClassTag = new 
SymbolClassTag(name);
+                               m->addControlTag(symbolClassTag);
+                       }
                }
        }
-       
+private:
+
+std::string rootClass;
 };
 
 } // namespace gnash::SWF


reply via email to

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