public void texture(PImage image) {
    textureImage = image;

    if (textureIndex == textures.length - 1) {
      textures = (PImage[]) PApplet.expand(textures);
    }
    if (textures[textureIndex] != null) {  // ???
      textureIndex++;
    }
    textures[textureIndex] = image;
  }