ruby2d 0.10.0 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/assets/include/SDL2/SDL.h +108 -14
- data/assets/include/SDL2/SDL_assert.h +81 -50
- data/assets/include/SDL2/SDL_atomic.h +135 -35
- data/assets/include/SDL2/SDL_audio.h +960 -355
- data/assets/include/SDL2/SDL_bits.h +11 -6
- data/assets/include/SDL2/SDL_blendmode.h +91 -14
- data/assets/include/SDL2/SDL_clipboard.h +30 -7
- data/assets/include/SDL2/SDL_config.h +3 -1
- data/assets/include/SDL2/SDL_config_android.h +11 -1
- data/assets/include/SDL2/SDL_config_emscripten.h +216 -0
- data/assets/include/SDL2/SDL_config_iphoneos.h +9 -1
- data/assets/include/SDL2/SDL_config_macosx.h +16 -2
- data/assets/include/SDL2/SDL_config_minimal.h +4 -1
- data/assets/include/SDL2/SDL_config_os2.h +37 -20
- data/assets/include/SDL2/SDL_config_pandora.h +6 -1
- data/assets/include/SDL2/SDL_config_psp.h +8 -8
- data/assets/include/SDL2/SDL_config_windows.h +39 -22
- data/assets/include/SDL2/SDL_config_winrt.h +23 -8
- data/assets/include/SDL2/SDL_config_wiz.h +6 -1
- data/assets/include/SDL2/SDL_copying.h +1 -1
- data/assets/include/SDL2/SDL_cpuinfo.h +331 -71
- data/assets/include/SDL2/SDL_egl.h +906 -280
- data/assets/include/SDL2/SDL_endian.h +101 -47
- data/assets/include/SDL2/SDL_error.h +70 -19
- data/assets/include/SDL2/SDL_events.h +387 -79
- data/assets/include/SDL2/SDL_filesystem.h +73 -64
- data/assets/include/SDL2/SDL_gamecontroller.h +585 -125
- data/assets/include/SDL2/SDL_gesture.h +36 -6
- data/assets/include/SDL2/SDL_haptic.h +304 -210
- data/assets/include/SDL2/SDL_hidapi.h +451 -0
- data/assets/include/SDL2/SDL_hints.h +1286 -897
- data/assets/include/SDL2/SDL_joystick.h +577 -130
- data/assets/include/SDL2/SDL_keyboard.h +162 -63
- data/assets/include/SDL2/SDL_keycode.h +7 -5
- data/assets/include/SDL2/SDL_loadso.h +42 -8
- data/assets/include/SDL2/SDL_locale.h +34 -32
- data/assets/include/SDL2/SDL_log.h +212 -19
- data/assets/include/SDL2/SDL_main.h +72 -17
- data/assets/include/SDL2/SDL_messagebox.h +70 -23
- data/assets/include/SDL2/SDL_metal.h +27 -32
- data/assets/include/SDL2/SDL_misc.h +19 -15
- data/assets/include/SDL2/SDL_mouse.h +262 -110
- data/assets/include/SDL2/SDL_mutex.h +286 -66
- data/assets/include/SDL2/SDL_name.h +1 -1
- data/assets/include/SDL2/SDL_opengl.h +1 -1
- data/assets/include/SDL2/SDL_opengles.h +1 -1
- data/assets/include/SDL2/SDL_opengles2.h +2 -2
- data/assets/include/SDL2/SDL_pixels.h +199 -34
- data/assets/include/SDL2/SDL_platform.h +39 -2
- data/assets/include/SDL2/SDL_power.h +23 -10
- data/assets/include/SDL2/SDL_quit.h +1 -1
- data/assets/include/SDL2/SDL_rect.h +78 -28
- data/assets/include/SDL2/SDL_render.h +1204 -472
- data/assets/include/SDL2/SDL_revision.h +2 -2
- data/assets/include/SDL2/SDL_rwops.h +605 -33
- data/assets/include/SDL2/SDL_scancode.h +1 -1
- data/assets/include/SDL2/SDL_sensor.h +76 -42
- data/assets/include/SDL2/SDL_shape.h +38 -27
- data/assets/include/SDL2/SDL_stdinc.h +96 -24
- data/assets/include/SDL2/SDL_surface.h +571 -139
- data/assets/include/SDL2/SDL_system.h +339 -101
- data/assets/include/SDL2/SDL_syswm.h +50 -20
- data/assets/include/SDL2/SDL_test.h +1 -1
- data/assets/include/SDL2/SDL_test_assert.h +2 -2
- data/assets/include/SDL2/SDL_test_common.h +23 -6
- data/assets/include/SDL2/SDL_test_compare.h +1 -1
- data/assets/include/SDL2/SDL_test_crc32.h +1 -1
- data/assets/include/SDL2/SDL_test_font.h +3 -3
- data/assets/include/SDL2/SDL_test_fuzzer.h +28 -26
- data/assets/include/SDL2/SDL_test_harness.h +6 -6
- data/assets/include/SDL2/SDL_test_images.h +1 -1
- data/assets/include/SDL2/SDL_test_log.h +1 -1
- data/assets/include/SDL2/SDL_test_md5.h +1 -1
- data/assets/include/SDL2/SDL_test_memory.h +1 -1
- data/assets/include/SDL2/SDL_test_random.h +2 -2
- data/assets/include/SDL2/SDL_thread.h +226 -128
- data/assets/include/SDL2/SDL_timer.h +129 -22
- data/assets/include/SDL2/SDL_touch.h +48 -8
- data/assets/include/SDL2/SDL_ttf.h +102 -9
- data/assets/include/SDL2/SDL_types.h +1 -1
- data/assets/include/SDL2/SDL_version.h +72 -46
- data/assets/include/SDL2/SDL_video.h +1266 -460
- data/assets/include/SDL2/SDL_vulkan.h +100 -161
- data/assets/include/SDL2/begin_code.h +22 -1
- data/assets/include/SDL2/close_code.h +1 -1
- data/assets/include/mrbconf.h +234 -0
- data/assets/include/mruby/array.h +317 -0
- data/assets/include/mruby/boxing_nan.h +130 -0
- data/assets/include/mruby/boxing_no.h +58 -0
- data/assets/include/mruby/boxing_word.h +205 -0
- data/assets/include/mruby/class.h +108 -0
- data/assets/include/mruby/common.h +92 -0
- data/assets/include/mruby/compile.h +210 -0
- data/assets/include/mruby/data.h +76 -0
- data/assets/include/mruby/debug.h +66 -0
- data/assets/include/mruby/dump.h +158 -0
- data/assets/include/mruby/endian.h +44 -0
- data/assets/include/mruby/error.h +137 -0
- data/assets/include/mruby/gc.h +92 -0
- data/assets/include/mruby/hash.h +242 -0
- data/assets/include/mruby/irep.h +147 -0
- data/assets/include/mruby/istruct.h +50 -0
- data/assets/include/mruby/khash.h +284 -0
- data/assets/include/mruby/numeric.h +169 -0
- data/assets/include/mruby/object.h +43 -0
- data/assets/include/mruby/opcode.h +43 -0
- data/assets/include/mruby/ops.h +122 -0
- data/assets/include/mruby/presym/disable.h +70 -0
- data/assets/include/mruby/presym/enable.h +37 -0
- data/assets/include/mruby/presym/scanning.h +73 -0
- data/assets/include/mruby/presym.h +40 -0
- data/assets/include/mruby/proc.h +209 -0
- data/assets/include/mruby/range.h +79 -0
- data/assets/include/mruby/re.h +16 -0
- data/assets/include/mruby/string.h +469 -0
- data/assets/include/mruby/throw.h +66 -0
- data/assets/include/mruby/value.h +400 -0
- data/assets/include/mruby/variable.h +140 -0
- data/assets/include/mruby/version.h +143 -0
- data/assets/include/mruby.h +1444 -0
- data/assets/macos/universal/bin/mrbc +0 -0
- data/assets/macos/universal/lib/libFLAC.a +0 -0
- data/assets/macos/universal/lib/libSDL2.a +0 -0
- data/assets/macos/universal/lib/libSDL2_image.a +0 -0
- data/assets/macos/{lib → universal/lib}/libSDL2_mixer.a +0 -0
- data/assets/macos/universal/lib/libSDL2_ttf.a +0 -0
- data/assets/macos/universal/lib/libfreetype.a +0 -0
- data/assets/macos/universal/lib/libgraphite2.a +0 -0
- data/assets/macos/universal/lib/libharfbuzz.a +0 -0
- data/assets/macos/universal/lib/libjpeg.a +0 -0
- data/assets/macos/universal/lib/libmodplug.a +0 -0
- data/assets/macos/{lib → universal/lib}/libmpg123.a +0 -0
- data/assets/{mingw/lib/libSDL2.a → macos/universal/lib/libmruby.a} +0 -0
- data/assets/macos/{lib → universal/lib}/libogg.a +0 -0
- data/assets/macos/universal/lib/libpng16.a +0 -0
- data/assets/macos/universal/lib/libtiff.a +0 -0
- data/assets/macos/universal/lib/libvorbis.a +0 -0
- data/assets/macos/universal/lib/libvorbisfile.a +0 -0
- data/assets/macos/universal/lib/libwebp.a +0 -0
- data/assets/test_media/README.md +3 -0
- data/assets/test_media/bitstream_vera/COPYRIGHT.txt +124 -0
- data/assets/test_media/bitstream_vera/vera.ttf +0 -0
- data/assets/test_media/boom.png +0 -0
- data/assets/test_media/coin.png +0 -0
- data/assets/test_media/colors.png +0 -0
- data/assets/test_media/controller.png +0 -0
- data/assets/test_media/dial.wav +0 -0
- data/assets/test_media/hero.png +0 -0
- data/assets/test_media/image.bmp +0 -0
- data/assets/test_media/image.jpg +0 -0
- data/assets/test_media/image.png +0 -0
- data/assets/test_media/music.flac +0 -0
- data/assets/test_media/music.mp3 +0 -0
- data/assets/test_media/music.ogg +0 -0
- data/assets/test_media/music.wav +0 -0
- data/assets/test_media/originals/boom.pxm +0 -0
- data/assets/test_media/originals/coin.pxm +0 -0
- data/assets/test_media/originals/controller.sketch +0 -0
- data/assets/test_media/originals/hero.pxm +0 -0
- data/assets/test_media/originals/image.pxm +0 -0
- data/assets/test_media/originals/music.caf +0 -0
- data/assets/test_media/originals/texture_atlas.pxm +0 -0
- data/assets/test_media/rondo_alla_turka.ogg +0 -0
- data/assets/test_media/sound.flac +0 -0
- data/assets/test_media/sound.mp3 +0 -0
- data/assets/test_media/sound.ogg +0 -0
- data/assets/test_media/sound.wav +0 -0
- data/assets/test_media/sprite_sheet.png +0 -0
- data/assets/test_media/texture_atlas.png +0 -0
- data/assets/wasm/build_config.rb +13 -0
- data/assets/wasm/libmruby.a +0 -0
- data/assets/wasm/template.html +17 -0
- data/assets/windows/glew/README.md +10 -0
- data/assets/windows/glew/glew.h +23686 -0
- data/assets/{mingw/lib → windows/glew}/libglew32.a +0 -0
- data/assets/windows/mingw-w64-x86_64/bin/mrbc.exe +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libFLAC.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libLerc.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libSDL2.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libSDL2_image.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libSDL2_mixer.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libSDL2_ttf.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libbrotlicommon.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libbrotlidec.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libbz2.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libdeflate.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libfreetype.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libglew32.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libgraphite2.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libharfbuzz.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libjbig.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libjpeg.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/liblzma.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libmodplug.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libmpg123.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libmruby.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libogg.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libopus.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libopusfile.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libpng16.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libsndfile.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libssp.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libstdc++.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libtiff.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libvorbis.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libvorbisfile.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libwebp.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libz.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libzstd.a +0 -0
- data/assets/{ios → xcode/ios}/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
- data/assets/{ios → xcode/ios}/Assets.xcassets/Contents.json +0 -0
- data/assets/{ios → xcode/ios}/Base.lproj/LaunchScreen.storyboard +0 -0
- data/assets/{ios → xcode/ios}/Info.plist +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mrbconf.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/array.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/class.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/common.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/compile.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/data.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/debug.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/dump.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/error.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/gc.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/hash.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/irep.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/istruct.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/khash.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/numeric.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/object.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/opcode.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/ops.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/proc.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/range.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/re.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/string.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/throw.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/value.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/variable.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/version.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Info.plist +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/MRuby +0 -0
- data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.pbxproj +0 -0
- data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
- data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
- data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
- data/assets/{ios → xcode/ios}/main.c +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/LaunchImage.launchimage/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Info.plist +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mrbconf.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/array.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/class.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/common.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/compile.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/data.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/debug.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/dump.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/error.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/gc.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/hash.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/irep.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/istruct.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/khash.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/numeric.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/object.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/opcode.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/ops.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/proc.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/range.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/re.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/string.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/throw.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/value.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/variable.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/version.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Info.plist +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/MRuby +0 -0
- data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.pbxproj +0 -0
- data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
- data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
- data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
- data/assets/{tvos → xcode/tvos}/main.c +0 -0
- data/bin/ruby2d +3 -4
- data/ext/ruby2d/extconf.rb +68 -46
- data/ext/ruby2d/font.c +35 -0
- data/ext/ruby2d/gl.c +9 -58
- data/ext/ruby2d/gl2.c +8 -83
- data/ext/ruby2d/gl3.c +57 -116
- data/ext/ruby2d/gles.c +130 -151
- data/ext/ruby2d/image.c +16 -96
- data/ext/ruby2d/ruby2d.c +265 -298
- data/ext/ruby2d/ruby2d.h +69 -159
- data/ext/ruby2d/sound.c +1 -1
- data/ext/ruby2d/text.c +20 -114
- data/ext/ruby2d/window.c +257 -219
- data/lib/ruby2d/circle.rb +3 -1
- data/lib/ruby2d/cli/build.rb +239 -59
- data/lib/ruby2d/cli/colorize.rb +5 -4
- data/lib/ruby2d/cli/platform.rb +17 -0
- data/lib/ruby2d/font.rb +26 -1
- data/lib/ruby2d/image.rb +22 -17
- data/lib/ruby2d/line.rb +3 -1
- data/lib/ruby2d/quad.rb +3 -1
- data/lib/ruby2d/rectangle.rb +1 -1
- data/lib/ruby2d/renderable.rb +0 -12
- data/lib/ruby2d/sound.rb +25 -0
- data/lib/ruby2d/sprite.rb +44 -89
- data/lib/ruby2d/square.rb +1 -1
- data/lib/ruby2d/text.rb +40 -20
- data/lib/ruby2d/texture.rb +28 -0
- data/lib/ruby2d/tileset.rb +47 -28
- data/lib/ruby2d/triangle.rb +3 -1
- data/lib/ruby2d/version.rb +1 -1
- data/lib/ruby2d/vertices.rb +89 -0
- data/lib/ruby2d/window.rb +13 -3
- data/lib/ruby2d.rb +16 -20
- metadata +249 -153
- data/assets/README.md +0 -22
- data/assets/Rakefile +0 -85
- data/assets/macos/lib/libFLAC.a +0 -0
- data/assets/macos/lib/libSDL2.a +0 -0
- data/assets/macos/lib/libSDL2_image.a +0 -0
- data/assets/macos/lib/libSDL2_ttf.a +0 -0
- data/assets/macos/lib/libfreetype.a +0 -0
- data/assets/macos/lib/libjpeg.a +0 -0
- data/assets/macos/lib/libpng16.a +0 -0
- data/assets/macos/lib/libtiff.a +0 -0
- data/assets/macos/lib/libvorbis.a +0 -0
- data/assets/macos/lib/libvorbisfile.a +0 -0
- data/assets/macos/lib/libwebp.a +0 -0
- data/assets/mingw/bin/SDL2.dll +0 -0
- data/assets/mingw/bin/SDL2_image.dll +0 -0
- data/assets/mingw/bin/SDL2_mixer.dll +0 -0
- data/assets/mingw/bin/SDL2_ttf.dll +0 -0
- data/assets/mingw/bin/glew32.dll +0 -0
- data/assets/mingw/bin/libFLAC-8.dll +0 -0
- data/assets/mingw/bin/libfreetype-6.dll +0 -0
- data/assets/mingw/bin/libjpeg-9.dll +0 -0
- data/assets/mingw/bin/libmodplug-1.dll +0 -0
- data/assets/mingw/bin/libmpg123-0.dll +0 -0
- data/assets/mingw/bin/libogg-0.dll +0 -0
- data/assets/mingw/bin/libopus-0.dll +0 -0
- data/assets/mingw/bin/libopusfile-0.dll +0 -0
- data/assets/mingw/bin/libpng16-16.dll +0 -0
- data/assets/mingw/bin/libtiff-5.dll +0 -0
- data/assets/mingw/bin/libvorbis-0.dll +0 -0
- data/assets/mingw/bin/libvorbisfile-3.dll +0 -0
- data/assets/mingw/bin/libwebp-7.dll +0 -0
- data/assets/mingw/bin/zlib1.dll +0 -0
- data/assets/mingw/lib/libSDL2.dll.a +0 -0
- data/assets/mingw/lib/libSDL2_image.a +0 -0
- data/assets/mingw/lib/libSDL2_image.dll.a +0 -0
- data/assets/mingw/lib/libSDL2_mixer.a +0 -0
- data/assets/mingw/lib/libSDL2_mixer.dll.a +0 -0
- data/assets/mingw/lib/libSDL2_test.a +0 -0
- data/assets/mingw/lib/libSDL2_ttf.a +0 -0
- data/assets/mingw/lib/libSDL2_ttf.dll.a +0 -0
- data/assets/mingw/lib/libSDL2main.a +0 -0
- data/assets/mingw/lib/libglew32.dll.a +0 -0
- data/ext/ruby2d/sprite.c +0 -147
- data/ext/ruby2d/tileset.c +0 -30
data/ext/ruby2d/ruby2d.c
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
// Native C extension for Ruby and MRuby
|
|
2
2
|
|
|
3
|
+
#ifndef RUBY2D_IOS_TVOS
|
|
4
|
+
#define RUBY2D_IOS_TVOS 0
|
|
5
|
+
#endif
|
|
6
|
+
|
|
3
7
|
// Ruby 2D includes
|
|
4
8
|
#if RUBY2D_IOS_TVOS
|
|
5
9
|
#else
|
|
@@ -59,6 +63,8 @@
|
|
|
59
63
|
#define r_str_new(str) mrb_str_new(mrb, str, strlen(str))
|
|
60
64
|
#define r_test(val) (mrb_test(val) == true)
|
|
61
65
|
#define r_ary_entry(ary, pos) mrb_ary_entry(ary, pos)
|
|
66
|
+
#define r_ary_new() mrb_ary_new(mrb)
|
|
67
|
+
#define r_ary_push(self, val) mrb_ary_push(mrb, self, val)
|
|
62
68
|
#define r_data_wrap_struct(name, data) mrb_obj_value(Data_Wrap_Struct(mrb, mrb->object_class, &name##_data_type, data))
|
|
63
69
|
#define r_data_get_struct(self, var, mrb_type, rb_type, data) Data_Get_Struct(mrb, r_iv_get(self, var), mrb_type, data)
|
|
64
70
|
#define r_define_module(name) mrb_define_module(mrb, name)
|
|
@@ -82,6 +88,8 @@
|
|
|
82
88
|
#define r_str_new(str) rb_str_new2(str)
|
|
83
89
|
#define r_test(val) (val != Qfalse && val != Qnil)
|
|
84
90
|
#define r_ary_entry(ary, pos) rb_ary_entry(ary, pos)
|
|
91
|
+
#define r_ary_new() rb_ary_new()
|
|
92
|
+
#define r_ary_push(self, val) rb_ary_push(self, val)
|
|
85
93
|
#define r_data_wrap_struct(name, data) Data_Wrap_Struct(rb_cObject, NULL, (free_##name), data)
|
|
86
94
|
#define r_data_get_struct(self, var, mrb_type, rb_type, data) Data_Get_Struct(r_iv_get(self, var), rb_type, data)
|
|
87
95
|
#define r_define_module(name) rb_define_module(name)
|
|
@@ -103,23 +111,11 @@
|
|
|
103
111
|
static R_VAL ruby2d_window;
|
|
104
112
|
|
|
105
113
|
// Ruby 2D native window
|
|
106
|
-
static R2D_Window *
|
|
114
|
+
static R2D_Window *ruby2d_c_window;
|
|
107
115
|
|
|
108
116
|
|
|
109
117
|
// Method signatures and structures for Ruby 2D classes
|
|
110
118
|
#if MRUBY
|
|
111
|
-
static void free_image(mrb_state *mrb, void *p_);
|
|
112
|
-
static const struct mrb_data_type image_data_type = {
|
|
113
|
-
"image", free_image
|
|
114
|
-
};
|
|
115
|
-
static void free_sprite(mrb_state *mrb, void *p_);
|
|
116
|
-
static const struct mrb_data_type sprite_data_type = {
|
|
117
|
-
"sprite", free_sprite
|
|
118
|
-
};
|
|
119
|
-
static void free_text(mrb_state *mrb, void *p_);
|
|
120
|
-
static const struct mrb_data_type text_data_type = {
|
|
121
|
-
"text", free_text
|
|
122
|
-
};
|
|
123
119
|
static void free_sound(mrb_state *mrb, void *p_);
|
|
124
120
|
static const struct mrb_data_type sound_data_type = {
|
|
125
121
|
"sound", free_sound
|
|
@@ -128,12 +124,19 @@ static R2D_Window *window;
|
|
|
128
124
|
static const struct mrb_data_type music_data_type = {
|
|
129
125
|
"music", free_music
|
|
130
126
|
};
|
|
127
|
+
static void free_font(mrb_state *mrb, void *p_);
|
|
128
|
+
static const struct mrb_data_type font_data_type = {
|
|
129
|
+
"font", free_font
|
|
130
|
+
};
|
|
131
|
+
static void free_surface(mrb_state *mrb, void *p_);
|
|
132
|
+
static const struct mrb_data_type surface_data_type = {
|
|
133
|
+
"surface", free_surface
|
|
134
|
+
};
|
|
131
135
|
#else
|
|
132
|
-
static void free_image(R2D_Image *img);
|
|
133
|
-
static void free_sprite(R2D_Sprite *spr);
|
|
134
|
-
static void free_text(R2D_Text *txt);
|
|
135
136
|
static void free_sound(R2D_Sound *snd);
|
|
136
137
|
static void free_music(R2D_Music *mus);
|
|
138
|
+
static void free_font(TTF_Font *font);
|
|
139
|
+
static void free_surface(SDL_Surface *surface);
|
|
137
140
|
#endif
|
|
138
141
|
|
|
139
142
|
|
|
@@ -141,7 +144,7 @@ static R2D_Window *window;
|
|
|
141
144
|
* Function pointer to free the Ruby 2D native window
|
|
142
145
|
*/
|
|
143
146
|
static void free_window() {
|
|
144
|
-
R2D_FreeWindow(
|
|
147
|
+
R2D_FreeWindow(ruby2d_c_window);
|
|
145
148
|
}
|
|
146
149
|
|
|
147
150
|
|
|
@@ -368,350 +371,232 @@ static R_VAL ruby2d_circle_ext_draw(R_VAL self, R_VAL a) {
|
|
|
368
371
|
|
|
369
372
|
|
|
370
373
|
/*
|
|
371
|
-
* Ruby2D::Image#
|
|
372
|
-
*
|
|
374
|
+
* Ruby2D::Image#ext_load_image
|
|
375
|
+
* Create an SDL surface from an image path, return the surface, width, and height
|
|
373
376
|
*/
|
|
374
377
|
#if MRUBY
|
|
375
|
-
static R_VAL
|
|
378
|
+
static R_VAL ruby2d_image_ext_load_image(mrb_state* mrb, R_VAL self) {
|
|
376
379
|
mrb_value path;
|
|
377
380
|
mrb_get_args(mrb, "o", &path);
|
|
378
381
|
#else
|
|
379
|
-
static R_VAL
|
|
380
|
-
#endif
|
|
381
|
-
R2D_Image *img = R2D_CreateImage(RSTRING_PTR(path));
|
|
382
|
-
if (!img) return R_FALSE;
|
|
383
|
-
|
|
384
|
-
// Get width and height from Ruby class. If set, use it, else choose the
|
|
385
|
-
// native dimensions of the image.
|
|
386
|
-
R_VAL w = r_iv_get(self, "@width");
|
|
387
|
-
R_VAL h = r_iv_get(self, "@height");
|
|
388
|
-
r_iv_set(self, "@width" , r_test(w) ? w : INT2NUM(img->width));
|
|
389
|
-
r_iv_set(self, "@height", r_test(h) ? h : INT2NUM(img->height));
|
|
390
|
-
r_iv_set(self, "@data", r_data_wrap_struct(image, img));
|
|
391
|
-
|
|
392
|
-
return R_TRUE;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
/*
|
|
397
|
-
* Ruby2D::Image#self.ext_draw
|
|
398
|
-
*/
|
|
399
|
-
#if MRUBY
|
|
400
|
-
static R_VAL ruby2d_image_ext_draw(mrb_state* mrb, R_VAL self) {
|
|
401
|
-
mrb_value a;
|
|
402
|
-
mrb_get_args(mrb, "o", &a);
|
|
403
|
-
#else
|
|
404
|
-
static R_VAL ruby2d_image_ext_draw(R_VAL self, R_VAL a) {
|
|
382
|
+
static R_VAL ruby2d_image_ext_load_image(R_VAL self, R_VAL path) {
|
|
405
383
|
#endif
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
R2D_Image *img;
|
|
409
|
-
r_data_get_struct(r_ary_entry(a, 0), "@data", &image_data_type, R2D_Image, img);
|
|
384
|
+
R2D_Init();
|
|
410
385
|
|
|
411
|
-
|
|
412
|
-
img->y = NUM2DBL(r_ary_entry(a, 2));
|
|
386
|
+
R_VAL result = r_ary_new();
|
|
413
387
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
if (r_test(w)) img->width = NUM2INT(w);
|
|
417
|
-
if (r_test(h)) img->height = NUM2INT(h);
|
|
388
|
+
SDL_Surface *surface = R2D_CreateImageSurface(RSTRING_PTR(path));
|
|
389
|
+
R2D_ImageConvertToRGB(surface);
|
|
418
390
|
|
|
419
|
-
|
|
391
|
+
r_ary_push(result, r_data_wrap_struct(surface, surface));
|
|
392
|
+
r_ary_push(result, INT2NUM(surface->w));
|
|
393
|
+
r_ary_push(result, INT2NUM(surface->h));
|
|
420
394
|
|
|
421
|
-
|
|
422
|
-
img->color.g = NUM2DBL(r_ary_entry(a, 7));
|
|
423
|
-
img->color.b = NUM2DBL(r_ary_entry(a, 8));
|
|
424
|
-
img->color.a = NUM2DBL(r_ary_entry(a, 9));
|
|
425
|
-
|
|
426
|
-
R2D_DrawImage(img);
|
|
427
|
-
return R_NIL;
|
|
395
|
+
return result;
|
|
428
396
|
}
|
|
429
397
|
|
|
430
398
|
|
|
431
399
|
/*
|
|
432
|
-
*
|
|
400
|
+
* Ruby2D::Text#ext_load_text
|
|
433
401
|
*/
|
|
434
402
|
#if MRUBY
|
|
435
|
-
static
|
|
436
|
-
|
|
403
|
+
static R_VAL ruby2d_text_ext_load_text(mrb_state* mrb, R_VAL self) {
|
|
404
|
+
mrb_value font, message;
|
|
405
|
+
mrb_get_args(mrb, "oo", &font, &message);
|
|
437
406
|
#else
|
|
438
|
-
static
|
|
407
|
+
static R_VAL ruby2d_text_ext_load_text(R_VAL self, R_VAL font, R_VAL message) {
|
|
439
408
|
#endif
|
|
440
|
-
|
|
441
|
-
}
|
|
409
|
+
R2D_Init();
|
|
442
410
|
|
|
411
|
+
R_VAL result = r_ary_new();
|
|
412
|
+
|
|
413
|
+
TTF_Font *ttf_font;
|
|
443
414
|
|
|
444
|
-
/*
|
|
445
|
-
* Ruby2D::Sprite#ext_init
|
|
446
|
-
* Initialize sprite structure data
|
|
447
|
-
*/
|
|
448
415
|
#if MRUBY
|
|
449
|
-
|
|
450
|
-
mrb_value path;
|
|
451
|
-
mrb_get_args(mrb, "o", &path);
|
|
416
|
+
Data_Get_Struct(mrb, font, &font_data_type, ttf_font);
|
|
452
417
|
#else
|
|
453
|
-
|
|
418
|
+
Data_Get_Struct(font, TTF_Font, ttf_font);
|
|
454
419
|
#endif
|
|
455
|
-
R2D_Sprite *spr = R2D_CreateSprite(RSTRING_PTR(path));
|
|
456
|
-
if (!spr) return R_FALSE;
|
|
457
420
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
421
|
+
SDL_Surface *surface = R2D_TextCreateSurface(ttf_font, RSTRING_PTR(message));
|
|
422
|
+
if (!surface) {
|
|
423
|
+
return result;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
r_ary_push(result, r_data_wrap_struct(surface, surface));
|
|
427
|
+
r_ary_push(result, INT2NUM(surface->w));
|
|
428
|
+
r_ary_push(result, INT2NUM(surface->h));
|
|
461
429
|
|
|
462
|
-
return
|
|
430
|
+
return result;
|
|
463
431
|
}
|
|
464
432
|
|
|
465
433
|
|
|
466
434
|
/*
|
|
467
|
-
* Ruby2D::
|
|
435
|
+
* Ruby2D::Texture#ext_create
|
|
468
436
|
*/
|
|
469
437
|
#if MRUBY
|
|
470
|
-
static R_VAL
|
|
471
|
-
mrb_value
|
|
472
|
-
mrb_get_args(mrb, "
|
|
438
|
+
static R_VAL ruby2d_texture_ext_create(mrb_state* mrb, R_VAL self) {
|
|
439
|
+
mrb_value rubySurface, width, height;
|
|
440
|
+
mrb_get_args(mrb, "ooo", &rubySurface, &width, &height);
|
|
473
441
|
#else
|
|
474
|
-
static R_VAL
|
|
442
|
+
static R_VAL ruby2d_texture_ext_create(R_VAL self, R_VAL rubySurface, R_VAL width, R_VAL height) {
|
|
475
443
|
#endif
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
R2D_Sprite *spr;
|
|
479
|
-
r_data_get_struct(r_ary_entry(a, 0), "@data", &sprite_data_type, R2D_Sprite, spr);
|
|
480
|
-
|
|
481
|
-
spr->x = NUM2DBL(r_ary_entry(a, 1));
|
|
482
|
-
spr->y = NUM2DBL(r_ary_entry(a, 2));
|
|
444
|
+
GLuint texture_id = 0;
|
|
445
|
+
SDL_Surface *surface;
|
|
483
446
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
R2D_RotateSprite(spr, NUM2DBL(r_ary_entry(a, 5)), R2D_CENTER);
|
|
447
|
+
#if MRUBY
|
|
448
|
+
Data_Get_Struct(mrb, rubySurface, &surface_data_type, surface);
|
|
449
|
+
#else
|
|
450
|
+
Data_Get_Struct(rubySurface, SDL_Surface, surface);
|
|
451
|
+
#endif
|
|
491
452
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
NUM2INT(r_ary_entry(a, 9))
|
|
498
|
-
);
|
|
453
|
+
// Detect image mode
|
|
454
|
+
GLint format = GL_RGB;
|
|
455
|
+
if (surface->format->BytesPerPixel == 4) {
|
|
456
|
+
format = GL_RGBA;
|
|
457
|
+
}
|
|
499
458
|
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
spr->color.a = NUM2DBL(r_ary_entry(a, 13));
|
|
459
|
+
R2D_GL_CreateTexture(&texture_id, format,
|
|
460
|
+
NUM2INT(width), NUM2INT(height),
|
|
461
|
+
surface->pixels, GL_NEAREST);
|
|
504
462
|
|
|
505
|
-
|
|
506
|
-
return R_NIL;
|
|
463
|
+
return INT2NUM(texture_id);
|
|
507
464
|
}
|
|
508
465
|
|
|
509
466
|
|
|
510
467
|
/*
|
|
511
|
-
*
|
|
468
|
+
* Ruby2D::Texture#ext_delete
|
|
512
469
|
*/
|
|
513
470
|
#if MRUBY
|
|
514
|
-
static
|
|
515
|
-
|
|
471
|
+
static R_VAL ruby2d_texture_ext_delete(mrb_state* mrb, R_VAL self) {
|
|
472
|
+
mrb_value rubyTexture_id;
|
|
473
|
+
mrb_get_args(mrb, "o", &rubyTexture_id);
|
|
516
474
|
#else
|
|
517
|
-
static
|
|
475
|
+
static R_VAL ruby2d_texture_ext_delete(R_VAL self, R_VAL rubyTexture_id) {
|
|
518
476
|
#endif
|
|
519
|
-
|
|
520
|
-
}
|
|
521
|
-
|
|
477
|
+
GLuint texture_id = NUM2INT(rubyTexture_id);
|
|
522
478
|
|
|
523
|
-
|
|
524
|
-
* Ruby2D::Tileset#ext_init
|
|
525
|
-
* Initialize tileset data
|
|
526
|
-
*/
|
|
527
|
-
static R_VAL ruby2d_tileset_ext_init(R_VAL self, R_VAL path) {
|
|
528
|
-
R2D_Image *img = R2D_CreateImage(RSTRING_PTR(path));
|
|
529
|
-
if (!img) return R_FALSE;
|
|
530
|
-
|
|
531
|
-
// Get width and height from Ruby class. If set, use it, else choose the
|
|
532
|
-
// native dimensions of the image.
|
|
533
|
-
R_VAL w = r_iv_get(self, "@width");
|
|
534
|
-
R_VAL h = r_iv_get(self, "@height");
|
|
535
|
-
r_iv_set(self, "@width" , r_test(w) ? w : INT2NUM(img->width));
|
|
536
|
-
r_iv_set(self, "@height", r_test(h) ? h : INT2NUM(img->height));
|
|
537
|
-
r_iv_set(self, "@data", r_data_wrap_struct(image, img));
|
|
479
|
+
R2D_GL_FreeTexture(&texture_id);
|
|
538
480
|
|
|
539
|
-
return R_TRUE;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
/*
|
|
544
|
-
* Ruby2D::Tileset#ext_draw
|
|
545
|
-
* Draws a single tile, will be called once per individual tile to draw
|
|
546
|
-
*/
|
|
547
|
-
static R_VAL ruby2d_tileset_ext_draw(R_VAL self, R_VAL a) {
|
|
548
|
-
// `a` is the array representing the tileset
|
|
549
|
-
|
|
550
|
-
R2D_Image *img;
|
|
551
|
-
r_data_get_struct(r_ary_entry(a, 0), "@data", &image_data_type, R2D_Image, img);
|
|
552
|
-
|
|
553
|
-
int tw = NUM2INT(r_ary_entry(a, 1));
|
|
554
|
-
int th = NUM2INT(r_ary_entry(a, 2));
|
|
555
|
-
int padding = NUM2INT(r_ary_entry(a, 3));
|
|
556
|
-
int spacing = NUM2INT(r_ary_entry(a, 4));
|
|
557
|
-
int tx = NUM2INT(r_ary_entry(a, 5));
|
|
558
|
-
int ty = NUM2INT(r_ary_entry(a, 6));
|
|
559
|
-
int x = NUM2INT(r_ary_entry(a, 7));
|
|
560
|
-
int y = NUM2INT(r_ary_entry(a, 8));
|
|
561
|
-
|
|
562
|
-
R2D_DrawTile(img, tw, th, padding, spacing, tx, ty, x, y);
|
|
563
481
|
return R_NIL;
|
|
564
482
|
}
|
|
565
483
|
|
|
566
484
|
|
|
567
485
|
/*
|
|
568
|
-
* Ruby2D::
|
|
569
|
-
* Initialize
|
|
486
|
+
* Ruby2D::Sound#ext_init
|
|
487
|
+
* Initialize sound structure data
|
|
570
488
|
*/
|
|
571
489
|
#if MRUBY
|
|
572
|
-
static R_VAL
|
|
490
|
+
static R_VAL ruby2d_sound_ext_init(mrb_state* mrb, R_VAL self) {
|
|
491
|
+
mrb_value path;
|
|
492
|
+
mrb_get_args(mrb, "o", &path);
|
|
573
493
|
#else
|
|
574
|
-
static R_VAL
|
|
494
|
+
static R_VAL ruby2d_sound_ext_init(R_VAL self, R_VAL path) {
|
|
575
495
|
#endif
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
mrb_str_resize(mrb, s, RSTRING_LEN(s));
|
|
580
|
-
#endif
|
|
581
|
-
|
|
582
|
-
R2D_Text *txt = R2D_CreateText(
|
|
583
|
-
RSTRING_PTR(r_iv_get(self, "@font")),
|
|
584
|
-
RSTRING_PTR(r_iv_get(self, "@text")),
|
|
585
|
-
NUM2DBL(r_iv_get(self, "@size"))
|
|
586
|
-
);
|
|
587
|
-
if (!txt) return R_FALSE;
|
|
588
|
-
|
|
589
|
-
r_iv_set(self, "@width", INT2NUM(txt->width));
|
|
590
|
-
r_iv_set(self, "@height", INT2NUM(txt->height));
|
|
591
|
-
r_iv_set(self, "@data", r_data_wrap_struct(text, txt));
|
|
592
|
-
|
|
496
|
+
R2D_Sound *snd = R2D_CreateSound(RSTRING_PTR(path));
|
|
497
|
+
if (!snd) return R_FALSE;
|
|
498
|
+
r_iv_set(self, "@data", r_data_wrap_struct(sound, snd));
|
|
593
499
|
return R_TRUE;
|
|
594
500
|
}
|
|
595
501
|
|
|
596
502
|
|
|
597
503
|
/*
|
|
598
|
-
* Ruby2D::
|
|
504
|
+
* Ruby2D::Sound#ext_play
|
|
599
505
|
*/
|
|
600
506
|
#if MRUBY
|
|
601
|
-
static R_VAL
|
|
602
|
-
mrb_value text;
|
|
603
|
-
mrb_get_args(mrb, "o", &text);
|
|
507
|
+
static R_VAL ruby2d_sound_ext_play(mrb_state* mrb, R_VAL self) {
|
|
604
508
|
#else
|
|
605
|
-
static R_VAL
|
|
509
|
+
static R_VAL ruby2d_sound_ext_play(R_VAL self) {
|
|
606
510
|
#endif
|
|
607
|
-
|
|
608
|
-
r_data_get_struct(self, "@data", &
|
|
609
|
-
|
|
610
|
-
R2D_SetText(txt, RSTRING_PTR(text));
|
|
611
|
-
|
|
612
|
-
r_iv_set(self, "@width", INT2NUM(txt->width));
|
|
613
|
-
r_iv_set(self, "@height", INT2NUM(txt->height));
|
|
614
|
-
|
|
511
|
+
R2D_Sound *snd;
|
|
512
|
+
r_data_get_struct(self, "@data", &sound_data_type, R2D_Sound, snd);
|
|
513
|
+
R2D_PlaySound(snd);
|
|
615
514
|
return R_NIL;
|
|
616
515
|
}
|
|
617
516
|
|
|
618
517
|
|
|
619
518
|
/*
|
|
620
|
-
* Ruby2D::
|
|
519
|
+
* Ruby2D::Sound#ext_length
|
|
621
520
|
*/
|
|
622
521
|
#if MRUBY
|
|
623
|
-
static R_VAL
|
|
624
|
-
mrb_value a;
|
|
625
|
-
mrb_get_args(mrb, "o", &a);
|
|
522
|
+
static R_VAL ruby2d_sound_ext_length(mrb_state* mrb, R_VAL self) {
|
|
626
523
|
#else
|
|
627
|
-
static R_VAL
|
|
524
|
+
static R_VAL ruby2d_sound_ext_length(R_VAL self) {
|
|
628
525
|
#endif
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
r_data_get_struct(r_ary_entry(a, 0), "@data", &text_data_type, R2D_Text, txt);
|
|
633
|
-
|
|
634
|
-
txt->x = NUM2DBL(r_ary_entry(a, 1));
|
|
635
|
-
txt->y = NUM2DBL(r_ary_entry(a, 2));
|
|
636
|
-
|
|
637
|
-
R2D_RotateText(txt, NUM2DBL(r_ary_entry(a, 3)), R2D_CENTER);
|
|
638
|
-
|
|
639
|
-
txt->color.r = NUM2DBL(r_ary_entry(a, 4));
|
|
640
|
-
txt->color.g = NUM2DBL(r_ary_entry(a, 5));
|
|
641
|
-
txt->color.b = NUM2DBL(r_ary_entry(a, 6));
|
|
642
|
-
txt->color.a = NUM2DBL(r_ary_entry(a, 7));
|
|
643
|
-
|
|
644
|
-
R2D_DrawText(txt);
|
|
645
|
-
return R_NIL;
|
|
526
|
+
R2D_Sound *snd;
|
|
527
|
+
r_data_get_struct(self, "@data", &sound_data_type, R2D_Sound, snd);
|
|
528
|
+
return INT2NUM(R2D_GetSoundLength(snd));
|
|
646
529
|
}
|
|
647
530
|
|
|
648
531
|
|
|
649
532
|
/*
|
|
650
|
-
* Free
|
|
533
|
+
* Free sound structure attached to Ruby 2D `Sound` class
|
|
651
534
|
*/
|
|
652
535
|
#if MRUBY
|
|
653
|
-
static void
|
|
654
|
-
|
|
536
|
+
static void free_sound(mrb_state *mrb, void *p_) {
|
|
537
|
+
R2D_Sound *snd = (R2D_Sound *)p_;
|
|
655
538
|
#else
|
|
656
|
-
static void
|
|
539
|
+
static void free_sound(R2D_Sound *snd) {
|
|
657
540
|
#endif
|
|
658
|
-
|
|
541
|
+
R2D_FreeSound(snd);
|
|
659
542
|
}
|
|
660
543
|
|
|
661
544
|
|
|
662
545
|
/*
|
|
663
|
-
* Ruby2D::Sound#
|
|
664
|
-
* Initialize sound structure data
|
|
546
|
+
* Ruby2D::Sound#ext_get_volume
|
|
665
547
|
*/
|
|
666
548
|
#if MRUBY
|
|
667
|
-
static R_VAL
|
|
668
|
-
mrb_value path;
|
|
669
|
-
mrb_get_args(mrb, "o", &path);
|
|
549
|
+
static R_VAL ruby2d_sound_ext_get_volume(mrb_state* mrb, R_VAL self) {
|
|
670
550
|
#else
|
|
671
|
-
static R_VAL
|
|
551
|
+
static R_VAL ruby2d_sound_ext_get_volume(R_VAL self) {
|
|
672
552
|
#endif
|
|
673
|
-
R2D_Sound *snd
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
return R_TRUE;
|
|
553
|
+
R2D_Sound *snd;
|
|
554
|
+
r_data_get_struct(self, "@data", &sound_data_type, R2D_Sound, snd);
|
|
555
|
+
return INT2NUM(ceil(Mix_VolumeChunk(snd->data, -1) * (100.0 / MIX_MAX_VOLUME)));
|
|
677
556
|
}
|
|
678
557
|
|
|
679
558
|
|
|
680
559
|
/*
|
|
681
|
-
* Ruby2D::
|
|
560
|
+
* Ruby2D::Music#ext_set_volume
|
|
682
561
|
*/
|
|
683
562
|
#if MRUBY
|
|
684
|
-
static R_VAL
|
|
563
|
+
static R_VAL ruby2d_sound_ext_set_volume(mrb_state* mrb, R_VAL self) {
|
|
564
|
+
mrb_value volume;
|
|
565
|
+
mrb_get_args(mrb, "o", &volume);
|
|
685
566
|
#else
|
|
686
|
-
static R_VAL
|
|
567
|
+
static R_VAL ruby2d_sound_ext_set_volume(R_VAL self, R_VAL volume) {
|
|
687
568
|
#endif
|
|
688
569
|
R2D_Sound *snd;
|
|
689
570
|
r_data_get_struct(self, "@data", &sound_data_type, R2D_Sound, snd);
|
|
690
|
-
|
|
571
|
+
Mix_VolumeChunk(snd->data, (NUM2INT(volume) / 100.0) * MIX_MAX_VOLUME);
|
|
691
572
|
return R_NIL;
|
|
692
573
|
}
|
|
693
574
|
|
|
694
575
|
|
|
695
576
|
/*
|
|
696
|
-
* Ruby2D::Sound#
|
|
577
|
+
* Ruby2D::Sound#ext_get_mix_volume
|
|
697
578
|
*/
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
579
|
+
#if MRUBY
|
|
580
|
+
static R_VAL ruby2d_sound_ext_get_mix_volume(mrb_state* mrb, R_VAL self) {
|
|
581
|
+
#else
|
|
582
|
+
static R_VAL ruby2d_sound_ext_get_mix_volume(R_VAL self) {
|
|
583
|
+
#endif
|
|
584
|
+
return INT2NUM(ceil(Mix_Volume(-1, -1) * (100.0 / MIX_MAX_VOLUME)));
|
|
702
585
|
}
|
|
703
586
|
|
|
704
587
|
|
|
705
588
|
/*
|
|
706
|
-
*
|
|
589
|
+
* Ruby2D::Music#ext_set_mix_volume
|
|
707
590
|
*/
|
|
708
591
|
#if MRUBY
|
|
709
|
-
static
|
|
710
|
-
|
|
592
|
+
static R_VAL ruby2d_sound_ext_set_mix_volume(mrb_state* mrb, R_VAL self) {
|
|
593
|
+
mrb_value volume;
|
|
594
|
+
mrb_get_args(mrb, "o", &volume);
|
|
711
595
|
#else
|
|
712
|
-
static
|
|
596
|
+
static R_VAL ruby2d_sound_ext_set_mix_volume(R_VAL self, R_VAL volume) {
|
|
713
597
|
#endif
|
|
714
|
-
|
|
598
|
+
Mix_Volume(-1, (NUM2INT(volume) / 100.0) * MIX_MAX_VOLUME);
|
|
599
|
+
return R_NIL;
|
|
715
600
|
}
|
|
716
601
|
|
|
717
602
|
|
|
@@ -832,13 +717,88 @@ static R_VAL ruby2d_music_ext_fadeout(R_VAL self, R_VAL ms) {
|
|
|
832
717
|
/*
|
|
833
718
|
* Ruby2D::Music#ext_length
|
|
834
719
|
*/
|
|
720
|
+
#if MRUBY
|
|
721
|
+
static R_VAL ruby2d_music_ext_length(mrb_state* mrb, R_VAL self) {
|
|
722
|
+
#else
|
|
835
723
|
static R_VAL ruby2d_music_ext_length(R_VAL self) {
|
|
724
|
+
#endif
|
|
836
725
|
R2D_Music *ms;
|
|
837
726
|
r_data_get_struct(self, "@data", &music_data_type, R2D_Music, ms);
|
|
838
727
|
return INT2NUM(R2D_GetMusicLength(ms));
|
|
839
728
|
}
|
|
840
729
|
|
|
841
730
|
|
|
731
|
+
/*
|
|
732
|
+
* Ruby2D::Font#ext_load
|
|
733
|
+
*/
|
|
734
|
+
#if MRUBY
|
|
735
|
+
static R_VAL ruby2d_font_ext_load(mrb_state* mrb, R_VAL self) {
|
|
736
|
+
mrb_value path, size, style;
|
|
737
|
+
mrb_get_args(mrb, "ooo", &path, &size, &style);
|
|
738
|
+
#else
|
|
739
|
+
static R_VAL ruby2d_font_ext_load(R_VAL self, R_VAL path, R_VAL size, R_VAL style) {
|
|
740
|
+
#endif
|
|
741
|
+
R2D_Init();
|
|
742
|
+
|
|
743
|
+
TTF_Font *font = R2D_FontCreateTTFFont(RSTRING_PTR(path), NUM2INT(size), RSTRING_PTR(style));
|
|
744
|
+
if (!font) {
|
|
745
|
+
return R_NIL;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
return r_data_wrap_struct(font, font);
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
/*
|
|
753
|
+
* Ruby2D::Texture#ext_draw
|
|
754
|
+
*/
|
|
755
|
+
#if MRUBY
|
|
756
|
+
static R_VAL ruby2d_texture_ext_draw(mrb_state* mrb, R_VAL self) {
|
|
757
|
+
mrb_value ruby_coordinates, ruby_texture_coordinates, ruby_color, texture_id;
|
|
758
|
+
mrb_get_args(mrb, "oooo", &ruby_coordinates, &ruby_texture_coordinates, &ruby_color, &texture_id);
|
|
759
|
+
#else
|
|
760
|
+
static R_VAL ruby2d_texture_ext_draw(R_VAL self, R_VAL ruby_coordinates, R_VAL ruby_texture_coordinates, R_VAL ruby_color, R_VAL texture_id) {
|
|
761
|
+
#endif
|
|
762
|
+
GLfloat coordinates[8];
|
|
763
|
+
GLfloat texture_coordinates[8];
|
|
764
|
+
GLfloat color[4];
|
|
765
|
+
|
|
766
|
+
for(int i = 0; i < 8; i++) { coordinates[i] = NUM2DBL(r_ary_entry(ruby_coordinates, i)); }
|
|
767
|
+
for(int i = 0; i < 8; i++) { texture_coordinates[i] = NUM2DBL(r_ary_entry(ruby_texture_coordinates, i)); }
|
|
768
|
+
for(int i = 0; i < 4; i++) { color[i] = NUM2DBL(r_ary_entry(ruby_color, i)); }
|
|
769
|
+
|
|
770
|
+
R2D_GL_DrawTexture(coordinates, texture_coordinates, color, NUM2INT(texture_id));
|
|
771
|
+
|
|
772
|
+
return R_NIL;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
/*
|
|
777
|
+
* Free font structure stored in the Ruby 2D `Font` class
|
|
778
|
+
*/
|
|
779
|
+
#if MRUBY
|
|
780
|
+
static void free_font(mrb_state *mrb, void *p_) {
|
|
781
|
+
TTF_Font *font = (TTF_Font *)p_;
|
|
782
|
+
#else
|
|
783
|
+
static void free_font(TTF_Font *font) {
|
|
784
|
+
#endif
|
|
785
|
+
TTF_CloseFont(font);
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
/*
|
|
790
|
+
* Free surface structure used within the Ruby 2D `Texture` class
|
|
791
|
+
*/
|
|
792
|
+
#if MRUBY
|
|
793
|
+
static void free_surface(mrb_state *mrb, void *p_) {
|
|
794
|
+
SDL_Surface *surface = (SDL_Surface *)p_;
|
|
795
|
+
#else
|
|
796
|
+
static void free_surface(SDL_Surface *surface) {
|
|
797
|
+
#endif
|
|
798
|
+
SDL_FreeSurface(surface);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
|
|
842
802
|
/*
|
|
843
803
|
* Free music structure attached to Ruby 2D `Music` class
|
|
844
804
|
*/
|
|
@@ -1032,14 +992,14 @@ static void on_controller(R2D_Event e) {
|
|
|
1032
992
|
static void update() {
|
|
1033
993
|
|
|
1034
994
|
// Set the cursor
|
|
1035
|
-
r_iv_set(ruby2d_window, "@mouse_x", INT2NUM(
|
|
1036
|
-
r_iv_set(ruby2d_window, "@mouse_y", INT2NUM(
|
|
995
|
+
r_iv_set(ruby2d_window, "@mouse_x", INT2NUM(ruby2d_c_window->mouse.x));
|
|
996
|
+
r_iv_set(ruby2d_window, "@mouse_y", INT2NUM(ruby2d_c_window->mouse.y));
|
|
1037
997
|
|
|
1038
998
|
// Store frames
|
|
1039
|
-
r_iv_set(ruby2d_window, "@frames", DBL2NUM(
|
|
999
|
+
r_iv_set(ruby2d_window, "@frames", DBL2NUM(ruby2d_c_window->frames));
|
|
1040
1000
|
|
|
1041
1001
|
// Store frame rate
|
|
1042
|
-
r_iv_set(ruby2d_window, "@fps", DBL2NUM(
|
|
1002
|
+
r_iv_set(ruby2d_window, "@fps", DBL2NUM(ruby2d_c_window->fps));
|
|
1043
1003
|
|
|
1044
1004
|
// Call update proc, `window.update`
|
|
1045
1005
|
r_funcall(ruby2d_window, "update_callback", 0);
|
|
@@ -1053,10 +1013,10 @@ static void render() {
|
|
|
1053
1013
|
|
|
1054
1014
|
// Set background color
|
|
1055
1015
|
R_VAL bc = r_iv_get(ruby2d_window, "@background");
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1016
|
+
ruby2d_c_window->background.r = NUM2DBL(r_iv_get(bc, "@r"));
|
|
1017
|
+
ruby2d_c_window->background.g = NUM2DBL(r_iv_get(bc, "@g"));
|
|
1018
|
+
ruby2d_c_window->background.b = NUM2DBL(r_iv_get(bc, "@b"));
|
|
1019
|
+
ruby2d_c_window->background.a = NUM2DBL(r_iv_get(bc, "@a"));
|
|
1060
1020
|
|
|
1061
1021
|
// Read window objects
|
|
1062
1022
|
R_VAL objects = r_iv_get(ruby2d_window, "@objects");
|
|
@@ -1170,19 +1130,19 @@ static R_VAL ruby2d_window_ext_show(R_VAL self) {
|
|
|
1170
1130
|
|
|
1171
1131
|
// Create and show window
|
|
1172
1132
|
|
|
1173
|
-
|
|
1133
|
+
ruby2d_c_window = R2D_CreateWindow(
|
|
1174
1134
|
title, width, height, update, render, flags
|
|
1175
1135
|
);
|
|
1176
1136
|
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1137
|
+
ruby2d_c_window->viewport.width = viewport_width;
|
|
1138
|
+
ruby2d_c_window->viewport.height = viewport_height;
|
|
1139
|
+
ruby2d_c_window->fps_cap = fps_cap;
|
|
1140
|
+
ruby2d_c_window->icon = icon;
|
|
1141
|
+
ruby2d_c_window->on_key = on_key;
|
|
1142
|
+
ruby2d_c_window->on_mouse = on_mouse;
|
|
1143
|
+
ruby2d_c_window->on_controller = on_controller;
|
|
1184
1144
|
|
|
1185
|
-
R2D_Show(
|
|
1145
|
+
R2D_Show(ruby2d_c_window);
|
|
1186
1146
|
|
|
1187
1147
|
atexit(free_window);
|
|
1188
1148
|
return R_NIL;
|
|
@@ -1199,8 +1159,8 @@ static R_VAL ruby2d_ext_screenshot(mrb_state* mrb, R_VAL self) {
|
|
|
1199
1159
|
#else
|
|
1200
1160
|
static R_VAL ruby2d_ext_screenshot(R_VAL self, R_VAL path) {
|
|
1201
1161
|
#endif
|
|
1202
|
-
if (
|
|
1203
|
-
R2D_Screenshot(
|
|
1162
|
+
if (ruby2d_c_window) {
|
|
1163
|
+
R2D_Screenshot(ruby2d_c_window, RSTRING_PTR(path));
|
|
1204
1164
|
return path;
|
|
1205
1165
|
} else {
|
|
1206
1166
|
return R_FALSE;
|
|
@@ -1211,8 +1171,12 @@ static R_VAL ruby2d_ext_screenshot(R_VAL self, R_VAL path) {
|
|
|
1211
1171
|
/*
|
|
1212
1172
|
* Ruby2D::Window#ext_close
|
|
1213
1173
|
*/
|
|
1174
|
+
#if MRUBY
|
|
1175
|
+
static R_VAL ruby2d_window_ext_close(mrb_state* mrb, R_VAL self) {
|
|
1176
|
+
#else
|
|
1214
1177
|
static R_VAL ruby2d_window_ext_close() {
|
|
1215
|
-
|
|
1178
|
+
#endif
|
|
1179
|
+
R2D_Close(ruby2d_c_window);
|
|
1216
1180
|
return R_NIL;
|
|
1217
1181
|
}
|
|
1218
1182
|
|
|
@@ -1275,41 +1239,14 @@ void Init_ruby2d() {
|
|
|
1275
1239
|
// Ruby2D::Image
|
|
1276
1240
|
R_CLASS ruby2d_image_class = r_define_class(ruby2d_module, "Image");
|
|
1277
1241
|
|
|
1278
|
-
// Ruby2D::Image#
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
// Ruby2D::Image#self.ext_draw
|
|
1282
|
-
r_define_class_method(ruby2d_image_class, "ext_draw", ruby2d_image_ext_draw, r_args_req(1));
|
|
1283
|
-
|
|
1284
|
-
// Ruby2D::Sprite
|
|
1285
|
-
R_CLASS ruby2d_sprite_class = r_define_class(ruby2d_module, "Sprite");
|
|
1286
|
-
|
|
1287
|
-
// Ruby2D::Sprite#ext_init
|
|
1288
|
-
r_define_method(ruby2d_sprite_class, "ext_init", ruby2d_sprite_ext_init, r_args_req(1));
|
|
1289
|
-
|
|
1290
|
-
// Ruby2D::Sprite#self.ext_draw
|
|
1291
|
-
r_define_class_method(ruby2d_sprite_class, "ext_draw", ruby2d_sprite_ext_draw, r_args_req(1));
|
|
1292
|
-
|
|
1293
|
-
// Ruby2D::Tileset
|
|
1294
|
-
R_CLASS ruby2d_tileset_class = r_define_class(ruby2d_module, "Tileset");
|
|
1295
|
-
|
|
1296
|
-
// Ruby2D::Tileset#ext_init
|
|
1297
|
-
r_define_method(ruby2d_tileset_class, "ext_init", ruby2d_tileset_ext_init, r_args_req(1));
|
|
1298
|
-
|
|
1299
|
-
// Ruby2D::Tileset#self.ext_draw
|
|
1300
|
-
r_define_class_method(ruby2d_tileset_class, "ext_draw", ruby2d_tileset_ext_draw, r_args_req(1));
|
|
1242
|
+
// Ruby2D::Image#ext_load_image
|
|
1243
|
+
r_define_class_method(ruby2d_image_class, "ext_load_image", ruby2d_image_ext_load_image, r_args_req(1));
|
|
1301
1244
|
|
|
1302
1245
|
// Ruby2D::Text
|
|
1303
1246
|
R_CLASS ruby2d_text_class = r_define_class(ruby2d_module, "Text");
|
|
1304
1247
|
|
|
1305
|
-
// Ruby2D::Text#
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
// Ruby2D::Text#ext_set
|
|
1309
|
-
r_define_method(ruby2d_text_class, "ext_set", ruby2d_text_ext_set, r_args_req(1));
|
|
1310
|
-
|
|
1311
|
-
// Ruby2D::Text#self.ext_draw
|
|
1312
|
-
r_define_class_method(ruby2d_text_class, "ext_draw", ruby2d_text_ext_draw, r_args_req(1));
|
|
1248
|
+
// Ruby2D::Text#ext_load_text
|
|
1249
|
+
r_define_class_method(ruby2d_text_class, "ext_load_text", ruby2d_text_ext_load_text, r_args_req(2));
|
|
1313
1250
|
|
|
1314
1251
|
// Ruby2D::Sound
|
|
1315
1252
|
R_CLASS ruby2d_sound_class = r_define_class(ruby2d_module, "Sound");
|
|
@@ -1319,6 +1256,18 @@ void Init_ruby2d() {
|
|
|
1319
1256
|
|
|
1320
1257
|
// Ruby2D::Sound#ext_play
|
|
1321
1258
|
r_define_method(ruby2d_sound_class, "ext_play", ruby2d_sound_ext_play, r_args_none);
|
|
1259
|
+
|
|
1260
|
+
// Ruby2D::Sound#ext_get_volume
|
|
1261
|
+
r_define_method(ruby2d_sound_class, "ext_get_volume", ruby2d_sound_ext_get_volume, r_args_none);
|
|
1262
|
+
|
|
1263
|
+
// Ruby2D::Sound#ext_set_volume
|
|
1264
|
+
r_define_method(ruby2d_sound_class, "ext_set_volume", ruby2d_sound_ext_set_volume, r_args_req(1));
|
|
1265
|
+
|
|
1266
|
+
// Ruby2D::Sound#self.ext_get_mix_volume
|
|
1267
|
+
r_define_class_method(ruby2d_sound_class, "ext_get_mix_volume", ruby2d_sound_ext_get_mix_volume, r_args_none);
|
|
1268
|
+
|
|
1269
|
+
// Ruby2D::Sound#self.ext_set_mix_volume
|
|
1270
|
+
r_define_class_method(ruby2d_sound_class, "ext_set_mix_volume", ruby2d_sound_ext_set_mix_volume, r_args_req(1));
|
|
1322
1271
|
|
|
1323
1272
|
// Ruby2D::Sound#ext_length
|
|
1324
1273
|
r_define_method(ruby2d_sound_class, "ext_length", ruby2d_sound_ext_length, r_args_none);
|
|
@@ -1353,6 +1302,24 @@ void Init_ruby2d() {
|
|
|
1353
1302
|
// Ruby2D::Music#ext_length
|
|
1354
1303
|
r_define_method(ruby2d_music_class, "ext_length", ruby2d_music_ext_length, r_args_none);
|
|
1355
1304
|
|
|
1305
|
+
// Ruby2D::Font
|
|
1306
|
+
R_CLASS ruby2d_font_class = r_define_class(ruby2d_module, "Font");
|
|
1307
|
+
|
|
1308
|
+
// Ruby2D::Font#ext_load
|
|
1309
|
+
r_define_class_method(ruby2d_font_class, "ext_load", ruby2d_font_ext_load, r_args_req(3));
|
|
1310
|
+
|
|
1311
|
+
// Ruby2D::Texture
|
|
1312
|
+
R_CLASS ruby2d_texture_class = r_define_class(ruby2d_module, "Texture");
|
|
1313
|
+
|
|
1314
|
+
// Ruby2D::Texture#ext_draw
|
|
1315
|
+
r_define_method(ruby2d_texture_class, "ext_draw", ruby2d_texture_ext_draw, r_args_req(4));
|
|
1316
|
+
|
|
1317
|
+
// Ruby2D::Texture#ext_create
|
|
1318
|
+
r_define_method(ruby2d_texture_class, "ext_create", ruby2d_texture_ext_create, r_args_req(3));
|
|
1319
|
+
|
|
1320
|
+
// Ruby2D::Texture#ext_delete
|
|
1321
|
+
r_define_method(ruby2d_texture_class, "ext_delete", ruby2d_texture_ext_delete, r_args_req(1));
|
|
1322
|
+
|
|
1356
1323
|
// Ruby2D::Window
|
|
1357
1324
|
R_CLASS ruby2d_window_class = r_define_class(ruby2d_module, "Window");
|
|
1358
1325
|
|