mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-15 04:32:35 +00:00
Update to support Gosu 2.0.0 (Gosu::Image taking in a Gosu::Image fails)
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
module CyberarmEngine
|
module CyberarmEngine
|
||||||
module Common
|
module Common
|
||||||
|
ImageBlob = Data.define(:to_blob, :columns, :rows)
|
||||||
|
|
||||||
def push_state(klass, options = {})
|
def push_state(klass, options = {})
|
||||||
window.push_state(klass, options)
|
window.push_state(klass, options)
|
||||||
end
|
end
|
||||||
@@ -85,7 +87,8 @@ module CyberarmEngine
|
|||||||
unless asset
|
unless asset
|
||||||
instance = nil
|
instance = nil
|
||||||
instance = if klass == Gosu::Image
|
instance = if klass == Gosu::Image
|
||||||
klass.new(path, retro: retro, tileable: tileable)
|
path_or_blob = path.is_a?(String) ? path : ImageBlob.new(path.to_blob, path.width, path.height)
|
||||||
|
klass.new(path_or_blob, retro: retro, tileable: tileable)
|
||||||
else
|
else
|
||||||
klass.new(path)
|
klass.new(path)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user