From 65f73d99b7f2c422ff6465b7de3a4e4a53a68460 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Thu, 22 Feb 2018 15:28:25 +0100 Subject: [PATCH] Update: CC - Bacon - Entity Loaded (8ia8dlk7l5.js) 1098 bytes modified --- 8ia8dlk7l5.js | 100 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 69 insertions(+), 31 deletions(-) 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;