From: Caspian Rychlik-P. <ci...@us...> - 2002-08-23 16:16:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory usw-pr-cvs1:/tmp/cvs-serv14959/src/java/org/lwjgl Modified Files: Display.java Sys.java Math.java DisplayMode.java Log Message: Mainly Javadoc fixes and Math stuff CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java Index: Sys.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Sys.java 19 Aug 2002 14:29:54 -0000 1.9 +++ Sys.java 23 Aug 2002 16:14:21 -0000 1.10 @@ -54,7 +54,7 @@ * inside a process which is already a different priority then this will not * be the initial priority. * - * @see #setProcessPriority() + * @see #setProcessPriority(int) */ public static final int NORMAL_PRIORITY = 0; @@ -70,7 +70,7 @@ * * This priority is <strong>not</strong> recommended for gaming applications. * - * @see #setProcessPriority() + * @see #setProcessPriority(int) */ public static final int REALTIME_PRIORITY = 2; Index: Math.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Math.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Math.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Math.java 20 Aug 2002 09:29:50 -0000 1.5 +++ Math.java 23 Aug 2002 16:14:21 -0000 1.6 @@ -119,7 +119,7 @@ }; /** Straight copy */ - public static final class MatrixOpCopy extends UnaryMatrixOperation { + private static final class MatrixOpCopy extends UnaryMatrixOperation { MatrixOpCopy() { super(0, "copy"); @@ -183,7 +183,7 @@ public static final MatrixOpCopy MATRIXOP_COPY = new MatrixOpCopy(); /** Negate the vector */ - public static final class MatrixOpNegate extends UnaryMatrixOperation { + private static final class MatrixOpNegate extends UnaryMatrixOperation { MatrixOpNegate() { super(1, "negate"); @@ -247,7 +247,7 @@ public static final MatrixOpNegate MATRIXOP_NEGATE = new MatrixOpNegate(); /** Normalise the vector (set to length 1) */ - public static final class MatrixOpNormalise extends UnaryMatrixOperation { + private static final class MatrixOpNormalise extends UnaryMatrixOperation { MatrixOpNormalise() { super(2, "normalise"); @@ -311,7 +311,7 @@ public static final MatrixOpNormalise MATRIXOP_NORMALISE = new MatrixOpNormalise(); /** Compute the inverse matrix */ - public static final class MatrixOpInvert extends UnaryMatrixOperation { + private static final class MatrixOpInvert extends UnaryMatrixOperation { MatrixOpInvert() { super(3, "invert"); @@ -392,10 +392,11 @@ /** * Check the compatibility of a binary matrix operation. + * @return the miniumum stride, in bytes * @throws IllegalArgumentException if the source and destinations are not * compatible */ - abstract void checkCompatibility( + abstract int checkCompatibility( int leftSourceWidth, int leftSourceHeight, boolean transposeLeftSource, @@ -410,13 +411,13 @@ /** Multiply left source by right source */ - public static final class MatrixOpMultiply extends BinaryMatrixOperation { + private static final class MatrixOpMultiply extends BinaryMatrixOperation { MatrixOpMultiply() { super(0, "multiply"); } - void checkCompatibility( + int checkCompatibility( int leftSourceWidth, int leftSourceHeight, boolean transposeLeftSource, @@ -430,6 +431,9 @@ int rightHeight = transposeRightSource ? rightSourceWidth : rightSourceHeight; if (leftWidth != rightHeight) throw new IllegalArgumentException("Left and right matrices are not compatible."); + int leftHeight = transposeLeftSource ? leftSourceWidth : leftSourceHeight; + int rightWidth = transposeRightSource ? rightSourceHeight : rightSourceWidth; + return (rightWidth * leftHeight) << 2; } MatrixOpClassification classify() { return MATRIXOP_NONE; @@ -502,13 +506,13 @@ public static final MatrixOpMultiply MATRIXOP_MULTIPLY = new MatrixOpMultiply(); /** Add right source to left source */ - public static final class MatrixOpAdd extends BinaryMatrixOperation { + private static final class MatrixOpAdd extends BinaryMatrixOperation { MatrixOpAdd() { super(1, "add"); } - void checkCompatibility( + int checkCompatibility( int leftSourceWidth, int leftSourceHeight, boolean transposeLeftSource, @@ -526,6 +530,7 @@ if (leftSourceWidth != rightSourceHeight || leftSourceHeight != rightSourceWidth) throw new IllegalArgumentException("Left and right matrices are not the same size."); } + return (leftSourceWidth * leftSourceHeight) << 2; } MatrixOpClassification classify() { @@ -599,13 +604,13 @@ public static final MatrixOpAdd MATRIXOP_ADD = new MatrixOpAdd(); /** Subtract right source from left source */ - public static final class MatrixOpSubtract extends BinaryMatrixOperation { + private static final class MatrixOpSubtract extends BinaryMatrixOperation { MatrixOpSubtract() { super(2, "subtract"); } - void checkCompatibility( + int checkCompatibility( int leftSourceWidth, int leftSourceHeight, boolean transposeLeftSource, @@ -615,7 +620,7 @@ boolean transposeDest) { // Same as for add, obviously... - MATRIXOP_ADD.checkCompatibility( + return MATRIXOP_ADD.checkCompatibility( leftSourceWidth, leftSourceHeight, transposeLeftSource, @@ -994,7 +999,7 @@ rightSourceStride = rightSourceWidth * rightSourceHeight; // Ensure the source and destination matrices are compatible - operation.checkCompatibility( + int minStride = operation.checkCompatibility( leftSourceWidth, leftSourceHeight, transposeLeftSource, @@ -1003,10 +1008,8 @@ transposeRightSource, transposeDest); - if (destStride == 0) { - // Calculate the destination stride from the input matrix sizes - - } + if (destStride == 0) + destStride = minStride; // Check unary matrix operation type MatrixOpClassification op = operation.classify().check(leftSourceAddress, leftSourceStride, leftElements, destAddress, destStride); Index: DisplayMode.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/DisplayMode.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/DisplayMode.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- DisplayMode.java 15 Aug 2002 15:46:18 -0000 1.2 +++ DisplayMode.java 23 Aug 2002 16:14:38 -0000 1.3 @@ -43,18 +43,18 @@ public final class DisplayMode { - public final int width, height, freq, bpp; + public final int width, height, bpp, freq; /** * Construct a display mode. * * @see Display */ - public DisplayMode(int width, int height, int freq, int bpp) { + public DisplayMode(int width, int height, int bpp, int freq) { this.width = width; this.height = height; - this.freq = freq; this.bpp = bpp; + this.freq = freq; } |