mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2026-03-22 03:56:13 +00:00
Reduce allocations in Background
This commit is contained in:
@@ -38,12 +38,21 @@ module CyberarmEngine
|
|||||||
origin_x = (@x + (@width / 2))
|
origin_x = (@x + (@width / 2))
|
||||||
origin_y = (@y + (@height / 2))
|
origin_y = (@y + (@height / 2))
|
||||||
|
|
||||||
points = [
|
# points = [
|
||||||
@top_left = Vector.new(@x, @y),
|
# @top_left = Vector.new(@x, @y),
|
||||||
@top_right = Vector.new(@x + @width, @y),
|
# @top_right = Vector.new(@x + @width, @y),
|
||||||
@bottom_left = Vector.new(@x, @y + @height),
|
# @bottom_left = Vector.new(@x, @y + @height),
|
||||||
@bottom_right = Vector.new(@x + @width, @y + @height)
|
# @bottom_right = Vector.new(@x + @width, @y + @height)
|
||||||
]
|
# ]
|
||||||
|
|
||||||
|
@top_left.x = @x
|
||||||
|
@top_left.y = @y
|
||||||
|
@top_right.x = @x + @width
|
||||||
|
@top_right.y = @y
|
||||||
|
@bottom_left.x = @x
|
||||||
|
@bottom_left.y = @y + @height
|
||||||
|
@bottom_right.x = @x + @width
|
||||||
|
@bottom_right.y = @y + @height
|
||||||
|
|
||||||
[@top_left, @top_right, @bottom_left, @bottom_right].each do |vector|
|
[@top_left, @top_right, @bottom_left, @bottom_right].each do |vector|
|
||||||
temp_x = vector.x - origin_x
|
temp_x = vector.x - origin_x
|
||||||
|
|||||||
Reference in New Issue
Block a user