mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-26 07:34:35 +00:00
Added vec2 support for multiple concurrent release to pool
This commit is contained in:
parent
b5d3707939
commit
bcd94c134e
5
vec2.lua
5
vec2.lua
@ -92,10 +92,13 @@ function vec2:pooled_copy()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--release a vector to the pool
|
--release a vector to the pool
|
||||||
function vec2:release()
|
function vec2:release(...)
|
||||||
if vec2.pool_size() < _vec2_pool_limit then
|
if vec2.pool_size() < _vec2_pool_limit then
|
||||||
table.insert(_vec2_pool, self)
|
table.insert(_vec2_pool, self)
|
||||||
end
|
end
|
||||||
|
if ... then
|
||||||
|
vec2.release(...)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--unpack for multi-args
|
--unpack for multi-args
|
||||||
|
Loading…
Reference in New Issue
Block a user