gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash/server ActionExec.cpp Function.cpp Global...


From: Vitaly Alexeev
Subject: [Gnash-commit] gnash/server ActionExec.cpp Function.cpp Global...
Date: Thu, 29 Jun 2006 19:15:00 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Vitaly Alexeev <alexeev>        06/06/29 19:15:00

Modified files:
        server         : ActionExec.cpp Function.cpp Global.cpp 
                         action_buffer.cpp as_environment.h 
                         character_def.h dlist.cpp sprite_instance.cpp 

Log message:
        added "onClipEvent(construct, unload)" handlers

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/server/ActionExec.cpp?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/server/Function.cpp?cvsroot=gnash&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/gnash/server/Global.cpp?cvsroot=gnash&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/gnash/server/action_buffer.cpp?cvsroot=gnash&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.h?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character_def.h?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.cpp?cvsroot=gnash&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.13&r2=1.14

Patches:
Index: ActionExec.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/ActionExec.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- ActionExec.cpp      28 Jun 2006 23:27:44 -0000      1.5
+++ ActionExec.cpp      29 Jun 2006 19:15:00 -0000      1.6
@@ -151,7 +151,7 @@
        // Do we still need this ?
        if ( action_id == SWF::ACTION_END ) {
                // this would turn into an assertion (next_pc==stop_pc)
-               log_msg("At ACTION_END next_pc=%d, stop_pc=%d", next_pc, 
stop_pc);
+               //              log_msg("At ACTION_END next_pc=%d, stop_pc=%d", 
next_pc, stop_pc);
                break;
        }
 

Index: Function.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/Function.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- Function.cpp        28 Jun 2006 23:27:44 -0000      1.22
+++ Function.cpp        29 Jun 2006 19:15:00 -0000      1.23
@@ -45,7 +45,7 @@
 #include <array.h>
 #include <gnash.h>
 #include <fn_call.h>
-#include <sprite_instance.cpp>
+#include <sprite_instance.h>
 
 #include <typeinfo>
 #include <iostream>

Index: Global.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/Global.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- Global.cpp  28 Jun 2006 23:27:44 -0000      1.12
+++ Global.cpp  29 Jun 2006 19:15:00 -0000      1.13
@@ -372,9 +372,13 @@
     assert(fn.nargs == 3 || fn.nargs == 4);
     assert((version == 5) ? (fn.nargs == 3) : true);
 
+               if (fn.arg(0).get_type() == as_value::UNDEFINED)
+               {
+                       return;
+               }
+
     // object
     as_object* const obj = fn.arg(0).to_object();
-    assert(obj != NULL);
 
     // list of child names
     as_object* props = fn.arg(1).to_object();

Index: action_buffer.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/action_buffer.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- action_buffer.cpp   26 Jun 2006 02:21:44 -0000      1.4
+++ action_buffer.cpp   29 Jun 2006 19:15:00 -0000      1.5
@@ -65,6 +65,12 @@
 
 namespace gnash {
 
+
+#if defined(_WIN32) || defined(WIN32)
+       SWFHandlers::container_type SWFHandlers::_handlers(255);
+       std::vector<std::string> SWFHandlers::_property_names;
+#endif
+
 static const SWFHandlers& ash = SWFHandlers::instance();
 
 action_buffer::action_buffer()
@@ -72,7 +78,7 @@
     m_decl_dict_processed_at(-1)
 {
        static int count=0;
-       printf("Action buffer %d created\n", ++count);
+//     printf("Action buffer %d created\n", ++count);
 }
 
 

Index: as_environment.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- as_environment.h    28 Jun 2006 23:27:44 -0000      1.6
+++ as_environment.h    29 Jun 2006 19:15:00 -0000      1.7
@@ -58,7 +58,7 @@
 namespace gnash {
 
 // Forward declarations
-struct sprite_instance;
+class sprite_instance;
 struct with_stack_entry;
 
 /// ActionScript "environment", essentially VM state?

Index: character_def.h
===================================================================
RCS file: /sources/gnash/gnash/server/character_def.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- character_def.h     28 Jun 2006 23:27:44 -0000      1.5
+++ character_def.h     29 Jun 2006 19:15:00 -0000      1.6
@@ -48,7 +48,7 @@
 class tu_file;
 namespace gnash {
        class character;
-       class cache_options;
+       struct cache_options;
        class sprite_instance;
 };
 

Index: dlist.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- dlist.cpp   14 Jun 2006 13:02:50 -0000      1.12
+++ dlist.cpp   29 Jun 2006 19:15:00 -0000      1.13
@@ -197,10 +197,7 @@
                *it = DisplayItem(ch);
        }
 
-       // do the frame1 actions (if applicable) and the "onClipEvent (load)"
-       // event.
-
-//     ch->on_event_load();
+       ch->on_event(event_id::CONSTRUCT);
        ch->execute_frame_tags(0);      // create dlist only
 
        //log_msg("After adding, list is:");
@@ -245,10 +242,7 @@
                // add the new char
                _characters.insert(it, di);
 
-               // do the frame1 actions (if applicable) and the
-               // "onClipEvent (load)" event.
-
-               //      ch->on_event_load();
+               ch->on_event(event_id::CONSTRUCT);
                ch->execute_frame_tags(0);      // create dlist only
        }
        else
@@ -336,8 +330,18 @@
                        _characters.end(),
                        DepthEquals(depth));
 
-       if ( new_end != _characters.end() ) {
+       if ( new_end != _characters.end() )
+       {
+               //Vitaly: UNLOAD event in DisplayList::clear() it is not caused,
+               // since character is removed already
+               DisplayItem& di = *new_end;
+               if (new_end->get_ptr())
+               {
+                       di->on_event(event_id::UNLOAD);
+               }
+
                _characters.erase(new_end, _characters.end());
+
        }
 
 #ifndef NDEBUG

Index: sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- sprite_instance.cpp 28 Jun 2006 23:27:44 -0000      1.13
+++ sprite_instance.cpp 29 Jun 2006 19:15:00 -0000      1.14
@@ -881,6 +881,7 @@
        {
                return dynamic_cast<sprite_instance*>(ch);
        }
+       return NULL;
 }
 
 void sprite_instance::set_member(const tu_stringi& name,
@@ -1152,6 +1153,13 @@
        if (m_play_state == PLAY)
        {
                int prev_frame = m_current_frame;
+
+               int frame_count = m_def->get_frame_count();
+               if ( (m_current_frame + 1) == frame_count && frame_count > 1 )
+               {
+                       m_display_list.reset();
+               }
+
                if (m_on_event_load_called)
                {
                        increment_frame_and_check_for_loop();




reply via email to

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