gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r9526: Color class as verbosity clea


From: Sandro Santilli
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r9526: Color class as verbosity cleanups
Date: Wed, 23 Jul 2008 13:49:03 +0200
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9526
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Wed 2008-07-23 13:49:03 +0200
message:
  Color class as verbosity cleanups
modified:
  libcore/asobj/Color.cpp
    ------------------------------------------------------------
    revno: 9524.1.1
    committer: Sandro Santilli <address@hidden>
    branch nick: mybranch
    timestamp: Wed 2008-07-23 13:42:35 +0200
    message:
      More informative aserror messages and c_str() removals
    modified:
      libcore/asobj/Color.cpp
=== modified file 'libcore/asobj/Color.cpp'
--- a/libcore/asobj/Color.cpp   2008-05-20 08:54:24 +0000
+++ b/libcore/asobj/Color.cpp   2008-07-23 11:42:35 +0000
@@ -184,7 +184,7 @@
        {
                IF_VERBOSE_ASCODING_ERRORS(
                std::stringstream ss; fn.dump_args(ss);
-               log_aserror(_("Color.getTransform(%s) : no or unloaded sprite 
associated with the Color object"), ss.str().c_str());
+               log_aserror(_("Color.getTransform(%s) : no or unloaded sprite 
associated with the Color object"), ss.str());
                );
                return as_value();
        }
@@ -277,7 +277,7 @@
        {
                IF_VERBOSE_ASCODING_ERRORS(
                std::stringstream ss; fn.dump_args(ss);
-               log_aserror(_("Color.setTransform(%s) : first argument doesn't 
cast to an object"), ss.str().c_str());
+               log_aserror(_("Color.setTransform(%s) : first argument doesn't 
cast to an object"), ss.str());
                );
                return as_value();
        }
@@ -287,7 +287,7 @@
        {
                IF_VERBOSE_ASCODING_ERRORS(
                std::stringstream ss; fn.dump_args(ss);
-               log_aserror(_("Color.setTransform(%s) : no or unloaded sprite 
associated with the Color object"), ss.str().c_str());
+               log_aserror(_("Color.setTransform(%s) : no or unloaded sprite 
associated with the Color object"), ss.str());
                );
                return as_value();
        }
@@ -321,7 +321,7 @@
        if ( trans->get_member(st.find("gb"), &tmp) ) ss << " gb:" << 
tmp.to_number();
        if ( trans->get_member(st.find("bb"), &tmp) ) ss << " bb:" << 
tmp.to_number();
        if ( trans->get_member(st.find("ab"), &tmp) ) ss << " ab:" << 
tmp.to_number();
-       log_debug("Color.setTransform(%s) : TESTING", ss.str().c_str());
+       log_debug("Color.setTransform(%s) : TESTING", ss.str());
 #endif
 
        return as_value();
@@ -343,18 +343,28 @@
                if ( ! sp )
                {
                        // must be a target..
-                       character* ch = 
fn.env().find_target(fn.arg(0).to_string());
-                       if ( ch ) sp = ch->to_movie();
-               }
-
-               IF_VERBOSE_ASCODING_ERRORS(
-               if ( ! sp )
-               {
-                       std::stringstream ss; fn.dump_args(ss);
-                       log_aserror(_("new Color(%s) : first argument doesn't 
evaluate or point to a MovieClip"),
-                               ss.str().c_str());
-               }
-               )
+                       character* ch = fn.env().find_target(arg.to_string());
+                       if ( ch )
+                       {
+                               sp = ch->to_movie();
+                               IF_VERBOSE_ASCODING_ERRORS(
+                               if ( ! sp )
+                               {
+                               std::stringstream ss; fn.dump_args(ss);
+                               log_aserror(_("new Color(%s) : first argument 
evaluates to character %s which is a %s (not a sprite)"),
+                                       ss.str(), ch->getTarget(), 
typeName(*ch));
+                               }
+                               )
+                       }
+                       else
+                       {
+                               IF_VERBOSE_ASCODING_ERRORS(
+                               std::stringstream ss; fn.dump_args(ss);
+                               log_aserror(_("new Color(%s) : first argument 
doesn't evaluate or point to a character"),
+                                       ss.str());
+                               )
+                       }
+               }
        }
 
        boost::intrusive_ptr<as_object> obj = new color_as_object(sp);


reply via email to

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