diff options
author | ubq323 <ubq323@ubq323.website> | 2023-06-19 05:36:12 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2023-06-19 05:36:12 +0100 |
commit | abc57f1c5a4fcf90acc650989f3dbf52b7609e9a (patch) | |
tree | bebee9469fae4aaf26216478ab66b7c332cde1d3 /client | |
parent | 16f350963e8b696690534cab2fd3b6eb681731c1 (diff) |
fix trailing whitespace
Diffstat (limited to 'client')
-rw-r--r-- | client/drawing2.lua | 9 | ||||
-rw-r--r-- | client/game.lua | 80 | ||||
-rw-r--r-- | client/movement.lua | 2 |
3 files changed, 43 insertions, 48 deletions
diff --git a/client/drawing2.lua b/client/drawing2.lua index 5c39a93..aade7d5 100644 --- a/client/drawing2.lua +++ b/client/drawing2.lua @@ -27,7 +27,7 @@ do 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 for n=0,5 do apv(vi(n,0)) end @@ -99,11 +99,11 @@ vec4 position(mat4 transform_projection, vec4 vertex_position) float a = clamp( (zoom-zthr0)/zthrd, 0, 1); a = max(fillness, a); - + int tidx = int(tile_type); tcol = (tidx == 0) ? vec4(0.0) : vec4(fillness*colors[tidx], a); - - + + return transform_projection * vertex_position; } ]],[[ @@ -147,7 +147,6 @@ local function draw_map(camera,map) -- luacheck: no redefined -- this does not catch every single nonvisible chunk goto next end - set_imesh(ch.imesh) love.graphics.drawInstanced(shape_mesh, count, tl.x, tl.y) diff --git a/client/game.lua b/client/game.lua index 081bcb7..1a6cd54 100644 --- a/client/game.lua +++ b/client/game.lua @@ -95,7 +95,6 @@ function SCENE.keypressed(key,scancode,isrepeat) if boffs then this_chatmsg = this_chatmsg:sub(1,boffs-1) end - end end end @@ -263,7 +262,6 @@ local function update(dt) map:remove_chunk(cp) end end - handle_net() end @@ -271,7 +269,7 @@ end local function draw() love.graphics.clear(1,1,1) love.graphics.origin() - + camera.pos = local_player.pos camera:apply_trans() @@ -306,7 +304,6 @@ local function draw() love.graphics.polygon("line",verts) end - love.graphics.origin() -- selected tile (temp) @@ -316,45 +313,44 @@ local function draw() if _G.debugmode and local_player then util.print_good(table.concat({ - "ms "..tostring(sm), - "mw "..tostring(wm), - "mh "..tostring(hm).." "..tostring(hm:round()), - "", - "pw "..tostring(local_player.pos), - "ph "..tostring(local_player.pos:to_hex()).." " + "ms "..tostring(sm), + "mw "..tostring(wm), + "mh "..tostring(hm).." "..tostring(hm:round()), + "", + "pw "..tostring(local_player.pos), + "ph "..tostring(local_player.pos:to_hex()).." " ..tostring(local_player.pos:to_hex():round()), - "", - "voob "..tostring(camera.zoom), - "", - "fps "..tostring(love.timer.getFPS()), - "ping "..tostring(peer:round_trip_time()), - "", - "res"..W.."x"..H, - - },"\n"),10,10) - end - - if show_controls then - util.print_good(help_text,"center","center") - end - - msgbox.draw() - - if ui_mode ~= "normal" then - util.print_good(ui_mode, -20,10) - end - - if ui_mode == "chat" then - chatmsg_text:set("- "..this_chatmsg) - local tw,th = chatmsg_text:getDimensions() - local y = H-th-30 - love.graphics.setColor(0,0,0,0.8) - love.graphics.rectangle("fill",0,y,W,th) - love.graphics.setColor(1,1,1) - love.graphics.draw(chatmsg_text,0,y) - love.graphics.setColor(0.8,0.8,0.8) - love.graphics.line(tw,y,tw,y+th) - end + "", + "voob "..tostring(camera.zoom), + "", + "fps "..tostring(love.timer.getFPS()), + "ping "..tostring(peer:round_trip_time()), + "", + "res"..W.."x"..H, + },"\n"),10,10) + end + + if show_controls then + util.print_good(help_text,"center","center") + end + + msgbox.draw() + + if ui_mode ~= "normal" then + util.print_good(ui_mode, -20,10) + end + + if ui_mode == "chat" then + chatmsg_text:set("- "..this_chatmsg) + local tw,th = chatmsg_text:getDimensions() + local y = H-th-30 + love.graphics.setColor(0,0,0,0.8) + love.graphics.rectangle("fill",0,y,W,th) + love.graphics.setColor(1,1,1) + love.graphics.draw(chatmsg_text,0,y) + love.graphics.setColor(0.8,0.8,0.8) + love.graphics.line(tw,y,tw,y+th) + end end local connected = false diff --git a/client/movement.lua b/client/movement.lua index 5cc6b85..7135f28 100644 --- a/client/movement.lua +++ b/client/movement.lua @@ -17,7 +17,7 @@ local function iqz_hex_sdgf(px,py, r) px = math.abs(px) py = math.abs(py) local w = kx*px+ky*py - + local _1 = 2*math.min(w,0) px = px - _1*kx py = py - _1*ky |