From 4400e24575cbfbd717a78a6a3914b6fcdb4ea350 Mon Sep 17 00:00:00 2001 From: oc Date: Mon, 31 Dec 2018 02:04:29 +0800 Subject: [PATCH] Keep order of autotiles --- libs/loader.js | 8 +++++++- libs/maps.js | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libs/loader.js b/libs/loader.js index 1b18f41e..b81c13a8 100644 --- a/libs/loader.js +++ b/libs/loader.js @@ -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(); diff --git a/libs/maps.js b/libs/maps.js index b0e40ce7..4ec0b3df 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -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);