From f55c9f415a081a175e48b51db894f23e59ce47a2 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sun, 18 Jun 2023 22:28:37 +0100 Subject: fix line lengths --- client/drawing2.lua | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'client/drawing2.lua') diff --git a/client/drawing2.lua b/client/drawing2.lua index c894e4c..800df78 100644 --- a/client/drawing2.lua +++ b/client/drawing2.lua @@ -21,8 +21,12 @@ do local function ve(n,f) return {cos(th(n)),sin(th(n)), f} end local function vi(n,f) return {ri*cos(th(n)),ri*sin(th(n)), f} end local function vo(n,f) return {ro*cos(th(n)),ro*sin(th(n)), f} end - local function apv(...) for _,x in ipairs({...}) do table.insert(vertices,x) end end - local function apm(...) for _,x in ipairs({...}) do table.insert(map,x) end end + local function apv(...) + for _,x in ipairs({...}) do table.insert(vertices,x) end + end + local function apm(...) + for _,x in ipairs({...}) do table.insert(map,x) end + end vertices[1] = {0,0, 1} for n=0,5 do apv(ve(n,1)) end @@ -88,7 +92,9 @@ vec4 position(mat4 transform_projection, vec4 vertex_position) { - vec2 instance_pos = vec2( floor(love_InstanceID/CHUNK_SIZE), mod(love_InstanceID, CHUNK_SIZE) ); + vec2 instance_pos = vec2( + floor(love_InstanceID/CHUNK_SIZE), + mod(love_InstanceID, CHUNK_SIZE) ); vertex_position.xy += hex_to_pos * instance_pos; float a = clamp( (zoom-zthr0)/zthrd, 0, 1); @@ -104,7 +110,8 @@ vec4 position(mat4 transform_projection, vec4 vertex_position) #pragma language glsl3 varying vec4 tcol; -vec4 effect(vec4 color, Image tex, vec2 texture_coords, vec2 screen_coords) +vec4 effect(vec4 color, Image tex, + vec2 texture_coords, vec2 screen_coords) { // return vec4(tcol.xyz,0.5); return tcol; @@ -133,7 +140,9 @@ local function draw_map(camera,map) local tl = htl:to_pos() local br = hbr:to_pos() - if br.x < cam_tl.x or cam_br.x < tl.x or br.y < cam_tl.y or cam_br.y < tl.y then + if br.x < cam_tl.x or cam_br.x < tl.x + or br.y < cam_tl.y or cam_br.y < tl.y + then -- definitely not visible on screen -- this does not catch every single nonvisible chunk goto next -- cgit v1.2.3