Mirror O/W arrangement: east tiles to canvas right, west to left
User wants only the O/W arrangement mirrored (image X-flip stays as it was). The drawing formula for canvasX now uses (-perp + halfPerp + 0.5) instead of (perp + halfPerp + 0.5), so tiles with perp<0 (world east, dx>0) land at large canvasX (right side of canvas). Y axis (forward direction in N flight) stays unchanged.
This commit is contained in:
1 parent
acac6dccfc
commit
29924d07b0
1 file changed
+1
-1
Vendored
+1
-1
@@ -335,7 +335,7 @@ function drawTileAt(lng, perp, dx, dz, centerTileX, centerTileY) {
|
|||||||
// N flight) lands at small canvasY (= screen top after flip).
|
// N flight) lands at small canvasY (= screen top after flip).
|
||||||
// For perp axis (X): keep the natural sign so world east (dx>0)
|
// For perp axis (X): keep the natural sign so world east (dx>0)
|
||||||
// ends up at canvasX > halfPerp area (right side of canvas).
|
// ends up at canvasX > halfPerp area (right side of canvas).
|
||||||
var canvasX = (perp + halfPerp + 0.5) * GROUND_TILE_SIZE;
|
var canvasX = (-perp + halfPerp + 0.5) * GROUND_TILE_SIZE;
|
||||||
var canvasY = (lng + halfLong + 0.5) * GROUND_TILE_SIZE;
|
var canvasY = (lng + halfLong + 0.5) * GROUND_TILE_SIZE;
|
||||||
if (canvasX < 0 || canvasX >= groundCanvas.width || canvasY < 0 || canvasY >= groundCanvas.height) {
|
if (canvasX < 0 || canvasX >= groundCanvas.width || canvasY < 0 || canvasY >= groundCanvas.height) {
|
||||||
return Promise.resolve(false);
|
return Promise.resolve(false);
|
||||||
|
|||||||
Reference in new issue
Block a user