[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/asobj/Color.cpp server/a...
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash ChangeLog server/asobj/Color.cpp server/a... |
Date: |
Thu, 17 Apr 2008 10:22:23 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/04/17 10:22:23
Modified files:
. : ChangeLog
server/asobj : Color.cpp Color.h Global.cpp
testsuite/actionscript.all: Color.as
Log message:
* server/asobj/Color.{h,cpp}: register ASnative separately.
* server/asobj/Global.cpp: only load Color on demand. I think
this won't reintroduce the old string_table lookup bug, but
this is where to revert if it does happen (until a better
solution is found).
* testsuite/actionscript.all/Color.as: test variables with same
name as class (case insensitive). Doesn't really get the
problem,
but this should be tested as well.
Also corrections to ChangeLog about what I actually committed
or didn't. (character.{h,cpp}).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6314&r2=1.6315
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Color.cpp?cvsroot=gnash&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Color.h?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Global.cpp?cvsroot=gnash&r1=1.116&r2=1.117
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Color.as?cvsroot=gnash&r1=1.14&r2=1.15
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6314
retrieving revision 1.6315
diff -u -b -r1.6314 -r1.6315
--- ChangeLog 17 Apr 2008 09:12:56 -0000 1.6314
+++ ChangeLog 17 Apr 2008 10:22:21 -0000 1.6315
@@ -1,8 +1,18 @@
2008-04-17 Benjamin Wolsey <address@hidden>
+ * server/asobj/Color.{h,cpp}: register ASnative separately.
+ * server/asobj/Global.cpp: only load Color on demand. I think
+ this won't reintroduce the old string_table lookup bug, but
+ this is where to revert if it does happen (until a better
+ solution is found).
+ * testsuite/actionscript.all/Color.as: test variables with same
+ name as class (case insensitive). Doesn't really get the problem,
+ but this should be tested as well.
+
+2008-04-17 Benjamin Wolsey <address@hidden>
+
* libbase/utf8.h: visibility...
- * server/character.cpp: replacing rint with floor wasn't a
- good idea.
+ * server/character.cpp: use std::floor instead of cast to int.
2008-04-17 Benjamin Wolsey <address@hidden>
@@ -10,8 +20,6 @@
add notes for unimplemented ASnatives.
* server/asobj/Global.cpp: register System ASnative functions at
startup.
- * server/character.h: use std::floor instead of rint and cast
- to int.
2008-04-17 Sandro Santilli <address@hidden>
Index: server/asobj/Color.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Color.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- server/asobj/Color.cpp 21 Jan 2008 20:55:54 -0000 1.21
+++ server/asobj/Color.cpp 17 Apr 2008 10:22:22 -0000 1.22
@@ -44,29 +44,28 @@
static as_value color_settransform(const fn_call& fn);
static as_value color_ctor(const fn_call& fn);
+void registerColorNative(as_object& o)
+{
+ VM& vm = o.getVM();
+
+ vm.registerNative(color_setrgb, 700, 0);
+ vm.registerNative(color_settransform, 700, 1);
+ vm.registerNative(color_getrgb, 700, 2);
+ vm.registerNative(color_gettransform, 700, 3);
+}
+
static void
attachColorInterface(as_object& o)
{
VM& vm = o.getVM();
// Color.setRGB
- //log_debug("Registering as native 700, 0");
- vm.registerNative(color_setrgb, 700, 0);
o.init_member("setRGB", vm.getNative(700, 0));
-
// Color.setTransform
- //log_debug("Registering as native 700, 1");
- vm.registerNative(color_settransform, 700, 1);
o.init_member("setTransform", vm.getNative(700, 1));
-
// Color.getRGB
- //log_debug("Registering as native 700, 2");
- vm.registerNative(color_getrgb, 700, 2);
o.init_member("getRGB", vm.getNative(700, 2));
-
// Color.getTransform
- //log_debug("Registering as native 700, 3");
- vm.registerNative(color_gettransform, 700, 3);
o.init_member("getTransform", vm.getNative(700, 3));
}
@@ -115,12 +114,6 @@
markAsObjectReachable();
}
- // override from as_object ?
- //std::string get_text_value() const { return "Color"; }
-
- // override from as_object ?
- //double get_numeric_value() const { return 0; }
-
sprite_instance* getSprite() const
{
checkSprite();
Index: server/asobj/Color.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Color.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- server/asobj/Color.h 26 Mar 2008 21:34:21 -0000 1.9
+++ server/asobj/Color.h 17 Apr 2008 10:22:23 -0000 1.10
@@ -25,12 +25,11 @@
class as_object;
+void registerColorNative(as_object& global);
+
/// Initialize the global Color class
void color_class_init(as_object& global);
-/// Return a Color instance (in case the core lib needs it)
-//std::auto_ptr<as_object> init_color_instance();
-
} // end of gnash namespace
// __GNASH_ASOBJ_COLOR_H__
Index: server/asobj/Global.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Global.cpp,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -b -r1.116 -r1.117
--- server/asobj/Global.cpp 17 Apr 2008 08:14:18 -0000 1.116
+++ server/asobj/Global.cpp 17 Apr 2008 10:22:23 -0000 1.117
@@ -622,9 +622,10 @@
init_member("NaN", as_value(NAN));
init_member("Infinity", as_value(INFINITY));
+ registerColorNative(*this);
+
// The following initializations are necessary
// to register ASnative functions
- color_class_init(*this);
textformat_class_init(*this);
registerDateNative(*this);
Index: testsuite/actionscript.all/Color.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Color.as,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- testsuite/actionscript.all/Color.as 11 Mar 2008 19:31:46 -0000 1.14
+++ testsuite/actionscript.all/Color.as 17 Apr 2008 10:22:23 -0000 1.15
@@ -22,7 +22,7 @@
// execute it like this gnash -1 -r 0 -v out.swf
-rcsid="$Id: Color.as,v 1.14 2008/03/11 19:31:46 strk Exp $";
+rcsid="$Id: Color.as,v 1.15 2008/04/17 10:22:23 bwy Exp $";
#include "check.as"
//--------------------------------
@@ -240,6 +240,42 @@
check_equals ( trans.aa, 100 );
check_equals ( trans.ab, 0 );
+// Some tests for same-named (case-insensitive) variables in SWF6
+
+#if OUTPUT_VERSION == 6
+color = 8;
+
+c = new Color;
+check_equals(c, undefined);
+c = new color;
+check_equals(c, undefined);
+
+delete color;
+c = new Color;
+check_equals (typeof(c), 'object');
+c = new color;
+check_equals (typeof(c), 'object');
+
+color = 8;
+check_equals (typeof(c), 'object');
+check_equals (typeof(c), 'object');
+
+delete c;
+c = new Color;
+check_equals (typeof(c), 'undefined');
+c = new color;
+check_equals (typeof(c), 'undefined');
+
+delete color; // variable
+delete color; // class
+c = new Color;
+check_equals (typeof(c), 'undefined');
+c = new color;
+check_equals (typeof(c), 'undefined');
+
+// Do not add any tests after here (color deleted).
+#endif
+
//-----------------------------------------------------------
// end of test
//-----------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/asobj/Color.cpp server/a...,
Benjamin Wolsey <=