gosu 1.4.5.pre1 → 1.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -8
- data/dependencies/SDL/include/SDL.h +2 -1
- data/dependencies/SDL/include/SDL_assert.h +8 -12
- data/dependencies/SDL/include/SDL_atomic.h +21 -1
- data/dependencies/SDL/include/SDL_audio.h +41 -5
- data/dependencies/SDL/include/SDL_bits.h +1 -1
- data/dependencies/SDL/include/SDL_blendmode.h +5 -7
- data/dependencies/SDL/include/SDL_clipboard.h +48 -1
- data/dependencies/SDL/include/SDL_config.h +73 -47
- data/dependencies/SDL/include/SDL_cpuinfo.h +40 -5
- data/dependencies/SDL/include/SDL_egl.h +60 -10
- data/dependencies/SDL/include/SDL_endian.h +35 -4
- data/dependencies/SDL/include/SDL_error.h +1 -1
- data/dependencies/SDL/include/SDL_events.h +33 -2
- data/dependencies/SDL/include/SDL_filesystem.h +6 -2
- data/dependencies/SDL/include/SDL_gamecontroller.h +79 -6
- data/dependencies/SDL/include/SDL_gesture.h +1 -1
- data/dependencies/SDL/include/SDL_guid.h +100 -0
- data/dependencies/SDL/include/SDL_haptic.h +1 -1
- data/dependencies/SDL/include/SDL_hidapi.h +1 -1
- data/dependencies/SDL/include/SDL_hints.h +646 -44
- data/dependencies/SDL/include/SDL_joystick.h +128 -8
- data/dependencies/SDL/include/SDL_keyboard.h +39 -2
- data/dependencies/SDL/include/SDL_keycode.h +7 -2
- data/dependencies/SDL/include/SDL_loadso.h +1 -1
- data/dependencies/SDL/include/SDL_locale.h +1 -1
- data/dependencies/SDL/include/SDL_log.h +3 -3
- data/dependencies/SDL/include/SDL_main.h +43 -3
- data/dependencies/SDL/include/SDL_messagebox.h +1 -1
- data/dependencies/SDL/include/SDL_metal.h +3 -2
- data/dependencies/SDL/include/SDL_misc.h +1 -1
- data/dependencies/SDL/include/SDL_mouse.h +13 -2
- data/dependencies/SDL/include/SDL_mutex.h +1 -1
- data/dependencies/SDL/include/SDL_name.h +1 -1
- data/dependencies/SDL/include/SDL_opengl.h +1 -52
- data/dependencies/SDL/include/SDL_opengl_glext.h +2260 -231
- data/dependencies/SDL/include/SDL_opengles.h +1 -1
- data/dependencies/SDL/include/SDL_opengles2.h +1 -1
- data/dependencies/SDL/include/SDL_opengles2_gl2.h +374 -339
- data/dependencies/SDL/include/SDL_opengles2_gl2ext.h +3479 -1496
- data/dependencies/SDL/include/SDL_opengles2_gl2platform.h +6 -9
- data/dependencies/SDL/include/SDL_opengles2_khrplatform.h +43 -14
- data/dependencies/SDL/include/SDL_pixels.h +1 -1
- data/dependencies/SDL/include/SDL_platform.h +33 -7
- data/dependencies/SDL/include/SDL_power.h +1 -1
- data/dependencies/SDL/include/SDL_quit.h +1 -1
- data/dependencies/SDL/include/SDL_rect.h +155 -3
- data/dependencies/SDL/include/SDL_render.h +47 -18
- data/dependencies/SDL/include/SDL_revision.h +6 -1
- data/dependencies/SDL/include/SDL_rwops.h +2 -16
- data/dependencies/SDL/include/SDL_scancode.h +47 -22
- data/dependencies/SDL/include/SDL_sensor.h +25 -4
- data/dependencies/SDL/include/SDL_shape.h +1 -1
- data/dependencies/SDL/include/SDL_stdinc.h +120 -9
- data/dependencies/SDL/include/SDL_surface.h +4 -2
- data/dependencies/SDL/include/SDL_system.h +67 -7
- data/dependencies/SDL/include/SDL_syswm.h +3 -1
- data/dependencies/SDL/include/SDL_test.h +1 -1
- data/dependencies/SDL/include/SDL_test_assert.h +1 -1
- data/dependencies/SDL/include/SDL_test_common.h +2 -1
- data/dependencies/SDL/include/SDL_test_compare.h +1 -1
- data/dependencies/SDL/include/SDL_test_crc32.h +1 -1
- data/dependencies/SDL/include/SDL_test_font.h +91 -4
- data/dependencies/SDL/include/SDL_test_fuzzer.h +1 -1
- data/dependencies/SDL/include/SDL_test_harness.h +1 -1
- data/dependencies/SDL/include/SDL_test_images.h +1 -1
- data/dependencies/SDL/include/SDL_test_log.h +1 -1
- data/dependencies/SDL/include/SDL_test_md5.h +1 -1
- data/dependencies/SDL/include/SDL_test_memory.h +1 -1
- data/dependencies/SDL/include/SDL_test_random.h +1 -1
- data/dependencies/SDL/include/SDL_thread.h +6 -6
- data/dependencies/SDL/include/SDL_timer.h +1 -1
- data/dependencies/SDL/include/SDL_touch.h +9 -1
- data/dependencies/SDL/include/SDL_types.h +1 -1
- data/dependencies/SDL/include/SDL_version.h +20 -4
- data/dependencies/SDL/include/SDL_video.h +72 -10
- data/dependencies/SDL/include/begin_code.h +5 -5
- data/dependencies/SDL/include/close_code.h +1 -1
- data/dependencies/SDL/lib/x64/libSDL2.dll.a +0 -0
- data/dependencies/SDL/lib/x86/libSDL2.dll.a +0 -0
- data/dependencies/SDL_sound/SDL_sound.c +210 -71
- data/dependencies/SDL_sound/SDL_sound.h +1 -1
- data/dependencies/SDL_sound/SDL_sound_coreaudio.c +111 -168
- data/dependencies/SDL_sound/SDL_sound_flac.c +0 -6
- data/dependencies/SDL_sound/SDL_sound_internal.h +24 -2
- data/dependencies/SDL_sound/SDL_sound_modplug.c +20 -8
- data/dependencies/SDL_sound/SDL_sound_mp3.c +11 -7
- data/dependencies/SDL_sound/SDL_sound_raw.c +1 -1
- data/dependencies/SDL_sound/SDL_sound_shn.c +1 -5
- data/dependencies/SDL_sound/SDL_sound_voc.c +1 -1
- data/dependencies/SDL_sound/SDL_sound_vorbis.c +2 -4
- data/dependencies/SDL_sound/SDL_sound_wav.c +49 -20
- data/dependencies/SDL_sound/dr_flac.h +237 -95
- data/dependencies/SDL_sound/dr_mp3.h +46 -33
- data/dependencies/SDL_sound/libmodplug/fastmix.c +53 -39
- data/dependencies/SDL_sound/libmodplug/libmodplug.h +0 -12
- data/dependencies/SDL_sound/libmodplug/load_669.c +37 -32
- data/dependencies/SDL_sound/libmodplug/load_amf.c +57 -44
- data/dependencies/SDL_sound/libmodplug/load_ams.c +127 -100
- data/dependencies/SDL_sound/libmodplug/load_dbm.c +40 -37
- data/dependencies/SDL_sound/libmodplug/load_dmf.c +61 -49
- data/dependencies/SDL_sound/libmodplug/load_dsm.c +18 -13
- data/dependencies/SDL_sound/libmodplug/load_far.c +31 -24
- data/dependencies/SDL_sound/libmodplug/load_gdm.c +27 -21
- data/dependencies/SDL_sound/libmodplug/load_it.c +106 -91
- data/dependencies/SDL_sound/libmodplug/load_mdl.c +43 -35
- data/dependencies/SDL_sound/libmodplug/load_med.c +66 -52
- data/dependencies/SDL_sound/libmodplug/load_mod.c +30 -26
- data/dependencies/SDL_sound/libmodplug/load_mt2.c +61 -50
- data/dependencies/SDL_sound/libmodplug/load_mtm.c +23 -17
- data/dependencies/SDL_sound/libmodplug/load_okt.c +18 -16
- data/dependencies/SDL_sound/libmodplug/load_psm.c +44 -32
- data/dependencies/SDL_sound/libmodplug/load_ptm.c +18 -14
- data/dependencies/SDL_sound/libmodplug/load_s3m.c +59 -53
- data/dependencies/SDL_sound/libmodplug/load_stm.c +23 -18
- data/dependencies/SDL_sound/libmodplug/load_ult.c +33 -29
- data/dependencies/SDL_sound/libmodplug/load_xm.c +64 -57
- data/dependencies/SDL_sound/libmodplug/mmcmp.c +2 -1
- data/dependencies/SDL_sound/libmodplug/snd_dsp.c +30 -20
- data/dependencies/SDL_sound/libmodplug/snd_flt.c +6 -4
- data/dependencies/SDL_sound/libmodplug/snd_fx.c +91 -65
- data/dependencies/SDL_sound/libmodplug/sndfile.c +91 -66
- data/dependencies/SDL_sound/libmodplug/sndmix.c +58 -35
- data/dependencies/SDL_sound/stb_vorbis.h +14 -9
- data/dependencies/mojoAL/mojoal.c +68 -40
- data/dependencies/stb/stb_image.h +117 -27
- data/dependencies/utf8proc/utf8proc.c +1 -1
- data/dependencies/utf8proc/utf8proc.h +1 -1
- data/dependencies/utf8proc/utf8proc_data.h +3366 -3184
- data/ext/gosu/extconf.rb +1 -1
- data/include/Gosu/Version.hpp +1 -1
- data/lib/SDL2.dll +0 -0
- data/lib64/SDL2.dll +0 -0
- data/src/AudioFile.hpp +1 -1
- data/src/AudioFileSDLSound.cpp +2 -0
- data/src/AudioImpl.hpp +2 -2
- data/src/Input.cpp +30 -26
- data/src/RubyGosu.cxx +146 -93
- data/src/RubyGosu.h +5 -7
- data/src/Window.cpp +3 -0
- metadata +6 -15
- data/dependencies/SDL/include/SDL_config_android.h +0 -157
- data/dependencies/SDL/include/SDL_config_iphoneos.h +0 -166
- data/dependencies/SDL/include/SDL_config_macosx.h +0 -197
- data/dependencies/SDL/include/SDL_config_minimal.h +0 -82
- data/dependencies/SDL/include/SDL_config_pandora.h +0 -128
- data/dependencies/SDL/include/SDL_config_psp.h +0 -144
- data/dependencies/SDL/include/SDL_config_windows.h +0 -225
- data/dependencies/SDL/include/SDL_config_winrt.h +0 -215
- data/dependencies/SDL/include/SDL_config_wiz.h +0 -121
- data/dependencies/SDL/include/SDL_copying.h +0 -20
data/ext/gosu/extconf.rb
CHANGED
@@ -33,7 +33,7 @@ $CXXFLAGS ||= ""
|
|
33
33
|
$CXXFLAGS << " -std=gnu++17 -Dregister="
|
34
34
|
|
35
35
|
# Make Gosu's own header files and all of its dependencies available to C++ source files.
|
36
|
-
$INCFLAGS << " -I../../include -I../../dependencies/stb -I../../dependencies/utf8proc -I../../dependencies/SDL_sound -I../../dependencies/mojoAL"
|
36
|
+
$INCFLAGS << " -I../../include -I../../dependencies/stb -I../../dependencies/utf8proc -I../../dependencies/SDL_sound -I../../dependencies/mojoAL/AL"
|
37
37
|
|
38
38
|
if windows
|
39
39
|
# We statically compile utf8proc into the Gosu binary.
|
data/include/Gosu/Version.hpp
CHANGED
data/lib/SDL2.dll
CHANGED
Binary file
|
data/lib64/SDL2.dll
CHANGED
Binary file
|
data/src/AudioFile.hpp
CHANGED
data/src/AudioFileSDLSound.cpp
CHANGED
data/src/AudioImpl.hpp
CHANGED
data/src/Input.cpp
CHANGED
@@ -13,6 +13,7 @@
|
|
13
13
|
#include <algorithm>
|
14
14
|
#include <array>
|
15
15
|
#include <mutex>
|
16
|
+
#include <stdexcept>
|
16
17
|
using namespace std;
|
17
18
|
|
18
19
|
static void require_sdl_video()
|
@@ -140,39 +141,42 @@ struct Gosu::Input::Impl : private Gosu::Noncopyable
|
|
140
141
|
}
|
141
142
|
int gamepad_slot = -1;
|
142
143
|
int joystick_instance_id = -1;
|
144
|
+
int i = e->jdevice.which; // SDL2 device_index
|
143
145
|
|
144
|
-
|
145
|
-
|
146
|
-
// Prefer the SDL_GameController API...
|
147
|
-
if (SDL_IsGameController(i)) {
|
148
|
-
if (SDL_GameController *game_controller = SDL_GameControllerOpen(i)) {
|
149
|
-
gamepad_slot = available_gamepad_slot_index();
|
150
|
-
joystick_instance_id = SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(game_controller));
|
151
|
-
if (gamepad_instance_id_is_known(joystick_instance_id)) {
|
152
|
-
continue;
|
153
|
-
}
|
154
|
-
open_game_controllers.emplace_back(
|
155
|
-
shared_ptr<SDL_GameController>(game_controller, SDL_GameControllerClose)
|
156
|
-
);
|
157
|
-
}
|
158
|
-
}
|
159
|
-
// ...but fall back on the good, old SDL_Joystick API.
|
160
|
-
else if (SDL_Joystick *joystick = SDL_JoystickOpen(i)) {
|
146
|
+
if (SDL_IsGameController(i)) {
|
147
|
+
if (SDL_GameController *game_controller = SDL_GameControllerOpen(i)) {
|
161
148
|
gamepad_slot = available_gamepad_slot_index();
|
162
|
-
joystick_instance_id = SDL_JoystickInstanceID(
|
149
|
+
joystick_instance_id = SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(game_controller));
|
163
150
|
if (gamepad_instance_id_is_known(joystick_instance_id)) {
|
164
|
-
|
151
|
+
return true;
|
165
152
|
}
|
166
|
-
|
167
|
-
|
153
|
+
#if SDL_VERSION_ATLEAST(2, 0, 12)
|
154
|
+
SDL_GameControllerSetPlayerIndex(game_controller, gamepad_slot);
|
155
|
+
#endif
|
156
|
+
open_game_controllers.emplace_back(
|
157
|
+
shared_ptr<SDL_GameController>(game_controller, SDL_GameControllerClose)
|
168
158
|
);
|
169
159
|
}
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
160
|
+
}
|
161
|
+
// ...but fall back on the good, old SDL_Joystick API.
|
162
|
+
else if (SDL_Joystick* joystick = SDL_JoystickOpen(i)) {
|
163
|
+
gamepad_slot = available_gamepad_slot_index();
|
164
|
+
joystick_instance_id = SDL_JoystickInstanceID(joystick);
|
165
|
+
if (gamepad_instance_id_is_known(joystick_instance_id)) {
|
166
|
+
return true;
|
175
167
|
}
|
168
|
+
#if SDL_VERSION_ATLEAST(2, 0, 12)
|
169
|
+
SDL_JoystickSetPlayerIndex(joystick, gamepad_slot);
|
170
|
+
#endif
|
171
|
+
open_joysticks.emplace_back(
|
172
|
+
shared_ptr<SDL_Joystick>(joystick, SDL_JoystickClose)
|
173
|
+
);
|
174
|
+
}
|
175
|
+
|
176
|
+
// Reserve gamepad slot and issue gamepad connection event
|
177
|
+
if (gamepad_slot >= 0 && joystick_instance_id >= 0) {
|
178
|
+
gamepad_slots[gamepad_slot] = joystick_instance_id;
|
179
|
+
enqueue_gamepad_connection_event(gamepad_slot, true, -1);
|
176
180
|
}
|
177
181
|
break;
|
178
182
|
}
|