Update: CC - Bacon - Entity Loaded (8ia8dlk7l5.js) 1250 bytes modified
parent
01d494a00f
commit
9fc8a86259
|
@ -1485,82 +1485,35 @@ GameLib.CustomCode.prototype.clearGrid = function() {
|
|||
|
||||
GameLib.CustomCode.prototype.createTile = function(tileName, imageName, displace) {
|
||||
|
||||
var apiMaterial;
|
||||
var material = {
|
||||
{
|
||||
materialType : GameLib.D3.API.Material.MATERIAL_TYPE_PHONG
|
||||
}
|
||||
}
|
||||
|
||||
if (imageName) {
|
||||
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();
|
||||
}
|
||||
material.diffuseMap = {
|
||||
image : this[imageName]
|
||||
};
|
||||
}
|
||||
|
||||
if (displace) {
|
||||
material.displacementMap = this.textureDisplacement;
|
||||
}
|
||||
|
||||
this[tileName] = new GameLib.D3.Mesh(
|
||||
this.graphics,
|
||||
new GameLib.D3.API.Mesh(
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
new GameLib.D3.API.Geometry.Buffer.Plane(
|
||||
null,
|
||||
1,
|
||||
1,
|
||||
10,
|
||||
10
|
||||
),
|
||||
[
|
||||
apiMaterial
|
||||
],
|
||||
null,
|
||||
this.scene
|
||||
)
|
||||
{
|
||||
geometry : {
|
||||
componentType : GameLib.Component.GEOMETRY_BUFFER_PLANE,
|
||||
width : 1,
|
||||
height : 1,
|
||||
widthSegments : 10,
|
||||
heightSegments : 10
|
||||
}
|
||||
scene : this.scene,
|
||||
materials : [apiMaterial]
|
||||
}
|
||||
)
|
||||
|
||||
this[tileName].visible = false;
|
||||
|
|
Loading…
Reference in New Issue