Enabled hack for faster rendering when zoomed in, which also fixed a bug that was annoying to fix.

This commit is contained in:
FrozenCow 2011-01-15 00:02:03 +01:00
parent d594df93ee
commit b5deec79be

View file

@ -69,14 +69,14 @@ KzedMapType.prototype = $.extend(new DynMapType(), {
offset = {x: mod(coord.x,segments)*-tileSize, y: mod(coord.y,segments)*-tileSize}; offset = {x: mod(coord.x,segments)*-tileSize, y: mod(coord.y,segments)*-tileSize};
// The next couple of lines are somewhat of a hack, but makes it faster to render zoomed in tiles: // The next couple of lines are somewhat of a hack, but makes it faster to render zoomed in tiles:
/*tileSize = imgSize; tileSize = imgSize;
if (offset.x == 0 && offset.y == 0) { if (offset.x == 0 && offset.y == 0) {
tileName = this.prefix + '_' + (-mapcoord.x) + '_' + mapcoord.y; tileName = this.prefix + '_' + (-mapcoord.x) + '_' + mapcoord.y;
} }
offset = {x: 0, y: 0};*/ offset = {x: 0, y: 0};
// The next line is not: // The next line is not:
tileName = this.prefix + '_' + (-mapcoord.x) + '_' + mapcoord.y; //tileName = this.prefix + '_' + (-mapcoord.x) + '_' + mapcoord.y;
} }
var img; var img;
var tile = $('<div/>') var tile = $('<div/>')
@ -112,7 +112,7 @@ KzedMapType.prototype = $.extend(new DynMapType(), {
this.dynmap.unregisterTile(this, tileName); this.dynmap.unregisterTile(this, tileName);
} }
return tile.get(0); return tile.get(0);
}, }
}); });