<commit_before>PhaserThree = {};

/** @constructor */
PhaserThree.Layer3d = function( game )
{
  this.init( game );
};

PhaserThree.Layer3d.prototype.init = function( game )
{
  this.game = game;

  // Renderer.
  this.renderer = new THREE.WebGLRenderer( { alpha: true, antialias: true } );
  this.renderer.setSize( game.width, game.height );

  // Canvas.
  this.canvas = this.renderer.domElement;

  // Scene.
  this.scene = new THREE.Scene();
  this.renderer.setClearColor( 0x000000, 0 );

  // Camera.
  this.camera = new THREE.PerspectiveCamera( 45, this.game.width / this.game.height, 0.1, 20000 );
  this.camera.position.set( 0.0, 0.0, 0.0 );
  this.camera.lookAt( new THREE.Vector3( 0.0, 0.0, 0.0 ) );
  this.scene.add( this.camera );

  // Sprite from Canvas.
  this.baseTexture = new PIXI.BaseTexture( this.canvas );
  this.texture = new PIXI.Texture( this.baseTexture );
  this.textureFrame = new Phaser.Frame( 0, 0, 0, this.game.width, this.game.height, "debug", game.rnd.uuid() );
  this.sprite = this.game.add.sprite( 0, 0, this.texture, this.textureFrame );
  this.sprite.fixedToCamera = true;
};

PhaserThree.Layer3d.prototype.update = function()
{
  this.scene.position.x = -this.game.camera.position.x * 2;
  this.scene.position.y = -this.game.camera.position.y * 2;

  this.renderer.render( this.scene, this.camera );

  this.game.renderer.updateTexture( this.baseTexture );
};<commit_msg>Made sure game renderer only attempts to update a Layer3d texture if updateTexture is defined (not always the case when Phaser uses canvas).<commit_after>PhaserThree = {};

/** @constructor */
PhaserThree.Layer3d = function( game )
{
  this.init( game );
};

PhaserThree.Layer3d.prototype.init = function( game )
{
  this.game = game;

  // Renderer.
  this.renderer = new THREE.WebGLRenderer( { alpha: true, antialias: true } );
  this.renderer.setSize( game.width, game.height );

  // Canvas.
  this.canvas = this.renderer.domElement;

  // Scene.
  this.scene = new THREE.Scene();
  this.renderer.setClearColor( 0x000000, 0 );

  // Camera.
  this.camera = new THREE.PerspectiveCamera( 45, this.game.width / this.game.height, 0.1, 20000 );
  this.camera.position.set( 0.0, 0.0, 0.0 );
  this.camera.lookAt( new THREE.Vector3( 0.0, 0.0, 0.0 ) );
  this.scene.add( this.camera );

  // Sprite from Canvas.
  this.baseTexture = new PIXI.BaseTexture( this.canvas );
  this.texture = new PIXI.Texture( this.baseTexture );
  this.textureFrame = new Phaser.Frame( 0, 0, 0, this.game.width, this.game.height, "debug", game.rnd.uuid() );
  this.sprite = this.game.add.sprite( 0, 0, this.texture, this.textureFrame );
  this.sprite.fixedToCamera = true;
};

PhaserThree.Layer3d.prototype.update = function()
{
  this.scene.position.x = -this.game.camera.position.x * 2;
  this.scene.position.y = -this.game.camera.position.y * 2;

  this.renderer.render( this.scene, this.camera );

  if( this.game.renderer.updateTexture !== undefined )
  {
    this.game.renderer.updateTexture( this.baseTexture );
  }
};
{'fraction_non_alphanumeric': 0.1579122340425532, 'fraction_numerical': 0.0269281914893617, 'mean_word_length': 3.4776785714285716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3582275', 'n_tokens_mistral': 1135, 'n_tokens_neox': 1067, 'n_words': 217}