gosu 1.0.0.pre1 → 1.1.0
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/ext/gosu/extconf.rb +4 -24
- data/include/Gosu/Buttons.hpp +18 -17
- data/include/Gosu/Font.hpp +1 -1
- 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 +25 -21
- data/lib/OpenAL32.dll +0 -0
- data/lib/gosu/patches.rb +0 -14
- data/lib/gosu/preview.rb +1 -3
- data/lib/gosu/swig_patches.rb +11 -10
- data/lib64/OpenAL32.dll +0 -0
- data/rdoc/gosu.rb +20 -6
- data/src/AudioFile.hpp +3 -0
- data/src/Input.cpp +28 -38
- data/src/Resolution.cpp +8 -8
- data/src/RubyGosu.cxx +646 -91
- data/src/RubyGosu.h +1 -1
- data/src/TrueTypeFontWin.cpp +3 -3
- data/src/Window.cpp +60 -31
- data/src/WindowUIKit.cpp +21 -9
- metadata +5 -31
- data/include/Gosu/AutoLink.hpp +0 -14
- data/include/Gosu/Channel.h +0 -25
- data/include/Gosu/Color.h +0 -38
- data/include/Gosu/Font.h +0 -36
- data/include/Gosu/Gosu.h +0 -82
- data/include/Gosu/Image.h +0 -54
- data/include/Gosu/Sample.h +0 -19
- data/include/Gosu/Song.h +0 -24
- data/include/Gosu/TextInput.h +0 -30
- data/include/Gosu/Window.h +0 -63
- data/lib/gosu/zen.rb +0 -89
- data/lib/libmpg123.dll +0 -0
- data/lib/libsndfile.dll +0 -0
- data/lib64/libmpg123.dll +0 -0
- data/lib64/libsndfile.dll +0 -0
- data/src/ChannelWrapper.cpp +0 -50
- data/src/ColorWrapper.cpp +0 -126
- data/src/Constants.cpp +0 -334
- data/src/FontWrapper.cpp +0 -74
- data/src/GosuWrapper.cpp +0 -251
- data/src/ImageWrapper.cpp +0 -168
- data/src/MPEGFile.hpp +0 -90
- data/src/SampleWrapper.cpp +0 -30
- data/src/SongWrapper.cpp +0 -52
- data/src/TextInputWrapper.cpp +0 -101
- data/src/WindowWrapper.cpp +0 -317
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c00e9925256d5f0c158716eeb225fd8bc5b9af17335f2a3b67b892a1c7d87d7
|
4
|
+
data.tar.gz: 3e2edbae0cf3ae45cf926ff228fd621c2d092c0e1ccbf425884b0ba01c984199
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab8f4550f297ae89f321e133b3ca9e0b5f77ab64b9c66415e379270eb90ac1c000de685b175e3dbfb5a9de34afa3cfb4eda3d8a5e40ebe9dd18b25ef22964dcf
|
7
|
+
data.tar.gz: 87803f08a8a4a13ec027ee265cc08be511eb95c30bc1494766310485d757799bffc794427f2fe1002142b00b1282b4ade6b90b985f01f00f3b03db041a12299b
|
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/Font.hpp
CHANGED
@@ -40,7 +40,7 @@ namespace Gosu
|
|
40
40
|
|
41
41
|
//! Returns the width, in pixels, the given text would occupy if drawn.
|
42
42
|
double text_width(const std::string& text) const;
|
43
|
-
//! Returns the width, in pixels, the given
|
43
|
+
//! Returns the width, in pixels, the given markup would occupy if drawn.
|
44
44
|
double markup_width(const std::string& markup) const;
|
45
45
|
|
46
46
|
//! Draws text so the top left corner of the text is at (x; y).
|
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,15 +6,16 @@
|
|
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
|
{
|
11
|
+
enum WindowFlags
|
12
|
+
{
|
13
|
+
WF_WINDOWED,
|
14
|
+
WF_FULLSCREEN = 1,
|
15
|
+
WF_RESIZABLE = 2,
|
16
|
+
WF_BORDERLESS = 4
|
17
|
+
};
|
18
|
+
|
21
19
|
//! Convenient all-in-one class that serves as the foundation of a standard Gosu application.
|
22
20
|
//! Manages initialization of all of Gosu's core components and provides timing functionality.
|
23
21
|
//! Note that you should really only use one instance of this class at the same time.
|
@@ -31,17 +29,23 @@ namespace Gosu
|
|
31
29
|
//! \param width Width of the window in points; that is, pixels on a normal display, and
|
32
30
|
//! 'points' on a high-resolution display.
|
33
31
|
//! \param height See width.
|
32
|
+
//! \param window_flags A bitmask of values from Gosu::WindowFlags.
|
34
33
|
//! \param update_interval Interval in milliseconds between two calls to the update member
|
35
34
|
//! function.
|
36
|
-
Window(
|
37
|
-
|
35
|
+
Window(int width, int height, unsigned window_flags = WF_WINDOWED,
|
36
|
+
double update_interval = 16.666666);
|
38
37
|
virtual ~Window();
|
39
38
|
|
40
|
-
|
41
|
-
|
39
|
+
int width() const;
|
40
|
+
int height() const;
|
42
41
|
bool fullscreen() const;
|
42
|
+
void resize(int width, int height, bool fullscreen);
|
43
|
+
|
43
44
|
bool resizable() const;
|
44
|
-
void
|
45
|
+
void set_resizable(bool resizable);
|
46
|
+
|
47
|
+
bool borderless() const;
|
48
|
+
void set_borderless(bool borderless);
|
45
49
|
|
46
50
|
double update_interval() const;
|
47
51
|
void set_update_interval(double update_interval);
|
@@ -82,8 +86,8 @@ namespace Gosu
|
|
82
86
|
//! By default, the window is redrawn all the time.
|
83
87
|
virtual bool needs_redraw() const { return true; }
|
84
88
|
|
85
|
-
//! If this function returns true, the system
|
86
|
-
virtual bool needs_cursor() const { return
|
89
|
+
//! If this function returns true, the system cursor will be visible while over the window.
|
90
|
+
virtual bool needs_cursor() const { return true; }
|
87
91
|
|
88
92
|
//! This function is called when the window loses focus on some platforms.
|
89
93
|
//! Most importantly, it is called on the iPhone or iPad when the user locks the screen.
|
@@ -139,22 +143,22 @@ namespace Gosu
|
|
139
143
|
//! Returns the width (in pixels) of a screen.
|
140
144
|
//! \param window The result describes the screen on which the window is shown, or the
|
141
145
|
//! primary screen if no window is given.
|
142
|
-
|
146
|
+
int screen_width(Window* window = nullptr);
|
143
147
|
|
144
148
|
//! Returns the height (in pixels) of the user's primary screen.
|
145
149
|
//! \param window The result describes the screen on which the window is shown, or the
|
146
150
|
//! primary screen if no window is given.
|
147
|
-
|
151
|
+
int screen_height(Window* window = nullptr);
|
148
152
|
|
149
153
|
//! Returns the maximum width (in 'points') that is available for a non-fullscreen Window.
|
150
154
|
//! All windows larger than this size will automatically be shrunk to fit.
|
151
155
|
//! \param window The result describes the screen on which the window is shown, or the
|
152
156
|
//! primary screen if no window is given.
|
153
|
-
|
157
|
+
int available_width(Window* window = nullptr);
|
154
158
|
|
155
159
|
//! Returns the maximum height (in 'points') that is available for a non-fullscreen Window.
|
156
160
|
//! All windows larger than this size will automatically be shrunk to fit.
|
157
161
|
//! \param window The result describes the screen on which the window is shown, or the
|
158
162
|
//! primary screen if no window is given.
|
159
|
-
|
163
|
+
int available_height(Window* window = nullptr);
|
160
164
|
}
|
data/lib/OpenAL32.dll
CHANGED
File without changes
|
data/lib/gosu/patches.rb
CHANGED
@@ -18,26 +18,12 @@ class ::Numeric
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
class Gosu::Font
|
22
|
-
# draw_text will stop parsing markup in Gosu 1.0.
|
23
|
-
alias_method :draw_text, :draw_markup
|
24
|
-
# draw_text_rel will stop parsing markup in Gosu 1.0.
|
25
|
-
alias_method :draw_text_rel, :draw_markup_rel
|
26
|
-
# text_width will stop parsing markup in Gosu 1.0.
|
27
|
-
alias_method :text_width, :markup_width
|
28
|
-
end
|
29
|
-
|
30
21
|
class Gosu::Image
|
31
22
|
BlobHelper = Struct.new(:columns, :rows, :to_blob)
|
32
23
|
|
33
24
|
def self.from_blob(width, height, rgba = "\0\0\0\0" * (width * height))
|
34
25
|
self.new(BlobHelper.new(width, height, rgba))
|
35
26
|
end
|
36
|
-
|
37
|
-
# from_markup will stop parsing markup in Gosu 1.0.
|
38
|
-
def self.from_markup(*args)
|
39
|
-
self.from_text(*args)
|
40
|
-
end
|
41
27
|
end
|
42
28
|
|
43
29
|
# Color constants.
|
data/lib/gosu/preview.rb
CHANGED
@@ -3,8 +3,6 @@ warn "gosu/preview.rb has been removed in Gosu 0.9.0, and Gosu itself \n" +
|
|
3
3
|
"Notable differences:\n" +
|
4
4
|
"• no global $window variable\n" +
|
5
5
|
"• no global Gosu.mouse_x and Gosu.mouse_y functions\n" +
|
6
|
-
"• Image#initialize et.al. use an options hash now
|
7
|
-
"If you cannot update your code base right now, you should require \n" +
|
8
|
-
"Gosu 0.8.x in your Gemfile: gem 'gosu', '~> 0.8.0'";
|
6
|
+
"• Image#initialize et.al. use an options hash now";
|
9
7
|
|
10
8
|
require 'gosu'
|
data/lib/gosu/swig_patches.rb
CHANGED
@@ -3,19 +3,20 @@
|
|
3
3
|
# compatible, but I just call protected_update etc. in the Ruby wrapper so I can add this
|
4
4
|
# custom debugging help:
|
5
5
|
class Gosu::Window
|
6
|
-
alias_method :
|
6
|
+
alias_method :initialize_with_bitmask, :initialize
|
7
7
|
|
8
|
-
def initialize
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
def initialize(width, height, *args)
|
9
|
+
$gosu_gl_blocks = nil
|
10
|
+
|
11
|
+
if args.first.is_a? Hash
|
12
|
+
flags = 0
|
13
|
+
flags |= 1 if args.first[:fullscreen]
|
14
|
+
flags |= 2 if args.first[:resizable]
|
15
|
+
flags |= 4 if args.first[:borderless]
|
16
|
+
initialize_with_bitmask(width, height, flags, args.first[:update_interval] || 16.666666)
|
14
17
|
else
|
15
|
-
|
18
|
+
initialize_with_bitmask(width, height, args[0] ? 1 : 0, args[1] || 16.666666)
|
16
19
|
end
|
17
|
-
$gosu_gl_blocks = nil
|
18
|
-
initialize_without_hash width, height, !!fullscreen, update_interval || 16.666666, !!resizable
|
19
20
|
end
|
20
21
|
|
21
22
|
%w(update draw needs_redraw? needs_cursor?
|