1. rude
  2. love

Commits

Alex Szpakowski  committed c19e47f

Made the no-game screen resizable (thanks Robin)

  • Participants
  • Parent commits c98670a
  • Branches default

Comments (1)

Files changed (2)

File src/scripts/boot.lua

View file
 		local img_w = rain.img_w
 		local img_h = rain.img_h
 
+		local batch_w = 2 * math.ceil(love.graphics.getWidth() / sx) + 2
+		local batch_h = 2 * math.ceil(love.graphics.getHeight() / sy) + 2
+
 		batch:clear()
+
+		if batch:getBufferSize() < batch_w * batch_h then
+			batch:setBufferSize(batch_w * batch_h)
+		end
+
 		batch:bind()
 
-		for i = 0,17 do
-			for j = 0,17 do
+		for i = 0, batch_h - 1 do
+			for j = 0, batch_w - 1 do
 				local is_even = (j % 2) == 0
 				local offset_y = is_even and sy * t or sy / 2 + sy * t
 				local x = ix + ox + j * sx
 		g_time = g_time + dt / 2
 		local int, frac = math.modf(g_time)
 		update_rain(frac)
+		inspector.x = love.graphics.getWidth() * 0.45
+		inspector.y = love.graphics.getHeight() * 0.55
 	end
 
 	local function draw_grid()
 		t.modules.sound = false
 		t.modules.physics = false
 		t.modules.joystick = false
+		t.window.resizable = true
 	end
 end
 

File src/scripts/boot.lua.h

View file
 	0x69, 0x6e, 0x2e, 0x69, 0x6d, 0x67, 0x5f, 0x77, 0x0a,
 	0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x69, 0x6d, 0x67, 0x5f, 0x68, 0x20, 0x3d, 0x20, 0x72, 0x61, 
 	0x69, 0x6e, 0x2e, 0x69, 0x6d, 0x67, 0x5f, 0x68, 0x0a,
+	0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x77, 0x20, 0x3d, 0x20, 
+	0x32, 0x20, 0x2a, 0x20, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x65, 0x69, 0x6c, 0x28, 0x6c, 0x6f, 0x76, 0x65, 
+	0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68, 
+	0x28, 0x29, 0x20, 0x2f, 0x20, 0x73, 0x78, 0x29, 0x20, 0x2b, 0x20, 0x32, 0x0a,
+	0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x68, 0x20, 0x3d, 0x20, 
+	0x32, 0x20, 0x2a, 0x20, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x65, 0x69, 0x6c, 0x28, 0x6c, 0x6f, 0x76, 0x65, 
+	0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 
+	0x74, 0x28, 0x29, 0x20, 0x2f, 0x20, 0x73, 0x79, 0x29, 0x20, 0x2b, 0x20, 0x32, 0x0a,
 	0x09, 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x3a, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x28, 0x29, 0x0a,
+	0x09, 0x09, 0x69, 0x66, 0x20, 0x62, 0x61, 0x74, 0x63, 0x68, 0x3a, 0x67, 0x65, 0x74, 0x42, 0x75, 0x66, 0x66, 
+	0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x28, 0x29, 0x20, 0x3c, 0x20, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x77, 
+	0x20, 0x2a, 0x20, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x68, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
+	0x09, 0x09, 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x3a, 0x73, 0x65, 0x74, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 
+	0x53, 0x69, 0x7a, 0x65, 0x28, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x77, 0x20, 0x2a, 0x20, 0x62, 0x61, 0x74, 
+	0x63, 0x68, 0x5f, 0x68, 0x29, 0x0a,
+	0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x3a, 0x62, 0x69, 0x6e, 0x64, 0x28, 0x29, 0x0a,
-	0x09, 0x09, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x31, 0x37, 0x20, 0x64, 0x6f, 0x0a,
-	0x09, 0x09, 0x09, 0x66, 0x6f, 0x72, 0x20, 0x6a, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x31, 0x37, 0x20, 0x64, 0x6f, 0x0a,
+	0x09, 0x09, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, 0x62, 0x61, 0x74, 0x63, 0x68, 
+	0x5f, 0x68, 0x20, 0x2d, 0x20, 0x31, 0x20, 0x64, 0x6f, 0x0a,
+	0x09, 0x09, 0x09, 0x66, 0x6f, 0x72, 0x20, 0x6a, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, 0x62, 0x61, 0x74, 0x63, 
+	0x68, 0x5f, 0x77, 0x20, 0x2d, 0x20, 0x31, 0x20, 0x64, 0x6f, 0x0a,
 	0x09, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x69, 0x73, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x20, 
 	0x3d, 0x20, 0x28, 0x6a, 0x20, 0x25, 0x20, 0x32, 0x29, 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x0a,
 	0x09, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x5f, 0x79, 
 	0x29, 0x0a,
 	0x09, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x61, 0x69, 0x6e, 0x28, 0x66, 0x72, 0x61, 0x63, 
 	0x29, 0x0a,
+	0x09, 0x09, 0x69, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 
+	0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x57, 0x69, 0x64, 
+	0x74, 0x68, 0x28, 0x29, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x34, 0x35, 0x0a,
+	0x09, 0x09, 0x69, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 
+	0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x48, 0x65, 0x69, 
+	0x67, 0x68, 0x74, 0x28, 0x29, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x35, 0x0a,
 	0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x72, 
 	0x61, 0x77, 0x5f, 0x67, 0x72, 0x69, 0x64, 0x28, 0x29, 0x0a,
 	0x73, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x0a,
 	0x09, 0x09, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6a, 0x6f, 0x79, 0x73, 0x74, 0x69, 
 	0x63, 0x6b, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x0a,
+	0x09, 0x09, 0x74, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x61, 0x62, 
+	0x6c, 0x65, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x0a,
 	0x09, 0x65, 0x6e, 0x64, 0x0a,
 	0x65, 0x6e, 0x64, 0x0a,
 	0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,