diff --git a/8ia8dlk7l5.js b/8ia8dlk7l5.js index f1a98a7..3fed224 100644 --- a/8ia8dlk7l5.js +++ b/8ia8dlk7l5.js @@ -1484,41 +1484,79 @@ GameLib.CustomCode.prototype.clearGrid = function() { GameLib.CustomCode.prototype.createTile = function(tileName, imageName, displace) { - var material = null; - var apiMaterial = {}; + var apiMaterial; if (imageName) { - - apiMaterial.diffuseMap = new GameLib.D3.Texture.Image( - this.graphics, - { - image : this[imageName] - } - ); - }; - - if (displace) { - apiMaterial.displacementMap = this.textureDisplacement; - } - - material = new GameLib.D3.Material.Phong( - this.graphics, - apiMaterial - ) + if (displace) { + apiMaterial = new GameLib.D3.API.Material.Phong( + null, + null, + null, + null, + null, + null, + null, + null, + this.textureDisplacement, + null, + null, + null, + null, + null, + null, + null, + null, + new GameLib.D3.API.Texture.Image( + null, + this[imageName] + ) + ) + } else { + apiMaterial = new GameLib.D3.API.Material.Phong( + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + new GameLib.D3.API.Texture.Image( + null, + this[imageName] + ) + ) + } + } else { + apiMaterial = new GameLib.D3.API.Material.Phong(); + } - this[tileName] = new GameLib.D3.Mesh( + this[tileName] = new GameLib.D3.Mesh( this.graphics, - { - geometry : { - componentType : GameLib.Component.GEOMETRY_BUFFER_PLANE, - width : 1, - height : 1, - widthSegments : 10, - heightSegments : 10 - }, - parentScene : this.scene, - materials : [material] - } + new GameLib.D3.API.Mesh( + null, + new GameLib.D3.API.Geometry.Buffer.Plane( + null, + 1, + 1, + 10, + 10 + ), + [ + apiMaterial + ], + null, + this.scene + ) ) this[tileName].visible = false;