Keep order of autotiles

This commit is contained in:
oc 2018-12-31 02:04:29 +08:00
parent 43a1876ae9
commit 4400e24575
2 changed files with 11 additions and 1 deletions

View File

@ -39,7 +39,13 @@ loader.prototype.load = function (callback) {
core.loader.loadImages(images, core.material.images.images, function () {
// 加载autotile
core.material.images.autotile = {};
core.loader.loadImages(Object.keys(core.material.icons.autotile), core.material.images.autotile, function () {
var keys = Object.keys(core.material.icons.autotile);
var autotiles = {};
core.loader.loadImages(keys, autotiles, function () {
keys.forEach(function (v) {
core.material.images.autotile[v] = autotiles[v];
});
setTimeout(function () {
core.maps.makeAutotileEdges();

View File

@ -688,6 +688,10 @@ maps.prototype.makeAutotileEdges = function () {
var canvas = document.createElement("canvas"), ctx = canvas.getContext('2d');
canvas.width = canvas.height = 32;
ctx.mozImageSmoothingEnabled = false;
ctx.webkitImageSmoothingEnabled = false;
ctx.msImageSmoothingEnabled = false;
ctx.imageSmoothingEnabled = false;
autotileIds.forEach(function (t) {
var n = core.maps.getNumberById(t);