[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/movie_instance.cpp serve...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/movie_instance.cpp serve... |
Date: |
Fri, 07 Sep 2007 07:10:20 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/09/07 07:10:20
Modified files:
. : ChangeLog
server : movie_instance.cpp movie_instance.h
movie_root.cpp
Log message:
* server/movie_instance.{cpp,h}: add overridden ::construct
method, taking care of ensuring frame1 is completely loaded
and calling the superclass version of it.
* server/movie_root.cpp (setLevel): call ::construct on newly
added levels (including level0).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4241&r2=1.4242
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_instance.cpp?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_instance.h?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.83&r2=1.84
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4241
retrieving revision 1.4242
diff -u -b -r1.4241 -r1.4242
--- ChangeLog 7 Sep 2007 00:11:25 -0000 1.4241
+++ ChangeLog 7 Sep 2007 07:10:19 -0000 1.4242
@@ -1,5 +1,13 @@
2007-09-07 Sandro Santilli <address@hidden>
+ * server/movie_instance.{cpp,h}: add overridden ::construct
+ method, taking care of ensuring frame1 is completely loaded
+ and calling the superclass version of it.
+ * server/movie_root.cpp (setLevel): call ::construct on newly
+ added levels (including level0).
+
+2007-09-07 Sandro Santilli <address@hidden>
+
* server/vm/VM.{cpp,h}: change the VM::init() functionality
to NOT instantiate the movie definition. This is propedeutic
for a cleanup in movie_instance construction, which will be
Index: server/movie_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_instance.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- server/movie_instance.cpp 7 Aug 2007 20:53:10 -0000 1.15
+++ server/movie_instance.cpp 7 Sep 2007 07:10:20 -0000 1.16
@@ -44,6 +44,45 @@
{
}
+void
+movie_instance::construct()
+{
+ //GNASH_REPORT_FUNCTION;
+
+ assert ( get_root()->get_root_movie() == this );
+
+ //_def->stopLoader();
+
+ // Load first frame (1-based index)
+ size_t nextframe = 1;
+ if ( !_def->ensure_frame_loaded(nextframe) )
+ {
+ IF_VERBOSE_MALFORMED_SWF(
+ log_swferror("Frame " SIZET_FMT " never loaded. Total frames: "
+ SIZET_FMT ".", nextframe, get_frame_count());
+ );
+ }
+
+ // The parser might have reset the total frame count
+ // due to SWF malformation, so we check this *after*
+ // the ensure_frame_loaded call above.
+ //
+ if ( get_frame_count() == 0 )
+ {
+ IF_VERBOSE_MALFORMED_SWF(
+ static bool warned=false;
+ if ( ! warned ) {
+ log_swferror(_("The movie with url %s has NO frames!"),
m_def->get_url().c_str());
+ warned=true;
+ }
+ );
+ return;
+ }
+
+ // Invoke proper constructor
+ sprite_instance::construct();
+}
+
// Advance of an SWF-defined movie instance
void
movie_instance::advance(float delta_time)
@@ -84,11 +123,6 @@
return;
}
- if (m_on_event_load_called == false)
- {
- construct();
- }
-
advance_sprite(delta_time);
if (m_on_event_load_called == false)
Index: server/movie_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_instance.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- server/movie_instance.h 10 Jul 2007 21:43:00 -0000 1.7
+++ server/movie_instance.h 7 Sep 2007 07:10:20 -0000 1.8
@@ -65,10 +65,14 @@
return const_cast<movie_instance*>(this);
}
- //virtual sprite_instance* get_root_movie()
- //{
- //return this;
- //}
+ /// Construct a top-level movie
+ //
+ /// This method will just ensure first frame is loaded
+ /// and then call sprite_instance::construct.
+ ///
+ /// It's intended to be called by movie_root::setLevel().
+ ///
+ void construct();
private:
Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -b -r1.83 -r1.84
--- server/movie_root.cpp 1 Sep 2007 01:20:46 -0000 1.83
+++ server/movie_root.cpp 7 Sep 2007 07:10:20 -0000 1.84
@@ -125,6 +125,9 @@
(int) movie->get_movie_definition()->get_width_pixels(),
(int) movie->get_movie_definition()->get_height_pixels());
+ /// Give life to this instance
+ movie->construct();
+
assert(testInvariant());
}
- [Gnash-commit] gnash ChangeLog server/movie_instance.cpp serve...,
Sandro Santilli <=