[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/Makefile.am server/execu...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/Makefile.am server/execu... |
Date: |
Wed, 23 May 2007 20:06:20 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/05/23 20:06:20
Modified files:
. : ChangeLog
server : Makefile.am execute_tag.h sprite_instance.cpp
sprite_instance.h
server/swf : PlaceObject2Tag.h tag_loaders.cpp
Added files:
server/swf : DisplayListTag.h RemoveObjectTag.cpp
RemoveObjectTag.h
Log message:
* server/execute_tag.h: drop is_remove_tag() method.
* server/sprite_instance.{cpp,h}: drop unused
execute_remove_tags() method.
* server/Makefile.am, server/swf/: DisplayListTag.h,
PlaceObject2Tag.h, RemoveObjectTag.{cpp,h}
tag_loaders.cpp: Add a DisplayListTag subclass of
execute_tag, and make RemoveObject and PlaceObject subclasses
of it.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3324&r2=1.3325
http://cvs.savannah.gnu.org/viewcvs/gnash/server/Makefile.am?cvsroot=gnash&r1=1.111&r2=1.112
http://cvs.savannah.gnu.org/viewcvs/gnash/server/execute_tag.h?cvsroot=gnash&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.274&r2=1.275
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.h?cvsroot=gnash&r1=1.110&r2=1.111
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/PlaceObject2Tag.h?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/tag_loaders.cpp?cvsroot=gnash&r1=1.106&r2=1.107
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/DisplayListTag.h?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/RemoveObjectTag.cpp?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/RemoveObjectTag.h?cvsroot=gnash&rev=1.1
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3324
retrieving revision 1.3325
diff -u -b -r1.3324 -r1.3325
--- ChangeLog 23 May 2007 19:36:35 -0000 1.3324
+++ ChangeLog 23 May 2007 20:06:19 -0000 1.3325
@@ -1,3 +1,14 @@
+2007-05-23 Sandro Santilli <address@hidden>
+
+ * server/execute_tag.h: drop is_remove_tag() method.
+ * server/sprite_instance.{cpp,h}: drop unused
+ execute_remove_tags() method.
+ * server/Makefile.am, server/swf/: DisplayListTag.h,
+ PlaceObject2Tag.h, RemoveObjectTag.{cpp,h}
+ tag_loaders.cpp: Add a DisplayListTag subclass of
+ execute_tag, and make RemoveObject and PlaceObject subclasses
+ of it.
+
2007-05-23 Ann Barcomb <address@hidden>
* doc/C/usermanual/installation/feature_configuration.xml,
Index: server/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/server/Makefile.am,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -b -r1.111 -r1.112
--- server/Makefile.am 28 Apr 2007 00:04:26 -0000 1.111
+++ server/Makefile.am 23 May 2007 20:06:19 -0000 1.112
@@ -18,7 +18,7 @@
#
#
-# $Id: Makefile.am,v 1.111 2007/04/28 00:04:26 rsavoye Exp $
+# $Id: Makefile.am,v 1.112 2007/05/23 20:06:19 strk Exp $
AUTOMAKE_OPTIONS =
@@ -71,6 +71,7 @@
swf/tag_loaders.cpp \
swf/DefineFontAlignZonesTag.cpp \
swf/PlaceObject2Tag.cpp \
+ swf/RemoveObjectTag.cpp \
swf_function.cpp \
video_stream_instance.cpp \
StreamProvider.cpp \
@@ -144,6 +145,8 @@
swf/tag_loaders.h \
swf/DefineFontAlignZonesTag.h \
swf/PlaceObject2Tag.h \
+ swf/RemoveObjectTag.h \
+ swf/DisplayListTag.h \
swf_event.h \
swf_function.h \
tesselate.h \
Index: server/execute_tag.h
===================================================================
RCS file: /sources/gnash/gnash/server/execute_tag.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- server/execute_tag.h 12 May 2007 06:50:37 -0000 1.12
+++ server/execute_tag.h 23 May 2007 20:06:19 -0000 1.13
@@ -66,9 +66,6 @@
if ( is_action_tag() ) execute(m);
}
- /// Return true if this is a RemoveObject tag
- virtual bool is_remove_tag() const { return false; }
-
/// Return true if this is an action tag.
virtual bool is_action_tag() const { return false; }
Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.274
retrieving revision 1.275
diff -u -b -r1.274 -r1.275
--- server/sprite_instance.cpp 23 May 2007 16:38:31 -0000 1.274
+++ server/sprite_instance.cpp 23 May 2007 20:06:20 -0000 1.275
@@ -2767,22 +2767,6 @@
testInvariant();
}
-void sprite_instance::execute_remove_tags(int frame)
-{
- assert(frame >= 0);
- assert((size_t)frame < m_def->get_frame_count());
-
- const PlayList& playlist = m_def->get_playlist(frame);
- for (unsigned int i = 0; i < playlist.size(); i++)
- {
- execute_tag* e = playlist[i];
- if (e->is_remove_tag())
- {
- e->execute_state(this);
- }
- }
-}
-
void
sprite_instance::goto_frame(size_t target_frame_number)
{
Index: server/sprite_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.h,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -b -r1.110 -r1.111
--- server/sprite_instance.h 12 May 2007 06:50:37 -0000 1.110
+++ server/sprite_instance.h 23 May 2007 20:06:20 -0000 1.111
@@ -251,17 +251,9 @@
//virtual void advance_root(float delta_time);
virtual void advance_sprite(float delta_time);
-
- /// Execute any remove-object tags associated with
- /// the specified frame.
- /// frame is 0-based
- void execute_remove_tags(int frame);
-
-
/// Take care of this frame's actions.
void do_actions();
-
/// Set the sprite state at the specified frame number.
//
/// 0-based frame numbers!!
Index: server/swf/PlaceObject2Tag.h
===================================================================
RCS file: /sources/gnash/gnash/server/swf/PlaceObject2Tag.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- server/swf/PlaceObject2Tag.h 21 May 2007 11:05:12 -0000 1.5
+++ server/swf/PlaceObject2Tag.h 23 May 2007 20:06:20 -0000 1.6
@@ -18,7 +18,7 @@
//
//
-/* $Id: PlaceObject2Tag.h,v 1.5 2007/05/21 11:05:12 strk Exp $ */
+/* $Id: PlaceObject2Tag.h,v 1.6 2007/05/23 20:06:20 strk Exp $ */
#ifndef GNASH_SWF_PLACEOBJECT2TAG_H
#define GNASH_SWF_PLACEOBJECT2TAG_H
@@ -27,7 +27,7 @@
#include "config.h"
#endif
-#include "execute_tag.h" // for inheritance
+#include "DisplayListTag.h" // for inheritance
#include "swf.h" // for tag_type definition
#include "matrix.h" // for composition
#include "cxform.h" // for composition
@@ -59,7 +59,7 @@
/// Postcondition of this tag execution is presence of an instance
/// at the affected depth. See getDepth().
///
-class PlaceObject2Tag : public execute_tag
+class PlaceObject2Tag : public DisplayListTag
{
public:
@@ -67,12 +67,12 @@
PlaceObject2Tag(const movie_definition& def)
:
+ DisplayListTag(0), // why is it 0 here and -1 for
RemoveObjectTag ??
m_tag_type(0),
m_name(NULL),
m_ratio(0),
m_has_matrix(false),
m_has_cxform(false),
- m_depth(0),
m_character_id(0),
m_clip_depth(0),
m_place_type(PLACE),
@@ -88,12 +88,6 @@
/// Place/move/whatever our object in the given movie.
void execute(sprite_instance* m);
- /// Proxy for execute(sprite_instance*)
- void execute_state(sprite_instance* m)
- {
- execute(m);
- }
-
/// Return true if this tag places a character
bool isPlace() const { return m_place_type == PLACE; }
@@ -103,16 +97,6 @@
/// Return true if this tag transforms a character
bool isMove() const { return m_place_type == MOVE; }
- /// Return the depth affected by this tag
- //
- /// NOTE: the returned depth is always in the
- /// static depth zone (character::staticDepthOffset .. -1)
- ///
- int getDepth() const
- {
- return m_depth;
- }
-
private:
int m_tag_type;
@@ -122,7 +106,6 @@
matrix m_matrix;
bool m_has_matrix;
bool m_has_cxform;
- int m_depth;
uint16_t m_character_id;
int m_clip_depth;
uint32_t all_event_flags;
Index: server/swf/tag_loaders.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/tag_loaders.cpp,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -b -r1.106 -r1.107
--- server/swf/tag_loaders.cpp 22 May 2007 22:51:00 -0000 1.106
+++ server/swf/tag_loaders.cpp 23 May 2007 20:06:20 -0000 1.107
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: tag_loaders.cpp,v 1.106 2007/05/22 22:51:00 martinwguy Exp $ */
+/* $Id: tag_loaders.cpp,v 1.107 2007/05/23 20:06:20 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -56,6 +56,7 @@
#include "video_stream_def.h"
#include "sound_definition.h"
#include "PlaceObject2Tag.h"
+#include "RemoveObjectTag.h"
#ifdef HAVE_ZLIB_H
#include <zlib.h>
@@ -842,70 +843,22 @@
assert(in->get_position() == in->get_tag_end_position());
}
-
-/// SWF Tag RemoveObject2 (28)
-//
-/// TODO: move in a separate file, like it was done
-/// for PlaceObject2Tag.
-///
-class remove_object_2 : public execute_tag
-{
-public:
- int m_depth, m_id;
- remove_object_2() : m_depth(-1), m_id(-1) {}
-
- void read(stream* in, int tag)
- {
- assert(tag == SWF::REMOVEOBJECT || tag == SWF::REMOVEOBJECT2);
-
- if (tag == SWF::REMOVEOBJECT)
- {
- // Older SWF's allow multiple objects at the same depth;
- // this m_id disambiguates. Later SWF's just use one
- // object per depth.
- m_id = in->read_u16();
- }
- m_depth = in->read_u16()+character::staticDepthOffset;
- }
-
- // TODO: be non-virtual if no allowing sublcassing this class
- virtual void execute(sprite_instance* m)
- {
- m->remove_display_object(m_depth, m_id);
- }
-
- // TODO: be non-virtual if no allowing sublcassing this class
- virtual void execute_state(sprite_instance* m)
- {
- execute(m);
- }
-
- // TODO: be non-virtual if no allowing sublcassing this class
- virtual bool is_remove_tag() const { return true; }
-
- /// Return the depth affected by this RemoveObject tag
- //
- /// NOTE: the returned depth is always in the
- /// static depth zone (character::staticDepthOffset .. -1)
- ///
- int getDepth() const { return m_depth; }
-};
-
-
void remove_object_2_loader(stream* in, tag_type tag, movie_definition* m)
{
assert(tag == SWF::REMOVEOBJECT || tag == SWF::REMOVEOBJECT2);
- remove_object_2* t = new remove_object_2;
+ std::auto_ptr<RemoveObjectTag> t ( new RemoveObjectTag );
t->read(in, tag);
IF_VERBOSE_PARSE
(
- log_parse(_(" remove_object_2(%d)"), t->m_depth);
+ log_parse(_(" remove_object_2(%d)"), t->getDepth());
);
- m->add_execute_tag(t);
m->removeTimelineDepth(t->getDepth());
+
+ // Ownership transferred to movie_definition
+ m->add_execute_tag(t.release());
}
Index: server/swf/DisplayListTag.h
===================================================================
RCS file: server/swf/DisplayListTag.h
diff -N server/swf/DisplayListTag.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ server/swf/DisplayListTag.h 23 May 2007 20:06:20 -0000 1.1
@@ -0,0 +1,110 @@
+// DisplayListTag.h: DisplayList tag, for Gnash.
+//
+// Copyright (C) 2007 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+//
+//
+//
+
+/* $Id: DisplayListTag.h,v 1.1 2007/05/23 20:06:20 strk Exp $ */
+
+#ifndef GNASH_SWF_DISPLAYLISTTAG_H
+#define GNASH_SWF_DISPLAYLISTTAG_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "execute_tag.h" // for inheritance
+#include "swf.h" // for tag_type definition
+//#include "tu_types.h" // for uint16_t, uint32_t etc. definition
+
+//#include <vector>
+
+// Forward declarations
+namespace gnash {
+ class stream;
+ class sprite_instance;
+ class swf_event;
+ class movie_definition;
+}
+
+namespace gnash {
+namespace SWF {
+namespace tag_loaders {
+
+/// DisplayList tag
+//
+/// DisplayList tags are all versions of PlaceObject and RemoveObject.
+/// They modify the DisplayList of a movie or sprite by
+/// placing, moving, replacing or removing characters at depths.
+///
+///
+class DisplayListTag : public execute_tag
+{
+public:
+
+ DisplayListTag(int depth)
+ :
+ m_depth(depth)
+ {}
+
+ virtual ~DisplayListTag() {}
+
+ virtual void execute(sprite_instance* m)=0;
+
+ void execute_state(sprite_instance* m)
+ {
+ execute(m);
+ }
+
+ /// Return true if this tag removes a character
+ virtual bool isRemove() const { return false; }
+
+ /// Return true if this tag places a character
+ virtual bool isPlace() const { return false; }
+
+ /// Return true if this tag replaces a character
+ virtual bool isReplace() const { return false; }
+
+ /// Return true if this tag transforms a character
+ virtual bool isMove() const { return false; }
+
+ /// Return the depth affected by this DisplayList tag
+ //
+ /// NOTE: the returned depth is always in the
+ /// static depth zone (character::staticDepthOffset .. -1)
+ ///
+ int getDepth() const { return m_depth; }
+
+protected:
+
+ int m_depth;
+
+};
+
+} // namespace gnash::SWF::tag_loaders
+} // namespace gnash::SWF
+} // namespace gnash
+
+
+#endif // GNASH_SWF_DISPLAYLISTTAG_H
+
+
+// Local Variables:
+// mode: C++
+// indent-tabs-mode: t
+// End:
Index: server/swf/RemoveObjectTag.cpp
===================================================================
RCS file: server/swf/RemoveObjectTag.cpp
diff -N server/swf/RemoveObjectTag.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ server/swf/RemoveObjectTag.cpp 23 May 2007 20:06:20 -0000 1.1
@@ -0,0 +1,65 @@
+// RemoveObjectTag.cpp: RemoveObject* tag for Gnash.
+//
+// Copyright (C) 2007 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+/* $Id: RemoveObjectTag.cpp,v 1.1 2007/05/23 20:06:20 strk Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "RemoveObjectTag.h"
+#include "sprite_instance.h"
+#include "swf.h" // for tag_type definition
+#include "log.h"
+#include "stream.h"
+
+namespace gnash {
+namespace SWF {
+namespace tag_loaders {
+
+void
+RemoveObjectTag::read(stream* in, tag_type tag)
+{
+ assert(tag == SWF::REMOVEOBJECT || tag == SWF::REMOVEOBJECT2);
+
+ if (tag == SWF::REMOVEOBJECT)
+ {
+ // Older SWF's allow multiple objects at the same depth;
+ // this m_id disambiguates. Later SWF's just use one
+ // object per depth.
+ m_id = in->read_u16();
+ }
+
+ m_depth = in->read_u16()+character::staticDepthOffset;
+}
+
+void
+RemoveObjectTag::execute(sprite_instance* m)
+{
+ m->remove_display_object(m_depth, m_id);
+}
+
+} // namespace gnash::SWF::tag_loaders
+} // namespace gnash::SWF
+} // namespace gnash
+
+// Local Variables:
+// mode: C++
+// indent-tabs-mode: t
+// End:
Index: server/swf/RemoveObjectTag.h
===================================================================
RCS file: server/swf/RemoveObjectTag.h
diff -N server/swf/RemoveObjectTag.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ server/swf/RemoveObjectTag.h 23 May 2007 20:06:20 -0000 1.1
@@ -0,0 +1,88 @@
+// RemoveObjectTag.h: RemoveObject* tag for Gnash.
+//
+// Copyright (C) 2007 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+//
+//
+//
+
+/* $Id: RemoveObjectTag.h,v 1.1 2007/05/23 20:06:20 strk Exp $ */
+
+#ifndef GNASH_SWF_REMOVEOBJECTTAG_H
+#define GNASH_SWF_REMOVEOBJECTTAG_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "DisplayListTag.h" // for inheritance
+#include "swf.h" // for tag_type definition
+
+// Forward declarations
+namespace gnash {
+ class stream;
+ class sprite_instance;
+ class swf_event;
+ class movie_definition;
+}
+
+namespace gnash {
+namespace SWF {
+namespace tag_loaders {
+
+/// SWF Tag RemoveObject (5) or RemoveObject2 (28)
+//
+/// The RemoveObject tag removes the character instance at the specified depth.
+///
+/// TODO: make this and PlaceObject2Tag subclasses of DisplayListTag (subclass
of execute_tag)
+///
+class RemoveObjectTag : public DisplayListTag
+{
+public:
+
+ RemoveObjectTag()
+ :
+ DisplayListTag(-1),
+ m_id(-1)
+ {}
+
+ /// Read SWF::REMOVEOBJECT or SWF::REMOVEOBJECT2
+ void read(stream* in, tag_type tag);
+
+ /// Remove object at specified depth from sprite_instance DisplayList.
+ void execute(sprite_instance* m);
+
+ // See dox in execute_tag.h
+ bool isRemove() const { return true; }
+
+private:
+
+ int m_id;
+
+};
+
+} // namespace gnash::SWF::tag_loaders
+} // namespace gnash::SWF
+} // namespace gnash
+
+
+#endif // GNASH_SWF_REMOVEOBJECTTAG_H
+
+
+// Local Variables:
+// mode: C++
+// indent-tabs-mode: t
+// End:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/Makefile.am server/execu...,
Sandro Santilli <=