message: fix for invalid texture
  * fix for invalid texture
  * new approach to fix
  undo last fix
  add fix into texture manager
  * added break (thanks
  * fixed little typo
  * implemented tweaks
  * on reflection, this should never be null!
diff: @@ -68,7 +68,6 @@ export default class TextureManager
  {
  // assume it good!
  // texture = texture.baseTexture || texture;
  - location = location || 0;
  const gl = this.gl;
  @@ -79,6 +78,29 @@ export default class TextureManager
  return null;
  }
  + const boundTextures = this.renderer.boundTextures;
  +
  + // if the location is undefined then this may have been called by n event.
  + // this being the case the texture may already be bound to a slot. As a texture can only be bound once
  + // we need to find its current location if it exists.
  + if (location === undefined)
  + {
  + location = 0;
  +
  + // TODO maybe we can use texture bound ids later on...
  + // check if texture is already bound..
  + for (let i = 0; i < boundTextures.length; ++i)
  + {
  + if (boundTextures[i] === texture)
  + {
  + location = i;
  + break;
  + }
  + }
  + }
  +
  + boundTextures[location] = texture;
  +
  gl.activeTexture(gl.TEXTURE0 + location);
  let glTexture = texture._glTextures[this.renderer.CONTEXT_UID];
  @@ -158,8 +180,6 @@ export default class TextureManager
  glTexture.upload(texture.source);
  }
  - this.renderer.boundTextures[location] = texture;
  -
  return glTexture;
  }
  