[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/BevelFilter.h server/Bit...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/BevelFilter.h server/Bit... |
Date: |
Sat, 29 Dec 2007 20:15:26 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/12/29 20:15:26
Modified files:
. : ChangeLog
server : BevelFilter.h BitmapFilter.h BlurFilter.h
ColorMatrixFilter.h ConvolutionFilter.h
DropShadowFilter.h GlowFilter.h
GradientBevelFilter.h GradientGlowFilter.h
cxform.cpp cxform.h matrix.cpp matrix.h
server/parser : action_buffer.cpp action_buffer.h
button_character_def.cpp button_character_def.h
filter_factory.cpp filter_factory.h
server/swf : DoActionTag.h DoInitActionTag.h
PlaceObject2Tag.cpp PlaceObject2Tag.h
Log message:
Give action_buffer a movie_definition reference, for tracking urls of
code
segments (to be used for security model)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5271&r2=1.5272
http://cvs.savannah.gnu.org/viewcvs/gnash/server/BevelFilter.h?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/server/BitmapFilter.h?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/server/BlurFilter.h?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/server/ColorMatrixFilter.h?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/server/ConvolutionFilter.h?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/server/DropShadowFilter.h?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/server/GlowFilter.h?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/server/GradientBevelFilter.h?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/server/GradientGlowFilter.h?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/server/cxform.cpp?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/server/cxform.h?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/server/matrix.cpp?cvsroot=gnash&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/gnash/server/matrix.h?cvsroot=gnash&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/action_buffer.cpp?cvsroot=gnash&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/action_buffer.h?cvsroot=gnash&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/button_character_def.cpp?cvsroot=gnash&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/button_character_def.h?cvsroot=gnash&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/filter_factory.cpp?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/filter_factory.h?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/DoActionTag.h?cvsroot=gnash&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/DoInitActionTag.h?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/PlaceObject2Tag.cpp?cvsroot=gnash&r1=1.28&r2=1.29
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/PlaceObject2Tag.h?cvsroot=gnash&r1=1.15&r2=1.16
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5271
retrieving revision 1.5272
diff -u -b -r1.5271 -r1.5272
--- ChangeLog 29 Dec 2007 13:54:47 -0000 1.5271
+++ ChangeLog 29 Dec 2007 20:15:23 -0000 1.5272
@@ -1,5 +1,23 @@
2007-12-29 Sandro Santilli <address@hidden>
+ * server/: BevelFilter.h, BitmapFilter.h,
+ BlurFilter.h, ColorMatrixFilter.h, ConvolutionFilter.h,
+ DropShadowFilter.h, GlowFilter.h, GradientBevelFilter.h,
+ GradientGlowFilter.h, cxform.{cpp,h}, matrix.{cpp,h},
+ parser/filter_factory.{cpp,h}:
+ Change interfaces to take gnash::stream
+ by ref rather then by pointer.
+ * server/parser/action_buffer.{cpp,h}: add a movie_definition
+ reference in code segments, and provide a getDefinitionURL()
+ method to retrive the originatin url.
+ * server/parser/button_character_def.{cpp,h},
+ server/swf/DoActionTag.h, server/swf/DoInitActionTag.h,
+ server/swf/PlaceObject2Tag.{h,cpp}:
+ Properly construct action_buffer by passing originating movie
+ definition.
+
+2007-12-29 Sandro Santilli <address@hidden>
+
* plugin/klash/Makefile.am: use kde-config to find install
system dirs for kde plugin.
* testsuite/MovieTester.cpp: allow loading initial movie
Index: server/BevelFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/BevelFilter.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- server/BevelFilter.h 12 Dec 2007 10:07:00 -0000 1.7
+++ server/BevelFilter.h 29 Dec 2007 20:15:24 -0000 1.8
@@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: BevelFilter.h,v 1.7 2007/12/12 10:07:00 zoulunkai Exp $ */
+/* $Id: BevelFilter.h,v 1.8 2007/12/29 20:15:24 strk Exp $ */
#ifndef GNASH_BEVELFILTER_H
#define GNASH_BEVELFILTER_H
@@ -42,7 +42,7 @@
} bevel_type;
// Fill from a stream. See parser/filter_factory.cpp for the
implementations.
- virtual bool read(stream* in);
+ virtual bool read(stream& in);
virtual ~BevelFilter() { return; }
Index: server/BitmapFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/BitmapFilter.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- server/BitmapFilter.h 29 Aug 2007 03:32:57 -0000 1.3
+++ server/BitmapFilter.h 29 Dec 2007 20:15:25 -0000 1.4
@@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: BitmapFilter.h,v 1.3 2007/08/29 03:32:57 cmusick Exp $ */
+/* $Id: BitmapFilter.h,v 1.4 2007/12/29 20:15:25 strk Exp $ */
#ifndef GNASH_BITMAPFILTER_H
#define GNASH_BITMAPFILTER_H
@@ -37,7 +37,7 @@
{
public:
// Fill from a stream. See parser/filter_factory.cpp for the
implementations.
- virtual bool read(stream* /*in*/) { return true; }
+ virtual bool read(stream& /*in*/) { return true; }
BitmapFilter() { return; }
virtual ~BitmapFilter() { return; }
Index: server/BlurFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/BlurFilter.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- server/BlurFilter.h 12 Dec 2007 10:07:00 -0000 1.5
+++ server/BlurFilter.h 29 Dec 2007 20:15:25 -0000 1.6
@@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: BlurFilter.h,v 1.5 2007/12/12 10:07:00 zoulunkai Exp $ */
+/* $Id: BlurFilter.h,v 1.6 2007/12/29 20:15:25 strk Exp $ */
#ifndef GNASH_BLURFILTER_H
#define GNASH_BLURFILTER_H
@@ -35,7 +35,7 @@
{
public:
// Fill from a stream. See parser/filter_factory.cpp for the
implementations.
- virtual bool read(stream* in);
+ virtual bool read(stream& in);
virtual ~BlurFilter() { return; }
Index: server/ColorMatrixFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/ColorMatrixFilter.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- server/ColorMatrixFilter.h 29 Aug 2007 03:32:58 -0000 1.3
+++ server/ColorMatrixFilter.h 29 Dec 2007 20:15:25 -0000 1.4
@@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: ColorMatrixFilter.h,v 1.3 2007/08/29 03:32:58 cmusick Exp $ */
+/* $Id: ColorMatrixFilter.h,v 1.4 2007/12/29 20:15:25 strk Exp $ */
#ifndef GNASH_COLORMATRIXFILTER_H
#define GNASH_COLORMATRIXFILTER_H
@@ -34,7 +34,7 @@
{
public:
// Fill from a stream. See parser/filter_factory.cpp for the
implementations.
- virtual bool read(stream* in);
+ virtual bool read(stream& in);
virtual ~ColorMatrixFilter() { return; }
Index: server/ConvolutionFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/ConvolutionFilter.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- server/ConvolutionFilter.h 12 Dec 2007 10:07:00 -0000 1.6
+++ server/ConvolutionFilter.h 29 Dec 2007 20:15:25 -0000 1.7
@@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: ConvolutionFilter.h,v 1.6 2007/12/12 10:07:00 zoulunkai Exp $ */
+/* $Id: ConvolutionFilter.h,v 1.7 2007/12/29 20:15:25 strk Exp $ */
#ifndef GNASH_CONVOLUTIONFILTER_H
#define GNASH_CONVOLUTIONFILTER_H
@@ -36,7 +36,7 @@
{
public:
// Fill from a stream. See parser/filter_factory.cpp for the
implementations.
- virtual bool read(stream* in);
+ virtual bool read(stream& in);
virtual ~ConvolutionFilter() { return; }
Index: server/DropShadowFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/DropShadowFilter.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- server/DropShadowFilter.h 12 Dec 2007 10:07:00 -0000 1.6
+++ server/DropShadowFilter.h 29 Dec 2007 20:15:25 -0000 1.7
@@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: DropShadowFilter.h,v 1.6 2007/12/12 10:07:00 zoulunkai Exp $ */
+/* $Id: DropShadowFilter.h,v 1.7 2007/12/29 20:15:25 strk Exp $ */
#ifndef GNASH_DROPSHADOWFILTER_H
#define GNASH_DROPSHADOWFILTER_H
@@ -35,7 +35,7 @@
{
public:
// Fill from a stream. See parser/filter_factory.cpp for the
implementations.
- virtual bool read(stream* in);
+ virtual bool read(stream& in);
virtual ~DropShadowFilter() { return; }
Index: server/GlowFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/GlowFilter.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- server/GlowFilter.h 12 Dec 2007 10:07:00 -0000 1.6
+++ server/GlowFilter.h 29 Dec 2007 20:15:25 -0000 1.7
@@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: GlowFilter.h,v 1.6 2007/12/12 10:07:00 zoulunkai Exp $ */
+/* $Id: GlowFilter.h,v 1.7 2007/12/29 20:15:25 strk Exp $ */
#ifndef GNASH_GLOWFILTER_H
#define GNASH_GLOWFILTER_H
@@ -35,7 +35,7 @@
{
public:
// Fill from a stream. See parser/filter_factory.cpp for the
implementations.
- virtual bool read(stream* in);
+ virtual bool read(stream& in);
virtual ~GlowFilter() { return; }
Index: server/GradientBevelFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/GradientBevelFilter.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- server/GradientBevelFilter.h 12 Dec 2007 10:07:00 -0000 1.6
+++ server/GradientBevelFilter.h 29 Dec 2007 20:15:25 -0000 1.7
@@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: GradientBevelFilter.h,v 1.6 2007/12/12 10:07:00 zoulunkai Exp $ */
+/* $Id: GradientBevelFilter.h,v 1.7 2007/12/29 20:15:25 strk Exp $ */
#ifndef GNASH_GRADIENTBEVELFILTER_H
#define GNASH_GRADIENTBEVELFILTER_H
@@ -43,7 +43,7 @@
} glow_types;
// Fill from a stream. See parser/filter_factory.cpp for the
implementations.
- virtual bool read(stream* in);
+ virtual bool read(stream& in);
virtual ~GradientBevelFilter() { return; }
Index: server/GradientGlowFilter.h
===================================================================
RCS file: /sources/gnash/gnash/server/GradientGlowFilter.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- server/GradientGlowFilter.h 12 Dec 2007 10:07:00 -0000 1.6
+++ server/GradientGlowFilter.h 29 Dec 2007 20:15:25 -0000 1.7
@@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: GradientGlowFilter.h,v 1.6 2007/12/12 10:07:00 zoulunkai Exp $ */
+/* $Id: GradientGlowFilter.h,v 1.7 2007/12/29 20:15:25 strk Exp $ */
#ifndef GNASH_GRADIENTGLOWFILTER_H
#define GNASH_GRADIENTGLOWFILTER_H
@@ -44,7 +44,7 @@
} glow_types;
// Fill from a stream. See parser/filter_factory.cpp for the
implementations.
- virtual bool read(stream* in);
+ virtual bool read(stream& in);
virtual ~GradientGlowFilter() { return; }
Index: server/cxform.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/cxform.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- server/cxform.cpp 12 Dec 2007 10:07:00 -0000 1.7
+++ server/cxform.cpp 29 Dec 2007 20:15:25 -0000 1.8
@@ -16,7 +16,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-// $Id: cxform.cpp,v 1.7 2007/12/12 10:07:00 zoulunkai Exp $
+// $Id: cxform.cpp,v 1.8 2007/12/29 20:15:25 strk Exp $
//
#ifdef HAVE_CONFIG_H
@@ -84,27 +84,27 @@
a = (boost::uint8_t) fclamp(a * m_[3][0] + m_[3][1], 0, 255);
}
-void cxform::read_rgb(stream* in)
+void cxform::read_rgb(stream& in)
{
- in->align();
+ in.align();
- bool has_add = in->read_bit();
- bool has_mult = in->read_bit();
- int nbits = in->read_uint(4);
+ bool has_add = in.read_bit();
+ bool has_mult = in.read_bit();
+ int nbits = in.read_uint(4);
if (has_mult) {
- m_[0][0] = in->read_sint(nbits) / 255.0f;
- m_[1][0] = in->read_sint(nbits) / 255.0f;
- m_[2][0] = in->read_sint(nbits) / 255.0f;
+ m_[0][0] = in.read_sint(nbits) / 255.0f;
+ m_[1][0] = in.read_sint(nbits) / 255.0f;
+ m_[2][0] = in.read_sint(nbits) / 255.0f;
m_[3][0] = 1;
}
else {
for (int i = 0; i < 4; i++) { m_[i][0] = 1; }
}
if (has_add) {
- m_[0][1] = (float) in->read_sint(nbits);
- m_[1][1] = (float) in->read_sint(nbits);
- m_[2][1] = (float) in->read_sint(nbits);
+ m_[0][1] = (float) in.read_sint(nbits);
+ m_[1][1] = (float) in.read_sint(nbits);
+ m_[2][1] = (float) in.read_sint(nbits);
m_[3][1] = 1;
}
else {
@@ -112,28 +112,28 @@
}
}
-void cxform::read_rgba(stream* in)
+void cxform::read_rgba(stream& in)
{
- in->align();
+ in.align();
- bool has_add = in->read_bit();
- bool has_mult = in->read_bit();
- int nbits = in->read_uint(4);
+ bool has_add = in.read_bit();
+ bool has_mult = in.read_bit();
+ int nbits = in.read_uint(4);
if (has_mult) {
- m_[0][0] = in->read_sint(nbits) / 256.0f;
- m_[1][0] = in->read_sint(nbits) / 256.0f;
- m_[2][0] = in->read_sint(nbits) / 256.0f;
- m_[3][0] = in->read_sint(nbits) / 256.0f;
+ m_[0][0] = in.read_sint(nbits) / 256.0f;
+ m_[1][0] = in.read_sint(nbits) / 256.0f;
+ m_[2][0] = in.read_sint(nbits) / 256.0f;
+ m_[3][0] = in.read_sint(nbits) / 256.0f;
}
else {
for (int i = 0; i < 4; i++) { m_[i][0] = 1; }
}
if (has_add) {
- m_[0][1] = (float) in->read_sint(nbits);
- m_[1][1] = (float) in->read_sint(nbits);
- m_[2][1] = (float) in->read_sint(nbits);
- m_[3][1] = (float) in->read_sint(nbits);
+ m_[0][1] = (float) in.read_sint(nbits);
+ m_[1][1] = (float) in.read_sint(nbits);
+ m_[2][1] = (float) in.read_sint(nbits);
+ m_[3][1] = (float) in.read_sint(nbits);
}
else {
for (int i = 0; i < 4; i++) { m_[i][1] = 0; }
Index: server/cxform.h
===================================================================
RCS file: /sources/gnash/gnash/server/cxform.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- server/cxform.h 4 Dec 2007 11:45:28 -0000 1.9
+++ server/cxform.h 29 Dec 2007 20:15:25 -0000 1.10
@@ -63,10 +63,16 @@
void transform(boost::uint8_t& r, boost::uint8_t& g, boost::uint8_t& b,
boost::uint8_t& a) const;
/// Read RGB from the SWF input stream.
- void read_rgb(stream* in);
+ void read_rgb(stream& in);
+
+ // temp hack, should drop..
+ void read_rgb(stream* in) { read_rgb(*in); }
/// Read RGBA from the SWF input stream.
- void read_rgba(stream* in);
+ void read_rgba(stream& in);
+
+ // temp hack, should drop..
+ void read_rgba(stream* in) { read_rgba(*in); }
/// Force component values to be in range.
void clamp();
Index: server/matrix.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/matrix.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- server/matrix.cpp 1 Dec 2007 00:14:59 -0000 1.21
+++ server/matrix.cpp 29 Dec 2007 20:15:25 -0000 1.22
@@ -19,7 +19,7 @@
//
// Original author: Thatcher Ulrich <address@hidden> 2003
//
-// $Id: matrix.cpp,v 1.21 2007/12/01 00:14:59 strk Exp $
+// $Id: matrix.cpp,v 1.22 2007/12/29 20:15:25 strk Exp $
//
#ifdef HAVE_CONFIG_H
@@ -204,36 +204,36 @@
void
-matrix::read(stream* in)
+matrix::read(stream& in)
// Initialize from the stream.
{
// TODO: compute number of bytes needed to read the matrix
// and ensure their availability using stream::ensureBytes
- in->align();
+ in.align();
set_identity();
- bool has_scale = in->read_bit();
+ bool has_scale = in.read_bit();
if (has_scale)
{
- int scale_nbits = in->read_uint(5);
- m_[0][0] = in->read_sint(scale_nbits) / 65536.0f;
- m_[1][1] = in->read_sint(scale_nbits) / 65536.0f;
+ int scale_nbits = in.read_uint(5);
+ m_[0][0] = in.read_sint(scale_nbits) / 65536.0f;
+ m_[1][1] = in.read_sint(scale_nbits) / 65536.0f;
}
- bool has_rotate = in->read_bit();
+ bool has_rotate = in.read_bit();
if (has_rotate)
{
- int rotate_nbits = in->read_uint(5);
- m_[1][0] = in->read_sint(rotate_nbits) / 65536.0f;
- m_[0][1] = in->read_sint(rotate_nbits) / 65536.0f;
+ int rotate_nbits = in.read_uint(5);
+ m_[1][0] = in.read_sint(rotate_nbits) / 65536.0f;
+ m_[0][1] = in.read_sint(rotate_nbits) / 65536.0f;
}
- int translate_nbits = in->read_uint(5);
+ int translate_nbits = in.read_uint(5);
if (translate_nbits > 0)
{
- m_[0][2] = (float) in->read_sint(translate_nbits);
- m_[1][2] = (float) in->read_sint(translate_nbits);
+ m_[0][2] = (float) in.read_sint(translate_nbits);
+ m_[1][2] = (float) in.read_sint(translate_nbits);
}
//IF_VERBOSE_PARSE(log_msg(" mat: has_scale = %d, has_rotate = %d\n",
has_scale, has_rotate));
Index: server/matrix.h
===================================================================
RCS file: /sources/gnash/gnash/server/matrix.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- server/matrix.h 10 Nov 2007 11:51:43 -0000 1.12
+++ server/matrix.h 29 Dec 2007 20:15:25 -0000 1.13
@@ -19,7 +19,7 @@
//
// Original author: Thatcher Ulrich <address@hidden> 2003
//
-// $Id: matrix.h,v 1.12 2007/11/10 11:51:43 strk Exp $
+// $Id: matrix.h,v 1.13 2007/12/29 20:15:25 strk Exp $
//
#ifndef GNASH_MATRIX_H
@@ -144,7 +144,10 @@
}
/// Initialize from the SWF input stream.
- void read(stream* in);
+ void read(stream& in);
+
+ // temp hack, should drop..
+ void read(stream* in) { read(*in); }
/// Debug log.
void print() const;
Index: server/parser/action_buffer.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/action_buffer.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- server/parser/action_buffer.cpp 18 Dec 2007 00:09:48 -0000 1.31
+++ server/parser/action_buffer.cpp 29 Dec 2007 20:15:25 -0000 1.32
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: action_buffer.cpp,v 1.31 2007/12/18 00:09:48 strk Exp $ */
+/* $Id: action_buffer.cpp,v 1.32 2007/12/29 20:15:25 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -29,6 +29,7 @@
#include "swf.h"
#include "ASHandlers.h"
#include "as_environment.h"
+#include "movie_definition.h"
#include <typeinfo>
@@ -47,9 +48,10 @@
static float convert_float_little(const void *p);
static double convert_double_wacky(const void *p);
-action_buffer::action_buffer()
+action_buffer::action_buffer(const movie_definition& md)
:
- m_decl_dict_processed_at(-1)
+ m_decl_dict_processed_at(-1),
+ _src(md)
{
// static int count=0;
// printf("Action buffer %d created\n", ++count);
@@ -586,6 +588,12 @@
return(convert_double_wacky(&m_buffer[pc]));
}
+const std::string&
+action_buffer::getDefinitionURL() const
+{
+ return _src.get_url();
+}
+
}
// Local Variables:
Index: server/parser/action_buffer.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/action_buffer.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- server/parser/action_buffer.h 13 Dec 2007 10:58:10 -0000 1.24
+++ server/parser/action_buffer.h 29 Dec 2007 20:15:25 -0000 1.25
@@ -36,9 +36,7 @@
namespace gnash {
class as_environment;
class as_value;
- namespace SWF {
- class ActionHandler;
- }
+ class movie_definition;
}
@@ -58,7 +56,7 @@
public:
friend class ActionExec;
- action_buffer();
+ action_buffer(const movie_definition& md);
/// Read action bytes from input stream up to but not including endPos
//
@@ -232,13 +230,15 @@
///
void process_decl_dict(size_t start_pc, size_t stop_pc) const;
+ const std::string& getDefinitionURL() const;
+
private:
// Don't put these as values in std::vector<>! They contain
// internal pointers and cannot be moved or copied.
// If you need to keep an array of them, keep pointers
// to new'd instances.
- action_buffer(const action_buffer& /*a*/) { abort(); }
+ action_buffer(const action_buffer& a) : _src(a._src) { abort(); }
/// the code itself, as read from the SWF
std::vector<boost::uint8_t> m_buffer;
@@ -249,6 +249,12 @@
/// FIXME: move to ActionExec
mutable int m_decl_dict_processed_at;
+ /// The movie_definition containing this action buffer
+ //
+ /// This pointer will be used to determine domain-based
+ /// permissions to grant to the action code.
+ ///
+ const movie_definition& _src;
};
Index: server/parser/button_character_def.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/button_character_def.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- server/parser/button_character_def.cpp 13 Dec 2007 23:01:15 -0000
1.23
+++ server/parser/button_character_def.cpp 29 Dec 2007 20:15:25 -0000
1.24
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: button_character_def.cpp,v 1.23 2007/12/13 23:01:15 strk Exp $ */
+/* $Id: button_character_def.cpp,v 1.24 2007/12/29 20:15:25 strk Exp $ */
// Based on the public domain work of Thatcher Ulrich <address@hidden> 2003
@@ -36,7 +36,9 @@
//
-button_action::button_action(stream& in, int tag_type, unsigned long endPos)
+button_action::button_action(stream& in, int tag_type, unsigned long endPos,
movie_definition& mdef)
+ :
+ m_actions(mdef)
{
// Read condition flags.
if (tag_type == SWF::DEFINEBUTTON) // 7
@@ -222,6 +224,9 @@
void
button_character_definition::readDefineButton(stream* in, movie_definition* m)
{
+ assert(m);
+ assert(in);
+
// Character ID has been read already
// Old button tag.
@@ -255,7 +260,7 @@
}
// Read actions.
- m_button_actions.push_back(new button_action(*in, SWF::DEFINEBUTTON,
endTagPos));
+ m_button_actions.push_back(new button_action(*in, SWF::DEFINEBUTTON,
endTagPos, *m));
// detect min/max layer number
m_min_layer=0;
@@ -327,7 +332,7 @@
unsigned long endActionPos = next_action_offset ?
next_action_pos : tagEndPosition;
- m_button_actions.push_back(new button_action(*in,
SWF::DEFINEBUTTON2, endActionPos));
+ m_button_actions.push_back(new button_action(*in,
SWF::DEFINEBUTTON2, endActionPos, *m));
if (next_action_offset == 0 )
{
Index: server/parser/button_character_def.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/button_character_def.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- server/parser/button_character_def.h 13 Dec 2007 23:01:15 -0000
1.23
+++ server/parser/button_character_def.h 29 Dec 2007 20:15:25 -0000
1.24
@@ -110,7 +110,11 @@
/// @param endPos
/// One past last valid-to-read byte position
///
- button_action(stream& in, int tag_type, unsigned long endPos);
+ /// @param mdef
+ /// The movie_definition this button action was read from
+ ///
+ ///
+ button_action(stream& in, int tag_type, unsigned long endPos,
movie_definition& mdef);
};
Index: server/parser/filter_factory.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/filter_factory.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- server/parser/filter_factory.cpp 12 Dec 2007 10:23:47 -0000 1.6
+++ server/parser/filter_factory.cpp 29 Dec 2007 20:15:25 -0000 1.7
@@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: filter_factory.cpp,v 1.6 2007/12/12 10:23:47 zoulunkai Exp $ */
+/* $Id: filter_factory.cpp,v 1.7 2007/12/29 20:15:25 strk Exp $ */
#include "filter_factory.h"
#include "BitmapFilter.h"
@@ -45,22 +45,22 @@
GRADIENT_BEVEL = 7
} filter_types;
-int const filter_factory::read(stream* in, int /* movie_version */,
+int const filter_factory::read(stream& in,
bool read_multiple, Filters* store)
{
int count = 1;
if (read_multiple)
{
- in->ensureBytes(1);
- count = static_cast<int> (in->read_u8());
+ in.ensureBytes(1);
+ count = static_cast<int> (in.read_u8());
}
for (int i = 0; i < count; ++i)
{
BitmapFilter *the_filter = NULL;
- filter_types filter_type = static_cast<filter_types> (in->read_u8());
+ filter_types filter_type = static_cast<filter_types> (in.read_u8());
switch (filter_type)
{
@@ -110,198 +110,198 @@
return count;
}
-bool DropShadowFilter::read(stream* in)
+bool DropShadowFilter::read(stream& in)
{
- m_color = in->read_u8() << 16 + in->read_u8() << 8 + in->read_u8();
- m_alpha = in->read_u8();
+ m_color = in.read_u8() << 16 + in.read_u8() << 8 + in.read_u8();
+ m_alpha = in.read_u8();
- m_blurX = in->read_fixed();
- m_blurY = in->read_fixed();
+ m_blurX = in.read_fixed();
+ m_blurY = in.read_fixed();
- m_angle = in->read_fixed();
- m_distance = in->read_fixed();
+ m_angle = in.read_fixed();
+ m_distance = in.read_fixed();
- m_strength = in->read_short_sfixed();
+ m_strength = in.read_short_sfixed();
- m_inner = in->read_bit();
- m_knockout = in->read_bit();
- m_hideObject = in->read_bit();
+ m_inner = in.read_bit();
+ m_knockout = in.read_bit();
+ m_hideObject = in.read_bit();
- static_cast<void> (in->read_uint(5)); // Throw these away on purpose.
+ static_cast<void> (in.read_uint(5)); // Throw these away on purpose.
return true;
}
-bool BlurFilter::read(stream* in)
+bool BlurFilter::read(stream& in)
{
- m_blurX = in->read_ufixed();
- m_blurY = in->read_ufixed();
+ m_blurX = in.read_ufixed();
+ m_blurY = in.read_ufixed();
- m_quality = static_cast<boost::uint8_t> (in->read_uint(5));
+ m_quality = static_cast<boost::uint8_t> (in.read_uint(5));
- static_cast<void> (in->read_uint(3)); // Throw these away.
+ static_cast<void> (in.read_uint(3)); // Throw these away.
return true;
}
-bool GlowFilter::read(stream* in)
+bool GlowFilter::read(stream& in)
{
- m_color = in->read_u8() << 16 + in->read_u8() << 8 + in->read_u8();
- m_alpha = in->read_u8();
+ m_color = in.read_u8() << 16 + in.read_u8() << 8 + in.read_u8();
+ m_alpha = in.read_u8();
- m_blurX = in->read_fixed();
- m_blurY = in->read_fixed();
+ m_blurX = in.read_fixed();
+ m_blurY = in.read_fixed();
- m_strength = in->read_short_sfixed();
+ m_strength = in.read_short_sfixed();
- m_inner = in->read_bit();
- m_knockout = in->read_bit();
+ m_inner = in.read_bit();
+ m_knockout = in.read_bit();
- static_cast<void> (in->read_uint(6)); // Throw these away.
+ static_cast<void> (in.read_uint(6)); // Throw these away.
return true;
}
-bool BevelFilter::read(stream* in)
+bool BevelFilter::read(stream& in)
{
// TODO: It is possible that the order of these two should be reversed.
// highlight might come first. Find out for sure and then fix and remove
// this comment.
- m_shadowColor = in->read_u8() << 16 + in->read_u8() << 8 + in->read_u8();
- m_shadowAlpha = in->read_u8();
+ m_shadowColor = in.read_u8() << 16 + in.read_u8() << 8 + in.read_u8();
+ m_shadowAlpha = in.read_u8();
- m_highlightColor = in->read_u8() << 16 + in->read_u8() << 8 +
in->read_u8();
- m_highlightAlpha = in->read_u8();
+ m_highlightColor = in.read_u8() << 16 + in.read_u8() << 8 + in.read_u8();
+ m_highlightAlpha = in.read_u8();
- m_blurX = in->read_fixed();
- m_blurY = in->read_fixed();
+ m_blurX = in.read_fixed();
+ m_blurY = in.read_fixed();
- m_angle = in->read_fixed();
- m_distance = in->read_fixed();
+ m_angle = in.read_fixed();
+ m_distance = in.read_fixed();
- m_strength = in->read_short_sfixed();
+ m_strength = in.read_short_sfixed();
- bool inner_shadow = in->read_bit();
- m_knockout = in->read_bit();
- in->read_bit(); // reserved ?
- bool on_top = in->read_bit();
+ bool inner_shadow = in.read_bit();
+ m_knockout = in.read_bit();
+ in.read_bit(); // reserved ?
+ bool on_top = in.read_bit();
// Set the bevel type. top and inner is full, top is outer, inner is inner
m_type = on_top ? (inner_shadow ? FULL_BEVEL : OUTER_BEVEL) : INNER_BEVEL;
- static_cast<void> (in->read_uint(4)); // Throw these away.
+ static_cast<void> (in.read_uint(4)); // Throw these away.
return true;
}
-bool GradientGlowFilter::read(stream* in)
+bool GradientGlowFilter::read(stream& in)
{
- boost::uint8_t count = in->read_u8(); // How many colorings.
+ boost::uint8_t count = in.read_u8(); // How many colorings.
m_colors.reserve(count);
m_alphas.reserve(count);
m_ratios.reserve(count);
for (int i = 0; i < count; ++i)
{
- m_colors.push_back(in->read_u8() << 16 + in->read_u8() << 8 +
in->read_u8());
- m_alphas.push_back(in->read_u8());
+ m_colors.push_back(in.read_u8() << 16 + in.read_u8() << 8 +
in.read_u8());
+ m_alphas.push_back(in.read_u8());
}
for (int i = 0; i < count; ++i)
{
- m_ratios.push_back(in->read_u8());
+ m_ratios.push_back(in.read_u8());
}
- m_blurX = in->read_fixed();
- m_blurY = in->read_fixed();
+ m_blurX = in.read_fixed();
+ m_blurY = in.read_fixed();
- m_angle = in->read_fixed();
- m_distance = in->read_fixed();
+ m_angle = in.read_fixed();
+ m_distance = in.read_fixed();
- m_strength = in->read_short_sfixed();
+ m_strength = in.read_short_sfixed();
- bool inner = in->read_bit();
- m_knockout = in->read_bit();
- in->read_bit(); // reserved ?
- bool outer = in->read_bit();
+ bool inner = in.read_bit();
+ m_knockout = in.read_bit();
+ in.read_bit(); // reserved ?
+ bool outer = in.read_bit();
m_type = outer ? (inner ? FULL_GLOW : OUTER_GLOW) : INNER_GLOW;
- m_quality = static_cast<boost::uint8_t> (in->read_uint(4));
+ m_quality = static_cast<boost::uint8_t> (in.read_uint(4));
return true;
}
-bool ConvolutionFilter::read(stream* in)
+bool ConvolutionFilter::read(stream& in)
{
- m_matrixX = in->read_u8();
- m_matrixY = in->read_u8();
+ m_matrixX = in.read_u8();
+ m_matrixY = in.read_u8();
- m_divisor = in->read_float();
- m_bias = in->read_float();
+ m_divisor = in.read_float();
+ m_bias = in.read_float();
m_matrix.reserve(m_matrixX * m_matrixY);
for (int i = 0; i < m_matrixX * m_matrixY; ++i)
{
- m_matrix.push_back(in->read_float());
+ m_matrix.push_back(in.read_float());
}
- m_color = in->read_u8() << 16 + in->read_u8() << 8 + in->read_u8();
- m_alpha = in->read_u8();
+ m_color = in.read_u8() << 16 + in.read_u8() << 8 + in.read_u8();
+ m_alpha = in.read_u8();
- static_cast<void> (in->read_uint(6)); // Throw away.
+ static_cast<void> (in.read_uint(6)); // Throw away.
- m_clamp = in->read_bit();
- m_preserveAlpha = in->read_bit();
+ m_clamp = in.read_bit();
+ m_preserveAlpha = in.read_bit();
return true;
}
-bool ColorMatrixFilter::read(stream* in)
+bool ColorMatrixFilter::read(stream& in)
{
m_matrix.reserve(20);
for (int i = 0; i < 20; ++i)
{
- m_matrix.push_back(in->read_float());
+ m_matrix.push_back(in.read_float());
}
return true;
}
-bool GradientBevelFilter::read(stream* in)
+bool GradientBevelFilter::read(stream& in)
{
- boost::uint8_t count = in->read_u8(); // How many colorings.
+ boost::uint8_t count = in.read_u8(); // How many colorings.
m_colors.reserve(count);
m_alphas.reserve(count);
m_ratios.reserve(count);
for (int i = 0; i < count; ++i)
{
- m_colors.push_back(in->read_u8() << 16 + in->read_u8() << 8 +
in->read_u8());
- m_alphas.push_back(in->read_u8());
+ m_colors.push_back(in.read_u8() << 16 + in.read_u8() << 8 +
in.read_u8());
+ m_alphas.push_back(in.read_u8());
}
for (int i = 0; i < count; ++i)
{
- m_ratios.push_back(in->read_u8());
+ m_ratios.push_back(in.read_u8());
}
- m_blurX = in->read_fixed();
- m_blurY = in->read_fixed();
+ m_blurX = in.read_fixed();
+ m_blurY = in.read_fixed();
- m_angle = in->read_fixed();
- m_distance = in->read_fixed();
+ m_angle = in.read_fixed();
+ m_distance = in.read_fixed();
- m_strength = in->read_short_sfixed();
+ m_strength = in.read_short_sfixed();
- bool inner = in->read_bit();
- m_knockout = in->read_bit();
- in->read_bit(); // reserved ?
- bool outer = in->read_bit();
+ bool inner = in.read_bit();
+ m_knockout = in.read_bit();
+ in.read_bit(); // reserved ?
+ bool outer = in.read_bit();
m_type = outer ? (inner ? FULL_BEVEL : OUTER_BEVEL) : INNER_BEVEL;
- m_quality = static_cast<boost::uint8_t> (in->read_uint(4));
+ m_quality = static_cast<boost::uint8_t> (in.read_uint(4));
return true;
}
Index: server/parser/filter_factory.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/filter_factory.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- server/parser/filter_factory.h 26 Aug 2007 15:14:13 -0000 1.1
+++ server/parser/filter_factory.h 29 Dec 2007 20:15:25 -0000 1.2
@@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: filter_factory.h,v 1.1 2007/08/26 15:14:13 cmusick Exp $ */
+/* $Id: filter_factory.h,v 1.2 2007/12/29 20:15:25 strk Exp $ */
#ifndef GNASH_FILTER_FACTORY_H
#define GNASH_FILTER_FACTORY_H
@@ -40,7 +40,7 @@
/// and push them into the vector store. Returns the number read.
/// If read_multiple is true, the first byte of the stream is
/// expected to contain the number of filters to be read.
- static int const read(stream* in, int movie_version, bool read_multiple,
+ static int const read(stream& in, bool read_multiple,
Filters* store);
};
Index: server/swf/DoActionTag.h
===================================================================
RCS file: /sources/gnash/gnash/server/swf/DoActionTag.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- server/swf/DoActionTag.h 13 Dec 2007 10:58:10 -0000 1.10
+++ server/swf/DoActionTag.h 29 Dec 2007 20:15:26 -0000 1.11
@@ -48,7 +48,9 @@
{
public:
- DoActionTag()
+ DoActionTag(movie_definition& md)
+ :
+ m_buf(md)
{}
/// Read a DoAction block from the stream
@@ -71,7 +73,7 @@
static void doActionLoader(stream* in, tag_type tag, movie_definition*
m)
{
- DoActionTag* da = new DoActionTag();
+ DoActionTag* da = new DoActionTag(*m);
da->read(in);
IF_VERBOSE_PARSE (
Index: server/swf/DoInitActionTag.h
===================================================================
RCS file: /sources/gnash/gnash/server/swf/DoInitActionTag.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- server/swf/DoInitActionTag.h 14 Dec 2007 20:13:46 -0000 1.6
+++ server/swf/DoInitActionTag.h 29 Dec 2007 20:15:26 -0000 1.7
@@ -48,8 +48,9 @@
{
public:
- DoInitActionTag(stream& in, int cid)
+ DoInitActionTag(stream& in, movie_definition& md, int cid)
:
+ _buf(md),
_cid(cid)
{
read(in);
@@ -57,12 +58,12 @@
virtual void execute_state(sprite_instance* m) const
{
- m->execute_init_action_buffer(m_buf, _cid);
+ m->execute_init_action_buffer(_buf, _cid);
}
virtual void execute(sprite_instance* m) const
{
- m->execute_init_action_buffer(m_buf, _cid);
+ m->execute_init_action_buffer(_buf, _cid);
}
// Tell the caller that we are an action tag.
@@ -74,7 +75,7 @@
static void doInitActionLoader(stream* in, tag_type tag, movie_definition*
m)
{
int cid = in->read_u16();
- DoInitActionTag* da = new DoInitActionTag(*in, cid);
+ DoInitActionTag* da = new DoInitActionTag(*in, *m, cid);
IF_VERBOSE_PARSE (
log_parse(_(" tag %d: do_init_action_loader"), tag);
@@ -91,11 +92,11 @@
//
void read(stream& in)
{
- m_buf.read(in, in.get_tag_end_position());
+ _buf.read(in, in.get_tag_end_position());
}
- action_buffer m_buf;
+ action_buffer _buf;
// id of referenced character definition
int _cid;
Index: server/swf/PlaceObject2Tag.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/PlaceObject2Tag.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- server/swf/PlaceObject2Tag.cpp 13 Dec 2007 10:58:10 -0000 1.28
+++ server/swf/PlaceObject2Tag.cpp 29 Dec 2007 20:15:26 -0000 1.29
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: PlaceObject2Tag.cpp,v 1.28 2007/12/13 10:58:10 strk Exp $ */
+/* $Id: PlaceObject2Tag.cpp,v 1.29 2007/12/29 20:15:26 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -35,11 +35,11 @@
namespace SWF {
void
-PlaceObject2Tag::readPlaceObject(stream* in)
+PlaceObject2Tag::readPlaceObject(stream& in)
{
// Original place_object tag; very simple.
- m_character_id = in->read_u16();
- m_depth = in->read_u16()+character::staticDepthOffset;
+ m_character_id = in.read_u16();
+ m_depth = in.read_u16()+character::staticDepthOffset;
m_matrix.read(in);
IF_VERBOSE_PARSE
@@ -49,7 +49,7 @@
m_matrix.print();
);
- if (in->get_position() < in->get_tag_end_position())
+ if (in.get_position() < in.get_tag_end_position())
{
m_color_transform.read_rgb(in);
@@ -64,10 +64,11 @@
// read placeObject2 actions
void
-PlaceObject2Tag::readPlaceActions(stream* in, int movie_version)
+PlaceObject2Tag::readPlaceActions(stream& in)
{
+ int movie_version = _movie_def.get_version();
- boost::uint16_t reserved = in->read_u16();
+ boost::uint16_t reserved = in.read_u16();
IF_VERBOSE_MALFORMED_SWF (
if ( reserved != 0 ) // must be 0
{
@@ -76,7 +77,7 @@
);
// The logical 'or' of all the following handlers.
- all_event_flags = (movie_version >= 6) ? in->read_u32() :
in->read_u16();
+ all_event_flags = (movie_version >= 6) ? in.read_u32() : in.read_u16();
IF_VERBOSE_PARSE (
log_parse(_(" actions: flags = 0x%X"), all_event_flags);
@@ -86,24 +87,24 @@
for (;;)
{
// Read event.
- in->align();
+ in.align();
- boost::uint32_t flags = (movie_version >= 6) ? in->read_u32() :
in->read_u16();
+ boost::uint32_t flags = (movie_version >= 6) ? in.read_u32() :
in.read_u16();
if (flags == 0) // no other events
{
break;
}
- boost::uint32_t event_length = in->read_u32();
- if ( in->get_tag_end_position()-in->get_position() <
event_length )
+ boost::uint32_t event_length = in.read_u32();
+ if ( in.get_tag_end_position() - in.get_position() <
event_length )
{
IF_VERBOSE_MALFORMED_SWF(
log_swferror(_("swf_event::read(), "
"even_length = %u, but only %lu bytes left "
"to the end of current tag."
" Breaking for safety."),
- event_length,
in->get_tag_end_position()-in->get_position());
+ event_length, in.get_tag_end_position() -
in.get_position());
);
break;
}
@@ -112,14 +113,14 @@
if (flags & (1 << 17)) // has KeyPress event
{
- ch = in->read_u8();
+ ch = in.read_u8();
event_length--;
}
// Read the actions for event(s)
- action_buffer* action = new action_buffer();
+ action_buffer* action = new action_buffer(_movie_def); //
ownership will be xferred to _actionBuffers
_actionBuffers.push_back(action); // take ownership
- action->read(*in, in->get_position()+event_length);
+ action->read(in, in.get_position()+event_length);
assert(action->size() == event_length);
@@ -183,12 +184,12 @@
// read SWF::PLACEOBJECT2
void
-PlaceObject2Tag::readPlaceObject2(stream* in, int movie_version)
+PlaceObject2Tag::readPlaceObject2(stream& in)
{
- in->align();
+ in.align();
// PlaceObject2 specific flags
- boost::uint8_t has_flags2 = in->read_u8();
+ boost::uint8_t has_flags2 = in.read_u8();
bool has_actions = has_flags2 & (1 << 7);
bool has_clip_depth = has_flags2 & (1 << 6);
@@ -199,9 +200,9 @@
bool has_char = has_flags2 & (1 << 1);
bool flag_move = has_flags2 & (1 << 0);
- m_depth = in->read_u16()+character::staticDepthOffset;
+ m_depth = in.read_u16()+character::staticDepthOffset;
- if (has_char) m_character_id = in->read_u16();
+ if (has_char) m_character_id = in.read_u16();
if (has_matrix)
{
@@ -216,20 +217,20 @@
}
if (has_ratio)
- m_ratio = in->read_u16();
+ m_ratio = in.read_u16();
else
m_ratio = character::noRatioValue;
- if (has_name) m_name = in->read_string();
+ if (has_name) m_name = in.read_string();
if (has_clip_depth)
- m_clip_depth = in->read_u16()+character::staticDepthOffset;
+ m_clip_depth = in.read_u16()+character::staticDepthOffset;
else
m_clip_depth = character::noClipDepthValue;
if (has_actions)
{
- readPlaceActions(in, movie_version);
+ readPlaceActions(in);
}
if (has_char == true && flag_move == true)
@@ -276,12 +277,12 @@
// read SWF::PLACEOBJECT3
void
-PlaceObject2Tag::readPlaceObject3(stream* in, int movie_version)
+PlaceObject2Tag::readPlaceObject3(stream& in)
{
- in->align();
+ in.align();
// PlaceObject2 specific flags
- boost::uint8_t has_flags2 = in->read_u8();
+ boost::uint8_t has_flags2 = in.read_u8();
bool has_actions = has_flags2 & (1 << 7);
bool has_clip_depth = has_flags2 & (1 << 6);
@@ -293,7 +294,7 @@
bool flag_move = has_flags2 & (1 << 0);
// PlaceObject3 specific flags, first 3 bits are unused
- boost::uint8_t has_flags3 = in->read_u8();
+ boost::uint8_t has_flags3 = in.read_u8();
bool hasImage = has_flags3 & (1 << 4);
bool hasClassName = has_flags3 & (1 << 3);
@@ -305,17 +306,17 @@
boost::uint8_t bitmask = 0;
std::string className;
- m_depth = in->read_u16()+character::staticDepthOffset;
+ m_depth = in.read_u16()+character::staticDepthOffset;
if (has_char)
{
- m_character_id = in->read_u16();
+ m_character_id = in.read_u16();
}
if (hasClassName || (hasImage && has_char) )
{
log_unimpl("PLACEOBJECT3 with associated class name");
- in->read_string(className);
+ in.read_string(className);
}
if (has_matrix)
@@ -331,38 +332,38 @@
}
if (has_ratio)
- m_ratio = in->read_u16();
+ m_ratio = in.read_u16();
else
m_ratio = character::noRatioValue;
- if (has_name) m_name = in->read_string();
+ if (has_name) m_name = in.read_string();
if (has_clip_depth)
- m_clip_depth = in->read_u16()+character::staticDepthOffset;
+ m_clip_depth = in.read_u16()+character::staticDepthOffset;
else
m_clip_depth = character::noClipDepthValue;
if (has_filters)
{
Filters v; // TODO: Attach the filters to the display object.
- filter_factory::read(in, movie_version, true, &v);
+ filter_factory::read(in, true, &v);
}
if (has_blend_mode)
{
- blend_mode = in->read_u8();
+ blend_mode = in.read_u8();
}
if (has_bitmap_caching)
{
// It is not certain that this actually exists, so if this reader
// is broken, it is probably here!
- bitmask = in->read_u8();
+ bitmask = in.read_u8();
}
if (has_actions)
{
- readPlaceActions(in, movie_version);
+ readPlaceActions(in);
}
if (has_char == true && flag_move == true)
@@ -409,7 +410,7 @@
}
void
-PlaceObject2Tag::read(stream* in, tag_type tag, int movie_version)
+PlaceObject2Tag::read(stream& in, tag_type tag)
{
m_tag_type = tag;
@@ -420,11 +421,11 @@
}
else if ( tag == SWF::PLACEOBJECT2 )
{
- readPlaceObject2(in, movie_version);
+ readPlaceObject2(in);
}
else
{
- readPlaceObject3(in, movie_version);
+ readPlaceObject3(in);
}
}
@@ -501,7 +502,7 @@
// TODO: who owns and is going to remove this tag ?
PlaceObject2Tag* ch = new PlaceObject2Tag(*m);
- ch->read(in, tag, m->get_version());
+ ch->read(*in, tag);
m->addControlTag(ch);
Index: server/swf/PlaceObject2Tag.h
===================================================================
RCS file: /sources/gnash/gnash/server/swf/PlaceObject2Tag.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- server/swf/PlaceObject2Tag.h 11 Dec 2007 15:33:10 -0000 1.15
+++ server/swf/PlaceObject2Tag.h 29 Dec 2007 20:15:26 -0000 1.16
@@ -19,7 +19,7 @@
//
//
-/* $Id: PlaceObject2Tag.h,v 1.15 2007/12/11 15:33:10 strk Exp $ */
+/* $Id: PlaceObject2Tag.h,v 1.16 2007/12/29 20:15:26 strk Exp $ */
#ifndef GNASH_SWF_PLACEOBJECT2TAG_H
#define GNASH_SWF_PLACEOBJECT2TAG_H
@@ -83,7 +83,7 @@
~PlaceObject2Tag();
/// Read SWF::PLACEOBJECT or SWF::PLACEOBJECT2
- void read(stream* in, tag_type tag, int movie_version);
+ void read(stream& in, tag_type tag);
/// Place/move/whatever our object in the given movie.
void execute(sprite_instance* m) const;
@@ -133,16 +133,16 @@
EventHandlers m_event_handlers;
// read SWF::PLACEOBJECT
- void readPlaceObject(stream* in);
+ void readPlaceObject(stream& in);
// read placeObject2 actions
- void readPlaceActions(stream* in, int movie_version);
+ void readPlaceActions(stream& in);
// read SWF::PLACEOBJECT2
- void readPlaceObject2(stream* in, int movie_version);
+ void readPlaceObject2(stream& in);
// read SWF::PLACEOBJECT3
- void readPlaceObject3(stream* in, int movie_version);
+ void readPlaceObject3(stream& in);
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/BevelFilter.h server/Bit...,
Sandro Santilli <=