• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Main repository of MikuMikuStudio


Commit MetaInfo

Revisão6ab7fe755d3462c046bf0a6cd4814de8e049432b (tree)
Hora2013-04-20 01:58:40
AutorShAdOwIsLoRd <ShAdOwIsLoRd@75d0...>
CommiterShAdOwIsLoRd

Mensagem de Log

  • TextureArray constructor ensures all images passed to it have the same format and dimensions, otherwise an IllegalArgumentException is thrown

git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@10562 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

Mudança Sumário

Diff

--- a/engine/src/core/com/jme3/texture/TextureArray.java
+++ b/engine/src/core/com/jme3/texture/TextureArray.java
@@ -31,6 +31,7 @@
3131 */
3232 package com.jme3.texture;
3333
34+import com.jme3.texture.Image.Format;
3435 import java.util.List;
3536 import java.util.logging.Level;
3637 import java.util.logging.Logger;
@@ -58,26 +59,27 @@ public class TextureArray extends Texture {
5859 }
5960
6061 /**
61- * Construct a TextureArray from the given list of images
62- * warning, this feature is only supported on opengl 3.0 version.
62+ * Construct a TextureArray from the given list of images.
6363 * To check if a hardware supports TextureArray check :
6464 * renderManager.getRenderer().getCaps().contains(Caps.TextureArray)
6565 * @param images
6666 */
6767 public TextureArray(List<Image> images) {
68- super();
68+ super();
69+
6970 int width = images.get(0).getWidth();
7071 int height = images.get(0).getHeight();
71- Image arrayImage = new Image(images.get(0).getFormat(), width, height,
72- null);
72+ Format format = images.get(0).getFormat();
73+ Image arrayImage = new Image(format, width, height, null);
7374
7475 for (Image img : images) {
7576 if (img.getHeight() != height || img.getWidth() != width) {
76- Logger.getLogger(TextureArray.class.getName()).log(
77- Level.WARNING,
78- "all images must have the same width/height");
79- continue;
77+ throw new IllegalArgumentException("Images in texture array must have same dimensions");
78+ }
79+ if (img.getFormat() != format) {
80+ throw new IllegalArgumentException("Images in texture array must have same format");
8081 }
82+
8183 arrayImage.addData(img.getData(0));
8284 }
8385 setImage(arrayImage);