diff --git a/generate_textures.lua b/generate_textures.lua index 4007428..bc95ba5 100644 --- a/generate_textures.lua +++ b/generate_textures.lua @@ -47,3 +47,14 @@ local pixels = { { _, _, _, _, _, _, _ }, } tga_encoder.image(pixels):save("textures/xmaps_dot_small.tga") + +local pixels = { + { _, _, _, _, _, _, _ }, + { _, _, _, _, _, _, _ }, + { _, _, _, K, K, _, _ }, + { _, _, K, W, W, K, _ }, + { _, _, K, W, W, K, _ }, + { _, _, _, K, K, _, _ }, + { _, _, _, _, _, _, _ }, +} +tga_encoder.image(pixels):save("textures/xmaps_dot_tiny.tga") diff --git a/init.lua b/init.lua index 1d60c76..b4961c6 100644 --- a/init.lua +++ b/init.lua @@ -637,37 +637,60 @@ xmaps.show_map_hud = function(player) local marker local dot_large = "xmaps_dot_large.tga" .. "^[makealpha:1,1,1" local dot_small = "xmaps_dot_small.tga" .. "^[makealpha:1,1,1" + local dot_tiny = "xmaps_dot_tiny.tga" .. "^[makealpha:1,1,1" if pos.x < minp.x then - if minp.x - pos.x < size then + if minp.x - pos.x < size * 2 then marker = dot_large - else + elseif minp.x - pos.x < size * 4 then marker = dot_small + else + marker = dot_tiny end pos.x = minp.x elseif pos.x > maxp.x then - if pos.x - maxp.x < size then + if pos.x - maxp.x < size * 2 then marker = dot_large - else + elseif pos.x - maxp.x < size * 4 then marker = dot_small + else + marker = dot_tiny end pos.x = maxp.x end - -- we never override the small marker + -- we never override a smaller marker -- yes, this is a literal corner case if pos.z < minp.z then - if minp.z - pos.z < 256 and marker ~= dot_small then + if ( + minp.z - pos.z < size * 2 and + marker ~= dot_small and + marker ~= dot_tiny + ) then marker = dot_large - else + elseif ( + minp.z - pos.z < size * 4 and + marker ~= dot_tiny + ) then marker = dot_small + else + marker = dot_tiny end pos.z = minp.z elseif pos.z > maxp.z then - if pos.z - maxp.z < 256 and marker ~= dot_small then + if ( + pos.z - maxp.z < size * 2 and + marker ~= dot_small and + marker ~= dot_tiny + ) then marker = dot_large - else + elseif ( + pos.z - maxp.z < size * 4 and + marker ~= dot_tiny + ) then marker = dot_small + else + marker = dot_tiny end pos.z = maxp.z end diff --git a/textures/xmaps_dot_tiny.tga b/textures/xmaps_dot_tiny.tga new file mode 100644 index 0000000..335a5c2 Binary files /dev/null and b/textures/xmaps_dot_tiny.tga differ