gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog server/fill_style.cpp server/ma...


From: Benjamin Wolsey
Subject: [Gnash-commit] gnash ChangeLog server/fill_style.cpp server/ma...
Date: Tue, 03 Jun 2008 10:44:46 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/06/03 10:44:46

Modified files:
        .              : ChangeLog 
        server         : fill_style.cpp matrix.cpp matrix.h 
        server/swf     : PlaceObject2Tag.cpp 

Log message:
                * server/parser/movie_def_impl.cpp: add ensureBytes.
                * server/matrix.{h,cpp}: drop matrix::print() method in favour
                  of the ostream operator. Make output prettier.
                * server/fill_style.cpp, server/swf/PlaceObject2Tag.cpp: use 
matrix
                  ostream operator.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6787&r2=1.6788
http://cvs.savannah.gnu.org/viewcvs/gnash/server/fill_style.cpp?cvsroot=gnash&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/gnash/server/matrix.cpp?cvsroot=gnash&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/gnash/server/matrix.h?cvsroot=gnash&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/PlaceObject2Tag.cpp?cvsroot=gnash&r1=1.44&r2=1.45

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6787
retrieving revision 1.6788
diff -u -b -r1.6787 -r1.6788
--- ChangeLog   3 Jun 2008 10:41:19 -0000       1.6787
+++ ChangeLog   3 Jun 2008 10:44:44 -0000       1.6788
@@ -1,6 +1,10 @@
 2008-06-03 Benjamin Wolsey <address@hidden>
 
        * server/parser/movie_def_impl.cpp: add ensureBytes.
+       * server/matrix.{h,cpp}: drop matrix::print() method in favour
+         of the ostream operator. Make output prettier.
+       * server/fill_style.cpp, server/swf/PlaceObject2Tag.cpp: use matrix
+         ostream operator.
 
 2008-06-03 Benjamin Wolsey <address@hidden>
 

Index: server/fill_style.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/fill_style.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- server/fill_style.cpp       3 Jun 2008 08:23:02 -0000       1.32
+++ server/fill_style.cpp       3 Jun 2008 10:44:45 -0000       1.33
@@ -297,7 +297,7 @@
                        pOther->m_bitmap_matrix.set_inverse(m);
                }
         IF_VERBOSE_PARSE(
-            m_bitmap_matrix.print();
+            log_parse("matrix: %s", m_bitmap_matrix);
         );
     }
     else

Index: server/matrix.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/matrix.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- server/matrix.cpp   24 May 2008 21:42:36 -0000      1.30
+++ server/matrix.cpp   3 Jun 2008 10:44:45 -0000       1.31
@@ -64,21 +64,6 @@
        m_[1][1] = 1;
 }
 
-std::ostream& operator<< (std::ostream& os, const matrix& m)
-{
-       os << "| " << m.m_[0][0] << " "
-               << m.m_[0][1] << " "
-               << TWIPS_TO_PIXELS(m.m_[0][2]) << " |";
-
-       os << "| " << m.m_[1][0] << " "
-               << m.m_[1][1] << " "
-               << TWIPS_TO_PIXELS(m.m_[1][2])
-               << " |";
-
-       return os;
-}
-
-
 void
 matrix::concatenate(const matrix& m)
 // Concatenate m's transform onto ours.  When
@@ -241,15 +226,6 @@
 
 
 void
-matrix::print() const
-// Debug log.
-{
-       log_parse("| %4.4f %4.4f %4.4f |", m_[0][0], m_[0][1], 
TWIPS_TO_PIXELS(m_[0][2]));
-       log_parse("| %4.4f %4.4f %4.4f |", m_[1][0], m_[1][1], 
TWIPS_TO_PIXELS(m_[1][2]));
-}
-
-
-void
 matrix::transform(point* result, const point& p) const
 // Transform point 'p' by our matrix.  Put the result in
 // *result.
@@ -440,6 +416,24 @@
        }
 }
 
+std::ostream& operator<< (std::ostream& o, const matrix& m)
+{
+    // 8 digits and a decimal point.
+    const short fieldWidth = 9;
+
+    o << std::endl << "| "
+      << std::setw(fieldWidth) << std::fixed << std::setprecision(4) << 
m.m_[0][0] << " "
+      << std::setw(fieldWidth) << std::fixed << std::setprecision(4) << 
m.m_[0][1] << " "
+      << std::setw(fieldWidth) << std::fixed << std::setprecision(4) << 
TWIPS_TO_PIXELS(m.m_[0][2])
+      << " |" 
+      << std::endl << "| "
+      << std::setw(fieldWidth) << std::fixed << std::setprecision(4) << 
m.m_[1][0] << " "
+      << std::setw(fieldWidth) << std::fixed << std::setprecision(4) << 
m.m_[1][1] << " "
+      << std::setw(fieldWidth) << std::fixed << std::setprecision(4) << 
TWIPS_TO_PIXELS(m.m_[1][2])
+      << " |";
+      
+      return o;
+}
 
 }      // end namespace gnash
 

Index: server/matrix.h
===================================================================
RCS file: /sources/gnash/gnash/server/matrix.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- server/matrix.h     27 Mar 2008 10:50:15 -0000      1.18
+++ server/matrix.h     3 Jun 2008 10:44:45 -0000       1.19
@@ -29,6 +29,7 @@
 #include "Point2d.h" // for transforming Point2d<float> (typedefe'd to point)
 
 #include <iosfwd>
+#include <iomanip>
 
 // Forward declarations
 namespace gnash {
@@ -144,9 +145,6 @@
        // temp hack, should drop..
        void    read(stream* in) { read(*in); }
 
-       /// Debug log.
-       void    print() const;
-
        /// Transform point 'p' by our matrix. 
        //
        /// Put the result in *result.
@@ -254,6 +252,7 @@
        float   m_[2][3];
 };
 
+
 inline bool operator== (const matrix& a, const matrix& b)
 {
        return  a.m_[0][0] == b.m_[0][0] &&

Index: server/swf/PlaceObject2Tag.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/PlaceObject2Tag.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- server/swf/PlaceObject2Tag.cpp      2 Jun 2008 09:52:54 -0000       1.44
+++ server/swf/PlaceObject2Tag.cpp      3 Jun 2008 10:44:45 -0000       1.45
@@ -42,7 +42,7 @@
             log_parse(_("  PLACEOBJECT: depth=%d(%d) char=%d"),
             m_depth, m_depth-character::staticDepthOffset,
             m_character_id);
-        m_matrix.print();
+            log_parse("%s", m_matrix);
     );
 
     if (in.get_position() < in.get_tag_end_position())
@@ -285,8 +285,7 @@
         if ( hasCharacter() ) log_parse(_("  char id = %d"), m_character_id);
         if ( hasMatrix() )
         {
-            log_parse(_("  mat:"));
-            m_matrix.print();
+            log_parse(_("  matrix: %s"), m_matrix);
         }
         if ( hasCxform() )
         {
@@ -379,18 +378,19 @@
     IF_VERBOSE_PARSE
     (
         if ( hasMatrix() ) {
-            log_parse("   matrix:");
-        m_matrix.print();
+            log_parse("   matrix: %s", m_matrix);
     }
         if ( hasCxform() ) {
             log_parse("   cxform:");
             m_color_transform.print();
     }
         if ( hasRatio() )  log_parse("   ratio:%d", m_ratio);
-        if ( hasName() ) log_parse("   name:%s", m_name.c_str());
+        if ( hasName() ) log_parse("   name:%s", m_name);
 
-        if ( hasClipDepth() )
-        log_parse("   clip_depth:%d(%d)", m_clip_depth, 
m_clip_depth-character::staticDepthOffset);
+        if ( hasClipDepth() ) {
+            log_parse("   clip_depth:%d(%d)", m_clip_depth,
+                      m_clip_depth-character::staticDepthOffset);
+        }
     );
 
     if ( hasFilters() )
@@ -423,8 +423,7 @@
         if ( hasCharacter() ) log_parse(_("  char id = %d"), m_character_id);
         if ( hasMatrix() )
         {
-            log_parse(_("  mat:"));
-            m_matrix.print();
+            log_parse(_("  matrix: %s"), m_matrix);
         }
         if ( hasCxform() )
         {
@@ -432,9 +431,10 @@
             m_color_transform.print();
         }
         if ( hasRatio() ) log_parse(_("  ratio: %d"), m_ratio);
-        if ( hasName() ) log_parse(_("  name = %s"), m_name.c_str());
-        if ( hasClassName() ) log_parse(_("  class name = %s"), 
className.c_str());
-        if ( hasClipDepth() ) log_parse(_("  clip_depth = %d (%d)"), 
m_clip_depth, m_clip_depth-character::staticDepthOffset);
+        if ( hasName() ) log_parse(_("  name = %s"), m_name);
+        if ( hasClassName() ) log_parse(_("  class name = %s"), className);
+        if ( hasClipDepth() ) log_parse(_("  clip_depth = %d (%d)"),
+                                m_clip_depth, 
m_clip_depth-character::staticDepthOffset);
         log_parse(_(" m_place_type: %d"), getPlaceType());
     );
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]