[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/parser/BitmapMovieDefini...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/parser/BitmapMovieDefini... |
Date: |
Sun, 18 Feb 2007 09:50:48 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/02/18 09:50:48
Modified files:
. : ChangeLog
server/parser : BitmapMovieDefinition.cpp
shape_character_def.cpp shape_character_def.h
Log message:
* server/parser/shape_character_def.{cpp,h}:
Changed signature of add_fill_style and
add_line_style to take into account reuse
of existing styles and to abstract offset
semantic (1-based).
* server/parser/BitmapMovieDefinition.cpp:
Update call to add_fill_stle; don't make
assumption about offset of the newly added
style.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2389&r2=1.2390
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/BitmapMovieDefinition.cpp?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/shape_character_def.cpp?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/shape_character_def.h?cvsroot=gnash&r1=1.8&r2=1.9
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2389
retrieving revision 1.2390
diff -u -b -r1.2389 -r1.2390
--- ChangeLog 17 Feb 2007 20:33:38 -0000 1.2389
+++ ChangeLog 18 Feb 2007 09:50:48 -0000 1.2390
@@ -1,3 +1,15 @@
+2007-02-17 Sandro Santilli <address@hidden>
+
+ * server/parser/shape_character_def.{cpp,h}:
+ Changed signature of add_fill_style and
+ add_line_style to take into account reuse
+ of existing styles and to abstract offset
+ semantic (1-based).
+ * server/parser/BitmapMovieDefinition.cpp:
+ Update call to add_fill_stle; don't make
+ assumption about offset of the newly added
+ style.
+
2007-02-16 Martin Guy <address@hidden>
* doc/C/sources.xml: Correct Debian dev package names.
Index: server/parser/BitmapMovieDefinition.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/BitmapMovieDefinition.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- server/parser/BitmapMovieDefinition.cpp 15 Feb 2007 21:16:29 -0000
1.6
+++ server/parser/BitmapMovieDefinition.cpp 18 Feb 2007 09:50:48 -0000
1.7
@@ -51,7 +51,7 @@
// Add the bitmap fill style (fill style 0)
fill_style bmFill(_bitmap.get());
- _shapedef->add_fill_style(bmFill);
+ size_t fillLeft = _shapedef->add_fill_style(bmFill);
// Define a rectangle filled with the bitmap style
@@ -63,7 +63,7 @@
log_msg("Creating a shape_definition wrapping a %g x %g bitmap", w, h);
- path bmPath(w, h, 1, 0, 0);
+ path bmPath(w, h, fillLeft, 0, 0);
bmPath.drawLineTo(w, 0);
bmPath.drawLineTo(0, 0);
bmPath.drawLineTo(0, h);
Index: server/parser/shape_character_def.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/shape_character_def.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- server/parser/shape_character_def.cpp 14 Feb 2007 13:50:30 -0000
1.11
+++ server/parser/shape_character_def.cpp 18 Feb 2007 09:50:48 -0000
1.12
@@ -6,7 +6,7 @@
// Quadratic bezier outline shapes, the basis for most SWF rendering.
-/* $Id: shape_character_def.cpp,v 1.11 2007/02/14 13:50:30 strk Exp $ */
+/* $Id: shape_character_def.cpp,v 1.12 2007/02/18 09:50:48 strk Exp $ */
#include "shape_character_def.h"
@@ -20,6 +20,7 @@
#include "tu_file.h"
#include <cfloat>
+#include <algorithm>
//#define DEBUG_DISPLAY_SHAPE_PATHS // won't probably work anymore (Udo)
@@ -645,6 +646,29 @@
}
}
+size_t
+shape_character_def::add_fill_style(const fill_style& stl)
+{
+ typedef FillStyleVect V;
+ V& v=m_fill_styles;
+
+ // TODO: check if the style is already in our list
+ // (needs operator== defined for fill_style)
+ v.push_back(stl);
+ return v.size(); // 1-based !
+}
+
+size_t
+shape_character_def::add_line_style(const line_style& stl)
+{
+ typedef LineStyleVect V;
+ V& v=m_line_styles;
+
+ // TODO: check if the style is already in our list
+ // (needs operator== defined for line_style)
+ v.push_back(stl);
+ return v.size(); // 1-based !
+}
} // end namespace gnash
Index: server/parser/shape_character_def.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/shape_character_def.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- server/parser/shape_character_def.h 14 Feb 2007 08:47:12 -0000 1.8
+++ server/parser/shape_character_def.h 18 Feb 2007 09:50:48 -0000 1.9
@@ -5,7 +5,7 @@
// Quadratic bezier outline shapes, the basis for most SWF rendering.
-/* $Id: shape_character_def.h,v 1.8 2007/02/14 08:47:12 strk Exp $ */
+/* $Id: shape_character_def.h,v 1.9 2007/02/18 09:50:48 strk Exp $ */
#ifndef GNASH_SHAPE_CHARACTER_DEF_H
#define GNASH_SHAPE_CHARACTER_DEF_H
@@ -25,6 +25,10 @@
class shape_character_def : public character_def, public
tesselate::tesselating_shape
{
public:
+
+ typedef std::vector<fill_style> FillStyleVect;
+ typedef std::vector<line_style> LineStyleVect;
+
shape_character_def();
virtual ~shape_character_def();
@@ -52,8 +56,9 @@
void output_cached_data(tu_file* out, const cache_options&
options);
void input_cached_data(tu_file* in);
- const std::vector<fill_style>& get_fill_styles() const {
return m_fill_styles; }
- const std::vector<line_style>& get_line_styles() const {
return m_line_styles; }
+ const FillStyleVect& get_fill_styles() const { return
m_fill_styles; }
+ const LineStyleVect& get_line_styles() const { return
m_line_styles; }
+
const std::vector<path>& get_paths() const { return
m_paths; }
// morph uses this
@@ -65,17 +70,27 @@
m_paths.push_back(pth);
}
- /// Used for programmatically creating shapes
- void add_fill_style(const fill_style& stl)
- {
- m_fill_styles.push_back(stl);
- }
+ /// \brief
+ /// Add a fill style, possibly reusing an existing
+ /// one if existent.
+ //
+ /// @return the 1-based offset of the fill style,
+ /// either added or found.
+ /// This offset is the one required to properly
+ /// reference it in gnash::path instances.
+ ///
+ size_t add_fill_style(const fill_style& stl);
- /// Used for programmatically creating shapes
- void add_line_style(const line_style& stl)
- {
- m_line_styles.push_back(stl);
- }
+ /// \brief
+ /// Add a line style, possibly reusing an existing
+ /// one if existent.
+ //
+ /// @return the 1-based offset of the line style,
+ /// either added or found.
+ /// This offset is the one required to properly
+ /// reference it in gnash::path instances.
+ ///
+ size_t add_line_style(const line_style& stl);
protected:
friend class morph2_character_def;