Created
August 19, 2010 09:03
-
-
Save bil-bas/537441 to your computer and use it in GitHub Desktop.
Gosu::Image::as_devil
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gosu::Image::as_devil (including workaround for Gosu to_blob colour shift bug) | |
module Gosu | |
class Image | |
def as_devil | |
raise ArgumentError, "Must provide a block" unless block_given? | |
devil_image = Devil.from_blob(Image.from_blob(to_blob, width, height).to_blob, width, height) | |
yield devil_image | |
gosu_image = devil_image.to_gosu $window | |
devil_image.delete | |
gosu_image | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment