From efcc734f15b6822526cf987fec49399196690735 Mon Sep 17 00:00:00 2001 From: kawasakikou Date: Wed, 29 Jul 2015 13:39:07 +0900 Subject: [PATCH 1/2] It has to pass the surface as an argument --- lib/dxruby_sdl/image.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dxruby_sdl/image.rb b/lib/dxruby_sdl/image.rb index b7877fa..8f65bff 100644 --- a/lib/dxruby_sdl/image.rb +++ b/lib/dxruby_sdl/image.rb @@ -115,7 +115,7 @@ def box_fill(x1, y1, x2, y2, color) end def draw(x, y, image, x1 = 0, y1 = 0, width = image.width, height = image.height) - SDL.blitSurface(image, x1, y1, width, height, self, x, y) + SDL.blitSurface(image._surface, x1, y1, width, height, self._surface, x, y) end def draw_font(x, y, string, font, color = [255, 255, 255]) From f3468d81c0aa6cc70611ab68311a307ce7bd1c0c Mon Sep 17 00:00:00 2001 From: kawasakikou Date: Wed, 29 Jul 2015 13:41:13 +0900 Subject: [PATCH 2/2] fix argument to image --- spec/lib/dxruby_sdl/image_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/lib/dxruby_sdl/image_spec.rb b/spec/lib/dxruby_sdl/image_spec.rb index 2f4113e..5a7df41 100644 --- a/spec/lib/dxruby_sdl/image_spec.rb +++ b/spec/lib/dxruby_sdl/image_spec.rb @@ -213,7 +213,7 @@ end describe SDL do - it { expect(SDL).to have_received(:blitSurface).with( dest_image, 0, 0, dest_image.width, dest_image.height, source_image, 0, 0).once } + it { expect(SDL).to have_received(:blitSurface).with( dest_image._surface, 0, 0, dest_image.width, dest_image.height, source_image._surface, 0, 0).once } end end @@ -228,7 +228,7 @@ end describe SDL do - it { expect(SDL).to have_received(:blitSurface).with(dest_image, 100, 200, 300, 400, source_image, 0, 0).once } + it { expect(SDL).to have_received(:blitSurface).with(dest_image._surface, 100, 200, 300, 400, source_image._surface, 0, 0).once } end end end