Mystro256 c4b98ff
From ab23031e0c2faecb77fde1be8a41d6f8ea4e6eda Mon Sep 17 00:00:00 2001
Mystro256 4e2795b
From: Mystro256 <alexjnewt at hotmail dot com>
Mystro256 c4b98ff
Date: Sun, 10 Jun 2018 21:19:23 -0400
Mystro256 c4b98ff
Subject: [PATCH] Love 11 support
Mystro256 c4b98ff
Mystro256 c4b98ff
---
Mystro256 c4b98ff
 conf.lua            | 2 +-
Mystro256 c4b98ff
 config.lua          | 6 +++---
Mystro256 c4b98ff
 highscore_entry.lua | 4 ++--
Mystro256 c4b98ff
 highscore_list.lua  | 4 ++--
Mystro256 c4b98ff
 ingame.lua          | 6 +++---
Mystro256 c4b98ff
 ingame_menu.lua     | 4 ++--
Mystro256 c4b98ff
 joystick.lua        | 4 ++--
Mystro256 c4b98ff
 main.lua            | 2 +-
Mystro256 c4b98ff
 resources.lua       | 4 ++--
Mystro256 c4b98ff
 util.lua            | 4 ++--
Mystro256 c4b98ff
 10 files changed, 20 insertions(+), 20 deletions(-)
Mystro256 c4b98ff
Mystro256 c4b98ff
diff --git a/conf.lua b/conf.lua
Mystro256 c4b98ff
index 8776da4..f00b216 100644
Mystro256 c4b98ff
--- a/conf.lua
Mystro256 c4b98ff
+++ b/conf.lua
Mystro256 c4b98ff
@@ -1,6 +1,6 @@
Mystro256 c4b98ff
 function love.conf(t)
Mystro256 c4b98ff
     t.identity = "mrrescue"
Mystro256 c4b98ff
-    t.version = "0.10.0"
Mystro256 c4b98ff
+    t.version = "11.0"
Mystro256 c4b98ff
     t.console = false
Mystro256 c4b98ff
     t.accelerometerjoystick = true
Mystro256 c4b98ff
     t.gammacorrect = false
Mystro256 c4b98ff
diff --git a/config.lua b/config.lua
Mystro256 c4b98ff
index 63eeb04..71c2b66 100644
Mystro256 c4b98ff
--- a/config.lua
Mystro256 c4b98ff
+++ b/config.lua
Mystro256 c4b98ff
@@ -38,7 +38,7 @@ function loadConfig()
Mystro256 c4b98ff
 			config[i] = v
Mystro256 c4b98ff
 		end
Mystro256 c4b98ff
 	end
Mystro256 c4b98ff
-	if love.filesystem.exists("settings") then
Mystro256 c4b98ff
+	if love.filesystem.getInfo("settings")~= nil then
Mystro256 c4b98ff
 		local data = love.filesystem.read("settings")
Mystro256 c4b98ff
 		local file = TSerial.unpack(data)
Mystro256 c4b98ff
 		for i,v in pairs(file) do
Mystro256 c4b98ff
@@ -52,7 +52,7 @@ function loadConfig()
Mystro256 c4b98ff
 end
Mystro256 c4b98ff
 
Mystro256 c4b98ff
 function loadHighscores()
Mystro256 c4b98ff
-	if love.filesystem.exists("highscores") then
Mystro256 c4b98ff
+	if love.filesystem.getInfo("highscores")~= nil then
Mystro256 c4b98ff
 		local data = love.filesystem.read("highscores")
Mystro256 c4b98ff
 		local file = TSerial.unpack(data)
Mystro256 c4b98ff
 		for i=1,3 do
Mystro256 c4b98ff
@@ -64,7 +64,7 @@ function loadHighscores()
Mystro256 c4b98ff
 end
Mystro256 c4b98ff
 
Mystro256 c4b98ff
 function loadStats()
Mystro256 c4b98ff
-	if love.filesystem.exists("stats") then
Mystro256 c4b98ff
+	if love.filesystem.getInfo("stats")~= nil then
Mystro256 c4b98ff
 		local data = love.filesystem.read("stats")
Mystro256 c4b98ff
 		stats = TSerial.unpack(data)
Mystro256 c4b98ff
 	end
Mystro256 c4b98ff
diff --git a/highscore_entry.lua b/highscore_entry.lua
Mystro256 c4b98ff
index 2f763af..3b3bb73 100644
Mystro256 c4b98ff
--- a/highscore_entry.lua
Mystro256 c4b98ff
+++ b/highscore_entry.lua
Mystro256 c4b98ff
@@ -45,9 +45,9 @@ function highscore_entry.draw()
Mystro256 c4b98ff
 		for ix = 1,10 do
Mystro256 c4b98ff
 			if highscore_entry.selection == char then
Mystro256 c4b98ff
 				lg.rectangle("fill", 33+ix*16, 66+iy*16, 14, 14)
Mystro256 c4b98ff
-				lg.setColor(0,0,0,255)
Mystro256 c4b98ff
+				lg.setColor(0,0,0,1)
Mystro256 c4b98ff
 				lg.print(KEYBOARD:sub(char,char), 37+ix*16, 70+iy*16)
Mystro256 c4b98ff
-				lg.setColor(255,255,255,255)
Mystro256 c4b98ff
+				lg.setColor(1,1,1,1)
Mystro256 c4b98ff
 			else
Mystro256 c4b98ff
 				lg.print(KEYBOARD:sub(char,char), 37+ix*16, 70+iy*16)
Mystro256 c4b98ff
 			end
Mystro256 c4b98ff
diff --git a/highscore_list.lua b/highscore_list.lua
Mystro256 c4b98ff
index 6a17973..b66d0e2 100644
Mystro256 c4b98ff
--- a/highscore_list.lua
Mystro256 c4b98ff
+++ b/highscore_list.lua
Mystro256 c4b98ff
@@ -31,10 +31,10 @@ function highscore_list.draw()
Mystro256 c4b98ff
 		if scores[i] then
Mystro256 c4b98ff
 			if highscore_list.level == highscore_list.hllevel
Mystro256 c4b98ff
 			and highscore_list.hlpos == i then
Mystro256 c4b98ff
-				lg.setColor(25,118,115,255)
Mystro256 c4b98ff
+				lg.setColor(25/255,118/255,115/255,1)
Mystro256 c4b98ff
 				lg.print(scores[i].name,   48, 14+i*16)
Mystro256 c4b98ff
 				lg.print(scores[i].score, 105, 14+i*16)
Mystro256 c4b98ff
-				lg.setColor(255,255,255,255)
Mystro256 c4b98ff
+				lg.setColor(1,1,1,1)
Mystro256 c4b98ff
 			else
Mystro256 c4b98ff
 				lg.print(scores[i].name,   48, 14+i*16)
Mystro256 c4b98ff
 				lg.print(scores[i].score, 105, 14+i*16)
Mystro256 c4b98ff
diff --git a/ingame.lua b/ingame.lua
Mystro256 c4b98ff
index 52004f1..f5c6f7c 100644
Mystro256 c4b98ff
--- a/ingame.lua
Mystro256 c4b98ff
+++ b/ingame.lua
Mystro256 c4b98ff
@@ -189,16 +189,16 @@ function ingame.draw()
Mystro256 c4b98ff
 		lg.pop()
Mystro256 c4b98ff
 
Mystro256 c4b98ff
 		if map.type == MT_NORMAL then
Mystro256 c4b98ff
-			lg.setBlendMode("multiply")
Mystro256 c4b98ff
+			lg.setBlendMode("multiply", "premultiplied")
Mystro256 c4b98ff
 			lg.draw(canvas, 0,0)
Mystro256 c4b98ff
 			lg.setBlendMode("alpha")
Mystro256 c4b98ff
 		end
Mystro256 c4b98ff
 
Mystro256 c4b98ff
 		-- Draw red screen if hit
Mystro256 c4b98ff
 		if player.heat > 0 then
Mystro256 c4b98ff
-			lg.setColor(255,255,255,cap(player.heat*255, 16, 255))
Mystro256 c4b98ff
+			lg.setColor(1,1,1,cap(player.heat*255, 16, 255)/255)
Mystro256 c4b98ff
 			lg.draw(img.red_screen, quad.red_screen, 0,0)
Mystro256 c4b98ff
-			lg.setColor(255,255,255,255)
Mystro256 c4b98ff
+			lg.setColor(1,1,1,1)
Mystro256 c4b98ff
 		end
Mystro256 c4b98ff
 
Mystro256 c4b98ff
 		-- Draw hud
Mystro256 c4b98ff
diff --git a/ingame_menu.lua b/ingame_menu.lua
Mystro256 c4b98ff
index 9fcf768..82a8459 100644
Mystro256 c4b98ff
--- a/ingame_menu.lua
Mystro256 c4b98ff
+++ b/ingame_menu.lua
Mystro256 c4b98ff
@@ -18,10 +18,10 @@ function ingame_menu.draw()
Mystro256 c4b98ff
 	lg.pop()
Mystro256 c4b98ff
 
Mystro256 c4b98ff
 	lg.scale(config.scale)
Mystro256 c4b98ff
-	lg.setColor(0,0,0,238)
Mystro256 c4b98ff
+	lg.setColor(0,0,0,238/255)
Mystro256 c4b98ff
 	lg.rectangle("fill", 0, 0, WIDTH, HEIGHT)
Mystro256 c4b98ff
 
Mystro256 c4b98ff
-	lg.setColor(255,255,255,255)
Mystro256 c4b98ff
+	lg.setColor(1,1,1,1)
Mystro256 c4b98ff
 	lg.printf("PAUSED", 0, 46, WIDTH, "center")
Mystro256 c4b98ff
 	lg.print("RESUME", 103, 92)
Mystro256 c4b98ff
 	lg.print("QUIT", 103, 106)
Mystro256 c4b98ff
diff --git a/joystick.lua b/joystick.lua
Mystro256 c4b98ff
index 50ccadb..72d545e 100644
Mystro256 c4b98ff
--- a/joystick.lua
Mystro256 c4b98ff
+++ b/joystick.lua
Mystro256 c4b98ff
@@ -22,11 +22,11 @@ function joystick.draw()
Mystro256 c4b98ff
 	lg.printf("SET JOYSTICK", 0, 39, WIDTH, "center")
Mystro256 c4b98ff
 	for i=1,4 do
Mystro256 c4b98ff
 		if joystick.waiting == true and joystick.selection == i then
Mystro256 c4b98ff
-			lg.setColor(195,52,41)
Mystro256 c4b98ff
+			lg.setColor(195/255,52/255,41/255)
Mystro256 c4b98ff
 		end
Mystro256 c4b98ff
 		lg.print(string.upper(joykeynames[i]), 65, 53+i*13)
Mystro256 c4b98ff
 		lg.print(config.joykeys[joykeynames[i]], 165, 53+i*13)
Mystro256 c4b98ff
-		lg.setColor(255,255,255)
Mystro256 c4b98ff
+		lg.setColor(1,1,1)
Mystro256 c4b98ff
 	end
Mystro256 c4b98ff
 	lg.print("DEFAULT", 65, 118)
Mystro256 c4b98ff
 	lg.print("BACK", 65, 131)
Mystro256 c4b98ff
diff --git a/main.lua b/main.lua
Mystro256 c4b98ff
index 9433e42..56096fa 100644
Mystro256 c4b98ff
--- a/main.lua
Mystro256 c4b98ff
+++ b/main.lua
Mystro256 c4b98ff
@@ -273,7 +273,7 @@ function love.releaseerrhand(msg)
Mystro256 c4b98ff
     local font = love.graphics.newFont(14)
Mystro256 c4b98ff
     love.graphics.setFont(font)
Mystro256 c4b98ff
 
Mystro256 c4b98ff
-    love.graphics.setColor(255, 255, 255, 255)
Mystro256 c4b98ff
+    love.graphics.setColor(1, 1, 1, 1)
Mystro256 c4b98ff
 
Mystro256 c4b98ff
     love.graphics.clear()
Mystro256 c4b98ff
 
Mystro256 c4b98ff
diff --git a/resources.lua b/resources.lua
Mystro256 c4b98ff
index e5aa70d..1bab520 100644
Mystro256 c4b98ff
--- a/resources.lua
Mystro256 c4b98ff
+++ b/resources.lua
Mystro256 c4b98ff
@@ -7,7 +7,7 @@ local snd = {}	-- sound Sources
Mystro256 c4b98ff
 
Mystro256 c4b98ff
 local IMAGE_FILES = {
Mystro256 c4b98ff
 	"splash", "tangram", "lovesplashpixel", "howto",
Mystro256 c4b98ff
-	"tiles", "door", "boldfont", "captain_dialog", "captain_dialog_sad",
Mystro256 c4b98ff
+	"tiles", "door", "captain_dialog", "captain_dialog_sad",
Mystro256 c4b98ff
 	"boss_health", "highscore_panes", "exclamation", "stats_screen",
Mystro256 c4b98ff
 	"awards", "hud", "hud2", "hud_people", "item_slots", "water_bar",
Mystro256 c4b98ff
 	"reserve_bar", "overloaded_bar", "temperature_bar", "temperature_bar_blink",
Mystro256 c4b98ff
@@ -147,7 +147,7 @@ function loadResources()
Mystro256 c4b98ff
 	img.stream:setWrap("repeat", "clamp")
Mystro256 c4b98ff
 
Mystro256 c4b98ff
 	-- Create fonts
Mystro256 c4b98ff
-	font.bold = lg.newImageFont(img.boldfont, " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!'-:*@<>+/_$&?", 2)
Mystro256 c4b98ff
+	font.bold = lg.newImageFont("data/boldfont.png", " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!'-:*@<>+/_$&?", 2)
Mystro256 c4b98ff
 	lg.setFont(font.bold)
Mystro256 c4b98ff
 
Mystro256 c4b98ff
 	-- Create quads
Mystro256 c4b98ff
diff --git a/util.lua b/util.lua
Mystro256 c4b98ff
index b9976da..656600a 100644
Mystro256 c4b98ff
--- a/util.lua
Mystro256 c4b98ff
+++ b/util.lua
Mystro256 c4b98ff
@@ -105,9 +105,9 @@ end
Mystro256 c4b98ff
 
Mystro256 c4b98ff
 
Mystro256 c4b98ff
 function drawBox(x,y,w,h)
Mystro256 c4b98ff
-	lg.setColor(30,23,18)
Mystro256 c4b98ff
+	lg.setColor(30/255,23/255,18/255)
Mystro256 c4b98ff
 	lg.rectangle("fill",x+1,y+1,w-2,h-2)
Mystro256 c4b98ff
-	lg.setColor(255,255,255)
Mystro256 c4b98ff
+	lg.setColor(1,1,1)
Mystro256 c4b98ff
 	-- Draw sides
Mystro256 c4b98ff
 	lg.draw(img.menu_box, quad.box_left, x, y+1, 0, 1, (h-2))
Mystro256 c4b98ff
 	lg.draw(img.menu_box, quad.box_left, x+w, y+1, 0, -1, (h-2))
Mystro256 c4b98ff
-- 
Mystro256 c4b98ff
2.14.4
Mystro256 c4b98ff