Update of /cvsroot/java-game-lib/LWJGL/src/native/win32
In directory usw-pr-cvs1:/tmp/cvs-serv16457
Modified Files:
org_lwjgl_Math_MatrixOpNormalise_MatrixOpDirect.cpp
org_lwjgl_Math_MatrixOpNormalise_MatrixOpSafe.cpp
Log Message:
Safe version now exists, some testing performed.
Index: org_lwjgl_Math_MatrixOpNormalise_MatrixOpDirect.cpp
CVS Browser:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math_MatrixOpNormalise_MatrixOpDirect.cpp
===================================================================
RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math_MatrixOpNormalise_MatrixOpDirect.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- org_lwjgl_Math_MatrixOpNormalise_MatrixOpDirect.cpp 28 Aug 2002 16:45:24 -0000 1.2
+++ org_lwjgl_Math_MatrixOpNormalise_MatrixOpDirect.cpp 29 Aug 2002 21:40:44 -0000 1.3
@@ -74,8 +74,7 @@
float * sourceRecord, * destRecord;
float magnitude, magnitude_squared;
- int i;
- register int j;
+ int i, j;
for (i = 0; i < source.elements; i++)
{
@@ -84,12 +83,12 @@
sourceRecord = source.nextRecord();
destRecord = dest.nextRecord();
- for (j = 0 ; j < sourceWidth*sourceHeight; i++)
+ for (j = 0 ; j < sourceWidth*sourceHeight; j++)
magnitude_squared += sourceRecord[j] * sourceRecord[j];
magnitude = (float) sqrt((double) magnitude_squared);
- for (j = 0; j < sourceWidth*sourceHeight; i++)
+ for (j = 0; j < sourceWidth*sourceHeight; j++)
destRecord[j] = sourceRecord[j] / magnitude;
dest.writeRecord();
Index: org_lwjgl_Math_MatrixOpNormalise_MatrixOpSafe.cpp
CVS Browser:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math_MatrixOpNormalise_MatrixOpSafe.cpp
===================================================================
RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math_MatrixOpNormalise_MatrixOpSafe.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- org_lwjgl_Math_MatrixOpNormalise_MatrixOpSafe.cpp 28 Aug 2002 16:45:24 -0000 1.2
+++ org_lwjgl_Math_MatrixOpNormalise_MatrixOpSafe.cpp 29 Aug 2002 21:40:44 -0000 1.3
@@ -40,7 +40,7 @@
*/
#include <windows.h>
-#include "org_lwjgl_Math_MatrixOpSubtract_MatrixOpSafe.h"
+#include "org_lwjgl_Math_MatrixOpNormalise_MatrixOpSafe.h"
#include "MatrixOpCommon.h"
#include <cmath>
@@ -72,22 +72,21 @@
float * sourceRecord, * destRecord;
float magnitude, magnitude_squared;
- int i;
- register int j;
+ int i, j;
for (i = 0; i < source.elements; i++)
{
magnitude_squared = 0;
sourceRecord = source.nextRecord();
- destRecord = dest.nextRecord();
+ destRecord = dest.nextRecord();
- for (j = 0 ; j < sourceWidth*sourceHeight; i++)
+ for (j = 0 ; j < sourceWidth*sourceHeight; j++)
magnitude_squared += sourceRecord[j] * sourceRecord[j];
magnitude = (float) sqrt((double) magnitude_squared);
- for (j = 0; j < sourceWidth*sourceHeight; i++)
+ for (j = 0; j < sourceWidth*sourceHeight; j++)
destRecord[j] = sourceRecord[j] / magnitude;
dest.writeRecord();
|