ruby2d 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/README.md +7 -9
- data/assets/Rakefile +85 -0
- data/assets/include/SDL2/SDL.h +1 -1
- data/assets/include/SDL2/SDL_assert.h +1 -1
- data/assets/include/SDL2/SDL_atomic.h +20 -2
- data/assets/include/SDL2/SDL_audio.h +47 -14
- data/assets/include/SDL2/SDL_bits.h +10 -1
- data/assets/include/SDL2/SDL_blendmode.h +7 -7
- data/assets/include/SDL2/SDL_clipboard.h +1 -1
- data/assets/include/SDL2/SDL_config.h +24 -390
- data/assets/include/SDL2/SDL_config_android.h +178 -0
- data/assets/include/SDL2/SDL_config_iphoneos.h +201 -0
- data/assets/include/SDL2/SDL_config_macosx.h +240 -0
- data/assets/include/SDL2/SDL_config_minimal.h +85 -0
- data/assets/include/SDL2/SDL_config_os2.h +170 -0
- data/assets/include/SDL2/SDL_config_pandora.h +133 -0
- data/assets/include/SDL2/SDL_config_psp.h +164 -0
- data/assets/include/SDL2/SDL_config_windows.h +257 -0
- data/assets/include/SDL2/SDL_config_winrt.h +240 -0
- data/assets/include/SDL2/SDL_config_wiz.h +146 -0
- data/assets/include/SDL2/SDL_copying.h +20 -0
- data/assets/include/SDL2/SDL_cpuinfo.h +90 -8
- data/assets/include/SDL2/SDL_egl.h +1 -1
- data/assets/include/SDL2/SDL_endian.h +1 -1
- data/assets/include/SDL2/SDL_error.h +1 -1
- data/assets/include/SDL2/SDL_events.h +4 -1
- data/assets/include/SDL2/SDL_filesystem.h +1 -1
- data/assets/include/SDL2/SDL_gamecontroller.h +1 -1
- data/assets/include/SDL2/SDL_gesture.h +1 -1
- data/assets/include/SDL2/SDL_haptic.h +1 -1
- data/assets/include/SDL2/SDL_hints.h +145 -14
- data/assets/include/SDL2/SDL_image.h +2 -2
- data/assets/include/SDL2/SDL_joystick.h +1 -1
- data/assets/include/SDL2/SDL_keyboard.h +1 -1
- data/assets/include/SDL2/SDL_keycode.h +1 -1
- data/assets/include/SDL2/SDL_loadso.h +1 -1
- data/assets/include/SDL2/SDL_log.h +1 -1
- data/assets/include/SDL2/SDL_main.h +28 -16
- data/assets/include/SDL2/SDL_messagebox.h +1 -1
- data/assets/include/SDL2/SDL_mouse.h +1 -1
- data/assets/include/SDL2/SDL_mutex.h +1 -1
- 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 +1 -1
- data/assets/include/SDL2/SDL_pixels.h +3 -3
- data/assets/include/SDL2/SDL_platform.h +1 -1
- data/assets/include/SDL2/SDL_power.h +1 -1
- data/assets/include/SDL2/SDL_quit.h +1 -1
- data/assets/include/SDL2/SDL_rect.h +29 -3
- data/assets/include/SDL2/SDL_render.h +168 -1
- data/assets/include/SDL2/SDL_revision.h +2 -2
- data/assets/include/SDL2/SDL_rwops.h +50 -13
- data/assets/include/SDL2/SDL_scancode.h +2 -2
- data/assets/include/SDL2/SDL_sensor.h +4 -4
- data/assets/include/SDL2/SDL_shape.h +1 -1
- data/assets/include/SDL2/SDL_stdinc.h +1 -1
- data/assets/include/SDL2/SDL_surface.h +2 -1
- data/assets/include/SDL2/SDL_system.h +1 -1
- data/assets/include/SDL2/SDL_syswm.h +11 -8
- data/assets/include/SDL2/SDL_test.h +1 -1
- data/assets/include/SDL2/SDL_test_assert.h +1 -1
- data/assets/include/SDL2/SDL_test_common.h +22 -5
- 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 +1 -1
- data/assets/include/SDL2/SDL_test_fuzzer.h +1 -1
- data/assets/include/SDL2/SDL_test_harness.h +1 -1
- 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 +3 -3
- data/assets/include/SDL2/SDL_test_random.h +1 -1
- data/assets/include/SDL2/SDL_thread.h +1 -1
- data/assets/include/SDL2/SDL_timer.h +1 -1
- data/assets/include/SDL2/SDL_touch.h +17 -1
- data/assets/include/SDL2/SDL_types.h +1 -1
- data/assets/include/SDL2/SDL_version.h +2 -2
- data/assets/include/SDL2/SDL_video.h +1 -1
- data/assets/include/SDL2/SDL_vulkan.h +3 -3
- data/assets/include/SDL2/begin_code.h +4 -1
- data/assets/include/SDL2/close_code.h +4 -1
- data/assets/include/simple2d.h +22 -0
- data/assets/linux/simple2d/Makefile +11 -8
- data/assets/linux/simple2d/bin/simple2d.sh +13 -7
- data/assets/linux/simple2d/include/simple2d.h +22 -0
- data/assets/linux/simple2d/src/gl.c +17 -13
- data/assets/linux/simple2d/src/gl3.c +105 -32
- data/assets/linux/simple2d/src/sound.c +37 -0
- data/assets/linux/simple2d/src/window.c +11 -0
- 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_mixer.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/libmpg123.a +0 -0
- data/assets/macos/lib/libogg.a +0 -0
- data/assets/macos/lib/libpng16.a +0 -0
- data/assets/macos/lib/libsimple2d.a +0 -0
- data/assets/macos/lib/libtiff.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/libpng16-16.dll +0 -0
- data/assets/mingw/bin/libtiff-5.dll +0 -0
- data/assets/mingw/bin/libwebp-7.dll +0 -0
- data/assets/mingw/lib/libSDL2.a +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_test.a +0 -0
- data/assets/mingw/lib/libSDL2main.a +0 -0
- data/assets/mingw/lib/libsimple2d.a +0 -0
- data/ext/ruby2d/extconf.rb +1 -1
- data/lib/ruby2d/version.rb +1 -1
- metadata +14 -2
@@ -46,6 +46,43 @@ void S2D_PlaySound(S2D_Sound *snd) {
|
|
46
46
|
}
|
47
47
|
|
48
48
|
|
49
|
+
/*
|
50
|
+
* Get the sound's volume
|
51
|
+
*/
|
52
|
+
int S2D_GetSoundVolume(S2D_Sound *snd) {
|
53
|
+
if (!snd) return -1;
|
54
|
+
return ceil(Mix_VolumeChunk(snd->data, -1) * (100.0 / MIX_MAX_VOLUME));
|
55
|
+
}
|
56
|
+
|
57
|
+
|
58
|
+
/*
|
59
|
+
* Set the sound's volume a given percentage
|
60
|
+
*/
|
61
|
+
void S2D_SetSoundVolume(S2D_Sound *snd, int volume) {
|
62
|
+
if (!snd) return;
|
63
|
+
// Set volume to be a percentage of the maximum mix volume
|
64
|
+
Mix_VolumeChunk(snd->data, (volume / 100.0) * MIX_MAX_VOLUME);
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
/*
|
69
|
+
* Get the sound mixer volume
|
70
|
+
*/
|
71
|
+
int S2D_GetSoundMixVolume() {
|
72
|
+
return ceil(Mix_Volume(-1, -1) * (100.0 / MIX_MAX_VOLUME));
|
73
|
+
}
|
74
|
+
|
75
|
+
|
76
|
+
/*
|
77
|
+
* Set the sound mixer volume a given percentage
|
78
|
+
*/
|
79
|
+
void S2D_SetSoundMixVolume(int volume) {
|
80
|
+
// This sets the volume value across all channels
|
81
|
+
// Set volume to be a percentage of the maximum mix volume
|
82
|
+
Mix_Volume(-1, (volume / 100.0) * MIX_MAX_VOLUME);
|
83
|
+
}
|
84
|
+
|
85
|
+
|
49
86
|
/*
|
50
87
|
* Free the sound
|
51
88
|
*/
|
@@ -91,6 +91,12 @@ int S2D_Show(S2D_Window *window) {
|
|
91
91
|
|
92
92
|
S2D_GL_Init(window);
|
93
93
|
|
94
|
+
// SDL 2.0.10 and macOS 10.15 fix ////////////////////////////////////////////
|
95
|
+
|
96
|
+
#if MACOS
|
97
|
+
SDL_SetWindowSize(window->sdl, window->width, window->height);
|
98
|
+
#endif
|
99
|
+
|
94
100
|
// Set Main Loop Data ////////////////////////////////////////////////////////
|
95
101
|
|
96
102
|
const Uint8 *key_state;
|
@@ -313,6 +319,11 @@ int S2D_Show(S2D_Window *window) {
|
|
313
319
|
if (window->render) window->render();
|
314
320
|
|
315
321
|
// Draw Frame //////////////////////////////////////////////////////////////
|
322
|
+
|
323
|
+
// Render and flush all OpenGL buffers
|
324
|
+
S2D_GL_FlushBuffers();
|
325
|
+
|
326
|
+
// Swap buffers to display drawn contents in the window
|
316
327
|
SDL_GL_SwapWindow(window->sdl);
|
317
328
|
}
|
318
329
|
|
data/assets/macos/lib/libFLAC.a
CHANGED
Binary file
|
data/assets/macos/lib/libSDL2.a
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/assets/macos/lib/libjpeg.a
CHANGED
Binary file
|
Binary file
|
data/assets/macos/lib/libogg.a
CHANGED
Binary file
|
data/assets/macos/lib/libpng16.a
CHANGED
Binary file
|
Binary file
|
data/assets/macos/lib/libtiff.a
CHANGED
Binary file
|
data/assets/macos/lib/libwebp.a
CHANGED
Binary file
|
data/assets/mingw/bin/SDL2.dll
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/assets/mingw/lib/libSDL2.a
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/ext/ruby2d/extconf.rb
CHANGED
data/lib/ruby2d/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby2d
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Black
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -33,6 +33,7 @@ extensions:
|
|
33
33
|
extra_rdoc_files: []
|
34
34
|
files:
|
35
35
|
- assets/README.md
|
36
|
+
- assets/Rakefile
|
36
37
|
- assets/app.icns
|
37
38
|
- assets/include/SDL2/SDL.h
|
38
39
|
- assets/include/SDL2/SDL_assert.h
|
@@ -42,6 +43,17 @@ files:
|
|
42
43
|
- assets/include/SDL2/SDL_blendmode.h
|
43
44
|
- assets/include/SDL2/SDL_clipboard.h
|
44
45
|
- assets/include/SDL2/SDL_config.h
|
46
|
+
- assets/include/SDL2/SDL_config_android.h
|
47
|
+
- assets/include/SDL2/SDL_config_iphoneos.h
|
48
|
+
- assets/include/SDL2/SDL_config_macosx.h
|
49
|
+
- assets/include/SDL2/SDL_config_minimal.h
|
50
|
+
- assets/include/SDL2/SDL_config_os2.h
|
51
|
+
- assets/include/SDL2/SDL_config_pandora.h
|
52
|
+
- assets/include/SDL2/SDL_config_psp.h
|
53
|
+
- assets/include/SDL2/SDL_config_windows.h
|
54
|
+
- assets/include/SDL2/SDL_config_winrt.h
|
55
|
+
- assets/include/SDL2/SDL_config_wiz.h
|
56
|
+
- assets/include/SDL2/SDL_copying.h
|
45
57
|
- assets/include/SDL2/SDL_cpuinfo.h
|
46
58
|
- assets/include/SDL2/SDL_egl.h
|
47
59
|
- assets/include/SDL2/SDL_endian.h
|