From 533fb86c5033e42a959cf13bf47872b8f27aadc3 Mon Sep 17 00:00:00 2001 From: "sky..ok" Date: Thu, 22 Mar 2012 00:22:09 +0000 Subject: [PATCH] Down to 260 Javadoc warnings from 324 git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9255 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/asset/AndroidAssetManager.java | 4 +- .../blending/TextureBlenderFactory.java | 33 ++- .../bullet/com/jme3/bullet/PhysicsSpace.java | 4 +- .../com/jme3/post/ssao/SSAOFilter.java | 12 +- .../com/jme3/shader/plugins/GLSLLoader.java | 9 +- .../com/jme3/texture/plugins/TGALoader.java | 231 +++++++++--------- .../src/core/com/jme3/asset/AssetCache.java | 4 +- .../com/jme3/asset/DesktopAssetManager.java | 14 +- .../influencers/ParticleInfluencer.java | 33 ++- engine/src/core/com/jme3/font/BitmapFont.java | 6 +- engine/src/core/com/jme3/post/Filter.java | 4 +- .../com/jme3/post/FilterPostProcessor.java | 8 +- .../src/core/com/jme3/renderer/Renderer.java | 8 +- engine/src/core/com/jme3/scene/BatchNode.java | 2 +- .../system/lwjgl/LwjglSmoothingTimer.java | 6 +- .../com/jme3/system/lwjgl/LwjglTimer.java | 6 +- .../plugins/ogre/matext/OgreMaterialKey.java | 2 +- .../jme3/terrain/geomipmap/TerrainPatch.java | 2 +- .../jme3tools/optimize/TextureAtlas.java | 4 +- .../jme3tools/optimize/TriangleCollector.java | 2 +- 20 files changed, 232 insertions(+), 162 deletions(-) diff --git a/engine/src/android/com/jme3/asset/AndroidAssetManager.java b/engine/src/android/com/jme3/asset/AndroidAssetManager.java index b2140dd9a..b8093ac4f 100644 --- a/engine/src/android/com/jme3/asset/AndroidAssetManager.java +++ b/engine/src/android/com/jme3/asset/AndroidAssetManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010 jMonkeyEngine + * Copyright (c) 2009-2012 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -106,7 +106,7 @@ public class AndroidAssetManager extends DesktopAssetManager { /** * Loads a texture. * - * @return + * @return the texture */ @Override public Texture loadTexture(TextureKey key) { diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/textures/blending/TextureBlenderFactory.java b/engine/src/blender/com/jme3/scene/plugins/blender/textures/blending/TextureBlenderFactory.java index c9ad61a75..edc5cdad6 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/textures/blending/TextureBlenderFactory.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/textures/blending/TextureBlenderFactory.java @@ -1,3 +1,34 @@ +/* + * Copyright (c) 2009-2012 jMonkeyEngine + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'jMonkeyEngine' nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ package com.jme3.scene.plugins.blender.textures.blending; import java.util.logging.Level; @@ -20,7 +51,7 @@ public class TextureBlenderFactory { * * @param format * the texture format - * @returntexture blending class + * @return texture blending class */ public static TextureBlender createTextureBlender(Format format) { switch (format) { diff --git a/engine/src/bullet/com/jme3/bullet/PhysicsSpace.java b/engine/src/bullet/com/jme3/bullet/PhysicsSpace.java index 14cc6351f..43ea670d1 100644 --- a/engine/src/bullet/com/jme3/bullet/PhysicsSpace.java +++ b/engine/src/bullet/com/jme3/bullet/PhysicsSpace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010 jMonkeyEngine + * Copyright (c) 2009-2012 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -376,7 +376,7 @@ public class PhysicsSpace { * calls the callable on the next physics tick (ensuring e.g. force applying) * @param * @param callable - * @return + * @return Future object */ public Future enqueue(Callable callable) { AppTask task = new AppTask(callable); diff --git a/engine/src/core-effects/com/jme3/post/ssao/SSAOFilter.java b/engine/src/core-effects/com/jme3/post/ssao/SSAOFilter.java index cb0c037b7..06ff26ec7 100644 --- a/engine/src/core-effects/com/jme3/post/ssao/SSAOFilter.java +++ b/engine/src/core-effects/com/jme3/post/ssao/SSAOFilter.java @@ -186,7 +186,7 @@ public class SSAOFilter extends Filter { /** * Return the bias
* see {@link #setBias(float bias)} - * @return + * @return bias */ public float getBias() { return bias; @@ -205,7 +205,7 @@ public class SSAOFilter extends Filter { /** * returns the ambient occlusion intensity - * @return + * @return intensity */ public float getIntensity() { return intensity; @@ -226,7 +226,7 @@ public class SSAOFilter extends Filter { /** * returns the sample radius
* see {link setSampleRadius(float sampleRadius)} - * @return + * @return the sample radius */ public float getSampleRadius() { return sampleRadius; @@ -247,7 +247,7 @@ public class SSAOFilter extends Filter { /** * returns the scale
* see {@link #setScale(float scale)} - * @return + * @return scale */ public float getScale() { return scale; @@ -267,7 +267,7 @@ public class SSAOFilter extends Filter { /** * debugging only , will be removed - * @return + * @return Whether or not */ public boolean isUseAo() { return useAo; @@ -286,7 +286,7 @@ public class SSAOFilter extends Filter { /** * debugging only , will be removed - * @return + * @return useOnlyAo */ public boolean isUseOnlyAo() { return useOnlyAo; diff --git a/engine/src/core-plugins/com/jme3/shader/plugins/GLSLLoader.java b/engine/src/core-plugins/com/jme3/shader/plugins/GLSLLoader.java index f9073b723..a4b063538 100644 --- a/engine/src/core-plugins/com/jme3/shader/plugins/GLSLLoader.java +++ b/engine/src/core-plugins/com/jme3/shader/plugins/GLSLLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010 jMonkeyEngine + * Copyright (c) 2009-2012 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -185,11 +185,8 @@ public class GLSLLoader implements AssetLoader { /** * - * @param owner - * @param in - * @param extension - * @param key - * @return + * @param info + * @return String of GLSL code * @throws java.io.IOException */ public Object load(AssetInfo info) throws IOException { diff --git a/engine/src/core-plugins/com/jme3/texture/plugins/TGALoader.java b/engine/src/core-plugins/com/jme3/texture/plugins/TGALoader.java index bbd51d641..e9e1904df 100644 --- a/engine/src/core-plugins/com/jme3/texture/plugins/TGALoader.java +++ b/engine/src/core-plugins/com/jme3/texture/plugins/TGALoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010 jMonkeyEngine + * Copyright (c) 2009-2012 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,7 +29,6 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - package com.jme3.texture.plugins; import com.jme3.asset.AssetInfo; @@ -59,37 +58,32 @@ public final class TGALoader implements AssetLoader { // 0 - no image data in file public static final int TYPE_NO_IMAGE = 0; - // 1 - uncompressed, color-mapped image public static final int TYPE_COLORMAPPED = 1; - // 2 - uncompressed, true-color image public static final int TYPE_TRUECOLOR = 2; - // 3 - uncompressed, black and white image public static final int TYPE_BLACKANDWHITE = 3; - // 9 - run-length encoded, color-mapped image public static final int TYPE_COLORMAPPED_RLE = 9; - // 10 - run-length encoded, true-color image public static final int TYPE_TRUECOLOR_RLE = 10; - // 11 - run-length encoded, black and white image public static final int TYPE_BLACKANDWHITE_RLE = 11; - public Object load(AssetInfo info) throws IOException{ - if (!(info.getKey() instanceof TextureKey)) + public Object load(AssetInfo info) throws IOException { + if (!(info.getKey() instanceof TextureKey)) { throw new IllegalArgumentException("Texture assets must be loaded using a TextureKey"); + } - boolean flip = ((TextureKey)info.getKey()).isFlipY(); + boolean flip = ((TextureKey) info.getKey()).isFlipY(); InputStream in = null; try { in = info.openStream(); Image img = load(in, flip); return img; } finally { - if (in != null){ + if (in != null) { in.close(); } } @@ -99,14 +93,14 @@ public final class TGALoader implements AssetLoader { * loadImage is a manual image loader which is entirely * independent of AWT. OUT: RGB888 or RGBA8888 Image object * - * @return Image object that contains the - * image, either as a RGB888 or RGBA8888 + * + + * @param in + * InputStream of an uncompressed 24b RGB or 32b RGBA TGA * @param flip * Flip the image vertically - * @param exp32 - * Add a dummy Alpha channel to 24b RGB image. - * @param fis - * InputStream of an uncompressed 24b RGB or 32b RGBA TGA + * @return Image object that contains the + * image, either as a RGB888 or RGBA8888 * @throws java.io.IOException */ public static Image load(InputStream in, boolean flip) throws IOException { @@ -151,49 +145,55 @@ public final class TGALoader implements AssetLoader { int pixelDepth = dis.readUnsignedByte(); int imageDescriptor = dis.readUnsignedByte(); if ((imageDescriptor & 32) != 0) // bit 5 : if 1, flip top/bottom ordering + { flip = !flip; + } if ((imageDescriptor & 16) != 0) // bit 4 : if 1, flip left/right ordering + { flipH = !flipH; - + } + // ---------- Done Reading the TGA header ---------- // - + // Skip image ID - if (idLength > 0) + if (idLength > 0) { in.skip(idLength); - + } + ColorMapEntry[] cMapEntries = null; if (colorMapType != 0) { // read the color map. int bytesInColorMap = (cMapDepth * cMapLength) >> 3; - int bitsPerColor = Math.min(cMapDepth/3 , 8); - + int bitsPerColor = Math.min(cMapDepth / 3, 8); + byte[] cMapData = new byte[bytesInColorMap]; in.read(cMapData); - + // Only go to the trouble of constructing the color map // table if this is declared a color mapped image. if (imageType == TYPE_COLORMAPPED || imageType == TYPE_COLORMAPPED_RLE) { cMapEntries = new ColorMapEntry[cMapLength]; - int alphaSize = cMapDepth - (3*bitsPerColor); + int alphaSize = cMapDepth - (3 * bitsPerColor); float scalar = 255f / (FastMath.pow(2, bitsPerColor) - 1); float alphaScalar = 255f / (FastMath.pow(2, alphaSize) - 1); for (int i = 0; i < cMapLength; i++) { ColorMapEntry entry = new ColorMapEntry(); int offset = cMapDepth * i; - entry.red = (byte)(int)(getBitsAsByte(cMapData, offset, bitsPerColor) * scalar); - entry.green = (byte)(int)(getBitsAsByte(cMapData, offset+bitsPerColor, bitsPerColor) * scalar); - entry.blue = (byte)(int)(getBitsAsByte(cMapData, offset+(2*bitsPerColor), bitsPerColor) * scalar); - if (alphaSize <= 0) - entry.alpha = (byte)255; - else - entry.alpha = (byte)(int)(getBitsAsByte(cMapData, offset+(3*bitsPerColor), alphaSize) * alphaScalar); - + entry.red = (byte) (int) (getBitsAsByte(cMapData, offset, bitsPerColor) * scalar); + entry.green = (byte) (int) (getBitsAsByte(cMapData, offset + bitsPerColor, bitsPerColor) * scalar); + entry.blue = (byte) (int) (getBitsAsByte(cMapData, offset + (2 * bitsPerColor), bitsPerColor) * scalar); + if (alphaSize <= 0) { + entry.alpha = (byte) 255; + } else { + entry.alpha = (byte) (int) (getBitsAsByte(cMapData, offset + (3 * bitsPerColor), alphaSize) * alphaScalar); + } + cMapEntries[i] = entry; } } } - - + + // Allocate image data array Format format; byte[] rawData = null; @@ -212,41 +212,45 @@ public final class TGALoader implements AssetLoader { byte green = 0; byte blue = 0; byte alpha = 0; - + // Faster than doing a 16-or-24-or-32 check on each individual pixel, // just make a seperate loop for each. if (pixelDepth == 16) { byte[] data = new byte[2]; - float scalar = 255f/31f; + float scalar = 255f / 31f; for (int i = 0; i <= (height - 1); i++) { - if (!flip) + if (!flip) { rawDataIndex = (height - 1 - i) * width * dl; + } for (int j = 0; j < width; j++) { data[1] = dis.readByte(); data[0] = dis.readByte(); - rawData[rawDataIndex++] = (byte)(int)(getBitsAsByte(data, 1, 5) * scalar); - rawData[rawDataIndex++] = (byte)(int)(getBitsAsByte(data, 6, 5) * scalar); - rawData[rawDataIndex++] = (byte)(int)(getBitsAsByte(data, 11, 5) * scalar); + rawData[rawDataIndex++] = (byte) (int) (getBitsAsByte(data, 1, 5) * scalar); + rawData[rawDataIndex++] = (byte) (int) (getBitsAsByte(data, 6, 5) * scalar); + rawData[rawDataIndex++] = (byte) (int) (getBitsAsByte(data, 11, 5) * scalar); if (dl == 4) { // create an alpha channel alpha = getBitsAsByte(data, 0, 1); - if (alpha == 1) alpha = (byte)255; + if (alpha == 1) { + alpha = (byte) 255; + } rawData[rawDataIndex++] = alpha; } } } format = dl == 4 ? Format.RGBA8 : Format.RGB8; - } else if (pixelDepth == 24){ + } else if (pixelDepth == 24) { for (int y = 0; y < height; y++) { - if (!flip) + if (!flip) { rawDataIndex = (height - 1 - y) * width * dl; - else + } else { rawDataIndex = y * width * dl; + } dis.readFully(rawData, rawDataIndex, width * dl); // for (int x = 0; x < width; x++) { - //read scanline + //read scanline // blue = dis.readByte(); // green = dis.readByte(); // red = dis.readByte(); @@ -256,10 +260,11 @@ public final class TGALoader implements AssetLoader { // } } format = Format.BGR8; - } else if (pixelDepth == 32){ + } else if (pixelDepth == 32) { for (int i = 0; i <= (height - 1); i++) { - if (!flip) + if (!flip) { rawDataIndex = (height - 1 - i) * width * dl; + } for (int j = 0; j < width; j++) { blue = dis.readByte(); @@ -273,26 +278,26 @@ public final class TGALoader implements AssetLoader { } } format = Format.RGBA8; - }else{ - throw new IOException("Unsupported TGA true color depth: "+pixelDepth); + } else { + throw new IOException("Unsupported TGA true color depth: " + pixelDepth); } - } else if( imageType == TYPE_TRUECOLOR_RLE ) { + } else if (imageType == TYPE_TRUECOLOR_RLE) { byte red = 0; byte green = 0; byte blue = 0; byte alpha = 0; // Faster than doing a 16-or-24-or-32 check on each individual pixel, // just make a seperate loop for each. - if( pixelDepth == 32 ){ - for( int i = 0; i <= ( height - 1 ); ++i ){ - if( !flip ){ - rawDataIndex = ( height - 1 - i ) * width * dl; + if (pixelDepth == 32) { + for (int i = 0; i <= (height - 1); ++i) { + if (!flip) { + rawDataIndex = (height - 1 - i) * width * dl; } - for( int j = 0; j < width; ++j ){ + for (int j = 0; j < width; ++j) { // Get the number of pixels the next chunk covers (either packed or unpacked) int count = dis.readByte(); - if( ( count & 0x80 ) != 0 ){ + if ((count & 0x80) != 0) { // Its an RLE packed block - use the following 1 pixel for the next pixels count &= 0x07f; j += count; @@ -300,16 +305,16 @@ public final class TGALoader implements AssetLoader { green = dis.readByte(); red = dis.readByte(); alpha = dis.readByte(); - while( count-- >= 0 ){ + while (count-- >= 0) { rawData[rawDataIndex++] = red; rawData[rawDataIndex++] = green; rawData[rawDataIndex++] = blue; rawData[rawDataIndex++] = alpha; } - } else{ + } else { // Its not RLE packed, but the next pixels are raw. j += count; - while( count-- >= 0 ){ + while (count-- >= 0) { blue = dis.readByte(); green = dis.readByte(); red = dis.readByte(); @@ -323,30 +328,30 @@ public final class TGALoader implements AssetLoader { } } format = Format.RGBA8; - } else if( pixelDepth == 24 ){ - for( int i = 0; i <= ( height - 1 ); i++ ){ - if( !flip ){ - rawDataIndex = ( height - 1 - i ) * width * dl; + } else if (pixelDepth == 24) { + for (int i = 0; i <= (height - 1); i++) { + if (!flip) { + rawDataIndex = (height - 1 - i) * width * dl; } - for( int j = 0; j < width; ++j ){ + for (int j = 0; j < width; ++j) { // Get the number of pixels the next chunk covers (either packed or unpacked) int count = dis.readByte(); - if( ( count & 0x80 ) != 0 ){ + if ((count & 0x80) != 0) { // Its an RLE packed block - use the following 1 pixel for the next pixels count &= 0x07f; j += count; blue = dis.readByte(); green = dis.readByte(); red = dis.readByte(); - while( count-- >= 0 ){ + while (count-- >= 0) { rawData[rawDataIndex++] = red; rawData[rawDataIndex++] = green; rawData[rawDataIndex++] = blue; } - } else{ + } else { // Its not RLE packed, but the next pixels are raw. j += count; - while( count-- >= 0 ){ + while (count-- >= 0) { blue = dis.readByte(); green = dis.readByte(); red = dis.readByte(); @@ -358,39 +363,39 @@ public final class TGALoader implements AssetLoader { } } format = Format.RGB8; - } else if( pixelDepth == 16 ){ - byte[] data = new byte[ 2 ]; + } else if (pixelDepth == 16) { + byte[] data = new byte[2]; float scalar = 255f / 31f; - for( int i = 0; i <= ( height - 1 ); i++ ){ - if( !flip ){ - rawDataIndex = ( height - 1 - i ) * width * dl; + for (int i = 0; i <= (height - 1); i++) { + if (!flip) { + rawDataIndex = (height - 1 - i) * width * dl; } - for( int j = 0; j < width; j++ ){ + for (int j = 0; j < width; j++) { // Get the number of pixels the next chunk covers (either packed or unpacked) int count = dis.readByte(); - if( ( count & 0x80 ) != 0 ){ + if ((count & 0x80) != 0) { // Its an RLE packed block - use the following 1 pixel for the next pixels count &= 0x07f; j += count; data[1] = dis.readByte(); data[0] = dis.readByte(); - blue = (byte) (int) ( getBitsAsByte( data, 1, 5 ) * scalar ); - green = (byte) (int) ( getBitsAsByte( data, 6, 5 ) * scalar ); - red = (byte) (int) ( getBitsAsByte( data, 11, 5 ) * scalar ); - while( count-- >= 0 ){ + blue = (byte) (int) (getBitsAsByte(data, 1, 5) * scalar); + green = (byte) (int) (getBitsAsByte(data, 6, 5) * scalar); + red = (byte) (int) (getBitsAsByte(data, 11, 5) * scalar); + while (count-- >= 0) { rawData[rawDataIndex++] = red; rawData[rawDataIndex++] = green; rawData[rawDataIndex++] = blue; } - } else{ + } else { // Its not RLE packed, but the next pixels are raw. j += count; - while( count-- >= 0 ){ + while (count-- >= 0) { data[1] = dis.readByte(); data[0] = dis.readByte(); - blue = (byte) (int) ( getBitsAsByte( data, 1, 5 ) * scalar ); - green = (byte) (int) ( getBitsAsByte( data, 6, 5 ) * scalar ); - red = (byte) (int) ( getBitsAsByte( data, 11, 5 ) * scalar ); + blue = (byte) (int) (getBitsAsByte(data, 1, 5) * scalar); + green = (byte) (int) (getBitsAsByte(data, 6, 5) * scalar); + red = (byte) (int) (getBitsAsByte(data, 11, 5) * scalar); rawData[rawDataIndex++] = red; rawData[rawDataIndex++] = green; rawData[rawDataIndex++] = blue; @@ -399,21 +404,23 @@ public final class TGALoader implements AssetLoader { } } format = Format.RGB8; - } else{ - throw new IOException( "Unsupported TGA true color depth: " + pixelDepth ); + } else { + throw new IOException("Unsupported TGA true color depth: " + pixelDepth); } - } else if( imageType == TYPE_COLORMAPPED ){ + } else if (imageType == TYPE_COLORMAPPED) { int bytesPerIndex = pixelDepth / 8; - + if (bytesPerIndex == 1) { for (int i = 0; i <= (height - 1); i++) { - if (!flip) + if (!flip) { rawDataIndex = (height - 1 - i) * width * dl; + } for (int j = 0; j < width; j++) { int index = dis.readUnsignedByte(); - if (index >= cMapEntries.length || index < 0) - throw new IOException("TGA: Invalid color map entry referenced: "+index); + if (index >= cMapEntries.length || index < 0) { + throw new IOException("TGA: Invalid color map entry referenced: " + index); + } ColorMapEntry entry = cMapEntries[index]; rawData[rawDataIndex++] = entry.red; @@ -422,17 +429,19 @@ public final class TGALoader implements AssetLoader { if (dl == 4) { rawData[rawDataIndex++] = entry.alpha; } - + } } } else if (bytesPerIndex == 2) { for (int i = 0; i <= (height - 1); i++) { - if (!flip) + if (!flip) { rawDataIndex = (height - 1 - i) * width * dl; + } for (int j = 0; j < width; j++) { int index = flipEndian(dis.readShort()); - if (index >= cMapEntries.length || index < 0) - throw new IOException("TGA: Invalid color map entry referenced: "+index); + if (index >= cMapEntries.length || index < 0) { + throw new IOException("TGA: Invalid color map entry referenced: " + index); + } ColorMapEntry entry = cMapEntries[index]; rawData[rawDataIndex++] = entry.red; @@ -444,15 +453,15 @@ public final class TGALoader implements AssetLoader { } } } else { - throw new IOException("TGA: unknown colormap indexing size used: "+bytesPerIndex); + throw new IOException("TGA: unknown colormap indexing size used: " + bytesPerIndex); } format = dl == 4 ? Format.RGBA8 : Format.RGB8; } else { throw new IOException("Grayscale TGA not supported"); } - - + + in.close(); // Get a pointer to the image memory ByteBuffer scratch = BufferUtils.createByteBuffer(rawData.length); @@ -472,16 +481,17 @@ public final class TGALoader implements AssetLoader { int offsetBytes = offset / 8; int indexBits = offset % 8; int rVal = 0; - + // start at data[offsetBytes]... spill into next byte as needed. - for (int i = length; --i >=0;) { + for (int i = length; --i >= 0;) { byte b = data[offsetBytes]; - int test = indexBits == 7 ? 1 : 2 << (6-indexBits); + int test = indexBits == 7 ? 1 : 2 << (6 - indexBits); if ((b & test) != 0) { - if (i == 0) + if (i == 0) { rVal++; - else - rVal += (2 << i-1); + } else { + rVal += (2 << i - 1); + } } indexBits++; if (indexBits == 8) { @@ -489,8 +499,8 @@ public final class TGALoader implements AssetLoader { offsetBytes++; } } - - return (byte)rVal; + + return (byte) rVal; } /** @@ -507,11 +517,12 @@ public final class TGALoader implements AssetLoader { } static class ColorMapEntry { + byte red, green, blue, alpha; - + @Override public String toString() { - return "entry: "+red+","+green+","+blue+","+alpha; + return "entry: " + red + "," + green + "," + blue + "," + alpha; } } } diff --git a/engine/src/core/com/jme3/asset/AssetCache.java b/engine/src/core/com/jme3/asset/AssetCache.java index 5dde799e7..99381e083 100644 --- a/engine/src/core/com/jme3/asset/AssetCache.java +++ b/engine/src/core/com/jme3/asset/AssetCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010 jMonkeyEngine + * Copyright (c) 2009-2012 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -98,7 +98,7 @@ public class AssetCache { *

* Thread-safe. * @param key - * @return + * @return the object matching the {@link AssetKey} */ public Object getFromCache(AssetKey key){ synchronized (regularCache){ diff --git a/engine/src/core/com/jme3/asset/DesktopAssetManager.java b/engine/src/core/com/jme3/asset/DesktopAssetManager.java index e2d8ef847..4ec475124 100644 --- a/engine/src/core/com/jme3/asset/DesktopAssetManager.java +++ b/engine/src/core/com/jme3/asset/DesktopAssetManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010 jMonkeyEngine + * Copyright (c) 2009-2012 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -218,7 +218,7 @@ public class DesktopAssetManager implements AssetManager { * * @param * @param key - * @return + * @return the loaded asset */ public T loadAsset(AssetKey key){ if (key == null) @@ -319,7 +319,7 @@ public class DesktopAssetManager implements AssetManager { /** * Loads a texture. * - * @return + * @return the texture */ public Texture loadTexture(TextureKey key){ return (Texture) loadAsset(key); @@ -335,7 +335,7 @@ public class DesktopAssetManager implements AssetManager { * @param name * @param generateMipmaps Enable if applying texture to 3D objects, disable * for GUI/HUD elements. - * @return + * @return the loaded texture */ public Texture loadTexture(String name, boolean generateMipmaps){ TextureKey key = new TextureKey(name, true); @@ -368,7 +368,7 @@ public class DesktopAssetManager implements AssetManager { * Loads a bitmap font with the given name. * * @param name - * @return + * @return the loaded {@link BitmapFont} */ public BitmapFont loadFont(String name){ return (BitmapFont) loadAsset(new AssetKey(name)); @@ -382,7 +382,7 @@ public class DesktopAssetManager implements AssetManager { * Load a vertex/fragment shader combo. * * @param key - * @return + * @return the loaded {@link Shader} */ public Shader loadShader(ShaderKey key){ // cache abuse in method @@ -412,7 +412,7 @@ public class DesktopAssetManager implements AssetManager { * Load a model. * * @param name - * @return + * @return the loaded model */ public Spatial loadModel(String name){ return loadModel(new ModelKey(name)); diff --git a/engine/src/core/com/jme3/effect/influencers/ParticleInfluencer.java b/engine/src/core/com/jme3/effect/influencers/ParticleInfluencer.java index 56c8cf99b..5e3532bb0 100644 --- a/engine/src/core/com/jme3/effect/influencers/ParticleInfluencer.java +++ b/engine/src/core/com/jme3/effect/influencers/ParticleInfluencer.java @@ -1,3 +1,34 @@ +/* + * Copyright (c) 2009-2012 jMonkeyEngine + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'jMonkeyEngine' nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ package com.jme3.effect.influencers; import com.jme3.effect.Particle; @@ -48,7 +79,7 @@ public interface ParticleInfluencer extends Savable, Cloneable { * Set the variation by which the initial velocity * of the particle is determined. variation should be a value * from 0 to 1, where 0 means particles are to spawn with exactly - * the velocity given in {@link ParticleEmitter#setStartVel(com.jme3.math.Vector3f) }, + * the velocity given in {@link ParticleEmitter#setInitialVelocity(com.jme3.math.Vector3f) }, * and 1 means particles are to spawn with a completely random velocity. */ void setVelocityVariation(float variation); diff --git a/engine/src/core/com/jme3/font/BitmapFont.java b/engine/src/core/com/jme3/font/BitmapFont.java index ce532e949..1b46caef0 100644 --- a/engine/src/core/com/jme3/font/BitmapFont.java +++ b/engine/src/core/com/jme3/font/BitmapFont.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010 jMonkeyEngine + * Copyright (c) 2009-2012 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -128,7 +128,7 @@ public class BitmapFont implements Savable { /** * Gets the line height of a StringBlock. * @param sb - * @return + * @return the line height */ public float getLineHeight(StringBlock sb) { return charSet.getLineHeight() * (sb.getSize() / charSet.getRenderedSize()); @@ -261,7 +261,7 @@ public class BitmapFont implements Savable { /** * Merge two fonts. * If two font have the same style, merge will fail. - * @param styleSet Style must be assigned to this. + * @param newFont Style must be assigned to this. * @author Yonghoon */ public void merge(BitmapFont newFont) { diff --git a/engine/src/core/com/jme3/post/Filter.java b/engine/src/core/com/jme3/post/Filter.java index 12babf581..ff2f655ec 100644 --- a/engine/src/core/com/jme3/post/Filter.java +++ b/engine/src/core/com/jme3/post/Filter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010 jMonkeyEngine + * Copyright (c) 2009-2012 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -338,7 +338,7 @@ public abstract class Filter implements Savable { /** * returns the name of the filter - * @return + * @return the Filter's name */ public String getName() { return name; diff --git a/engine/src/core/com/jme3/post/FilterPostProcessor.java b/engine/src/core/com/jme3/post/FilterPostProcessor.java index d97e8e91d..155edeed4 100644 --- a/engine/src/core/com/jme3/post/FilterPostProcessor.java +++ b/engine/src/core/com/jme3/post/FilterPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010 jMonkeyEngine + * Copyright (c) 2009-2012 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -87,7 +87,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable { } /** - * Don't use this constructor use {@link FilterPostProcessor(AssetManager assetManager)}
+ * Don't use this constructor, use {@link #FilterPostProcessor(AssetManager assetManager)}
* This constructor is used for serialization only */ public FilterPostProcessor() { @@ -488,7 +488,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable { /** * For internal use only
* returns the depth texture of the scene - * @return + * @return the depth texture */ public Texture2D getDepthTexture() { return depthTexture; @@ -497,7 +497,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable { /** * For internal use only
* returns the rendered texture of the scene - * @return + * @return the filter texture */ public Texture2D getFilterTexture() { return filterTexture; diff --git a/engine/src/core/com/jme3/renderer/Renderer.java b/engine/src/core/com/jme3/renderer/Renderer.java index 6e366ab18..b94bd1d5d 100644 --- a/engine/src/core/com/jme3/renderer/Renderer.java +++ b/engine/src/core/com/jme3/renderer/Renderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010 jMonkeyEngine + * Copyright (c) 2009-2012 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -270,7 +270,7 @@ public interface Renderer { public void renderMesh(Mesh mesh, int lod, int count); /** - * Resets all previously used {@link GLObject}s on this Renderer. + * Resets all previously used GLObjects on this Renderer. * The state of the GLObjects is reset in such way, that using * them again will cause the renderer to reupload them. * Call this method when you know the GL context is going to shutdown. @@ -280,14 +280,14 @@ public interface Renderer { public void resetGLObjects(); /** - * Deletes all previously used {@link GLObject}s on this Renderer, and + * Deletes all previously used GLObjects on this Renderer, and * then resets the GLObjects. * * @see #resetGLObjects() * @see GLObject#deleteObject(com.jme3.renderer.Renderer) */ public void cleanup(); - + /** * Sets the alpha to coverage state. *

diff --git a/engine/src/core/com/jme3/scene/BatchNode.java b/engine/src/core/com/jme3/scene/BatchNode.java index 303de7a02..ca6e70daf 100644 --- a/engine/src/core/com/jme3/scene/BatchNode.java +++ b/engine/src/core/com/jme3/scene/BatchNode.java @@ -56,7 +56,7 @@ import java.util.logging.Logger; * this geometries are directly attached to the node in the scene graph. * usage is like any other node except you have to call the {@link #batch()} method once all geoms have been attached to the sub scene graph and theire material set * (see todo more automagic for further enhancements) - * all the geometry that have been batched are set to {@link CullHint#Always} to not render them. + * all the geometry that have been batched are set to {@link Spatial.CullHint#Always} to not render them. * the sub geometries can be transformed as usual their transforms are used to update the mesh of the geometryBatch. * sub geoms can be removed but it may be slower than the normal spatial removing * Sub geoms can be added after the batch() method has been called but won't be batched and will be rendered as normal geometries. diff --git a/engine/src/lwjgl/com/jme3/system/lwjgl/LwjglSmoothingTimer.java b/engine/src/lwjgl/com/jme3/system/lwjgl/LwjglSmoothingTimer.java index 2c9b80a76..bc7f3c5c8 100644 --- a/engine/src/lwjgl/com/jme3/system/lwjgl/LwjglSmoothingTimer.java +++ b/engine/src/lwjgl/com/jme3/system/lwjgl/LwjglSmoothingTimer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010 jMonkeyEngine + * Copyright (c) 2009-2012 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -106,14 +106,14 @@ public class LwjglSmoothingTimer extends Timer { } /** - * @see com.jme.util.Timer#getTime() + * @see Timer#getTime() */ public long getTime() { return Sys.getTime() - startTime; } /** - * @see com.jme.util.Timer#getResolution() + * @see Timer#getResolution() */ public long getResolution() { return LWJGL_TIMER_RES; diff --git a/engine/src/lwjgl/com/jme3/system/lwjgl/LwjglTimer.java b/engine/src/lwjgl/com/jme3/system/lwjgl/LwjglTimer.java index 681f9de4e..681e7389c 100644 --- a/engine/src/lwjgl/com/jme3/system/lwjgl/LwjglTimer.java +++ b/engine/src/lwjgl/com/jme3/system/lwjgl/LwjglTimer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010 jMonkeyEngine + * Copyright (c) 2009-2012 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -81,14 +81,14 @@ public class LwjglTimer extends Timer { } /** - * @see com.jme.util.Timer#getTime() + * @see Timer#getTime() */ public long getTime() { return Sys.getTime() - startTime; } /** - * @see com.jme.util.Timer#getResolution() + * @see Timer#getResolution() */ public long getResolution() { return LWJGL_TIMER_RES; diff --git a/engine/src/ogre/com/jme3/scene/plugins/ogre/matext/OgreMaterialKey.java b/engine/src/ogre/com/jme3/scene/plugins/ogre/matext/OgreMaterialKey.java index fa57d48a4..8c5137bbe 100644 --- a/engine/src/ogre/com/jme3/scene/plugins/ogre/matext/OgreMaterialKey.java +++ b/engine/src/ogre/com/jme3/scene/plugins/ogre/matext/OgreMaterialKey.java @@ -65,7 +65,7 @@ public class OgreMaterialKey extends AssetKey { /** * Returns the {@link MaterialExtensionSet} previously set using * {@link OgreMaterialKey#setMaterialExtensionSet(com.jme3.scene.plugins.ogre.matext.MaterialExtensionSet) } method. - * @return + * @return the {@link MaterialExtensionSet} */ public MaterialExtensionSet getMaterialExtensionSet() { return matExts; diff --git a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainPatch.java b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainPatch.java index 83537af22..cd9c29935 100644 --- a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainPatch.java +++ b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainPatch.java @@ -218,7 +218,7 @@ public class TerrainPatch extends Geometry { * If the patch size is 32 then the returned value would be log2(32)-2 = 3 * You can then use that value, 3, to see how many times you can divide 32 by 2 * before the terrain gets too un-detailed (can't stitch it any further). - * @return + * @return the maximum LOD */ public int getMaxLod() { if (maxLod < 0) diff --git a/engine/src/tools/jme3tools/optimize/TextureAtlas.java b/engine/src/tools/jme3tools/optimize/TextureAtlas.java index 13c8b6972..ef8ac120f 100644 --- a/engine/src/tools/jme3tools/optimize/TextureAtlas.java +++ b/engine/src/tools/jme3tools/optimize/TextureAtlas.java @@ -368,7 +368,7 @@ public class TextureAtlas { /** * Get the TextureAtlasTile for the given Texture * @param texture The texture to retrieve the TextureAtlasTile for. - * @return + * @return the atlas tile */ public TextureAtlasTile getAtlasTile(Texture texture) { String sourceTextureName = textureName(texture); @@ -390,7 +390,7 @@ public class TextureAtlas { /** * Creates a new atlas texture for the given map name. * @param mapName - * @return + * @return the atlas texture */ public Texture getAtlasTexture(String mapName) { if (images == null) { diff --git a/engine/src/tools/jme3tools/optimize/TriangleCollector.java b/engine/src/tools/jme3tools/optimize/TriangleCollector.java index 9ce4ffa76..3a2ccd1ba 100644 --- a/engine/src/tools/jme3tools/optimize/TriangleCollector.java +++ b/engine/src/tools/jme3tools/optimize/TriangleCollector.java @@ -94,7 +94,7 @@ public class TriangleCollector { * * @param inGeoms * @param tris - * @return + * @return The optimized geometries */ public static final List gatherTris(Geometry[] inGeoms, List tris){ Collections.sort(tris, comparator);