mirror of
https://github.com/bakpakin/tiny-ecs.git
synced 2026-07-22 07:56:52 -06:00
Love2D 11.3 port
This commit is contained in:
+3
-3
@@ -20,7 +20,7 @@ function MultiSource:cleanup(older_than)
|
||||
|
||||
for instance, lastPlayed in pairs(self.instances) do
|
||||
local age = now - lastPlayed
|
||||
if age > older_than and instance:isStopped() then
|
||||
if age > older_than and not instance:isPlaying() then
|
||||
self.instances[instance] = nil
|
||||
end
|
||||
end
|
||||
@@ -28,7 +28,7 @@ end
|
||||
|
||||
function MultiSource:getStoppedOrNewInstance()
|
||||
for instance in pairs(self.instances) do
|
||||
if instance:isStopped() then return instance end
|
||||
if not instance:isPlaying() then return instance end
|
||||
end
|
||||
return self.source:clone()
|
||||
end
|
||||
@@ -88,4 +88,4 @@ multisource.new = function(source)
|
||||
return setmetatable({source = source, instances = {}}, MultiSourceMt)
|
||||
end
|
||||
|
||||
return multisource
|
||||
return multisource
|
||||
|
||||
+6
-6
@@ -876,9 +876,9 @@ function Map:draw()
|
||||
end
|
||||
|
||||
function Map:drawLayer(layer)
|
||||
framework.setColor(255, 255, 255, 255 * layer.opacity)
|
||||
framework.setColor(1, 1, 1, layer.opacity)
|
||||
layer:draw()
|
||||
framework.setColor(255, 255, 255, 255)
|
||||
framework.setColor(1, 1, 1, 1)
|
||||
end
|
||||
|
||||
function Map:drawTileLayer(layer)
|
||||
@@ -919,10 +919,10 @@ function Map:drawObjectLayer(layer)
|
||||
|
||||
assert(layer.type == "objectgroup", "Invalid layer type: " .. layer.type .. ". Layer must be of type: objectgroup")
|
||||
|
||||
local line = { 160, 160, 160, 255 * layer.opacity }
|
||||
local fill = { 160, 160, 160, 255 * layer.opacity * 0.2 }
|
||||
local shadow = { 0, 0, 0, 255 * layer.opacity }
|
||||
local reset = { 255, 255, 255, 255 * layer.opacity }
|
||||
local line = { 0.63, 0.63, 0.63, layer.opacity }
|
||||
local fill = { 0.63, 0.63, 0.63, layer.opacity * 0.2 }
|
||||
local shadow = { 0, 0, 0, layer.opacity }
|
||||
local reset = { 1, 1, 1, layer.opacity }
|
||||
|
||||
local function sortVertices(obj)
|
||||
local vertices = {{},{}}
|
||||
|
||||
Reference in New Issue
Block a user