[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/swf/tag_loaders.cpp
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/swf/tag_loaders.cpp |
Date: |
Sun, 10 Dec 2006 23:33:36 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 06/12/10 23:33:36
Modified files:
. : ChangeLog
server/swf : tag_loaders.cpp
Log message:
* server/swf/tag_loaders.cpp (place_object_2):
some cleanup of class definition.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1909&r2=1.1910
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/tag_loaders.cpp?cvsroot=gnash&r1=1.62&r2=1.63
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1909
retrieving revision 1.1910
diff -u -b -r1.1909 -r1.1910
--- ChangeLog 10 Dec 2006 18:39:22 -0000 1.1909
+++ ChangeLog 10 Dec 2006 23:33:36 -0000 1.1910
@@ -1,3 +1,8 @@
+2006-12-11 Sandro Santilli <address@hidden>
+
+ * server/swf/tag_loaders.cpp (place_object_2):
+ some cleanup of class definition.
+
2006-12-10 Sandro Santilli <address@hidden>
* server/PropertyList.{h,cpp} (delProperty):
Index: server/swf/tag_loaders.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/tag_loaders.cpp,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -b -r1.62 -r1.63
--- server/swf/tag_loaders.cpp 6 Dec 2006 10:58:34 -0000 1.62
+++ server/swf/tag_loaders.cpp 10 Dec 2006 23:33:36 -0000 1.63
@@ -18,7 +18,7 @@
//
//
-/* $Id: tag_loaders.cpp,v 1.62 2006/12/06 10:58:34 strk Exp $ */
+/* $Id: tag_loaders.cpp,v 1.63 2006/12/10 23:33:36 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -746,7 +746,7 @@
}
}
-/// SWF Tag PlaceObject2 (9)
+/// SWF Tag PlaceObject (4) or PlaceObject2 (9)
class place_object_2 : public execute_tag
{
public:
@@ -794,13 +794,8 @@
m_event_handlers.resize(0);
}
- // read SWF::PLACEOBJECT or SWF::PLACEOBJECT2
- void read(stream* in, tag_type tag, int movie_version)
- {
-
- m_tag_type = tag;
-
- if (tag == SWF::PLACEOBJECT)
+ // read SWF::PLACEOBJECT
+ void readPlaceObject(stream* in)
{
// Original place_object tag; very simple.
m_character_id = in->read_u16();
@@ -826,89 +821,21 @@
}
}
- else
- {
- assert(tag == SWF::PLACEOBJECT2);
-
- in->align();
-
- bool has_actions = in->read_uint(1) ? true : false;
- bool has_clip_bracket = in->read_uint(1) ? true :
false;
- bool has_name = in->read_uint(1) ? true : false;
- bool has_ratio = in->read_uint(1) ? true : false;
- bool has_cxform = in->read_uint(1) ? true : false;
- bool has_matrix = in->read_uint(1) ? true : false;
- bool has_char = in->read_uint(1) ? true : false;
- bool flag_move = in->read_uint(1) ? true : false;
-
- m_depth = in->read_u16();
-
- IF_VERBOSE_PARSE
- (
- log_parse(" depth = %d", m_depth);
- );
-
- if (has_char) {
- m_character_id = in->read_u16();
- IF_VERBOSE_PARSE
- (
- log_parse(" char id = %d", m_character_id);
- );
- }
-
- if (has_matrix) {
- m_has_matrix = true;
- m_matrix.read(in);
- IF_VERBOSE_PARSE
- (
- log_parse(" mat:");
- m_matrix.print();
- );
- }
- if (has_cxform) {
- m_has_cxform = true;
- m_color_transform.read_rgba(in);
- IF_VERBOSE_PARSE
- (
- log_parse(" cxform:");
- m_color_transform.print();
- );
- }
-
- if (has_ratio) {
- m_ratio = (float)in->read_u16() / (float)65535;
- IF_VERBOSE_PARSE
- (
- log_parse(" ratio: %f", m_ratio);
- );
- }
- if (has_name) {
- m_name = in->read_string();
- }
- IF_VERBOSE_PARSE
- (
- log_parse(" name = %s", m_name ? m_name : "<null>");
- );
- if (has_clip_bracket) {
- m_clip_depth = in->read_u16();
- IF_VERBOSE_PARSE
- (
- log_parse(" clip_depth = %d", m_clip_depth);
- );
- }
- if (has_actions)
+ // read placeObject2 actions
+ void readPlaceActions(stream* in, int movie_version)
{
+
uint16_t reserved = in->read_u16();
assert(reserved == 0); // must be 0
// The logical 'or' of all the following handlers.
// I don't think we care about this...
- uint32_t all_flags = (movie_version >= 6) ?
in->read_u32() : in->read_u16();
+ uint32_t all_flags = (movie_version >= 6) ?
+ in->read_u32() : in->read_u16();
UNUSED(all_flags);
- IF_VERBOSE_PARSE
- (
+ IF_VERBOSE_PARSE (
log_parse(" actions: flags = 0x%X", all_flags);
);
@@ -1010,6 +937,85 @@
}
+ // read SWF::PLACEOBJECT2
+ void readPlaceObject2(stream* in, int movie_version)
+ {
+ in->align();
+
+ bool has_actions = in->read_uint(1) ? true : false;
+ bool has_clip_bracket = in->read_uint(1) ? true : false;
+ bool has_name = in->read_uint(1) ? true : false;
+ bool has_ratio = in->read_uint(1) ? true : false;
+ bool has_cxform = in->read_uint(1) ? true : false;
+ bool has_matrix = in->read_uint(1) ? true : false;
+ bool has_char = in->read_uint(1) ? true : false;
+ bool flag_move = in->read_uint(1) ? true : false;
+
+ m_depth = in->read_u16();
+
+ IF_VERBOSE_PARSE
+ (
+ log_parse(" depth = %d", m_depth);
+ );
+
+ if (has_char)
+ {
+ m_character_id = in->read_u16();
+ IF_VERBOSE_PARSE (
+ log_parse(" char id = %d", m_character_id);
+ );
+ }
+
+ if (has_matrix)
+ {
+ m_has_matrix = true;
+ m_matrix.read(in);
+ IF_VERBOSE_PARSE (
+ log_parse(" mat:");
+ m_matrix.print();
+ );
+ }
+
+ if (has_cxform)
+ {
+ m_has_cxform = true;
+ m_color_transform.read_rgba(in);
+ IF_VERBOSE_PARSE (
+ log_parse(" cxform:");
+ m_color_transform.print();
+ );
+ }
+
+ if (has_ratio)
+ {
+ m_ratio = (float)in->read_u16() / (float)65535;
+ IF_VERBOSE_PARSE (
+ log_parse(" ratio: %f", m_ratio);
+ );
+ }
+
+ if (has_name)
+ {
+ m_name = in->read_string();
+ IF_VERBOSE_PARSE (
+ log_parse(" name = %s", m_name ? m_name :
"<null>");
+ );
+ }
+
+ if (has_clip_bracket)
+ {
+ m_clip_depth = in->read_u16();
+ IF_VERBOSE_PARSE (
+ log_parse(" clip_depth = %d", m_clip_depth);
+ );
+ }
+
+ if (has_actions)
+ {
+ readPlaceActions(in, movie_version);
+ }
+
+
if (has_char == true && flag_move == true)
{
// Remove whatever's at m_depth, and put
m_character there.
@@ -1028,11 +1034,26 @@
//log_msg("place object at depth %i\n", m_depth);
}
+
+ // read SWF::PLACEOBJECT or SWF::PLACEOBJECT2
+ void read(stream* in, tag_type tag, int movie_version)
+ {
+
+ m_tag_type = tag;
+
+ if (tag == SWF::PLACEOBJECT)
+ {
+ readPlaceObject(in);
+ }
+ else
+ {
+ readPlaceObject2(in, movie_version);
+ }
}
+ /// Place/move/whatever our object in the given movie.
void execute(sprite_instance* m)
- // Place/move/whatever our object in the given movie.
{
switch (m_place_type) {
case PLACE:
@@ -1074,6 +1095,7 @@
}
}
+ /// Proxy for execute(sprite_instance*)
void execute_state(sprite_instance* m)
{
execute(m);
@@ -1115,13 +1137,15 @@
}
}
+#if 0
+ /// "depth_id" is the 16-bit depth & id packed into one 32-bit int.
+ // TODO: check why .. THIS FUNCTION SEEMS UNUSED!
virtual uint32 get_depth_id_of_replace_or_add_tag() const
- // "depth_id" is the 16-bit depth & id packed into one 32-bit int.
{
if (m_place_type == PLACE || m_place_type == REPLACE)
{
int id = -1;
- if (m_tag_type == 4)
+ if (m_tag_type == SWF::PLACEOBJECT)
{
// Old-style PlaceObject; the corresponding Remove
// is specific to the character_id.
@@ -1134,6 +1158,7 @@
return (uint32) -1;
}
}
+#endif
};
- [Gnash-commit] gnash ChangeLog server/swf/tag_loaders.cpp,
Sandro Santilli <=