[Gridflow-cvs] [svn] commit: r6124 - /trunk/src/classes3.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Sun Aug 15 16:12:51 EDT 2010


Author: matju
Date: Sun Aug 15 16:12:51 2010
New Revision: 6124

Log:
[#rotatificator]: add cast

Modified:
    trunk/src/classes3.cxx

Modified: trunk/src/classes3.cxx
==============================================================================
--- trunk/src/classes3.cxx (original)
+++ trunk/src/classes3.cxx Sun Aug 15 16:12:51 2010
@@ -1289,13 +1289,15 @@
 \class GridRotatificator : FObject {
 	int angle;
 	int from, to, n;
+	\attr NumberTypeE cast;
+	\constructor (int from=0, int to=1, int n=2) {cast=int32_e; angle=0; _0_axis(from,to,n);}
 	\decl 0 float (int scale) {
-		int32 rotator[n*n];
+		float32 rotator[n*n];
 		for (int i=0; i<n; i++) for (int j=0; j<n; j++) rotator[i*n+j] = scale * (i==j);
 		float th = angle * M_PI / 18000;
 		for (int i=0; i<2; i++) for (int j=0; j<2; j++)
-			rotator[(i?to:from)*n+(j?to:from)] = (int32)round(scale*cos(th+(j-i)*M_PI/2));
-		GridOut go(this,0,Dim(n,n),int32_e);
+			rotator[(i?to:from)*n+(j?to:from)] = round(scale*cos(th+(j-i)*M_PI/2));
+		GridOut go(this,0,Dim(n,n),cast);
 		go.send(n*n,rotator);
 	}
 	\decl 0 axis (int from, int to, int n) {
@@ -1305,10 +1307,6 @@
 		this->from = from;
 		this->  to =   to;
 		this->   n =    n;
-	}
-	\constructor (int from=0, int to=1, int n=2) {
-		angle=0;
-		_0_axis(from,to,n);
 	}
 	\decl 1 float(int angle) {this->angle = angle;}
 };



More information about the Gridflow-cvs mailing list