mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2026-03-29 07:06:13 +00:00
Reduce usages of Gosu.clip_to in Background
This commit is contained in:
@@ -21,7 +21,18 @@ module CyberarmEngine
|
|||||||
end
|
end
|
||||||
|
|
||||||
def draw
|
def draw
|
||||||
|
if @angle.zero?
|
||||||
|
render
|
||||||
|
else
|
||||||
Gosu.clip_to(@x, @y, @width, @height) do
|
Gosu.clip_to(@x, @y, @width, @height) do
|
||||||
|
render
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
debug_outline if @debug
|
||||||
|
end
|
||||||
|
|
||||||
|
def render
|
||||||
Gosu.draw_quad(
|
Gosu.draw_quad(
|
||||||
@top_left.x, @top_left.y, @paint.top_left,
|
@top_left.x, @top_left.y, @paint.top_left,
|
||||||
@top_right.x, @top_right.y, @paint.top_right,
|
@top_right.x, @top_right.y, @paint.top_right,
|
||||||
@@ -31,9 +42,6 @@ module CyberarmEngine
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
debug_outline if @debug
|
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@top_left.x = @x
|
@top_left.x = @x
|
||||||
@top_left.y = @y
|
@top_left.y = @y
|
||||||
@@ -146,13 +154,3 @@ module CyberarmEngine
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Add <=> method to support Range based gradients
|
|
||||||
# NOTE: Disabled, causes stack overflow 🙃
|
|
||||||
# module Gosu
|
|
||||||
# class Color
|
|
||||||
# def <=>(_other)
|
|
||||||
# self
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|||||||
Reference in New Issue
Block a user