gosu 1.0.0.pre1 → 1.0.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/gosu/extconf.rb +4 -24
- data/include/Gosu/Buttons.hpp +18 -17
- data/include/Gosu/Fwd.hpp +0 -5
- data/include/Gosu/Input.hpp +13 -40
- data/include/Gosu/Utility.hpp +14 -3
- data/include/Gosu/Version.hpp +3 -3
- data/include/Gosu/Window.hpp +2 -12
- data/lib/OpenAL32.dll +0 -0
- data/lib64/OpenAL32.dll +0 -0
- data/rdoc/gosu.rb +6 -5
- data/src/AudioFile.hpp +3 -0
- data/src/Constants.cpp +9 -5
- data/src/GosuWrapper.cpp +4 -4
- data/src/Input.cpp +27 -28
- data/src/RubyGosu.cxx +25 -30
- data/src/WindowWrapper.cpp +3 -3
- metadata +3 -8
- data/include/Gosu/AutoLink.hpp +0 -14
- data/lib/libmpg123.dll +0 -0
- data/lib/libsndfile.dll +0 -0
- data/lib64/libmpg123.dll +0 -0
- data/lib64/libsndfile.dll +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee520b114c06651017a9aac042728e418654c2721bd483fe3de6c44be2acc1de
|
4
|
+
data.tar.gz: 2da43a5b2e1a19d45e1be85acceb48210c70a9fb866e03ca392c6232c8e89186
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af2d2f9ac8121b4edae0ab5fd2bdd9aa69c0209741ae2af4dabc99419ab0ba9520c0dafa51640132db79c1496f2993f40ab000c475e562d079b59fdecd3227e7
|
7
|
+
data.tar.gz: 0ee8ff41e302362370ed40d2d640444a89a232ddd35a072d4c038941b6412ea7662d06ea5acdabe8ffc1739ca73aade3d88ec0b4090bb7db8023b5ec777f97d2
|
data/ext/gosu/extconf.rb
CHANGED
@@ -5,11 +5,9 @@ when /^mingw/
|
|
5
5
|
windows = true
|
6
6
|
when /^darwin/
|
7
7
|
macos = true
|
8
|
-
when /linux/
|
9
|
-
linux = true
|
10
8
|
end
|
11
9
|
|
12
|
-
if
|
10
|
+
if not windows
|
13
11
|
puts 'The Gosu gem requires some libraries to be installed system-wide.'
|
14
12
|
puts 'See the following site for a list:'
|
15
13
|
if macos
|
@@ -54,12 +52,11 @@ if windows
|
|
54
52
|
$LDFLAGS << " -L../../dependencies/al_soft/x86 -L../../dependencies/SDL/lib/x86"
|
55
53
|
end
|
56
54
|
$LDFLAGS << " -lgdi32 -lwinmm -lOpenGL32 -lOpenAL32 -lSDL2"
|
55
|
+
# Link libstdc++ statically to avoid having another DLL dependency when using Ocra.
|
56
|
+
$LDFLAGS << " -static-libstdc++"
|
57
57
|
elsif macos
|
58
58
|
# Compile all C++ files as Objective C++ on macOS since mkmf does not support .mm files.
|
59
59
|
$CXXFLAGS << " -x objective-c++ -fobjc-arc -DNDEBUG"
|
60
|
-
# Prevents issues with Apple's pre-installed Ruby 2.3 on macOS 10.13.
|
61
|
-
# https://github.com/gosu/gosu/issues/424
|
62
|
-
$CXXFLAGS << " -Wno-reserved-user-defined-literal"
|
63
60
|
|
64
61
|
# Explicitly specify libc++ as the standard library.
|
65
62
|
# rvm will sometimes try to override this:
|
@@ -82,7 +79,7 @@ elsif macos
|
|
82
79
|
$LDFLAGS.gsub! "-arch i386", ""
|
83
80
|
$ARCH_FLAG.gsub! "-arch i386", ""
|
84
81
|
CONFIG['LDSHARED'].gsub! "-arch i386", ""
|
85
|
-
|
82
|
+
else
|
86
83
|
if /BCM2708/ =~ `cat /proc/cpuinfo`
|
87
84
|
$INCFLAGS << " -I/opt/vc/include/GLES"
|
88
85
|
$INCFLAGS << " -I/opt/vc/include"
|
@@ -113,21 +110,4 @@ Dir.glob('../../dependencies/**/*.c').each do |dep|
|
|
113
110
|
end
|
114
111
|
end
|
115
112
|
|
116
|
-
# Gem::Version#initialize is apparently broken in some versions of Ruby, so use a local helper.
|
117
|
-
def ruby_newer_than?(want_version)
|
118
|
-
have_parts = RUBY_VERSION.split('.').map { |part| part.to_i }
|
119
|
-
want_parts = want_version.split('.').map { |part| part.to_i }
|
120
|
-
have_parts << 0 while have_parts.size < want_parts.size
|
121
|
-
want_parts << 0 while want_parts.size < have_parts.size
|
122
|
-
(have_parts <=> want_parts) == 1
|
123
|
-
end
|
124
|
-
|
125
|
-
# In some versions of Ruby/mkmf, the $CXXFLAGS variable does not work.
|
126
|
-
# We can modify CONFIG instead, and our changes will end up in the Makefile.
|
127
|
-
# See: http://bugs.ruby-lang.org/issues/8315
|
128
|
-
# The lower bound was reduced to 1.9.3 here: https://github.com/gosu/gosu/issues/321
|
129
|
-
if ruby_newer_than?("1.9.2") and not ruby_newer_than?("2.2.0")
|
130
|
-
CONFIG['CXXFLAGS'] = "#$CFLAGS #$CXXFLAGS"
|
131
|
-
end
|
132
|
-
|
133
113
|
create_makefile "gosu", "../../src"
|
data/include/Gosu/Buttons.hpp
CHANGED
@@ -1,15 +1,12 @@
|
|
1
1
|
#pragma once
|
2
2
|
|
3
|
-
#include <Gosu/Platform.hpp>
|
4
|
-
|
5
3
|
namespace Gosu
|
6
4
|
{
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
enum
|
5
|
+
/// List of button IDs that can be used with Gosu::Input.
|
6
|
+
/// This enumeration contains IDs for keyboard keys (KB_*),
|
7
|
+
/// mouse buttons and mouse wheel (MS_*), as well as gamepad buttons (GP_*).
|
8
|
+
enum Button
|
11
9
|
{
|
12
|
-
KB_RANGE_BEGIN,
|
13
10
|
KB_ESCAPE = 41,
|
14
11
|
KB_F1 = 58,
|
15
12
|
KB_F2 = 59,
|
@@ -51,8 +48,8 @@ namespace Gosu
|
|
51
48
|
KB_DOWN = 81,
|
52
49
|
KB_HOME = 74,
|
53
50
|
KB_END = 77,
|
54
|
-
|
55
|
-
|
51
|
+
KB_PRINT_SCREEN = 70,
|
52
|
+
KB_SCROLL_LOCK = 71,
|
56
53
|
KB_PAUSE = 72,
|
57
54
|
KB_INSERT = 73,
|
58
55
|
KB_DELETE = 76,
|
@@ -70,7 +67,7 @@ namespace Gosu
|
|
70
67
|
KB_COMMA = 54,
|
71
68
|
KB_PERIOD = 55,
|
72
69
|
KB_SLASH = 56,
|
73
|
-
|
70
|
+
KB_CAPS_LOCK = 57,
|
74
71
|
KB_A = 4,
|
75
72
|
KB_B = 5,
|
76
73
|
KB_C = 6,
|
@@ -97,7 +94,8 @@ namespace Gosu
|
|
97
94
|
KB_X = 27,
|
98
95
|
KB_Y = 28,
|
99
96
|
KB_Z = 29,
|
100
|
-
|
97
|
+
/// ` on US/UK macOS, < on EU macOS, \ on US/UK Windows
|
98
|
+
KB_ISO = 100,
|
101
99
|
KB_NUMPAD_0 = 98,
|
102
100
|
KB_NUMPAD_1 = 89,
|
103
101
|
KB_NUMPAD_2 = 90,
|
@@ -129,7 +127,6 @@ namespace Gosu
|
|
129
127
|
MS_OTHER_5,
|
130
128
|
MS_OTHER_6,
|
131
129
|
MS_OTHER_7,
|
132
|
-
MS_RANGE_END = 0x110,
|
133
130
|
|
134
131
|
GP_RANGE_BEGIN,
|
135
132
|
GP_DPAD_LEFT = GP_RANGE_BEGIN,
|
@@ -263,8 +260,14 @@ namespace Gosu
|
|
263
260
|
GP_3_DOWN,
|
264
261
|
GP_RANGE_END = GP_3_DOWN,
|
265
262
|
|
266
|
-
|
267
|
-
|
263
|
+
NUM_GAMEPADS = 4,
|
264
|
+
NO_BUTTON = 0xffffffff,
|
265
|
+
};
|
266
|
+
|
267
|
+
/// List of axis IDs that can be used with Gosu::Input.
|
268
|
+
enum Axis
|
269
|
+
{
|
270
|
+
GP_LEFT_STICK_X_AXIS,
|
268
271
|
GP_LEFT_STICK_Y_AXIS,
|
269
272
|
GP_RIGHT_STICK_X_AXIS,
|
270
273
|
GP_RIGHT_STICK_Y_AXIS,
|
@@ -298,9 +301,7 @@ namespace Gosu
|
|
298
301
|
GP_3_RIGHT_STICK_Y_AXIS,
|
299
302
|
GP_3_LEFT_TRIGGER_AXIS,
|
300
303
|
GP_3_RIGHT_TRIGGER_AXIS,
|
301
|
-
GP_AXES_RANGE_END = GP_3_RIGHT_TRIGGER_AXIS,
|
302
304
|
|
303
|
-
|
304
|
-
NO_BUTTON = 0xffffffff,
|
305
|
+
NUM_AXES
|
305
306
|
};
|
306
307
|
}
|
data/include/Gosu/Fwd.hpp
CHANGED
@@ -1,14 +1,9 @@
|
|
1
|
-
//! \file Fwd.hpp
|
2
|
-
//! Contains forward declarations of all of Gosu's available classes.
|
3
|
-
|
4
1
|
#pragma once
|
5
2
|
|
6
|
-
//! The library's main namespace.
|
7
3
|
namespace Gosu
|
8
4
|
{
|
9
5
|
class Bitmap;
|
10
6
|
class Buffer;
|
11
|
-
class Button;
|
12
7
|
class Channel;
|
13
8
|
class Color;
|
14
9
|
class File;
|
data/include/Gosu/Input.hpp
CHANGED
@@ -1,11 +1,9 @@
|
|
1
|
-
//! \file Input.hpp
|
2
|
-
//! Interface of the Input class.
|
3
|
-
|
4
1
|
#pragma once
|
5
2
|
|
6
3
|
#include <Gosu/Fwd.hpp>
|
7
4
|
#include <Gosu/Buttons.hpp>
|
8
5
|
#include <Gosu/Platform.hpp>
|
6
|
+
#include <Gosu/Utility.hpp>
|
9
7
|
#include <functional>
|
10
8
|
#include <memory>
|
11
9
|
#include <string>
|
@@ -13,56 +11,30 @@
|
|
13
11
|
|
14
12
|
namespace Gosu
|
15
13
|
{
|
16
|
-
|
17
|
-
|
18
|
-
{
|
19
|
-
unsigned id_;
|
20
|
-
|
21
|
-
public:
|
22
|
-
//! For internal use.
|
23
|
-
explicit Button(unsigned id) : id_(id) {}
|
24
|
-
//! For internal use.
|
25
|
-
unsigned id() const { return id_; }
|
26
|
-
|
27
|
-
//! Default constructor; == no_button.
|
28
|
-
Button() : id_(NO_BUTTON) {}
|
29
|
-
|
30
|
-
//! Conversion from ButtonName constants.
|
31
|
-
Button(ButtonName name) : id_(name) {}
|
32
|
-
};
|
33
|
-
|
34
|
-
//! Tests whether two Buttons identify the same physical button.
|
35
|
-
inline bool operator==(Button lhs, Button rhs) { return lhs.id() == rhs.id(); }
|
36
|
-
inline bool operator!=(Button lhs, Button rhs) { return !(lhs == rhs); }
|
37
|
-
inline bool operator<(Button lhs, Button rhs) { return lhs.id() < rhs.id(); }
|
38
|
-
|
39
|
-
//! Struct that saves information about a touch on the surface of a multi-
|
40
|
-
//! touch device.
|
41
|
-
//! Available even on non-iPhone platforms to make it easier to compile the
|
42
|
-
//! same source for multiple platforms.
|
14
|
+
/// Struct that saves information about a touch on the surface of a multi-touch device.
|
15
|
+
/// (Right now this is only supported on iOS.)
|
43
16
|
struct Touch
|
44
17
|
{
|
45
|
-
|
18
|
+
/// Allows for identification of a touch across calls.
|
46
19
|
void* id;
|
47
|
-
|
48
|
-
|
20
|
+
/// Position of a touch on the touch screen.
|
21
|
+
double x, y;
|
49
22
|
};
|
50
23
|
typedef std::vector<Touch> Touches;
|
51
24
|
|
52
|
-
|
53
|
-
|
54
|
-
class Input
|
25
|
+
/// Manages initialization and shutdown of the input system.
|
26
|
+
/// Only one Input instance can exist per application.
|
27
|
+
class Input : Noncopyable
|
55
28
|
{
|
56
29
|
struct Impl;
|
57
|
-
|
58
|
-
const std::unique_ptr<Impl> pimpl;
|
30
|
+
std::unique_ptr<Impl> pimpl;
|
59
31
|
|
60
32
|
public:
|
61
33
|
#ifdef GOSU_IS_IPHONE
|
62
34
|
Input(void* view, float update_interval);
|
63
35
|
void feed_touch_event(std::function<void (Touch)>& callback, void* touches);
|
64
36
|
#else
|
65
|
-
Input(void* window);
|
37
|
+
explicit Input(void* window);
|
66
38
|
bool feed_sdl_event(void* event);
|
67
39
|
#endif
|
68
40
|
|
@@ -87,7 +59,8 @@ namespace Gosu
|
|
87
59
|
//! Updated every tick.
|
88
60
|
static bool down(Button btn);
|
89
61
|
|
90
|
-
//! Returns the value of a
|
62
|
+
//! Returns the value of a gamepad stick in the range -1.0 through +1.0, or a trigger in the
|
63
|
+
//! range 0.0 through +1.0.
|
91
64
|
//! Updated every tick.
|
92
65
|
static double axis(Button btn);
|
93
66
|
|
data/include/Gosu/Utility.hpp
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
//! \file Utility.hpp
|
2
|
-
//! General purpose utility functions.
|
3
|
-
|
4
1
|
#pragma once
|
5
2
|
|
6
3
|
#include <string>
|
@@ -17,4 +14,18 @@ namespace Gosu
|
|
17
14
|
//! values such as 'en_US', 'de_DE.UTF-8', 'ja', 'zh-Hans'.
|
18
15
|
//! The first two letters will always be a language code.
|
19
16
|
std::string language();
|
17
|
+
|
18
|
+
class Noncopyable
|
19
|
+
{
|
20
|
+
protected:
|
21
|
+
Noncopyable() = default;
|
22
|
+
~Noncopyable() = default;
|
23
|
+
|
24
|
+
public:
|
25
|
+
Noncopyable(const Noncopyable& other) = delete;
|
26
|
+
Noncopyable& operator=(const Noncopyable& other) = delete;
|
27
|
+
|
28
|
+
Noncopyable(Noncopyable&& other) = delete;
|
29
|
+
Noncopyable& operator=(Noncopyable&& other) = delete;
|
30
|
+
};
|
20
31
|
}
|
data/include/Gosu/Version.hpp
CHANGED
data/include/Gosu/Window.hpp
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
//! \file Window.hpp
|
2
|
-
//! Interface of the Window class.
|
3
|
-
|
4
1
|
#pragma once
|
5
2
|
|
6
3
|
#include <Gosu/Fwd.hpp>
|
@@ -9,13 +6,6 @@
|
|
9
6
|
#include <memory>
|
10
7
|
#include <string>
|
11
8
|
|
12
|
-
#ifdef GOSU_IS_WIN
|
13
|
-
#ifndef NOMINMAX
|
14
|
-
#define NOMINMAX
|
15
|
-
#endif
|
16
|
-
#include <windows.h>
|
17
|
-
#endif
|
18
|
-
|
19
9
|
namespace Gosu
|
20
10
|
{
|
21
11
|
//! Convenient all-in-one class that serves as the foundation of a standard Gosu application.
|
@@ -82,8 +72,8 @@ namespace Gosu
|
|
82
72
|
//! By default, the window is redrawn all the time.
|
83
73
|
virtual bool needs_redraw() const { return true; }
|
84
74
|
|
85
|
-
//! If this function returns true, the system
|
86
|
-
virtual bool needs_cursor() const { return
|
75
|
+
//! If this function returns true, the system cursor will be visible while over the window.
|
76
|
+
virtual bool needs_cursor() const { return true; }
|
87
77
|
|
88
78
|
//! This function is called when the window loses focus on some platforms.
|
89
79
|
//! Most importantly, it is called on the iPhone or iPad when the user locks the screen.
|
data/lib/OpenAL32.dll
CHANGED
File without changes
|
data/lib64/OpenAL32.dll
CHANGED
File without changes
|
data/rdoc/gosu.rb
CHANGED
@@ -32,8 +32,8 @@ module Gosu
|
|
32
32
|
KB_DOWN = :an_integer
|
33
33
|
KB_END = :an_integer
|
34
34
|
|
35
|
-
|
36
|
-
|
35
|
+
KB_PRINT_SCREEN = :an_integer
|
36
|
+
KB_SCROLL_LOCK = :an_integer
|
37
37
|
KB_PAUSE = :an_integer
|
38
38
|
|
39
39
|
##
|
@@ -75,7 +75,7 @@ module Gosu
|
|
75
75
|
KB_RIGHT_SHIFT = :an_integer
|
76
76
|
KB_SEMICOLON = :an_integer
|
77
77
|
KB_SLASH = :an_integer
|
78
|
-
|
78
|
+
KB_CAPS_LOCK = :an_integer
|
79
79
|
KB_SPACE = :an_integer
|
80
80
|
KB_TAB = :an_integer
|
81
81
|
KB_UP = :an_integer
|
@@ -875,7 +875,7 @@ module Gosu
|
|
875
875
|
def draw; end
|
876
876
|
|
877
877
|
##
|
878
|
-
# This method can be
|
878
|
+
# This method can be overridden to give the game a chance to opt out of a call to {#draw}; however, the operating system can still force a redraw for any reason.
|
879
879
|
#
|
880
880
|
# @return [true, false] whether the window needs to be redrawn.
|
881
881
|
#
|
@@ -883,7 +883,8 @@ module Gosu
|
|
883
883
|
def needs_redraw?; end
|
884
884
|
|
885
885
|
##
|
886
|
-
# This method can be
|
886
|
+
# This method can be overridden to control the visibility of the system cursor over your window.
|
887
|
+
# The base class implementation returns true.
|
887
888
|
#
|
888
889
|
# @return [true, false] whether the system cursor should be shown.
|
889
890
|
def needs_cursor?; end
|
data/src/AudioFile.hpp
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
#include <Gosu/IO.hpp>
|
4
4
|
|
5
5
|
#ifdef GOSU_IS_MAC
|
6
|
+
// Ignore OpenAL deprecation warnings. If macOS stops shipping OpenAL, it's more likely that we bundle our own version
|
7
|
+
// of it than that we switch to another audio API.
|
8
|
+
#define OPENAL_DEPRECATED
|
6
9
|
#include <OpenAL/al.h>
|
7
10
|
#else
|
8
11
|
#include <AL/al.h>
|
data/src/Constants.cpp
CHANGED
@@ -88,6 +88,9 @@ unsigned Gosu_KB_UP = Gosu::KB_UP;
|
|
88
88
|
unsigned Gosu_KB_DOWN = Gosu::KB_DOWN;
|
89
89
|
unsigned Gosu_KB_HOME = Gosu::KB_HOME;
|
90
90
|
unsigned Gosu_KB_END = Gosu::KB_END;
|
91
|
+
unsigned Gosu_KB_PRINT_SCREEN = Gosu::KB_PRINT_SCREEN;
|
92
|
+
unsigned Gosu_KB_SCROLL_LOCK = Gosu::KB_SCROLL_LOCK;
|
93
|
+
unsigned Gosu_KB_PAUSE = Gosu::KB_PAUSE;
|
91
94
|
unsigned Gosu_KB_INSERT = Gosu::KB_INSERT;
|
92
95
|
unsigned Gosu_KB_DELETE = Gosu::KB_DELETE;
|
93
96
|
unsigned Gosu_KB_PAGE_UP = Gosu::KB_PAGE_UP;
|
@@ -104,6 +107,7 @@ unsigned Gosu_KB_APOSTROPHE = Gosu::KB_APOSTROPHE;
|
|
104
107
|
unsigned Gosu_KB_COMMA = Gosu::KB_COMMA;
|
105
108
|
unsigned Gosu_KB_PERIOD = Gosu::KB_PERIOD;
|
106
109
|
unsigned Gosu_KB_SLASH = Gosu::KB_SLASH;
|
110
|
+
unsigned Gosu_KB_CAPS_LOCK = Gosu::KB_CAPS_LOCK;
|
107
111
|
unsigned Gosu_KB_A = Gosu::KB_A;
|
108
112
|
unsigned Gosu_KB_B = Gosu::KB_B;
|
109
113
|
unsigned Gosu_KB_C = Gosu::KB_C;
|
@@ -291,35 +295,35 @@ unsigned Gosu_GP_3_RIGHT = Gosu::GP_3_RIGHT;
|
|
291
295
|
unsigned Gosu_GP_3_UP = Gosu::GP_3_UP;
|
292
296
|
unsigned Gosu_GP_3_DOWN = Gosu::GP_3_DOWN;
|
293
297
|
|
294
|
-
unsigned Gosu_GP_LEFT_STICK_X_AXIS = Gosu::
|
298
|
+
unsigned Gosu_GP_LEFT_STICK_X_AXIS = Gosu::GP_LEFT_STICK_X_AXIS;
|
295
299
|
unsigned Gosu_GP_LEFT_STICK_Y_AXIS = Gosu::GP_LEFT_STICK_Y_AXIS;
|
296
300
|
unsigned Gosu_GP_RIGHT_STICK_X_AXIS = Gosu::GP_RIGHT_STICK_X_AXIS;
|
297
301
|
unsigned Gosu_GP_RIGHT_STICK_Y_AXIS = Gosu::GP_RIGHT_STICK_Y_AXIS;
|
298
302
|
unsigned Gosu_GP_LEFT_TRIGGER_AXIS = Gosu::GP_LEFT_TRIGGER_AXIS;
|
299
303
|
unsigned Gosu_GP_RIGHT_TRIGGER_AXIS = Gosu::GP_RIGHT_TRIGGER_AXIS;
|
300
304
|
|
301
|
-
unsigned Gosu_GP_0_LEFT_STICK_X_AXIS = Gosu::
|
305
|
+
unsigned Gosu_GP_0_LEFT_STICK_X_AXIS = Gosu::GP_0_LEFT_STICK_X_AXIS;
|
302
306
|
unsigned Gosu_GP_0_LEFT_STICK_Y_AXIS = Gosu::GP_0_LEFT_STICK_Y_AXIS;
|
303
307
|
unsigned Gosu_GP_0_RIGHT_STICK_X_AXIS = Gosu::GP_0_RIGHT_STICK_X_AXIS;
|
304
308
|
unsigned Gosu_GP_0_RIGHT_STICK_Y_AXIS = Gosu::GP_0_RIGHT_STICK_Y_AXIS;
|
305
309
|
unsigned Gosu_GP_0_LEFT_TRIGGER_AXIS = Gosu::GP_0_LEFT_TRIGGER_AXIS;
|
306
310
|
unsigned Gosu_GP_0_RIGHT_TRIGGER_AXIS = Gosu::GP_0_RIGHT_TRIGGER_AXIS;
|
307
311
|
|
308
|
-
unsigned Gosu_GP_1_LEFT_STICK_X_AXIS = Gosu::
|
312
|
+
unsigned Gosu_GP_1_LEFT_STICK_X_AXIS = Gosu::GP_1_LEFT_STICK_X_AXIS;
|
309
313
|
unsigned Gosu_GP_1_LEFT_STICK_Y_AXIS = Gosu::GP_1_LEFT_STICK_Y_AXIS;
|
310
314
|
unsigned Gosu_GP_1_RIGHT_STICK_X_AXIS = Gosu::GP_1_RIGHT_STICK_X_AXIS;
|
311
315
|
unsigned Gosu_GP_1_RIGHT_STICK_Y_AXIS = Gosu::GP_1_RIGHT_STICK_Y_AXIS;
|
312
316
|
unsigned Gosu_GP_1_LEFT_TRIGGER_AXIS = Gosu::GP_1_LEFT_TRIGGER_AXIS;
|
313
317
|
unsigned Gosu_GP_1_RIGHT_TRIGGER_AXIS = Gosu::GP_1_RIGHT_TRIGGER_AXIS;
|
314
318
|
|
315
|
-
unsigned Gosu_GP_2_LEFT_STICK_X_AXIS = Gosu::
|
319
|
+
unsigned Gosu_GP_2_LEFT_STICK_X_AXIS = Gosu::GP_2_LEFT_STICK_X_AXIS;
|
316
320
|
unsigned Gosu_GP_2_LEFT_STICK_Y_AXIS = Gosu::GP_2_LEFT_STICK_Y_AXIS;
|
317
321
|
unsigned Gosu_GP_2_RIGHT_STICK_X_AXIS = Gosu::GP_2_RIGHT_STICK_X_AXIS;
|
318
322
|
unsigned Gosu_GP_2_RIGHT_STICK_Y_AXIS = Gosu::GP_2_RIGHT_STICK_Y_AXIS;
|
319
323
|
unsigned Gosu_GP_2_LEFT_TRIGGER_AXIS = Gosu::GP_2_LEFT_TRIGGER_AXIS;
|
320
324
|
unsigned Gosu_GP_2_RIGHT_TRIGGER_AXIS = Gosu::GP_2_RIGHT_TRIGGER_AXIS;
|
321
325
|
|
322
|
-
unsigned Gosu_GP_3_LEFT_STICK_X_AXIS = Gosu::
|
326
|
+
unsigned Gosu_GP_3_LEFT_STICK_X_AXIS = Gosu::GP_3_LEFT_STICK_X_AXIS;
|
323
327
|
unsigned Gosu_GP_3_LEFT_STICK_Y_AXIS = Gosu::GP_3_LEFT_STICK_Y_AXIS;
|
324
328
|
unsigned Gosu_GP_3_RIGHT_STICK_X_AXIS = Gosu::GP_3_RIGHT_STICK_X_AXIS;
|
325
329
|
unsigned Gosu_GP_3_RIGHT_STICK_Y_AXIS = Gosu::GP_3_RIGHT_STICK_Y_AXIS;
|
data/src/GosuWrapper.cpp
CHANGED
@@ -187,7 +187,7 @@ unsigned Gosu_screen_height(Gosu_Window *window)
|
|
187
187
|
|
188
188
|
int Gosu_button_down(int btn)
|
189
189
|
{
|
190
|
-
return Gosu::Input::down((Gosu::
|
190
|
+
return Gosu::Input::down((Gosu::Button)btn);
|
191
191
|
}
|
192
192
|
|
193
193
|
const char *Gosu_button_id_to_char(int id)
|
@@ -200,13 +200,13 @@ const char *Gosu_button_id_to_char(int id)
|
|
200
200
|
|
201
201
|
unsigned Gosu_button_char_to_id(const char *btn)
|
202
202
|
{
|
203
|
-
return Gosu::Input::char_to_id(btn)
|
203
|
+
return Gosu::Input::char_to_id(btn);
|
204
204
|
}
|
205
205
|
|
206
206
|
const char *Gosu_button_name(int btn)
|
207
207
|
{
|
208
208
|
static thread_local std::string name;
|
209
|
-
name = Gosu::Input::button_name((Gosu::
|
209
|
+
name = Gosu::Input::button_name((Gosu::Button)btn);
|
210
210
|
return name.empty() ? nullptr : name.c_str();
|
211
211
|
}
|
212
212
|
|
@@ -219,7 +219,7 @@ const char *Gosu_gamepad_name(int id)
|
|
219
219
|
|
220
220
|
double Gosu_axis(int btn)
|
221
221
|
{
|
222
|
-
return Gosu::Input::axis((Gosu::
|
222
|
+
return Gosu::Input::axis((Gosu::Button)btn);
|
223
223
|
}
|
224
224
|
|
225
225
|
int Gosu_fps()
|
data/src/Input.cpp
CHANGED
@@ -26,8 +26,7 @@ static void require_sdl_video()
|
|
26
26
|
|
27
27
|
static const unsigned NUM_BUTTONS_PER_GAMEPAD =
|
28
28
|
(Gosu::GP_RANGE_END - Gosu::GP_RANGE_BEGIN + 1 - 4) / (Gosu::NUM_GAMEPADS + 1) - 3;
|
29
|
-
static const unsigned NUM_AXES_PER_GAMEPAD =
|
30
|
-
(Gosu::GP_AXES_RANGE_END - Gosu::GP_AXES_RANGE_BEGIN + 1) / (Gosu::NUM_GAMEPADS + 1);
|
29
|
+
static const unsigned NUM_AXES_PER_GAMEPAD = Gosu::NUM_AXES / (Gosu::NUM_GAMEPADS + 1);
|
31
30
|
static const unsigned NUM_BUTTONS = Gosu::GP_RANGE_END + 1;
|
32
31
|
|
33
32
|
static array<bool, NUM_BUTTONS> button_states = {false};
|
@@ -416,17 +415,17 @@ private:
|
|
416
415
|
GamepadBuffer gamepad;
|
417
416
|
|
418
417
|
// Poll axes first.
|
419
|
-
gamepad.axes[GP_LEFT_STICK_X_AXIS
|
418
|
+
gamepad.axes[GP_LEFT_STICK_X_AXIS] =
|
420
419
|
scale_axis(SDL_GameControllerGetAxis(controller, SDL_CONTROLLER_AXIS_LEFTX));
|
421
|
-
gamepad.axes[GP_LEFT_STICK_Y_AXIS
|
420
|
+
gamepad.axes[GP_LEFT_STICK_Y_AXIS] =
|
422
421
|
scale_axis(SDL_GameControllerGetAxis(controller, SDL_CONTROLLER_AXIS_LEFTY));
|
423
|
-
gamepad.axes[GP_RIGHT_STICK_X_AXIS
|
422
|
+
gamepad.axes[GP_RIGHT_STICK_X_AXIS] =
|
424
423
|
scale_axis(SDL_GameControllerGetAxis(controller, SDL_CONTROLLER_AXIS_RIGHTX));
|
425
|
-
gamepad.axes[GP_RIGHT_STICK_Y_AXIS
|
424
|
+
gamepad.axes[GP_RIGHT_STICK_Y_AXIS] =
|
426
425
|
scale_axis(SDL_GameControllerGetAxis(controller, SDL_CONTROLLER_AXIS_RIGHTY));
|
427
|
-
gamepad.axes[GP_LEFT_TRIGGER_AXIS
|
426
|
+
gamepad.axes[GP_LEFT_TRIGGER_AXIS] =
|
428
427
|
scale_axis(SDL_GameControllerGetAxis(controller, SDL_CONTROLLER_AXIS_TRIGGERLEFT));
|
429
|
-
gamepad.axes[GP_RIGHT_TRIGGER_AXIS
|
428
|
+
gamepad.axes[GP_RIGHT_TRIGGER_AXIS] =
|
430
429
|
scale_axis(SDL_GameControllerGetAxis(controller, SDL_CONTROLLER_AXIS_TRIGGERRIGHT));
|
431
430
|
|
432
431
|
gamepad.buttons[GP_DPAD_LEFT - GP_RANGE_BEGIN] =
|
@@ -460,19 +459,19 @@ private:
|
|
460
459
|
// Just guess that the first four axes are equivalent to two analog sticks.
|
461
460
|
int axes = SDL_JoystickNumAxes(joystick);
|
462
461
|
if (axes > 0) {
|
463
|
-
gamepad.axes[GP_LEFT_STICK_X_AXIS
|
462
|
+
gamepad.axes[GP_LEFT_STICK_X_AXIS] =
|
464
463
|
scale_axis(SDL_JoystickGetAxis(joystick, 0));
|
465
464
|
}
|
466
465
|
if (axes > 1) {
|
467
|
-
gamepad.axes[GP_LEFT_STICK_Y_AXIS
|
466
|
+
gamepad.axes[GP_LEFT_STICK_Y_AXIS] =
|
468
467
|
scale_axis(SDL_JoystickGetAxis(joystick, 1));
|
469
468
|
}
|
470
469
|
if (axes > 2) {
|
471
|
-
gamepad.axes[GP_RIGHT_STICK_X_AXIS
|
470
|
+
gamepad.axes[GP_RIGHT_STICK_X_AXIS] =
|
472
471
|
scale_axis(SDL_JoystickGetAxis(joystick, 2));
|
473
472
|
}
|
474
473
|
if (axes > 3) {
|
475
|
-
gamepad.axes[GP_RIGHT_STICK_Y_AXIS
|
474
|
+
gamepad.axes[GP_RIGHT_STICK_Y_AXIS] =
|
476
475
|
scale_axis(SDL_JoystickGetAxis(joystick, 3));
|
477
476
|
}
|
478
477
|
|
@@ -501,20 +500,20 @@ private:
|
|
501
500
|
{
|
502
501
|
gamepad.directions[0] =
|
503
502
|
gamepad.buttons[GP_DPAD_LEFT - GP_RANGE_BEGIN] ||
|
504
|
-
gamepad.axes[GP_LEFT_STICK_X_AXIS
|
505
|
-
gamepad.axes[GP_RIGHT_STICK_X_AXIS
|
503
|
+
gamepad.axes[GP_LEFT_STICK_X_AXIS] <= -0.5 ||
|
504
|
+
gamepad.axes[GP_RIGHT_STICK_X_AXIS] <= -0.5;
|
506
505
|
gamepad.directions[1] =
|
507
506
|
gamepad.buttons[GP_DPAD_RIGHT - GP_RANGE_BEGIN] ||
|
508
|
-
gamepad.axes[GP_LEFT_STICK_X_AXIS
|
509
|
-
gamepad.axes[GP_RIGHT_STICK_X_AXIS
|
507
|
+
gamepad.axes[GP_LEFT_STICK_X_AXIS] >= +0.5 ||
|
508
|
+
gamepad.axes[GP_RIGHT_STICK_X_AXIS] >= +0.5;
|
510
509
|
gamepad.directions[2] =
|
511
510
|
gamepad.buttons[GP_DPAD_UP - GP_RANGE_BEGIN] ||
|
512
|
-
gamepad.axes[GP_LEFT_STICK_Y_AXIS
|
513
|
-
gamepad.axes[GP_RIGHT_STICK_Y_AXIS
|
511
|
+
gamepad.axes[GP_LEFT_STICK_Y_AXIS] <= -0.5 ||
|
512
|
+
gamepad.axes[GP_RIGHT_STICK_Y_AXIS] <= -0.5;
|
514
513
|
gamepad.directions[3] =
|
515
514
|
gamepad.buttons[GP_DPAD_DOWN - GP_RANGE_BEGIN] ||
|
516
|
-
gamepad.axes[GP_LEFT_STICK_Y_AXIS
|
517
|
-
gamepad.axes[GP_RIGHT_STICK_Y_AXIS
|
515
|
+
gamepad.axes[GP_LEFT_STICK_Y_AXIS] >= +0.5 ||
|
516
|
+
gamepad.axes[GP_RIGHT_STICK_Y_AXIS] >= +0.5;
|
518
517
|
}
|
519
518
|
};
|
520
519
|
|
@@ -537,12 +536,12 @@ string Gosu::Input::id_to_char(Button btn)
|
|
537
536
|
{
|
538
537
|
require_sdl_video();
|
539
538
|
|
540
|
-
if (btn
|
539
|
+
if (btn > KB_RANGE_END) return "";
|
541
540
|
|
542
541
|
// SDL_GetKeyName returns "Space" for this value, but we want the character value.
|
543
|
-
if (btn
|
542
|
+
if (btn == KB_SPACE) return " ";
|
544
543
|
|
545
|
-
SDL_Keycode keycode = SDL_GetKeyFromScancode(static_cast<SDL_Scancode>(btn
|
544
|
+
SDL_Keycode keycode = SDL_GetKeyFromScancode(static_cast<SDL_Scancode>(btn));
|
546
545
|
if (keycode == SDLK_UNKNOWN) return "";
|
547
546
|
|
548
547
|
const char* name = SDL_GetKeyName(keycode);
|
@@ -573,7 +572,7 @@ std::string Gosu::Input::button_name(Button btn)
|
|
573
572
|
{
|
574
573
|
require_sdl_video();
|
575
574
|
|
576
|
-
SDL_Keycode keycode = SDL_GetKeyFromScancode(static_cast<SDL_Scancode>(btn
|
575
|
+
SDL_Keycode keycode = SDL_GetKeyFromScancode(static_cast<SDL_Scancode>(btn));
|
577
576
|
return SDL_GetKeyName(keycode);
|
578
577
|
}
|
579
578
|
|
@@ -601,17 +600,17 @@ std::string Gosu::Input::gamepad_name(int index)
|
|
601
600
|
|
602
601
|
bool Gosu::Input::down(Gosu::Button btn)
|
603
602
|
{
|
604
|
-
if (btn == NO_BUTTON || btn
|
603
|
+
if (btn == NO_BUTTON || btn >= NUM_BUTTONS) return false;
|
605
604
|
|
606
|
-
return button_states[btn
|
605
|
+
return button_states[btn];
|
607
606
|
}
|
608
607
|
|
609
608
|
double Gosu::Input::axis(Gosu::Button btn)
|
610
609
|
{
|
611
|
-
unsigned axis_id = btn
|
610
|
+
unsigned axis_id = btn - GP_LEFT_STICK_X_AXIS;
|
612
611
|
|
613
612
|
if (axis_id >= axis_states.size()) {
|
614
|
-
throw std::out_of_range("Invalid axis ID: " + std::to_string(btn
|
613
|
+
throw std::out_of_range("Invalid axis ID: " + std::to_string(btn));
|
615
614
|
}
|
616
615
|
|
617
616
|
return axis_states[axis_id];
|
data/src/RubyGosu.cxx
CHANGED
@@ -2174,22 +2174,21 @@ namespace Swig {
|
|
2174
2174
|
|
2175
2175
|
/* -------- TYPES TABLE (BEGIN) -------- */
|
2176
2176
|
|
2177
|
-
#define
|
2178
|
-
#define
|
2179
|
-
#define
|
2180
|
-
#define
|
2181
|
-
#define
|
2182
|
-
#define
|
2183
|
-
#define
|
2184
|
-
#define
|
2185
|
-
#define
|
2186
|
-
#define
|
2187
|
-
#define
|
2188
|
-
#define
|
2189
|
-
#define
|
2190
|
-
|
2191
|
-
static
|
2192
|
-
static swig_module_info swig_module = {swig_types, 14, 0, 0, 0, 0};
|
2177
|
+
#define SWIGTYPE_p_Gosu__Channel swig_types[0]
|
2178
|
+
#define SWIGTYPE_p_Gosu__Color swig_types[1]
|
2179
|
+
#define SWIGTYPE_p_Gosu__Font swig_types[2]
|
2180
|
+
#define SWIGTYPE_p_Gosu__GLTexInfo swig_types[3]
|
2181
|
+
#define SWIGTYPE_p_Gosu__Image swig_types[4]
|
2182
|
+
#define SWIGTYPE_p_Gosu__Sample swig_types[5]
|
2183
|
+
#define SWIGTYPE_p_Gosu__Song swig_types[6]
|
2184
|
+
#define SWIGTYPE_p_Gosu__TextInput swig_types[7]
|
2185
|
+
#define SWIGTYPE_p_Gosu__Window swig_types[8]
|
2186
|
+
#define SWIGTYPE_p_char swig_types[9]
|
2187
|
+
#define SWIGTYPE_p_double swig_types[10]
|
2188
|
+
#define SWIGTYPE_p_std__arrayT_double_16_t swig_types[11]
|
2189
|
+
#define SWIGTYPE_p_std__string swig_types[12]
|
2190
|
+
static swig_type_info *swig_types[14];
|
2191
|
+
static swig_module_info swig_module = {swig_types, 13, 0, 0, 0, 0};
|
2193
2192
|
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
|
2194
2193
|
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
|
2195
2194
|
|
@@ -3320,7 +3319,7 @@ void SwigDirector_Window::button_down(Gosu::Button arg0) {
|
|
3320
3319
|
VALUE SWIGUNUSED result;
|
3321
3320
|
|
3322
3321
|
{
|
3323
|
-
obj0 = arg0 == Gosu::NO_BUTTON ? Qnil : LONG2NUM(
|
3322
|
+
obj0 = arg0 == Gosu::NO_BUTTON ? Qnil : LONG2NUM(arg0);
|
3324
3323
|
}
|
3325
3324
|
result = rb_funcall(swig_get_self(), rb_intern("protected_button_down"), 1,obj0);
|
3326
3325
|
}
|
@@ -3331,7 +3330,7 @@ void SwigDirector_Window::button_up(Gosu::Button arg0) {
|
|
3331
3330
|
VALUE SWIGUNUSED result;
|
3332
3331
|
|
3333
3332
|
{
|
3334
|
-
obj0 = arg0 == Gosu::NO_BUTTON ? Qnil : LONG2NUM(
|
3333
|
+
obj0 = arg0 == Gosu::NO_BUTTON ? Qnil : LONG2NUM(arg0);
|
3335
3334
|
}
|
3336
3335
|
result = rb_funcall(swig_get_self(), rb_intern("protected_button_up"), 1,obj0);
|
3337
3336
|
}
|
@@ -10272,14 +10271,14 @@ _wrap_char_to_button_id(int argc, VALUE *argv, VALUE self) {
|
|
10272
10271
|
}
|
10273
10272
|
{
|
10274
10273
|
try {
|
10275
|
-
result = Gosu::char_to_button_id(arg1);
|
10274
|
+
result = (Gosu::Button)Gosu::char_to_button_id(arg1);
|
10276
10275
|
}
|
10277
10276
|
catch (const std::exception& e) {
|
10278
10277
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
10279
10278
|
}
|
10280
10279
|
}
|
10281
10280
|
{
|
10282
|
-
vresult = result == Gosu::NO_BUTTON ? Qnil : LONG2NUM(
|
10281
|
+
vresult = result == Gosu::NO_BUTTON ? Qnil : LONG2NUM(result);
|
10283
10282
|
}
|
10284
10283
|
return vresult;
|
10285
10284
|
fail:
|
@@ -11651,7 +11650,6 @@ fail:
|
|
11651
11650
|
|
11652
11651
|
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
|
11653
11652
|
|
11654
|
-
static swig_type_info _swigt__p_Gosu__Button = {"_p_Gosu__Button", "Gosu::Button *", 0, 0, (void*)0, 0};
|
11655
11653
|
static swig_type_info _swigt__p_Gosu__Channel = {"_p_Gosu__Channel", "Gosu::Channel *", 0, 0, (void*)0, 0};
|
11656
11654
|
static swig_type_info _swigt__p_Gosu__Color = {"_p_Gosu__Color", "Gosu::Color *", 0, 0, (void*)0, 0};
|
11657
11655
|
static swig_type_info _swigt__p_Gosu__Font = {"_p_Gosu__Font", "Gosu::Font *", 0, 0, (void*)0, 0};
|
@@ -11667,7 +11665,6 @@ static swig_type_info _swigt__p_std__arrayT_double_16_t = {"_p_std__arrayT_doubl
|
|
11667
11665
|
static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)0, 0};
|
11668
11666
|
|
11669
11667
|
static swig_type_info *swig_type_initial[] = {
|
11670
|
-
&_swigt__p_Gosu__Button,
|
11671
11668
|
&_swigt__p_Gosu__Channel,
|
11672
11669
|
&_swigt__p_Gosu__Color,
|
11673
11670
|
&_swigt__p_Gosu__Font,
|
@@ -11683,7 +11680,6 @@ static swig_type_info *swig_type_initial[] = {
|
|
11683
11680
|
&_swigt__p_std__string,
|
11684
11681
|
};
|
11685
11682
|
|
11686
|
-
static swig_cast_info _swigc__p_Gosu__Button[] = { {&_swigt__p_Gosu__Button, 0, 0, 0},{0, 0, 0, 0}};
|
11687
11683
|
static swig_cast_info _swigc__p_Gosu__Channel[] = { {&_swigt__p_Gosu__Channel, 0, 0, 0},{0, 0, 0, 0}};
|
11688
11684
|
static swig_cast_info _swigc__p_Gosu__Color[] = { {&_swigt__p_Gosu__Color, 0, 0, 0},{0, 0, 0, 0}};
|
11689
11685
|
static swig_cast_info _swigc__p_Gosu__Font[] = { {&_swigt__p_Gosu__Font, 0, 0, 0},{0, 0, 0, 0}};
|
@@ -11699,7 +11695,6 @@ static swig_cast_info _swigc__p_std__arrayT_double_16_t[] = { {&_swigt__p_std__
|
|
11699
11695
|
static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}};
|
11700
11696
|
|
11701
11697
|
static swig_cast_info *swig_cast_initial[] = {
|
11702
|
-
_swigc__p_Gosu__Button,
|
11703
11698
|
_swigc__p_Gosu__Channel,
|
11704
11699
|
_swigc__p_Gosu__Color,
|
11705
11700
|
_swigc__p_Gosu__Font,
|
@@ -11969,9 +11964,9 @@ SWIGEXPORT void Init_gosu(void) {
|
|
11969
11964
|
SWIG_RubyInitializeTrackings();
|
11970
11965
|
rb_define_const(mGosu, "VERSION", SWIG_From_std_string(static_cast< std::string >(Gosu::VERSION)));
|
11971
11966
|
rb_define_const(mGosu, "LICENSES", SWIG_From_std_string(static_cast< std::string >(Gosu::LICENSES)));
|
11972
|
-
rb_define_const(mGosu, "MAJOR_VERSION", SWIG_From_int(static_cast< int >(
|
11973
|
-
rb_define_const(mGosu, "MINOR_VERSION", SWIG_From_int(static_cast< int >(
|
11974
|
-
rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(
|
11967
|
+
rb_define_const(mGosu, "MAJOR_VERSION", SWIG_From_int(static_cast< int >(1)));
|
11968
|
+
rb_define_const(mGosu, "MINOR_VERSION", SWIG_From_int(static_cast< int >(0)));
|
11969
|
+
rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(0)));
|
11975
11970
|
rb_define_module_function(mGosu, "milliseconds", VALUEFUNC(_wrap_milliseconds), -1);
|
11976
11971
|
rb_define_module_function(mGosu, "random", VALUEFUNC(_wrap_random), -1);
|
11977
11972
|
rb_define_module_function(mGosu, "degrees_to_radians", VALUEFUNC(_wrap_degrees_to_radians), -1);
|
@@ -12163,8 +12158,8 @@ SWIGEXPORT void Init_gosu(void) {
|
|
12163
12158
|
rb_define_const(mGosu, "KB_DOWN", SWIG_From_int(static_cast< int >(Gosu::KB_DOWN)));
|
12164
12159
|
rb_define_const(mGosu, "KB_HOME", SWIG_From_int(static_cast< int >(Gosu::KB_HOME)));
|
12165
12160
|
rb_define_const(mGosu, "KB_END", SWIG_From_int(static_cast< int >(Gosu::KB_END)));
|
12166
|
-
rb_define_const(mGosu, "
|
12167
|
-
rb_define_const(mGosu, "
|
12161
|
+
rb_define_const(mGosu, "KB_PRINT_SCREEN", SWIG_From_int(static_cast< int >(Gosu::KB_PRINT_SCREEN)));
|
12162
|
+
rb_define_const(mGosu, "KB_SCROLL_LOCK", SWIG_From_int(static_cast< int >(Gosu::KB_SCROLL_LOCK)));
|
12168
12163
|
rb_define_const(mGosu, "KB_PAUSE", SWIG_From_int(static_cast< int >(Gosu::KB_PAUSE)));
|
12169
12164
|
rb_define_const(mGosu, "KB_INSERT", SWIG_From_int(static_cast< int >(Gosu::KB_INSERT)));
|
12170
12165
|
rb_define_const(mGosu, "KB_DELETE", SWIG_From_int(static_cast< int >(Gosu::KB_DELETE)));
|
@@ -12182,7 +12177,7 @@ SWIGEXPORT void Init_gosu(void) {
|
|
12182
12177
|
rb_define_const(mGosu, "KB_COMMA", SWIG_From_int(static_cast< int >(Gosu::KB_COMMA)));
|
12183
12178
|
rb_define_const(mGosu, "KB_PERIOD", SWIG_From_int(static_cast< int >(Gosu::KB_PERIOD)));
|
12184
12179
|
rb_define_const(mGosu, "KB_SLASH", SWIG_From_int(static_cast< int >(Gosu::KB_SLASH)));
|
12185
|
-
rb_define_const(mGosu, "
|
12180
|
+
rb_define_const(mGosu, "KB_CAPS_LOCK", SWIG_From_int(static_cast< int >(Gosu::KB_CAPS_LOCK)));
|
12186
12181
|
rb_define_const(mGosu, "KB_A", SWIG_From_int(static_cast< int >(Gosu::KB_A)));
|
12187
12182
|
rb_define_const(mGosu, "KB_B", SWIG_From_int(static_cast< int >(Gosu::KB_B)));
|
12188
12183
|
rb_define_const(mGosu, "KB_C", SWIG_From_int(static_cast< int >(Gosu::KB_C)));
|
data/src/WindowWrapper.cpp
CHANGED
@@ -55,20 +55,20 @@ void Gosu::WindowForWrapper::draw()
|
|
55
55
|
|
56
56
|
void Gosu::WindowForWrapper::default_button_down(unsigned btn)
|
57
57
|
{
|
58
|
-
Gosu::Window::button_down(Gosu::
|
58
|
+
Gosu::Window::button_down(Gosu::Button(btn));
|
59
59
|
}
|
60
60
|
|
61
61
|
void Gosu::WindowForWrapper::button_down(Gosu::Button btn)
|
62
62
|
{
|
63
63
|
if (button_down_callback != nullptr) {
|
64
|
-
button_down_callback(btn
|
64
|
+
button_down_callback(btn);
|
65
65
|
}
|
66
66
|
}
|
67
67
|
|
68
68
|
void Gosu::WindowForWrapper::button_up(Gosu::Button btn)
|
69
69
|
{
|
70
70
|
if (button_up_callback != nullptr) {
|
71
|
-
button_up_callback(btn
|
71
|
+
button_up_callback(btn);
|
72
72
|
}
|
73
73
|
}
|
74
74
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gosu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Raschke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
2D game development library.
|
@@ -186,7 +186,6 @@ files:
|
|
186
186
|
- dependencies/utf8proc/utf8proc_data.h
|
187
187
|
- ext/gosu/extconf.rb
|
188
188
|
- include/Gosu/Audio.hpp
|
189
|
-
- include/Gosu/AutoLink.hpp
|
190
189
|
- include/Gosu/Bitmap.hpp
|
191
190
|
- include/Gosu/Buttons.hpp
|
192
191
|
- include/Gosu/Channel.h
|
@@ -227,12 +226,8 @@ files:
|
|
227
226
|
- lib/gosu/run.rb
|
228
227
|
- lib/gosu/swig_patches.rb
|
229
228
|
- lib/gosu/zen.rb
|
230
|
-
- lib/libmpg123.dll
|
231
|
-
- lib/libsndfile.dll
|
232
229
|
- lib64/OpenAL32.dll
|
233
230
|
- lib64/SDL2.dll
|
234
|
-
- lib64/libmpg123.dll
|
235
|
-
- lib64/libsndfile.dll
|
236
231
|
- rdoc/gosu.rb
|
237
232
|
- src/Audio.cpp
|
238
233
|
- src/AudioFile.hpp
|
@@ -335,7 +330,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
335
330
|
requirements:
|
336
331
|
- - ">="
|
337
332
|
- !ruby/object:Gem::Version
|
338
|
-
version:
|
333
|
+
version: 2.5.0
|
339
334
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
340
335
|
requirements:
|
341
336
|
- - ">"
|
data/include/Gosu/AutoLink.hpp
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
//! \file AutoLink.hpp
|
2
|
-
//! Contains pragmas that make MSVC link against all the necessary libraries
|
3
|
-
//! automatically.
|
4
|
-
|
5
|
-
#ifdef _MSC_VER
|
6
|
-
#pragma once
|
7
|
-
|
8
|
-
#ifdef NDEBUG
|
9
|
-
#pragma comment(lib, "Gosu.lib")
|
10
|
-
#else
|
11
|
-
#pragma comment(lib, "GosuDebug.lib")
|
12
|
-
#endif
|
13
|
-
|
14
|
-
#endif
|
data/lib/libmpg123.dll
DELETED
Binary file
|
data/lib/libsndfile.dll
DELETED
Binary file
|
data/lib64/libmpg123.dll
DELETED
Binary file
|
data/lib64/libsndfile.dll
DELETED
Binary file
|