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]) 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