Skip to content

Commit

Permalink
map pixel draw
Browse files Browse the repository at this point in the history
  • Loading branch information
spectrenoir06 committed May 31, 2020
1 parent 3da9c80 commit f8eb8fe
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 28 deletions.
50 changes: 25 additions & 25 deletions UI/settings/pixel_map.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,31 +124,31 @@ function pixel_map:reload()
local channel_data = love.thread.getChannel("data")
channel_data:push({type = "map", data = mapping.map})

-- for x=1,mapping.lx do
-- for y=1,mapping.ly do
-- local v
-- if self.map[x] then
-- v = self.map[x][y]
-- end
-- if v and v.id ~=-1 then
-- local ur,ug,ub = hslToRgb((v.uni/8)%1,1,l-( (v.id%170)/170) * (l * 0.8) )
--
-- love.graphics.setColor(ur, ug, ub)
-- love.graphics.rectangle("fill", v.x*24, v.y*24, 24, 24)
-- love.graphics.setColor(0.2,0.2,0.2,1)
-- love.graphics.rectangle("line", v.x*24, v.y*24, 24, 24)
-- love.graphics.setColor(0,0,0,1)
-- love.graphics.print(v.id, v.x*24-small_font:getWidth(v.id)/2+12+1, v.y*24+5+1)
-- love.graphics.setColor(1,1,1,1)
-- love.graphics.print(v.id, v.x*24-small_font:getWidth(v.id)/2+12, v.y*24+5)
-- else
-- love.graphics.setColor(0.85,0.85,0.85)
-- love.graphics.rectangle("fill", (x-1)*24, (y-1)*24, 24, 24)
-- love.graphics.setColor(0.2,0.2,0.2,1)
-- love.graphics.rectangle("line", (x-1)*24, (y-1)*24, 24, 24)
-- end
-- end
-- end
for x=1,mapping.lx do
for y=1,mapping.ly do
local v
if self.map[x] then
v = self.map[x][y]
end
if v and v.id ~=-1 then
local ur,ug,ub = hslToRgb((v.uni/8)%1,1,l-( (v.id%170)/170) * (l * 0.8) )

love.graphics.setColor(ur, ug, ub)
love.graphics.rectangle("fill", v.x*24, v.y*24, 24, 24)
love.graphics.setColor(0.2,0.2,0.2,1)
love.graphics.rectangle("line", v.x*24, v.y*24, 24, 24)
love.graphics.setColor(0,0,0,1)
love.graphics.print(v.id, v.x*24-small_font:getWidth(v.id)/2+12+1, v.y*24+5+1)
love.graphics.setColor(1,1,1,1)
love.graphics.print(v.id, v.x*24-small_font:getWidth(v.id)/2+12, v.y*24+5)
else
love.graphics.setColor(0.85,0.85,0.85)
love.graphics.rectangle("fill", (x-1)*24, (y-1)*24, 24, 24)
love.graphics.setColor(0.2,0.2,0.2,1)
love.graphics.rectangle("line", (x-1)*24, (y-1)*24, 24, 24)
end
end
end
love.graphics.setCanvas()
end

Expand Down
5 changes: 2 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
releases/LED-Master.love: main.lua conf.lua UI/ lib/
love-release -b

releases/LED-Master.apk: clean_love
love-release

releases/LED-Master.apk: releases/LED-Master.love
mv releases/LED-Master.love ../love2apk/love_decoded/assets/game.love
cp ressource/AndroidManifest.xml ../love2apk/love_decoded/
apktool b -o releases/LED-Master.apk ../love2apk/love_decoded
Expand Down

0 comments on commit f8eb8fe

Please sign in to comment.