diff options
| author | Tom Black <[email protected]> | 2018-09-29 17:45:36 -0700 |
|---|---|---|
| committer | Tom Black <[email protected]> | 2018-09-29 17:45:36 -0700 |
| commit | 8d5c566d17fa719b8b940b5cbb468eb16a176c86 (patch) | |
| tree | fa707d58e60a78459d99ee5865be1c7042bde2e5 /lib | |
| parent | 04c5441976a4bc90a076e97a4d30aef26d8477d4 (diff) | |
| download | ruby2d-build-wasm.tar.gz ruby2d-build-wasm.zip | |
Build for WebAssembly, first passbuild-wasm
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/ruby2d/image.rb | 6 | ||||
| -rw-r--r-- | lib/ruby2d/music.rb | 6 | ||||
| -rw-r--r-- | lib/ruby2d/sound.rb | 6 | ||||
| -rw-r--r-- | lib/ruby2d/sprite.rb | 8 | ||||
| -rw-r--r-- | lib/ruby2d/text.rb | 6 | ||||
| -rw-r--r-- | lib/ruby2d/window.rb | 6 |
6 files changed, 13 insertions, 25 deletions
diff --git a/lib/ruby2d/image.rb b/lib/ruby2d/image.rb index 9386f6b..2ee9ef3 100644 --- a/lib/ruby2d/image.rb +++ b/lib/ruby2d/image.rb @@ -10,10 +10,8 @@ module Ruby2D def initialize(opts = {}) @path = opts[:path] - unless RUBY_ENGINE == 'opal' - unless File.exists? @path - raise Error, "Cannot find image file `#{@path}`" - end + unless File.exists? @path + raise Error, "Cannot find image file `#{@path}`" end @x = opts[:x] || 0 diff --git a/lib/ruby2d/music.rb b/lib/ruby2d/music.rb index 41b8901..b9fa8ad 100644 --- a/lib/ruby2d/music.rb +++ b/lib/ruby2d/music.rb @@ -8,10 +8,8 @@ module Ruby2D def initialize(path) - unless RUBY_ENGINE == 'opal' - unless File.exists? path - raise Error, "Cannot find audio file `#{path}`" - end + unless File.exists? path + raise Error, "Cannot find audio file `#{path}`" end @path = path diff --git a/lib/ruby2d/sound.rb b/lib/ruby2d/sound.rb index c1d4060..07043a9 100644 --- a/lib/ruby2d/sound.rb +++ b/lib/ruby2d/sound.rb @@ -8,10 +8,8 @@ module Ruby2D def initialize(path) - unless RUBY_ENGINE == 'opal' - unless File.exists? path - raise Error, "Cannot find audio file `#{path}`" - end + unless File.exists? path + raise Error, "Cannot find audio file `#{path}`" end @path = path diff --git a/lib/ruby2d/sprite.rb b/lib/ruby2d/sprite.rb index a00617f..934fac7 100644 --- a/lib/ruby2d/sprite.rb +++ b/lib/ruby2d/sprite.rb @@ -9,11 +9,9 @@ module Ruby2D def initialize(path, opts = {}) - # Check if sprite file exists, unless running on the web - unless RUBY_ENGINE == 'opal' - unless File.exists? path - raise Error, "Cannot find sprite image file `#{path}`" - end + # Check if sprite file exists + unless File.exists? path + raise Error, "Cannot find sprite image file `#{path}`" end # Sprite image file path diff --git a/lib/ruby2d/text.rb b/lib/ruby2d/text.rb index 1b2207d..4d1d74c 100644 --- a/lib/ruby2d/text.rb +++ b/lib/ruby2d/text.rb @@ -16,10 +16,8 @@ module Ruby2D @rotate = opts[:rotate] || 0 @font = opts[:font] - unless RUBY_ENGINE == 'opal' - unless File.exists? @font - raise Error, "Cannot find font file `#{@font}`" - end + unless File.exists? @font + raise Error, "Cannot find font file `#{@font}`" end self.color = opts[:color] || 'white' diff --git a/lib/ruby2d/window.rb b/lib/ruby2d/window.rb index 5b0b7cb..c610d0f 100644 --- a/lib/ruby2d/window.rb +++ b/lib/ruby2d/window.rb @@ -320,10 +320,8 @@ module Ruby2D # Add controller mappings from file def add_controller_mappings - unless RUBY_ENGINE == 'opal' - if File.exists? @controller_mappings - ext_add_controller_mappings(@controller_mappings) - end + if File.exists? @controller_mappings + ext_add_controller_mappings(@controller_mappings) end end |
