gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_start-


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_start-458-g04f6836
Date: Thu, 31 Mar 2011 15:30:59 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  04f6836a8f65ce86de5c5fcba55eed8eda391c99 (commit)
       via  6b91ad1ec7ed1614e7aa84367d31bc88336a44d0 (commit)
       via  66d97c4f2c42a65c80c8a3b6b36fc7196a45bd9c (commit)
       via  1d020ae3c9a839bed40cd5f0df51832baf62f3d4 (commit)
      from  0285d4f453742d5bf4fbb29e343a4ff3cef57d56 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=04f6836a8f65ce86de5c5fcba55eed8eda391c99


commit 04f6836a8f65ce86de5c5fcba55eed8eda391c99
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Mar 31 14:20:18 2011 +0200

    Don't pass a movie_definition to movie_root's ctor
    just to pass a version to the VM; Don't pass a version
    to the VM ctor, as it is mutable.

diff --git a/cygnal/cvm.cpp b/cygnal/cvm.cpp
index 1e90335..efd2a9f 100644
--- a/cygnal/cvm.cpp
+++ b/cygnal/cvm.cpp
@@ -434,7 +434,7 @@ play_movie(const std::string& filename, const RunResources& 
runResources)
 
     // Use a clock advanced at every iteration to match exact FPS speed.
     ManualClock cl;
-    gnash::movie_root m(*md, cl, runResources);
+    gnash::movie_root m(cl, runResources);
     
     // Register processor to receive ActionScript events (Mouse, Stage
     // System etc).
diff --git a/gui/Player.cpp b/gui/Player.cpp
index 7160e8f..bb6c235 100644
--- a/gui/Player.cpp
+++ b/gui/Player.cpp
@@ -496,7 +496,7 @@ Player::run(int argc, char* argv[], const std::string& 
infile,
     // Now that we know about movie size, create gui window.
     _gui->createWindow(_url.c_str(), _width, _height, _xPosition, _yPosition);
 
-    movie_root root(*_movieDef, _gui->getClock(), *_runResources);
+    movie_root root(_gui->getClock(), *_runResources);
     
     _callbacksHandler.reset(new CallbacksHandler(*_gui, *this)); 
     
diff --git a/gui/pythonmod/gnash-view.cpp b/gui/pythonmod/gnash-view.cpp
index f58b1c6..1908250 100644
--- a/gui/pythonmod/gnash-view.cpp
+++ b/gui/pythonmod/gnash-view.cpp
@@ -452,7 +452,7 @@ gnash_view_load_movie(GnashView *view, const gchar *uri)
     //       before and destroyed after _virtualClock !
     view->system_clock.reset(new gnash::SystemClock());
     view->virtual_clock.reset(new 
gnash::InterruptableVirtualClock(*view->system_clock));
-    view->stage.reset(new gnash::movie_root(*view->movie_definition, 
*view->virtual_clock, *view->run_info));
+    view->stage.reset(new gnash::movie_root(*view->virtual_clock, 
*view->run_info));
     
     view->movie_definition->completeLoad();
 
diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index 80be4f7..7de5e28 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -132,12 +132,11 @@ clear(movie_root::ActionQueue& aq)
 } // anonymous namespace
 
 
-movie_root::movie_root(const movie_definition& def,
-        VirtualClock& clock, const RunResources& runResources)
+movie_root::movie_root(VirtualClock& clock, const RunResources& runResources)
     :
     _gc(*this),
     _runResources(runResources),
-    _vm(def.get_version(), *this, clock),
+    _vm(*this, clock),
     _interfaceHandler(0),
     _fsCommandHandler(0),
     _stageWidth(1),
@@ -201,6 +200,8 @@ movie_root::~movie_root()
 Movie*
 movie_root::init(movie_definition* def, const MovieClip::MovieVariables& vars)
 {
+    _vm.setSWFVersion(def->get_version());
+
     Movie* mr = def->createMovie(*_vm.getGlobal());
     mr->setVariables(vars);
     setRootMovie(mr);
diff --git a/libcore/movie_root.h b/libcore/movie_root.h
index 00f069f..93fa4a9 100644
--- a/libcore/movie_root.h
+++ b/libcore/movie_root.h
@@ -175,9 +175,7 @@ public:
     //
     /// Make sure to call setRootMovie() 
     /// before using any of this class methods !
-    ///
-    movie_root(const movie_definition& def, VirtualClock& clock,
-            const RunResources& runResources);
+    movie_root(VirtualClock& clock, const RunResources& runResources);
 
     ~movie_root();
 
diff --git a/libcore/vm/VM.cpp b/libcore/vm/VM.cpp
index 5905976..16bcd22 100644
--- a/libcore/vm/VM.cpp
+++ b/libcore/vm/VM.cpp
@@ -51,11 +51,11 @@ gnash::RcInitFile& rcfile = 
gnash::RcInitFile::getDefaultInstance();
 
 namespace gnash {
 
-VM::VM(int version, movie_root& root, VirtualClock& clock)
+VM::VM(movie_root& root, VirtualClock& clock)
        :
        _rootMovie(root),
        _global(new Global_as(*this)),
-       _swfversion(version),
+       _swfversion(6),
        _clock(clock),
        _stack(),
     _shLib(new SharedObjectLibrary(*this)),
diff --git a/libcore/vm/VM.h b/libcore/vm/VM.h
index 82c1f52..3ab1bf0 100644
--- a/libcore/vm/VM.h
+++ b/libcore/vm/VM.h
@@ -78,10 +78,9 @@ public:
        
        /// Initializes the VM
     //
-    /// @param version      The initial version of the VM
     /// @param root         The movie_root that owns this VM
     /// @param clock        The clock to use for advances.
-       VM(int version, movie_root& root, VirtualClock& clock);
+       VM(movie_root& root, VirtualClock& clock);
 
        ~VM();
 
diff --git a/testsuite/MovieTester.cpp b/testsuite/MovieTester.cpp
index 55ed1ea..6e76edd 100644
--- a/testsuite/MovieTester.cpp
+++ b/testsuite/MovieTester.cpp
@@ -129,7 +129,7 @@ MovieTester::MovieTester(const std::string& url)
        throw GnashException("Could not load movie from "+url);
     }
     
-    _movie_root = new movie_root(*_movie_def, _clock, *_runResources);
+    _movie_root = new movie_root(_clock, *_runResources);
     
     // Initialize viewport size with the one advertised in the header
     _width = unsigned(_movie_def->get_width_pixels());
diff --git a/testsuite/libcore.all/AsValueTest.cpp 
b/testsuite/libcore.all/AsValueTest.cpp
index b846c7a..a7d4824 100644
--- a/testsuite/libcore.all/AsValueTest.cpp
+++ b/testsuite/libcore.all/AsValueTest.cpp
@@ -108,7 +108,7 @@ main(int argc, char *argv[])
 
     ManualClock clock;
 
-    movie_root stage(*md, clock, runResources);
+    movie_root stage(clock, runResources);
 
     MovieClip::MovieVariables v;
     stage.init(md, v);
diff --git a/testsuite/libcore.all/DisplayListTest.cpp 
b/testsuite/libcore.all/DisplayListTest.cpp
index 807ecbe..dd5bc42 100644
--- a/testsuite/libcore.all/DisplayListTest.cpp
+++ b/testsuite/libcore.all/DisplayListTest.cpp
@@ -60,7 +60,7 @@ main(int /*argc*/, char** /*argv*/)
     boost::intrusive_ptr<movie_definition> md6(new DummyMovieDefinition(ri, 
6));
     
     ManualClock clock;
-    movie_root stage(*md5, clock, ri);
+    movie_root stage(clock, ri);
     
     MovieClip::MovieVariables v;
     stage.init(md5.get(), v);
diff --git a/testsuite/libcore.all/PropertyListTest.cpp 
b/testsuite/libcore.all/PropertyListTest.cpp
index 13fbe17..66ab68f 100644
--- a/testsuite/libcore.all/PropertyListTest.cpp
+++ b/testsuite/libcore.all/PropertyListTest.cpp
@@ -80,7 +80,7 @@ main(int /*argc*/, char** /*argv*/)
 
        ManualClock clock;
 
-    movie_root root(*md5, clock, runResources);
+    movie_root root(clock, runResources);
 
     root.init(md5.get(), MovieClip::MovieVariables());
 
diff --git a/utilities/processor.cpp b/utilities/processor.cpp
index c114355..b0b80b6 100644
--- a/utilities/processor.cpp
+++ b/utilities/processor.cpp
@@ -447,7 +447,7 @@ play_movie(const std::string& filename, const RunResources& 
runResources)
     // and their parsing thread alive until static destruction. The parser
     // can then continue to access destroyed resources.
     {
-        gnash::movie_root m(*md, cl, runResources);
+        gnash::movie_root m(cl, runResources);
         
         // Register processor to receive ActionScript events (Mouse, Stage
         // System etc).

http://git.savannah.gnu.org/cgit//commit/?id=6b91ad1ec7ed1614e7aa84367d31bc88336a44d0


commit 6b91ad1ec7ed1614e7aa84367d31bc88336a44d0
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Mar 31 17:10:09 2011 +0200

    Don't handle AS initialization depending on version;
    handle SWF4 during lookup instead (no global). Fixes
    swfdec/version4-global.swf.

diff --git a/libcore/as_environment.cpp b/libcore/as_environment.cpp
index acc9206..6a0eccc 100644
--- a/libcore/as_environment.cpp
+++ b/libcore/as_environment.cpp
@@ -553,7 +553,8 @@ getVariableRaw(const as_environment& env, const 
std::string& varname,
         return as_value(global);
     }
 
-    if (global->get_member(key, &val)) {
+    // Version 4 only has local variables.
+    if (swfVersion > 4 && global->get_member(key, &val)) {
 #ifdef GNASH_DEBUG_GET_VARIABLE
         log_debug("Found %s in _global", varname);
 #endif
diff --git a/libcore/asobj/Global_as.cpp b/libcore/asobj/Global_as.cpp
index 1509215..cebb385 100644
--- a/libcore/asobj/Global_as.cpp
+++ b/libcore/asobj/Global_as.cpp
@@ -286,22 +286,16 @@ Global_as::registerClasses()
     const ObjectURI& flash = getURI(vm, "flash");
     flash_package_init(*this, flash); 
 
-    const int version = vm.getSWFVersion();
-
-    if (version > 4) {
-            // This is surely not correct, but they are not available
-            // in SWF4
-            init_member("escape", vm.getNative(100, 0));
-            init_member("unescape", vm.getNative(100, 1));
-            init_member("parseInt", vm.getNative(100, 2));
-            init_member("parseFloat", vm.getNative(100, 3));
-            init_member("isNaN", vm.getNative(200, 18));
-            init_member("isFinite", vm.getNative(200, 19));
-
-            init_member("NaN", as_value(NaN));
-            init_member("Infinity", as_value(
-                        std::numeric_limits<double>::infinity()));
-    }
+    init_member("escape", vm.getNative(100, 0));
+    init_member("unescape", vm.getNative(100, 1));
+    init_member("parseInt", vm.getNative(100, 2));
+    init_member("parseFloat", vm.getNative(100, 3));
+    init_member("isNaN", vm.getNative(200, 18));
+    init_member("isFinite", vm.getNative(200, 19));
+
+    init_member("NaN", as_value(NaN));
+    init_member("Infinity", as_value(
+                std::numeric_limits<double>::infinity()));
 
     loadExtensions();
 }
diff --git a/testsuite/swfdec/PASSING b/testsuite/swfdec/PASSING
index 3037a53..b123d98 100644
--- a/testsuite/swfdec/PASSING
+++ b/testsuite/swfdec/PASSING
@@ -1488,6 +1488,7 @@ undefinedtrace-v7.swf:
 undefinedtrace-v8.swf:
 unloadmovie-simple-5.swf:3b897f539cb7eb764692def6fcc62853
 various-tests-5.swf:ff6088cd684cb3114303a3ae4e620953
+version4-global.swf:610ccd369d9c6f92b377ea504d065428
 video-enumerate.swf:5eced177f03fc88bccb99f0acd2d2f7d
 video-properties-6.swf:95109f25a5cac0fe2d18628dcea22633
 video-properties-7.swf:64f07e267ae93cdefec5c51c3fc9981d

http://git.savannah.gnu.org/cgit//commit/?id=66d97c4f2c42a65c80c8a3b6b36fc7196a45bd9c


commit 66d97c4f2c42a65c80c8a3b6b36fc7196a45bd9c
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Mar 31 14:06:45 2011 +0200

    Drop proxy functions and cleanup.

diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index 1deb132..80be4f7 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -1134,9 +1134,8 @@ movie_root::getStageWidth() const
     // If scaling is allowed, always return the original movie size.
     if (_rootMovie) {
         return static_cast<size_t>(_rootMovie->widthPixels());
-    } else {
-        return 0;
-    }
+    } 
+    return 0;
 }
 
 /// Get actionscript height of stage, in pixels. The height
@@ -1151,9 +1150,8 @@ movie_root::getStageHeight() const
     // If scaling is allowed, always return the original movie size.
     if (_rootMovie) {
         return static_cast<size_t>(_rootMovie->heightPixels());
-    } else {
-        return 0;
-    }
+    } 
+    return 0;
 }
 
 /// Takes a short int bitfield: the four bits correspond
@@ -1676,7 +1674,8 @@ movie_root::markReachableResources() const
 
     // Mark original top-level movie
     // This should always be in _movies, but better make sure
-    if ( _rootMovie ) _rootMovie->setReachable();
+    assert(_rootMovie);
+    _rootMovie->setReachable();
 
     // Mark mouse entities 
     _mouseButtonState.markReachableResources();
diff --git a/libcore/movie_root.h b/libcore/movie_root.h
index e95809e..00f069f 100644
--- a/libcore/movie_root.h
+++ b/libcore/movie_root.h
@@ -308,13 +308,6 @@ public:
         return *_rootMovie;
     }
 
-    /// Return the current nominal frame rate for the Stage.
-    //
-    /// This is dependent on the Movie set as root movie.
-    float frameRate() const {
-        return _rootMovie->frameRate();
-    }
-
     void stop_drag() {
         _dragState.reset();
     }
@@ -359,15 +352,6 @@ public:
     /// @return true on success, false on error (no such timer)
     bool clearIntervalTimer(boost::uint32_t x);
 
-    /// Return 0-based frame index of originating root movie
-    //
-    /// TODO: drop this function (currently used by gprocessor)
-    ///       or change it to to delegate to _level0 ?
-    ///
-    size_t get_current_frame() const {
-        return _rootMovie->get_current_frame();
-    }
-
     void set_background_color(const rgba& color);
 
     void set_background_alpha(float alpha);
@@ -404,13 +388,6 @@ public:
     ///   - Run the GC collector
     void advanceMovie();
 
-    /// 0-based!! delegates to originating root movie
-    //
-    /// TODO: drop this method. currently used by gprocessor.
-    void goto_frame(size_t target_frame_number) {
-        _rootMovie->goto_frame(target_frame_number);
-    }
-
     void display();
 
     /// Get a unique number for unnamed instances.

http://git.savannah.gnu.org/cgit//commit/?id=1d020ae3c9a839bed40cd5f0df51832baf62f3d4


commit 1d020ae3c9a839bed40cd5f0df51832baf62f3d4
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Mar 31 14:05:58 2011 +0200

    Use functions of Movies directly.

diff --git a/gui/gui.cpp b/gui/gui.cpp
index 5ae1080..d949409 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -629,7 +629,7 @@ Gui::notify_key_event(gnash::key::code k, int modifier, 
bool pressed)
               case gnash::key::EQUALS:
               {
                   if (_stage) {
-                      const float fps = _stage->frameRate();
+                      const float fps = _stage->getRootMovie().frameRate();
                       // Min interval allowed: 1/100 second (100FPS)
                       const size_t ni = 1000.0/fps;
                       setInterval(ni);
@@ -969,14 +969,14 @@ Gui::advanceMovie(bool doDisplay)
     // Advance movie by one frame
     const bool advanced = m->advance();
 #else
-    const size_t cur_frame = m->getRootMovie()->get_current_frame();
-    const size_t tot_frames = m->getRootMovie()->get_frame_count();
+    const size_t cur_frame = m->getRootMovie().get_current_frame();
+    const size_t tot_frames = m->getRootMovie().get_frame_count();
     const bool advanced = m->advance();
     
     m->getRootMovie().ensureFrameLoaded(tot_frames);
     m->goto_frame(cur_frame + 1);
     m->getRootMovie().setPlayState(gnash::MovieClip::PLAYSTATE_PLAY);
-    log_debug(_("Frame %d"), m->get_current_frame());
+    log_debug(_("Frame %d"), m->getRootMovie().get_current_frame());
 #endif
     
 #ifdef GNASH_FPS_DEBUG
@@ -1006,7 +1006,7 @@ Gui::advanceMovie(bool doDisplay)
        if (doDisplay && visible()) display(m);
 
        if (!loops()) {
-               size_t curframe = m->get_current_frame(); // can be 0 on 
malformed SWF
+               size_t curframe = m->getRootMovie().get_current_frame(); // can 
be 0 on malformed SWF
                const gnash::MovieClip& si = m->getRootMovie();
                if (curframe + 1 >= si.get_frame_count()) {
                        quit(); 
diff --git a/utilities/processor.cpp b/utilities/processor.cpp
index 890e3c8..c114355 100644
--- a/utilities/processor.cpp
+++ b/utilities/processor.cpp
@@ -473,7 +473,7 @@ play_movie(const std::string& filename, const RunResources& 
runResources)
         // Run through the movie.
         while (!quitrequested) {
             
-            size_t     last_frame = m.get_current_frame();
+            size_t     last_frame = m.getRootMovie().get_current_frame();
             //printf("advancing clock by %lu\n", clockAdvance);
             cl.advance(clockAdvance);
             m.advance();
@@ -492,7 +492,7 @@ play_movie(const std::string& filename, const RunResources& 
runResources)
                 break;
             }
 
-            size_t curr_frame = m.get_current_frame();
+            size_t curr_frame = m.getRootMovie().get_current_frame();
             
             // We reached the end, done !
             if (curr_frame >= md->get_frame_count() - 1 )
@@ -521,7 +521,7 @@ play_movie(const std::string& filename, const RunResources& 
runResources)
                     }
                     fprintf(stderr, "Kicking movie after %g seconds in STOP 
mode, kick ct = %d\n", waitforadvance, kick_count);
                     fflush(stderr);
-                    m.goto_frame(last_frame + 1);
+                    m.getRootMovie().goto_frame(last_frame + 1);
                     
m.getRootMovie().setPlayState(gnash::MovieClip::PLAYSTATE_PLAY);
                     kick_count++;
 
@@ -535,7 +535,7 @@ play_movie(const std::string& filename, const RunResources& 
runResources)
             }
             
             // We looped back.  Skip ahead...
-            else if (m.get_current_frame() < last_frame)
+            else if (m.getRootMovie().get_current_frame() < last_frame)
             {
                 if ( last_frame > latest_frame ) latest_frame = last_frame;
                 if ( ++loop_back_count > allowloopbacks )
@@ -543,7 +543,7 @@ play_movie(const std::string& filename, const RunResources& 
runResources)
                     log_debug("%d loop backs; jumping one-after "
                             "latest frame (%d)",
                             loop_back_count, latest_frame+1);
-                    m.goto_frame(latest_frame + 1);
+                    m.getRootMovie().goto_frame(latest_frame + 1);
                     loop_back_count = 0;
                 }
             }

-----------------------------------------------------------------------

Summary of changes:
 cygnal/cvm.cpp                             |    2 +-
 gui/Player.cpp                             |    2 +-
 gui/gui.cpp                                |   10 +++++-----
 gui/pythonmod/gnash-view.cpp               |    2 +-
 libcore/as_environment.cpp                 |    3 ++-
 libcore/asobj/Global_as.cpp                |   26 ++++++++++----------------
 libcore/movie_root.cpp                     |   20 ++++++++++----------
 libcore/movie_root.h                       |   27 +--------------------------
 libcore/vm/VM.cpp                          |    4 ++--
 libcore/vm/VM.h                            |    3 +--
 testsuite/MovieTester.cpp                  |    2 +-
 testsuite/libcore.all/AsValueTest.cpp      |    2 +-
 testsuite/libcore.all/DisplayListTest.cpp  |    2 +-
 testsuite/libcore.all/PropertyListTest.cpp |    2 +-
 testsuite/swfdec/PASSING                   |    1 +
 utilities/processor.cpp                    |   12 ++++++------
 16 files changed, 45 insertions(+), 75 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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