Skip to content

Commit e0b29a0

Browse files
committed
Luven v1.11
Little correction that dispose lightShapes too in the Luven.dispose() function.
1 parent 2a5f01b commit e0b29a0

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

luven/luven.lua

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
local luven = {
2-
_VERSION = 'Luven v1.1',
2+
_VERSION = 'Luven v1.11',
33
_URL = 'https://github.com/chicogamedev/Luven',
44
_DESCRIPTION = 'A minimalist light engine for Löve2D',
55
_CONTRIBUTORS = 'Lionel Leeser, Pedro Gimeno (Help with camera)',
@@ -342,7 +342,7 @@ function luven.drawEnd()
342342
if (useIntegratedCamera) then
343343
luven.camera:unset()
344344
end -- if
345-
345+
346346
lg.setBlendMode("multiply", "premultiplied")
347347
lgDraw(lightMap)
348348
lg.setBlendMode("alpha")
@@ -356,6 +356,7 @@ function luven.dispose()
356356
end -- for
357357

358358
clearTable(currentLights)
359+
clearTable(luven.lightShapes)
359360

360361
lightMap:release()
361362
end -- if
@@ -397,7 +398,7 @@ function luven.addNormalLight(x, y, color, power, lightShape, angle, sx, sy)
397398

398399
local id = getNextId()
399400
local light = currentLights[id]
400-
401+
401402
clearTable(light)
402403

403404
light.id = id
@@ -442,10 +443,10 @@ function luven.addFlickeringLight(x, y, colorRange, powerRange, speedRange, ligh
442443
assertType(functionName, "angle", angle, "number")
443444
assertPositiveNumber(functionName, "sx", sx)
444445
assertPositiveNumber(functionName, "sy", sy)
445-
446+
446447
local id = getNextId()
447448
local light = currentLights[id]
448-
449+
449450
clearTable(light)
450451

451452
light.id = id
@@ -503,7 +504,7 @@ function luven.addFlashingLight(x, y, color, maxPower, speed, lightShape, angle,
503504
light.power = 0
504505
light.type = lightTypes.flashing
505506
light.shape = lightShape
506-
507+
507508
light.maxPower = maxPower
508509
light.speed = speed
509510
light.timer = 0
@@ -566,4 +567,4 @@ function luven.getLightScale(lightId)
566567
return currentLights[lightId].scaleX, currentLights[lightId].scaleY
567568
end -- function
568569

569-
return luven
570+
return luven

0 commit comments

Comments
 (0)