diff --git a/.gitignore b/.gitignore index d163863..cded043 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -build/ \ No newline at end of file +build/ +test/ \ No newline at end of file diff --git a/locationQuery.lua b/locationQuery.lua index b774934..c6ee7fa 100644 --- a/locationQuery.lua +++ b/locationQuery.lua @@ -4,7 +4,7 @@ local t = {} local math = math local hash = function( x, y, debug ) - local s = "h"..("%2d%2d"):format(math.floor( 0.5 + (180 + x) / 10 ), math.floor( 0.5 + (100 + y) / 10 ) ) + local s = "h"..("%2d%2d"):format(math.floor( 0.5 + (180 + x) / 20 ), math.floor( 0.5 + (100 + y) / 20 ) ) return s end diff --git a/travelNodes.lua b/travelNodes.lua index 31cc5fe..73b463b 100644 --- a/travelNodes.lua +++ b/travelNodes.lua @@ -22,7 +22,7 @@ local function isConnected( startNode, endNode ) for i = 1, n do ix, iy = ix + dx, iy + dy - if not( isSailable( ix, iy ) ) then return nil end + if not( isSailable( ix, -iy ) ) then return nil end end return true @@ -54,7 +54,7 @@ function t.load( filename, sailable ) if imgd:getPixel( x, 399 - y ) > 0 then local long = 360 * ( x - 800 ) / 800 - 360 / 2 + 360 local lat = 360 * ( 600 / 800 ) * ( 600 - y ) / 600 - 180 - nodes.nodes[n] = setmetatable({x = long, y = lat, idx = n}, mtTravelNode ) + nodes.nodes[n] = setmetatable({x = long, y = -lat, idx = n}, mtTravelNode ) print( nodes.nodes[n]:formatDisplayInfo() ) nodes.points[ 2 * n - 1 ] = long nodes.points[ 2 * n ] = lat @@ -96,7 +96,7 @@ function t.drawConnections( nodes ) for i, connection in pairs( nodes.connections ) do for j in pairs( connection ) do local ix, iy, fx, fy = nodes.nodes[i].x, nodes.nodes[i].y, nodes.nodes[j].x, nodes.nodes[j].y - lg.line( ix, iy, fx, fy ) + lg.line( ix, -iy, fx, -fy ) end end