gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/character.cpp server/cha...


From: Zou Lunkai
Subject: [Gnash-commit] gnash ChangeLog server/character.cpp server/cha...
Date: Mon, 28 Apr 2008 09:04:03 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Zou Lunkai <zoulunkai>  08/04/28 09:04:03

Modified files:
        .              : ChangeLog 
        server         : character.cpp character.h dlist.cpp dlist.h 
                         sprite_instance.cpp 
        server/parser  : morph2_character_def.cpp 

Log message:
        * server/character.{h,cpp}, server/dlist.{h,cpp}
          server/parser/morph2_character_def.cpp,
          server/sprite_instance.cpp: drop character::noRatioValue. Now all
          character's ratio value are default to 0 if not set explicitly. 
        
        character::noRatioValue was a workaround to tell if we should update 
the current ratio when dealing with PlaceObject2 tags, no longer needed as all 
flags in PlaceObject2 are kept  now.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6427&r2=1.6428
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.cpp?cvsroot=gnash&r1=1.94&r2=1.95
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.h?cvsroot=gnash&r1=1.141&r2=1.142
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.cpp?cvsroot=gnash&r1=1.119&r2=1.120
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.h?cvsroot=gnash&r1=1.67&r2=1.68
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.519&r2=1.520
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/morph2_character_def.cpp?cvsroot=gnash&r1=1.23&r2=1.24

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6427
retrieving revision 1.6428
diff -u -b -r1.6427 -r1.6428
--- ChangeLog   28 Apr 2008 09:00:28 -0000      1.6427
+++ ChangeLog   28 Apr 2008 09:04:01 -0000      1.6428
@@ -1,3 +1,10 @@
+2008-04-28 Zou Lunkai <address@hidden>
+       
+       * server/character.{h,cpp}, server/dlist.{h,cpp}
+         server/parser/morph2_character_def.cpp,
+         server/sprite_instance.cpp: drop character::noRatioValue. Now all
+         character's ratio value are default to 0 if not set explicitly. 
+       
 2008-04-28 Benjamin Wolsey <address@hidden>
 
        * server/edit_text_character.{h,cpp}: check for end of string when

Index: server/character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/character.cpp,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -b -r1.94 -r1.95
--- server/character.cpp        22 Apr 2008 23:54:59 -0000      1.94
+++ server/character.cpp        28 Apr 2008 09:04:02 -0000      1.95
@@ -49,7 +49,6 @@
 const int character::removedDepthOffset;
 const int character::noClipDepthValue;
 const int character::dynClipDepthValue;
-const int character::noRatioValue;
 
 // Initialize unnamed instance count
 unsigned int character::_lastUnnamedInstanceNum=0;
@@ -670,10 +669,6 @@
        return handler;
 }
 
-character::~character()
-{
-}
-
 bool
 character::unload()
 {

Index: server/character.h
===================================================================
RCS file: /sources/gnash/gnash/server/character.h,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -b -r1.141 -r1.142
--- server/character.h  27 Apr 2008 15:39:39 -0000      1.141
+++ server/character.h  28 Apr 2008 09:04:02 -0000      1.142
@@ -364,11 +364,6 @@
     ///
     static const int dynClipDepthValue = -2000000;
 
-  // Maybe it's better to move all these constants to DisplayListTag
-  static const int noRatioValue = -1;
-
-    ~character();
-
     character(character* parent, int id)
   :
   m_id(id),

Index: server/dlist.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.cpp,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -b -r1.119 -r1.120
--- server/dlist.cpp    24 Apr 2008 10:27:13 -0000      1.119
+++ server/dlist.cpp    28 Apr 2008 09:04:02 -0000      1.120
@@ -347,8 +347,8 @@
   int depth,
   const cxform* color_xform,
   const matrix* mat,
-  int ratio,
-  int /* clip_depth */)
+  int* ratio,
+  int* /* clip_depth */)
 {
   testInvariant();
 
@@ -389,9 +389,9 @@
   {
     ch->set_matrix(*mat);
   }
-  if(ratio != character::noRatioValue)
+  if(ratio)
   {
-    ch->set_ratio(ratio);
+    ch->set_ratio(*ratio);
   }
 
   testInvariant();
@@ -936,10 +936,7 @@
                 itOld++;
                 itNew++;
 
-                bool is_ratio_compatible = ( ( chOld->get_ratio() == 
chNew->get_ratio() )
-                    || ( chOld->get_ratio()==0 && 
chNew->get_ratio()==character::noRatioValue )
-                    || ( chOld->get_ratio()==character::noRatioValue && 
chNew->get_ratio()==0 ) );
-                
+                bool is_ratio_compatible = chOld->get_ratio() == 
chNew->get_ratio();
                 if( !is_ratio_compatible || chOld->isDynamic() || 
!chOld->isActionScriptReferenceable() )
                 {
                     // replace the character in old list with corresponding 
character in new list

Index: server/dlist.h
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.h,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -b -r1.67 -r1.68
--- server/dlist.h      24 Apr 2008 10:27:14 -0000      1.67
+++ server/dlist.h      28 Apr 2008 09:04:02 -0000      1.68
@@ -174,8 +174,8 @@
                int depth,
                const cxform* color_xform,
                const matrix* mat,
-               int ratio,
-               int clip_depth);
+               int* ratio,
+               int* clip_depth);
 
        /// Removes the object at the specified depth.
        //

Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.519
retrieving revision 1.520
diff -u -b -r1.519 -r1.520
--- server/sprite_instance.cpp  27 Apr 2008 22:16:31 -0000      1.519
+++ server/sprite_instance.cpp  28 Apr 2008 09:04:02 -0000      1.520
@@ -3225,12 +3225,14 @@
 sprite_instance::move_display_object(const SWF::PlaceObject2Tag* tag)
 {
     DisplayList& dlist = const_cast<DisplayList &>( getDisplayList() );
+       
+       int ratio = tag->getRatio();
     dlist.move_display_object(
         tag->getDepth(), 
         tag->hasCxform() ? &tag->getCxform() : NULL,
         tag->hasMatrix() ? &tag->getMatrix() : NULL,
-        tag->getRatio(), 
-        tag->getClipDepth());
+        tag->hasRatio()  ? &ratio  : NULL,
+        NULL); // clip_depth is not used in MOVE tag(at least no related 
tests). 
 }
 
 void sprite_instance::replace_display_object(const SWF::PlaceObject2Tag* tag)
@@ -3273,7 +3275,7 @@
                 std::string instance_name = getNextUnnamedInstanceName();
                 ch->set_name(instance_name);
             }
-            if(tag->getRatio() != character::noRatioValue)
+            if(tag->hasRatio())
             {
                 ch->set_ratio(tag->getRatio());
             }

Index: server/parser/morph2_character_def.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/morph2_character_def.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- server/parser/morph2_character_def.cpp      29 Mar 2008 02:24:43 -0000      
1.23
+++ server/parser/morph2_character_def.cpp      28 Apr 2008 09:04:02 -0000      
1.24
@@ -114,8 +114,7 @@
 //             GNASH_REPORT_FUNCTION;
 
                unsigned int i = 0;
-               float ratio = (inst->get_ratio()==character::noRatioValue) ? 0 
: inst->get_ratio()/65535.0;
-
+               float ratio = inst->get_ratio() / 65535.0;
                // bounds
                rect    new_bound;
                new_bound.set_lerp(m_shape1->get_bound(), 
m_shape2->get_bound(), ratio);




reply via email to

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