[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/character.cpp testsuite/...
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash ChangeLog server/character.cpp testsuite/... |
Date: |
Wed, 16 Apr 2008 19:16:59 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/04/16 19:16:58
Modified files:
. : ChangeLog
server : character.cpp
testsuite/actionscript.all: MovieClip.as
Log message:
* server/character.cpp: x and y translation should be
rounded down to next twip.
* testsuite/actionscript.all/MovieClip.as: tests for _x and
_y.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6301&r2=1.6302
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.cpp?cvsroot=gnash&r1=1.88&r2=1.89
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/MovieClip.as?cvsroot=gnash&r1=1.123&r2=1.124
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6301
retrieving revision 1.6302
diff -u -b -r1.6301 -r1.6302
--- ChangeLog 16 Apr 2008 16:59:42 -0000 1.6301
+++ ChangeLog 16 Apr 2008 19:16:56 -0000 1.6302
@@ -1,3 +1,10 @@
+2008-04-16 Benjamin Wolsey <address@hidden>
+
+ * server/character.cpp: x and y translation should be
+ rounded down to next twip.
+ * testsuite/actionscript.all/MovieClip.as: tests for _x and
+ _y.
+
2008-04-16 Sandro Santilli <address@hidden>
* server/movie_root.cpp (generate_mouse_button_events): don't let
Index: server/character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/character.cpp,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -b -r1.88 -r1.89
--- server/character.cpp 11 Apr 2008 15:33:45 -0000 1.88
+++ server/character.cpp 16 Apr 2008 19:16:58 -0000 1.89
@@ -237,7 +237,7 @@
{
double newx = fn.arg(0).to_number();
matrix m = ptr->get_matrix();
-
m.set_x_translation(std::infinite_to_fzero(PIXELS_TO_TWIPS(newx)));
+
m.set_x_translation(static_cast<int>(std::infinite_to_fzero(PIXELS_TO_TWIPS(newx))));
ptr->set_matrix(m);
ptr->transformedByScript(); // m_accept_anim_moves = false;
}
@@ -259,8 +259,10 @@
else // setter
{
double newy = fn.arg(0).to_number();
+ log_debug("_y setter called with %d, to twips: %d", newy,
PIXELS_TO_TWIPS(newy));
matrix m = ptr->get_matrix();
-
m.set_y_translation(std::infinite_to_fzero(PIXELS_TO_TWIPS(newy)));
+
m.set_y_translation(static_cast<int>(std::infinite_to_fzero(PIXELS_TO_TWIPS(newy))));
+ log_debug("_y trans now: %d", m.get_y_translation());
ptr->set_matrix(m);
ptr->transformedByScript(); // m_accept_anim_moves = false;
}
Index: testsuite/actionscript.all/MovieClip.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/MovieClip.as,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -b -r1.123 -r1.124
--- testsuite/actionscript.all/MovieClip.as 1 Apr 2008 19:47:20 -0000
1.123
+++ testsuite/actionscript.all/MovieClip.as 16 Apr 2008 19:16:58 -0000
1.124
@@ -20,28 +20,28 @@
// compile this test case with Ming makeswf, and then
// execute it like this gnash -1 -r 0 -v out.swf
-rcsid="$Id: MovieClip.as,v 1.123 2008/04/01 19:47:20 strk Exp $";
+rcsid="$Id: MovieClip.as,v 1.124 2008/04/16 19:16:58 bwy Exp $";
-rcsid="$Id: MovieClip.as,v 1.123 2008/04/01 19:47:20 strk Exp $";
+rcsid="$Id: MovieClip.as,v 1.124 2008/04/16 19:16:58 bwy Exp $";
#include "check.as"
// To be called at end of test
endOfTest = function()
{
#if OUTPUT_VERSION <= 5
- check_totals(200); // SWF5
+ check_totals(210); // SWF5
#endif
#if OUTPUT_VERSION == 6
- check_totals(614); // SWF6
+ check_totals(624); // SWF6
#endif
#if OUTPUT_VERSION == 7
- check_totals(631); // SWF7
+ check_totals(641); // SWF7
#endif
#if OUTPUT_VERSION >= 8
- check_totals(632); // SWF8+
+ check_totals(642); // SWF8+
#endif
play();
@@ -1295,7 +1295,46 @@
static_clip._xscale *= 0.5;
static_clip._yscale *= 2;
+ // If it's not one twip, it's nothing
+ static_clip._y += 0.04;
+ check_equals(static_clip._y, 0);
+
+ static_clip._y += 0.04;
+ check_equals(static_clip._y, 0);
+
+ static_clip._y += 0.04;
+ check_equals(static_clip._y, 0);
+
+ static_clip._y = 0.09;
+ check(static_clip._y > 0.04999 && static_clip._y < 0.50001);
+
+ // Gnash can't do this because _x and _y are floats at the
+ // moment, but it probably should be able to.
+ xcheck_equals(static_clip._y, 0.05);
+
+ // If it's not one twip, it's nothing
+ static_clip._x += 0.04;
+ check_equals(static_clip._x, 0);
+
+ static_clip._x += 0.04;
+ check_equals(static_clip._x, 0);
+
+ static_clip._x += 0.04;
+ check_equals(static_clip._x, 0);
+
+ static_clip._x = 20.09;
+ check(static_clip._x > 20.049999 && static_clip._x < 20.050001);
+ xcheck_equals(static_clip._x, 0.05);
+
// TODO: try with x/y being getter-setter of the localToGlobal and
globalToLocal parameter
+
+
+/* static_clip._y = 160;*/
+/* for (i = 0; )*/
+/* static_clip._y -= (static_clip._y - 150) / 5;*/
+/* trace (static_clip._y);*/
+/* }*/
+
}
else
{
- [Gnash-commit] gnash ChangeLog server/character.cpp testsuite/...,
Benjamin Wolsey <=