[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/styles.cpp server/styles...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/styles.cpp server/styles... |
Date: |
Mon, 28 Apr 2008 13:23:28 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 08/04/28 13:23:27
Modified files:
. : ChangeLog
server : styles.cpp styles.h
server/parser : morph2_character_def.cpp
Log message:
* server/styles.{cpp,h}: add line_style.set_lerp, drop
friendliness.
* server/parser/morph2_character_def.cpp: use
line_style.set_lerp
rather then accessing its private members.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6431&r2=1.6432
http://cvs.savannah.gnu.org/viewcvs/gnash/server/styles.cpp?cvsroot=gnash&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/gnash/server/styles.h?cvsroot=gnash&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/morph2_character_def.cpp?cvsroot=gnash&r1=1.24&r2=1.25
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6431
retrieving revision 1.6432
diff -u -b -r1.6431 -r1.6432
--- ChangeLog 28 Apr 2008 12:33:10 -0000 1.6431
+++ ChangeLog 28 Apr 2008 13:23:26 -0000 1.6432
@@ -1,5 +1,11 @@
2008-04-28 Sandro Santilli <address@hidden>
+ * server/styles.{cpp,h}: add line_style.set_lerp, drop friendliness.
+ * server/parser/morph2_character_def.cpp: use line_style.set_lerp
+ rather then accessing its private members.
+
+2008-04-28 Sandro Santilli <address@hidden>
+
* server/sprite_instance.cpp: have methods of the DrawingApi
log an as_error if more args then supported are passed.
This will help finding out when the player API adds support
Index: server/styles.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/styles.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- server/styles.cpp 28 Jan 2008 15:16:51 -0000 1.37
+++ server/styles.cpp 28 Apr 2008 13:23:27 -0000 1.38
@@ -25,7 +25,8 @@
line_style::line_style()
:
- m_width(0)
+ m_width(0),
+ m_color()
{
}
@@ -133,6 +134,13 @@
}
}
+void
+line_style::set_lerp(const line_style& ls1, const line_style& ls2, float ratio)
+{
+ m_width = (boost::uint16_t)frnd(flerp(ls1.get_width(), ls2.get_width(),
ratio));
+ m_color.set_lerp(ls1.get_color(), ls2.get_color(), ratio);
+}
+
// end of namespace
}
Index: server/styles.h
===================================================================
RCS file: /sources/gnash/gnash/server/styles.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- server/styles.h 5 Mar 2008 03:55:59 -0000 1.24
+++ server/styles.h 28 Apr 2008 13:23:27 -0000 1.25
@@ -19,15 +19,8 @@
class stream;
class movie_definition;
-class base_line_style
-{
-public:
- virtual ~base_line_style(){};
-
-};
-
/// For the outside of outline shapes, or just bare lines.
-class line_style : public base_line_style
+class line_style
{
public:
line_style();
@@ -69,27 +62,27 @@
/// Return line color and alpha
const rgba& get_color() const { return m_color; }
+ /// Set this style to the interpolation of the given one
+ //
+ /// @param ls1
+ /// First line_style to interpolate.
+ ///
+ /// @param ls2
+ /// Second line_style to interpolate.
+ ///
+ /// @ratio
+ /// The interpolation factor (0..1).
+ /// When 0, this will be equal to ls1, when 1
+ /// this will be equal to ls2.
+ ///
+ void set_lerp(const line_style& ls1, const line_style& ls2, float
ratio);
+
private:
- friend class morph2_character_def;
- friend class triangulating_render_handler;
boost::uint16_t m_width; // in TWIPS
rgba m_color;
};
-class morph_line_style : public base_line_style
-{
-public:
- morph_line_style();
- morph_line_style(stream* in);
-
- void read(stream* in);
-
-private:
- boost::uint16_t m_width[2];
- rgba m_color[2];
-};
-
} // namespace gnash
Index: server/parser/morph2_character_def.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/morph2_character_def.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- server/parser/morph2_character_def.cpp 28 Apr 2008 09:04:02 -0000
1.24
+++ server/parser/morph2_character_def.cpp 28 Apr 2008 13:23:27 -0000
1.25
@@ -135,10 +135,11 @@
for (i=0; i < m_line_styles.size(); i++)
{
line_style& ls = m_line_styles[i];
+
const line_style& ls1 = m_shape1->get_line_styles()[i];
const line_style& ls2 = m_shape2->get_line_styles()[i];
- ls.m_width =
(boost::uint16_t)frnd(flerp(ls1.get_width(), ls2.get_width(), ratio));
- ls.m_color.set_lerp(ls1.get_color(), ls2.get_color(),
ratio);
+
+ ls.set_lerp(ls1, ls2, ratio);
}
// This is used for cases in which number
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/styles.cpp server/styles...,
Sandro Santilli <=