Package org.newdawn.slick

Examples of org.newdawn.slick.SlickException


    super(image.getTexture().getTextureWidth(), image.getTexture().getTextureHeight());
    this.image = image;
   
    Log.debug("Creating pbuffer(rtt) "+image.getWidth()+"x"+image.getHeight());
    if ((Pbuffer.getCapabilities() & Pbuffer.PBUFFER_SUPPORTED) == 0) {
      throw new SlickException("Your OpenGL card does not support PBuffers and hence can't handle the dynamic images required for this application.");
    }
    if ((Pbuffer.getCapabilities() & Pbuffer.RENDER_TEXTURE_SUPPORTED) == 0) {
      throw new SlickException("Your OpenGL card does not support Render-To-Texture and hence can't handle the dynamic images required for this application.");
    }
 
    init();
 
View Full Code Here


      image.setTexture(tex);
     
      Display.makeCurrent();
    } catch (Exception e) {
      Log.error(e);
      throw new SlickException("Failed to create PBuffer for dynamic image. OpenGL driver failure?");
    }
  }
View Full Code Here

            }
          }
        }
      } catch (IOException e) {
        Log.error(e);
        throw new SlickException("Unable to decode base 64 block");
      }
    } else {
      throw new SlickException("Unsupport tiled map type: " + encoding
          + "," + compression + " (only gzip base64 supported)");
    }
  }
View Full Code Here

        Element docElement = doc.getDocumentElement();
        element = docElement; // (Element)
                    // docElement.getElementsByTagName("tileset").item(0);
      } catch (Exception e) {
        Log.error(e);
        throw new SlickException(
            "Unable to load or parse sourced tileset: "
                + this.map.tilesLocation + "/" + source);
      }
    }
    String tileWidthString = element.getAttribute("tilewidth");
    String tileHeightString = element.getAttribute("tileheight");
    if (tileWidthString.length() == 0 || tileHeightString.length() == 0) {
      throw new SlickException(
          "TiledMap requires that the map be created with tilesets that use a "
              + "single image.  Check the WiKi for more complete information.");
    }
    tileWidth = Integer.parseInt(tileWidthString);
    tileHeight = Integer.parseInt(tileHeightString);
View Full Code Here

        objectGroups.add(objectGroup);
      }
    } catch (Exception e) {
      Log.error(e);
      throw new SlickException("Failed to parse tilemap", e);
    }
  }
View Full Code Here

    sound = new Sound("testdata/restart.ogg");
    charlie = new Sound("testdata/cbrown01.wav");
    try {
      engine = AudioLoader.getAudio("WAV", ResourceLoader.getResourceAsStream("testdata/engine.wav"));
    } catch (IOException e) {
      throw new SlickException("Failed to load engine", e);
    }
    music = musica = new Music("testdata/SMB-X.XM");
    //music = musica = new Music("testdata/theme.ogg", true);
    musicb = new Music("testdata/kirby.ogg", true);
    burp = new Sound("testdata/burp.aif");
View Full Code Here

    this.container = container;
   
    try {
      fire = ParticleIO.loadConfiguredSystem("testdata/system.xml");
    } catch (IOException e) {
      throw new SlickException("Failed to load particle systems", e);
    }
   
    copy = new Image(400,300);
    String[] formats = ImageOut.getSupportedFormats();
    message = "Formats supported: ";
View Full Code Here

      try {
        nextResource.load();
        // slow down loading for example purposes
        try { Thread.sleep(50); } catch (Exception e) {}
      } catch (IOException e) {
        throw new SlickException("Failed to load: "+nextResource.getDescription(), e);
      }
     
      nextResource = null;
    }
   
View Full Code Here

   * @throws SlickException Indicates a failure during copy or a invalid particle system to be duplicated
   */
  public ParticleSystem duplicate() throws SlickException {
    for (int i=0;i<emitters.size();i++) {
      if (!(emitters.get(i) instanceof ConfigurableEmitter)) {
        throw new SlickException("Only systems contianing configurable emitters can be duplicated");
      }
    }
 
    ParticleSystem theCopy = null;
    try {
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      ParticleIO.saveConfiguredSystem(bout, this);
      ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
      theCopy = ParticleIO.loadConfiguredSystem(bin);
    } catch (IOException e) {
      Log.error("Failed to duplicate particle system");
      throw new SlickException("Unable to duplicated particle system", e);
    }
   
    return theCopy;
  }
View Full Code Here

          glyphPageHeight = Integer.parseInt(value);
        } else if (name.equals("effect.class")) {
          try {
            effects.add(Class.forName(value).newInstance());
          } catch (Exception ex) {
            throw new SlickException("Unable to create effect instance: " + value, ex);
          }
        } else if (name.startsWith("effect.")) {
          // Set an effect value on the last added effect.
          name = name.substring(7);
          ConfigurableEffect effect = (ConfigurableEffect)effects.get(effects.size() - 1);
          List values = effect.getValues();
          for (Iterator iter = values.iterator(); iter.hasNext();) {
            Value effectValue = (Value)iter.next();
            if (effectValue.getName().equals(name)) {
              effectValue.setString(value);
              break;
            }
          }
          effect.setValues(values);
        }
      }
      reader.close();
    } catch (Exception ex) {
      throw new SlickException("Unable to load Hiero font file", ex);
    }
  }
View Full Code Here

TOP

Related Classes of org.newdawn.slick.SlickException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.