gosu 1.1.1.1 → 1.2.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/include/Gosu/Font.hpp +4 -4
- data/include/Gosu/Graphics.hpp +6 -4
- data/include/Gosu/GraphicsBase.hpp +6 -6
- data/include/Gosu/Image.hpp +3 -3
- data/include/Gosu/ImageData.hpp +1 -1
- data/include/Gosu/Utility.hpp +10 -8
- data/include/Gosu/Version.hpp +2 -2
- data/lib/gosu/compat.rb +4 -0
- data/src/EmptyImageData.hpp +1 -1
- data/src/Font.cpp +4 -4
- data/src/Graphics.cpp +4 -4
- data/src/Image.cpp +4 -3
- data/src/LargeImageData.cpp +1 -1
- data/src/LargeImageData.hpp +1 -1
- data/src/Macro.cpp +2 -2
- data/src/Macro.hpp +1 -1
- data/src/RenderState.hpp +5 -5
- data/src/RubyGosu.cxx +80 -78
- data/src/RubyGosu.h +2 -2
- data/src/TexChunk.cpp +1 -1
- data/src/TexChunk.hpp +1 -1
- data/src/TrueTypeFontApple.cpp +10 -2
- data/src/Utility.cpp +52 -23
- metadata +2 -4
- data/src/UtilityApple.cpp +0 -16
- data/src/UtilityWin.cpp +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9f867c68587f182be0ba872daf669724376a55b6f7e0c3853eca5f350dc413f
|
4
|
+
data.tar.gz: f24639563ba937303f9a81dd22a78ad5a22fa9243d980c629d163605656be0b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bb10eafcfa8742066e246e607ada383af5d2f3a461910e386064b27788d5620ab289b2081e0e4652240df9faf7cb1bb8d669fb95b7bcfbfb040e767c4354edd
|
7
|
+
data.tar.gz: dc56b6a28a0f8980027c3f3bc5fd110e806617a4b22b3d6e918fa24f99d59cea98cd03d85af875968bcc7b98bc283ac810aca7a37e199ff1f4aaaaea1de7fc80
|
data/include/Gosu/Font.hpp
CHANGED
@@ -44,11 +44,11 @@ namespace Gosu
|
|
44
44
|
//! Draws text so the top left corner of the text is at (x; y).
|
45
45
|
void draw_text(const std::string& text, double x, double y, ZPos z,
|
46
46
|
double scale_x = 1, double scale_y = 1, Color c = Color::WHITE,
|
47
|
-
|
47
|
+
BlendMode mode = BM_DEFAULT) const;
|
48
48
|
//! Draws markup so the top left corner of the text is at (x; y).
|
49
49
|
void draw_markup(const std::string& markup, double x, double y, ZPos z,
|
50
50
|
double scale_x = 1, double scale_y = 1, Color c = Color::WHITE,
|
51
|
-
|
51
|
+
BlendMode mode = BM_DEFAULT) const;
|
52
52
|
|
53
53
|
//! Draws text at a position relative to (x; y).
|
54
54
|
//! \param rel_x Determines where the text is drawn horizontally. If
|
@@ -58,7 +58,7 @@ namespace Gosu
|
|
58
58
|
//! \param rel_y See rel_x.
|
59
59
|
void draw_text_rel(const std::string& text, double x, double y, ZPos z,
|
60
60
|
double rel_x, double rel_y, double scale_x = 1, double scale_y = 1,
|
61
|
-
Color c = Color::WHITE,
|
61
|
+
Color c = Color::WHITE, BlendMode mode = BM_DEFAULT) const;
|
62
62
|
//! Draws text at a position relative to (x; y).
|
63
63
|
//! \param rel_x Determines where the text is drawn horizontally. If
|
64
64
|
//! rel_x is 0.0, the text will be to the right of x, if it is 1.0,
|
@@ -67,7 +67,7 @@ namespace Gosu
|
|
67
67
|
//! \param rel_y See rel_x.
|
68
68
|
void draw_markup_rel(const std::string& markup, double x, double y, ZPos z,
|
69
69
|
double rel_x, double rel_y, double scale_x = 1, double scale_y = 1,
|
70
|
-
Color c = Color::WHITE,
|
70
|
+
Color c = Color::WHITE, BlendMode mode = BM_DEFAULT) const;
|
71
71
|
|
72
72
|
//! Maps a letter to a specific image, instead of generating one using
|
73
73
|
//! Gosu's built-in text rendering.
|
data/include/Gosu/Graphics.hpp
CHANGED
@@ -78,21 +78,23 @@ namespace Gosu
|
|
78
78
|
//! image to simulate lines, or contribute a better draw_line to Gosu.
|
79
79
|
static void draw_line(double x1, double y1, Color c1,
|
80
80
|
double x2, double y2, Color c2,
|
81
|
-
ZPos z,
|
81
|
+
ZPos z, BlendMode mode = BM_DEFAULT);
|
82
82
|
|
83
83
|
static void draw_triangle(double x1, double y1, Color c1,
|
84
84
|
double x2, double y2, Color c2,
|
85
85
|
double x3, double y3, Color c3,
|
86
|
-
ZPos z,
|
86
|
+
ZPos z,
|
87
|
+
BlendMode mode = BM_DEFAULT);
|
87
88
|
|
88
89
|
static void draw_quad(double x1, double y1, Color c1,
|
89
90
|
double x2, double y2, Color c2,
|
90
91
|
double x3, double y3, Color c3,
|
91
92
|
double x4, double y4, Color c4,
|
92
|
-
ZPos z,
|
93
|
+
ZPos z, BlendMode mode = BM_DEFAULT);
|
93
94
|
|
94
95
|
static void draw_rect(double x, double y, double width, double height,
|
95
|
-
Color c, ZPos z,
|
96
|
+
Color c, ZPos z,
|
97
|
+
BlendMode mode = BM_DEFAULT);
|
96
98
|
|
97
99
|
//! For internal use only.
|
98
100
|
void set_physical_resolution(unsigned physical_width, unsigned physical_height);
|
@@ -15,18 +15,18 @@ namespace Gosu
|
|
15
15
|
|
16
16
|
//! Determines the way colors are combined when one is drawn onto
|
17
17
|
//! another.
|
18
|
-
enum
|
18
|
+
enum BlendMode
|
19
19
|
{
|
20
|
-
|
20
|
+
BM_DEFAULT,
|
21
21
|
//! The color's channels will be interpolated. The alpha channel
|
22
22
|
//! specifies the opacity of the new color, 255 is full opacity.
|
23
|
-
|
23
|
+
BM_INTERPOLATE = BM_DEFAULT,
|
24
24
|
//! The colors' channels will be added. The alpha channel specifies
|
25
25
|
//! the percentage of the new color's channels that will be added
|
26
26
|
//! to the old color's channels.
|
27
|
-
|
27
|
+
BM_ADD,
|
28
28
|
//! The color's channels will be multiplied with each other.
|
29
|
-
|
29
|
+
BM_MULTIPLY
|
30
30
|
};
|
31
31
|
|
32
32
|
enum FontFlags
|
@@ -50,7 +50,7 @@ namespace Gosu
|
|
50
50
|
{
|
51
51
|
IF_SMOOTH = 0,
|
52
52
|
|
53
|
-
// Note: No constant for '1', but Gosu treats '1' as
|
53
|
+
// Note: No constant for '1', but Gosu treats '1' as IF_TILEABLE for
|
54
54
|
// backward compatibility reasons (this parameter used to be a bool).
|
55
55
|
|
56
56
|
IF_TILEABLE_LEFT = 1 << 1,
|
data/include/Gosu/Image.hpp
CHANGED
@@ -49,10 +49,10 @@ namespace Gosu
|
|
49
49
|
|
50
50
|
//! Draws the image so its upper left corner is at (x; y).
|
51
51
|
void draw(double x, double y, ZPos z = 0, double scale_x = 1, double scale_y = 1,
|
52
|
-
Color c = Color::WHITE,
|
52
|
+
Color c = Color::WHITE, BlendMode mode = BM_DEFAULT) const;
|
53
53
|
//! Like draw(), but with modulation colors for all four corners.
|
54
54
|
void draw_mod(double x, double y, ZPos z, double scale_x, double scale_y,
|
55
|
-
Color c1, Color c2, Color c3, Color c4,
|
55
|
+
Color c1, Color c2, Color c3, Color c4, BlendMode mode = BM_DEFAULT) const;
|
56
56
|
|
57
57
|
//! Draws the image rotated by the given angle so that its rotation
|
58
58
|
//! center is at (x; y). Note that this is different from how all the
|
@@ -65,7 +65,7 @@ namespace Gosu
|
|
65
65
|
//! \param center_y See center_x.
|
66
66
|
void draw_rot(double x, double y, ZPos z = 0, double angle = 0,
|
67
67
|
double center_x = 0.5, double center_y = 0.5, double scale_x = 1, double scale_y = 1,
|
68
|
-
Color c = Color::WHITE,
|
68
|
+
Color c = Color::WHITE, BlendMode mode = BM_DEFAULT) const;
|
69
69
|
|
70
70
|
#ifndef SWIG
|
71
71
|
//! Provides access to the underlying image data object.
|
data/include/Gosu/ImageData.hpp
CHANGED
data/include/Gosu/Utility.hpp
CHANGED
@@ -1,19 +1,21 @@
|
|
1
1
|
#pragma once
|
2
2
|
|
3
3
|
#include <string>
|
4
|
+
#include <vector>
|
4
5
|
|
5
6
|
namespace Gosu
|
6
7
|
{
|
7
8
|
std::u32string utf8_to_composed_utc4(const std::string& utf8);
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
|
10
|
+
/// Returns true if the filename has the given extension.
|
11
|
+
/// The comparison is case-insensitive, but you must pass the extension in lower case.
|
11
12
|
bool has_extension(std::string_view filename, std::string_view extension);
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
|
14
|
+
/// Returns the user's preferred user_languages/locales, e.g. {"en_US", "de_DE", "ja"}.
|
15
|
+
/// The first two letters of each element will always be a language code.
|
16
|
+
/// This value is not cached. Please memorize the specific value that you are interested in,
|
17
|
+
/// typically the first language in the returned array that your game supports.
|
18
|
+
std::vector<std::string> user_languages();
|
17
19
|
|
18
20
|
class Noncopyable
|
19
21
|
{
|
data/include/Gosu/Version.hpp
CHANGED
data/lib/gosu/compat.rb
CHANGED
data/src/EmptyImageData.hpp
CHANGED
data/src/Font.cpp
CHANGED
@@ -112,13 +112,13 @@ double Gosu::Font::markup_width(const string& markup) const
|
|
112
112
|
}
|
113
113
|
|
114
114
|
void Gosu::Font::draw_text(const string& text, double x, double y, ZPos z,
|
115
|
-
double scale_x, double scale_y, Color c,
|
115
|
+
double scale_x, double scale_y, Color c, BlendMode mode) const
|
116
116
|
{
|
117
117
|
draw_markup(escape_markup(text), x, y, z, scale_x, scale_y, c, mode);
|
118
118
|
}
|
119
119
|
|
120
120
|
void Gosu::Font::draw_markup(const string& markup, double x, double y, ZPos z,
|
121
|
-
double scale_x, double scale_y, Color c,
|
121
|
+
double scale_x, double scale_y, Color c, BlendMode mode) const
|
122
122
|
{
|
123
123
|
double current_y = y;
|
124
124
|
|
@@ -142,7 +142,7 @@ void Gosu::Font::draw_markup(const string& markup, double x, double y, ZPos z,
|
|
142
142
|
|
143
143
|
void Gosu::Font::draw_text_rel(const string& text, double x, double y, ZPos z,
|
144
144
|
double rel_x, double rel_y, double scale_x, double scale_y,
|
145
|
-
Color c,
|
145
|
+
Color c, BlendMode mode) const
|
146
146
|
{
|
147
147
|
if (rel_x) x -= text_width(text) * scale_x * rel_x;
|
148
148
|
if (rel_y) y -= height() * scale_y * rel_y;
|
@@ -152,7 +152,7 @@ void Gosu::Font::draw_text_rel(const string& text, double x, double y, ZPos z,
|
|
152
152
|
|
153
153
|
void Gosu::Font::draw_markup_rel(const string& markup, double x, double y, ZPos z,
|
154
154
|
double rel_x, double rel_y, double scale_x, double scale_y,
|
155
|
-
Color c,
|
155
|
+
Color c, BlendMode mode) const
|
156
156
|
{
|
157
157
|
if (rel_x) x -= markup_width(markup) * scale_x * rel_x;
|
158
158
|
if (rel_y) y -= height() * scale_y * rel_y;
|
data/src/Graphics.cpp
CHANGED
@@ -330,7 +330,7 @@ void Gosu::Graphics::transform(const Gosu::Transform& transform, const function<
|
|
330
330
|
}
|
331
331
|
|
332
332
|
void Gosu::Graphics::draw_line(double x1, double y1, Color c1,
|
333
|
-
double x2, double y2, Color c2, ZPos z,
|
333
|
+
double x2, double y2, Color c2, ZPos z, BlendMode mode)
|
334
334
|
{
|
335
335
|
DrawOp op;
|
336
336
|
op.render_state.mode = mode;
|
@@ -343,7 +343,7 @@ void Gosu::Graphics::draw_line(double x1, double y1, Color c1,
|
|
343
343
|
}
|
344
344
|
|
345
345
|
void Gosu::Graphics::draw_triangle(double x1, double y1, Color c1, double x2, double y2, Color c2,
|
346
|
-
double x3, double y3, Color c3, ZPos z,
|
346
|
+
double x3, double y3, Color c3, ZPos z, BlendMode mode)
|
347
347
|
{
|
348
348
|
DrawOp op;
|
349
349
|
op.render_state.mode = mode;
|
@@ -361,7 +361,7 @@ void Gosu::Graphics::draw_triangle(double x1, double y1, Color c1, double x2, do
|
|
361
361
|
}
|
362
362
|
|
363
363
|
void Gosu::Graphics::draw_quad(double x1, double y1, Color c1, double x2, double y2, Color c2,
|
364
|
-
double x3, double y3, Color c3, double x4, double y4, Color c4, ZPos z,
|
364
|
+
double x3, double y3, Color c3, double x4, double y4, Color c4, ZPos z, BlendMode mode)
|
365
365
|
{
|
366
366
|
normalize_coordinates(x1, y1, x2, y2, x3, y3, c3, x4, y4, c4);
|
367
367
|
|
@@ -384,7 +384,7 @@ void Gosu::Graphics::draw_quad(double x1, double y1, Color c1, double x2, double
|
|
384
384
|
}
|
385
385
|
|
386
386
|
void Gosu::Graphics::draw_rect(double x, double y, double width, double height, Color c,
|
387
|
-
ZPos z, Gosu::
|
387
|
+
ZPos z, Gosu::BlendMode mode)
|
388
388
|
{
|
389
389
|
draw_quad(x, y, c, x + width, y, c, x, y + height, c, x + width, y + height, c, z, mode);
|
390
390
|
}
|
data/src/Image.cpp
CHANGED
@@ -57,7 +57,7 @@ unsigned Gosu::Image::height() const
|
|
57
57
|
}
|
58
58
|
|
59
59
|
void Gosu::Image::draw(double x, double y, ZPos z, double scale_x, double scale_y, Color c,
|
60
|
-
|
60
|
+
BlendMode mode) const
|
61
61
|
{
|
62
62
|
double x2 = x + width() * scale_x;
|
63
63
|
double y2 = y + height() * scale_y;
|
@@ -66,7 +66,7 @@ void Gosu::Image::draw(double x, double y, ZPos z, double scale_x, double scale_
|
|
66
66
|
}
|
67
67
|
|
68
68
|
void Gosu::Image::draw_mod(double x, double y, ZPos z, double scale_x, double scale_y, Color c1,
|
69
|
-
Color c2, Color c3, Color c4,
|
69
|
+
Color c2, Color c3, Color c4, BlendMode mode) const
|
70
70
|
{
|
71
71
|
double x2 = x + width() * scale_x;
|
72
72
|
double y2 = y + height() * scale_y;
|
@@ -75,7 +75,8 @@ void Gosu::Image::draw_mod(double x, double y, ZPos z, double scale_x, double sc
|
|
75
75
|
}
|
76
76
|
|
77
77
|
void Gosu::Image::draw_rot(double x, double y, ZPos z, double angle,
|
78
|
-
double center_x, double center_y, double scale_x, double scale_y, Color c,
|
78
|
+
double center_x, double center_y, double scale_x, double scale_y, Color c,
|
79
|
+
BlendMode mode) const
|
79
80
|
{
|
80
81
|
double size_x = width() * scale_x;
|
81
82
|
double size_y = height() * scale_y;
|
data/src/LargeImageData.cpp
CHANGED
@@ -69,7 +69,7 @@ void Gosu::LargeImageData::draw(double x1, double y1, Color c1,
|
|
69
69
|
double x2, double y2, Color c2,
|
70
70
|
double x3, double y3, Color c3,
|
71
71
|
double x4, double y4, Color c4,
|
72
|
-
ZPos z,
|
72
|
+
ZPos z, BlendMode mode) const
|
73
73
|
{
|
74
74
|
normalize_coordinates(x1, y1, x2, y2, x3, y3, c3, x4, y4, c4);
|
75
75
|
|
data/src/LargeImageData.hpp
CHANGED
@@ -25,7 +25,7 @@ public:
|
|
25
25
|
double x2, double y2, Color c2,
|
26
26
|
double x3, double y3, Color c3,
|
27
27
|
double x4, double y4, Color c4,
|
28
|
-
ZPos z,
|
28
|
+
ZPos z, BlendMode mode) const override;
|
29
29
|
|
30
30
|
const GLTexInfo* gl_tex_info() const override { return nullptr; }
|
31
31
|
|
data/src/Macro.cpp
CHANGED
@@ -162,7 +162,7 @@ int Gosu::Macro::height() const
|
|
162
162
|
}
|
163
163
|
|
164
164
|
void Gosu::Macro::draw(double x1, double y1, Color c1, double x2, double y2, Color c2,
|
165
|
-
double x3, double y3, Color c3, double x4, double y4, Color c4, ZPos z,
|
165
|
+
double x3, double y3, Color c3, double x4, double y4, Color c4, ZPos z, BlendMode mode) const
|
166
166
|
{
|
167
167
|
if (c1 != Color::WHITE || c2 != Color::WHITE || c3 != Color::WHITE || c4 != Color::WHITE) {
|
168
168
|
throw invalid_argument("Macros cannot be tinted with colors");
|
@@ -185,7 +185,7 @@ Gosu::Bitmap Gosu::Macro::to_bitmap() const
|
|
185
185
|
pimpl->width, 0, Color::WHITE,
|
186
186
|
0, pimpl->height, Color::WHITE,
|
187
187
|
pimpl->width, pimpl->height, Color::WHITE,
|
188
|
-
0,
|
188
|
+
0, BM_DEFAULT);
|
189
189
|
}).data().to_bitmap();
|
190
190
|
}
|
191
191
|
|
data/src/Macro.hpp
CHANGED
@@ -18,7 +18,7 @@ public:
|
|
18
18
|
|
19
19
|
void draw(double x1, double y1, Color c1, double x2, double y2, Color c2,
|
20
20
|
double x3, double y3, Color c3, double x4, double y4, Color c4, ZPos z,
|
21
|
-
|
21
|
+
BlendMode mode) const override;
|
22
22
|
|
23
23
|
const Gosu::GLTexInfo* gl_tex_info() const override;
|
24
24
|
|
data/src/RenderState.hpp
CHANGED
@@ -10,10 +10,10 @@ struct Gosu::RenderState
|
|
10
10
|
std::shared_ptr<Texture> texture;
|
11
11
|
const Transform* transform;
|
12
12
|
ClipRect clip_rect;
|
13
|
-
|
13
|
+
BlendMode mode;
|
14
14
|
|
15
15
|
RenderState()
|
16
|
-
: transform(0), mode(
|
16
|
+
: transform(0), mode(BM_DEFAULT)
|
17
17
|
{
|
18
18
|
clip_rect.width = NO_CLIPPING;
|
19
19
|
}
|
@@ -39,10 +39,10 @@ struct Gosu::RenderState
|
|
39
39
|
|
40
40
|
void apply_alpha_mode() const
|
41
41
|
{
|
42
|
-
if (mode ==
|
42
|
+
if (mode == BM_ADD) {
|
43
43
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
44
44
|
}
|
45
|
-
else if (mode ==
|
45
|
+
else if (mode == BM_MULTIPLY) {
|
46
46
|
glBlendFunc(GL_DST_COLOR, GL_ZERO);
|
47
47
|
}
|
48
48
|
else {
|
@@ -174,7 +174,7 @@ public:
|
|
174
174
|
}
|
175
175
|
}
|
176
176
|
|
177
|
-
void set_alpha_mode(
|
177
|
+
void set_alpha_mode(BlendMode new_mode)
|
178
178
|
{
|
179
179
|
if (new_mode == mode) return;
|
180
180
|
|
data/src/RubyGosu.cxx
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* ----------------------------------------------------------------------------
|
2
2
|
* This file was automatically generated by SWIG (http://www.swig.org).
|
3
|
-
* Version 4.
|
3
|
+
* Version 4.0.2
|
4
4
|
*
|
5
5
|
* This file is not intended to be easily readable and contains a number of
|
6
6
|
* coding conventions designed to improve portability and efficiency. Do not make
|
@@ -2203,7 +2203,7 @@ static VALUE mGosu;
|
|
2203
2203
|
#define SWIG_RUBY_THREAD_END_BLOCK
|
2204
2204
|
|
2205
2205
|
|
2206
|
-
#define SWIGVERSION
|
2206
|
+
#define SWIGVERSION 0x040002
|
2207
2207
|
#define SWIG_VERSION SWIGVERSION
|
2208
2208
|
|
2209
2209
|
|
@@ -2353,7 +2353,7 @@ namespace Gosu
|
|
2353
2353
|
{
|
2354
2354
|
void draw_line(double x1, double y1, Gosu::Color c1,
|
2355
2355
|
double x2, double y2, Gosu::Color c2,
|
2356
|
-
Gosu::ZPos z = 0, Gosu::
|
2356
|
+
Gosu::ZPos z = 0, Gosu::BlendMode mode = Gosu::BM_DEFAULT)
|
2357
2357
|
{
|
2358
2358
|
Gosu::Graphics::draw_line(x1, y1, c1, x2, y2, c2, z, mode);
|
2359
2359
|
}
|
@@ -2361,7 +2361,7 @@ namespace Gosu
|
|
2361
2361
|
void draw_triangle(double x1, double y1, Gosu::Color c1,
|
2362
2362
|
double x2, double y2, Gosu::Color c2,
|
2363
2363
|
double x3, double y3, Gosu::Color c3,
|
2364
|
-
Gosu::ZPos z = 0, Gosu::
|
2364
|
+
Gosu::ZPos z = 0, Gosu::BlendMode mode = Gosu::BM_DEFAULT)
|
2365
2365
|
{
|
2366
2366
|
Gosu::Graphics::draw_triangle(x1, y1, c1, x2, y2, c2, x3, y3, c3, z, mode);
|
2367
2367
|
}
|
@@ -2370,13 +2370,13 @@ namespace Gosu
|
|
2370
2370
|
double x2, double y2, Gosu::Color c2,
|
2371
2371
|
double x3, double y3, Gosu::Color c3,
|
2372
2372
|
double x4, double y4, Gosu::Color c4,
|
2373
|
-
Gosu::ZPos z = 0, Gosu::
|
2373
|
+
Gosu::ZPos z = 0, Gosu::BlendMode mode = Gosu::BM_DEFAULT)
|
2374
2374
|
{
|
2375
2375
|
Gosu::Graphics::draw_quad(x1, y1, c1, x2, y2, c2, x3, y3, c3, x4, y4, c4, z, mode);
|
2376
2376
|
}
|
2377
2377
|
|
2378
2378
|
void draw_rect(double x, double y, double width, double height, Gosu::Color c,
|
2379
|
-
Gosu::ZPos z = 0, Gosu::
|
2379
|
+
Gosu::ZPos z = 0, Gosu::BlendMode mode = Gosu::BM_DEFAULT)
|
2380
2380
|
{
|
2381
2381
|
Gosu::Graphics::draw_rect(x, y, width, height, c, z, mode);
|
2382
2382
|
}
|
@@ -2519,7 +2519,7 @@ SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2))
|
|
2519
2519
|
}
|
2520
2520
|
|
2521
2521
|
|
2522
|
-
/*@SWIG:/
|
2522
|
+
/*@SWIG:/opt/homebrew/Cellar/swig/4.0.2/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2523
2523
|
SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE arg)
|
2524
2524
|
{
|
2525
2525
|
VALUE *args = (VALUE *)arg;
|
@@ -2562,7 +2562,7 @@ SWIG_From_unsigned_SS_int (unsigned int value)
|
|
2562
2562
|
#include <string>
|
2563
2563
|
|
2564
2564
|
|
2565
|
-
/*@SWIG:/
|
2565
|
+
/*@SWIG:/opt/homebrew/Cellar/swig/4.0.2/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2566
2566
|
SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE arg)
|
2567
2567
|
{
|
2568
2568
|
VALUE *args = (VALUE *)arg;
|
@@ -2768,7 +2768,7 @@ SWIG_AsPtr_std_string (VALUE obj, std::string **val)
|
|
2768
2768
|
}
|
2769
2769
|
|
2770
2770
|
|
2771
|
-
/*@SWIG:/
|
2771
|
+
/*@SWIG:/opt/homebrew/Cellar/swig/4.0.2/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2772
2772
|
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE arg)
|
2773
2773
|
{
|
2774
2774
|
VALUE *args = (VALUE *)arg;
|
@@ -2923,7 +2923,7 @@ SWIGINTERN Gosu::Image *new_Gosu_Image(VALUE source,VALUE options=0){
|
|
2923
2923
|
|
2924
2924
|
return new Gosu::Image(bmp, src_x, src_y, src_width, src_height, flags);
|
2925
2925
|
}
|
2926
|
-
SWIGINTERN void Gosu_Image_draw_as_quad(Gosu::Image *self,double x1,double y1,Gosu::Color c1,double x2,double y2,Gosu::Color c2,double x3,double y3,Gosu::Color c3,double x4,double y4,Gosu::Color c4,Gosu::ZPos z,Gosu::
|
2926
|
+
SWIGINTERN void Gosu_Image_draw_as_quad(Gosu::Image *self,double x1,double y1,Gosu::Color c1,double x2,double y2,Gosu::Color c2,double x3,double y3,Gosu::Color c3,double x4,double y4,Gosu::Color c4,Gosu::ZPos z,Gosu::BlendMode mode=Gosu::BM_DEFAULT){
|
2927
2927
|
self->data().draw(x1, y1, c1, x2, y2, c2, x3, y3, c3, x4, y4, c4, z, mode);
|
2928
2928
|
}
|
2929
2929
|
SWIGINTERN Gosu::GLTexInfo *Gosu_Image_gl_tex_info(Gosu::Image const *self){
|
@@ -3300,7 +3300,7 @@ std::string SwigDirector_TextInput::filter(std::string text) const {
|
|
3300
3300
|
}
|
3301
3301
|
|
3302
3302
|
|
3303
|
-
SwigDirector_Window::SwigDirector_Window(VALUE self,int width,int height,unsigned int window_flags,double update_interval): Gosu::Window(width, height, window_flags, update_interval), Swig::Director(self) {
|
3303
|
+
SwigDirector_Window::SwigDirector_Window(VALUE self, int width, int height, unsigned int window_flags, double update_interval): Gosu::Window(width, height, window_flags, update_interval), Swig::Director(self) {
|
3304
3304
|
|
3305
3305
|
}
|
3306
3306
|
|
@@ -3864,8 +3864,8 @@ fail:
|
|
3864
3864
|
|
3865
3865
|
|
3866
3866
|
SWIGINTERN VALUE
|
3867
|
-
|
3868
|
-
std::string result;
|
3867
|
+
_wrap_user_languages(int argc, VALUE *argv, VALUE self) {
|
3868
|
+
SwigValueWrapper< std::vector< std::string > > result;
|
3869
3869
|
VALUE vresult = Qnil;
|
3870
3870
|
|
3871
3871
|
if ((argc < 0) || (argc > 0)) {
|
@@ -3873,15 +3873,17 @@ _wrap_language(int argc, VALUE *argv, VALUE self) {
|
|
3873
3873
|
}
|
3874
3874
|
{
|
3875
3875
|
try {
|
3876
|
-
result = Gosu::
|
3876
|
+
result = Gosu::user_languages();
|
3877
3877
|
}
|
3878
3878
|
catch (const std::exception& e) {
|
3879
3879
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
3880
3880
|
}
|
3881
3881
|
}
|
3882
3882
|
{
|
3883
|
-
vresult =
|
3884
|
-
|
3883
|
+
vresult = rb_ary_new2((&result)->size());
|
3884
|
+
for (std::size_t i = 0; i < (&result)->size(); i++) {
|
3885
|
+
rb_ary_store(vresult, i, rb_str_new2((*&result)[i].c_str()));
|
3886
|
+
}
|
3885
3887
|
}
|
3886
3888
|
return vresult;
|
3887
3889
|
fail:
|
@@ -5373,7 +5375,7 @@ _wrap_Font_draw_text(int argc, VALUE *argv, VALUE self) {
|
|
5373
5375
|
double arg6 = (double) 1 ;
|
5374
5376
|
double arg7 = (double) 1 ;
|
5375
5377
|
Gosu::Color arg8 = (Gosu::Color) Gosu::Color::WHITE ;
|
5376
|
-
Gosu::
|
5378
|
+
Gosu::BlendMode arg9 = (Gosu::BlendMode) Gosu::BM_DEFAULT ;
|
5377
5379
|
void *argp1 = 0 ;
|
5378
5380
|
int res1 = 0 ;
|
5379
5381
|
int res2 = SWIG_OLDOBJ ;
|
@@ -5461,16 +5463,16 @@ _wrap_Font_draw_text(int argc, VALUE *argv, VALUE self) {
|
|
5461
5463
|
const char* cstr = Gosu::cstr_from_symbol(argv[7]);
|
5462
5464
|
|
5463
5465
|
if (!strcmp(cstr, "default")) {
|
5464
|
-
arg9 = Gosu::
|
5466
|
+
arg9 = Gosu::BM_DEFAULT;
|
5465
5467
|
}
|
5466
5468
|
else if (!strcmp(cstr, "add") || !strcmp(cstr, "additive")) {
|
5467
|
-
arg9 = Gosu::
|
5469
|
+
arg9 = Gosu::BM_ADD;
|
5468
5470
|
}
|
5469
5471
|
else if (!strcmp(cstr, "multiply")) {
|
5470
|
-
arg9 = Gosu::
|
5472
|
+
arg9 = Gosu::BM_MULTIPLY;
|
5471
5473
|
}
|
5472
5474
|
else {
|
5473
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid
|
5475
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid blend mode (expected one of :default, :add, "
|
5474
5476
|
":multiply)");
|
5475
5477
|
}
|
5476
5478
|
}
|
@@ -5501,7 +5503,7 @@ _wrap_Font_draw_markup(int argc, VALUE *argv, VALUE self) {
|
|
5501
5503
|
double arg6 = (double) 1 ;
|
5502
5504
|
double arg7 = (double) 1 ;
|
5503
5505
|
Gosu::Color arg8 = (Gosu::Color) Gosu::Color::WHITE ;
|
5504
|
-
Gosu::
|
5506
|
+
Gosu::BlendMode arg9 = (Gosu::BlendMode) Gosu::BM_DEFAULT ;
|
5505
5507
|
void *argp1 = 0 ;
|
5506
5508
|
int res1 = 0 ;
|
5507
5509
|
int res2 = SWIG_OLDOBJ ;
|
@@ -5589,16 +5591,16 @@ _wrap_Font_draw_markup(int argc, VALUE *argv, VALUE self) {
|
|
5589
5591
|
const char* cstr = Gosu::cstr_from_symbol(argv[7]);
|
5590
5592
|
|
5591
5593
|
if (!strcmp(cstr, "default")) {
|
5592
|
-
arg9 = Gosu::
|
5594
|
+
arg9 = Gosu::BM_DEFAULT;
|
5593
5595
|
}
|
5594
5596
|
else if (!strcmp(cstr, "add") || !strcmp(cstr, "additive")) {
|
5595
|
-
arg9 = Gosu::
|
5597
|
+
arg9 = Gosu::BM_ADD;
|
5596
5598
|
}
|
5597
5599
|
else if (!strcmp(cstr, "multiply")) {
|
5598
|
-
arg9 = Gosu::
|
5600
|
+
arg9 = Gosu::BM_MULTIPLY;
|
5599
5601
|
}
|
5600
5602
|
else {
|
5601
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid
|
5603
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid blend mode (expected one of :default, :add, "
|
5602
5604
|
":multiply)");
|
5603
5605
|
}
|
5604
5606
|
}
|
@@ -5631,7 +5633,7 @@ _wrap_Font_draw_text_rel(int argc, VALUE *argv, VALUE self) {
|
|
5631
5633
|
double arg8 = (double) 1 ;
|
5632
5634
|
double arg9 = (double) 1 ;
|
5633
5635
|
Gosu::Color arg10 = (Gosu::Color) Gosu::Color::WHITE ;
|
5634
|
-
Gosu::
|
5636
|
+
Gosu::BlendMode arg11 = (Gosu::BlendMode) Gosu::BM_DEFAULT ;
|
5635
5637
|
void *argp1 = 0 ;
|
5636
5638
|
int res1 = 0 ;
|
5637
5639
|
int res2 = SWIG_OLDOBJ ;
|
@@ -5733,16 +5735,16 @@ _wrap_Font_draw_text_rel(int argc, VALUE *argv, VALUE self) {
|
|
5733
5735
|
const char* cstr = Gosu::cstr_from_symbol(argv[9]);
|
5734
5736
|
|
5735
5737
|
if (!strcmp(cstr, "default")) {
|
5736
|
-
arg11 = Gosu::
|
5738
|
+
arg11 = Gosu::BM_DEFAULT;
|
5737
5739
|
}
|
5738
5740
|
else if (!strcmp(cstr, "add") || !strcmp(cstr, "additive")) {
|
5739
|
-
arg11 = Gosu::
|
5741
|
+
arg11 = Gosu::BM_ADD;
|
5740
5742
|
}
|
5741
5743
|
else if (!strcmp(cstr, "multiply")) {
|
5742
|
-
arg11 = Gosu::
|
5744
|
+
arg11 = Gosu::BM_MULTIPLY;
|
5743
5745
|
}
|
5744
5746
|
else {
|
5745
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid
|
5747
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid blend mode (expected one of :default, :add, "
|
5746
5748
|
":multiply)");
|
5747
5749
|
}
|
5748
5750
|
}
|
@@ -5775,7 +5777,7 @@ _wrap_Font_draw_markup_rel(int argc, VALUE *argv, VALUE self) {
|
|
5775
5777
|
double arg8 = (double) 1 ;
|
5776
5778
|
double arg9 = (double) 1 ;
|
5777
5779
|
Gosu::Color arg10 = (Gosu::Color) Gosu::Color::WHITE ;
|
5778
|
-
Gosu::
|
5780
|
+
Gosu::BlendMode arg11 = (Gosu::BlendMode) Gosu::BM_DEFAULT ;
|
5779
5781
|
void *argp1 = 0 ;
|
5780
5782
|
int res1 = 0 ;
|
5781
5783
|
int res2 = SWIG_OLDOBJ ;
|
@@ -5877,16 +5879,16 @@ _wrap_Font_draw_markup_rel(int argc, VALUE *argv, VALUE self) {
|
|
5877
5879
|
const char* cstr = Gosu::cstr_from_symbol(argv[9]);
|
5878
5880
|
|
5879
5881
|
if (!strcmp(cstr, "default")) {
|
5880
|
-
arg11 = Gosu::
|
5882
|
+
arg11 = Gosu::BM_DEFAULT;
|
5881
5883
|
}
|
5882
5884
|
else if (!strcmp(cstr, "add") || !strcmp(cstr, "additive")) {
|
5883
|
-
arg11 = Gosu::
|
5885
|
+
arg11 = Gosu::BM_ADD;
|
5884
5886
|
}
|
5885
5887
|
else if (!strcmp(cstr, "multiply")) {
|
5886
|
-
arg11 = Gosu::
|
5888
|
+
arg11 = Gosu::BM_MULTIPLY;
|
5887
5889
|
}
|
5888
5890
|
else {
|
5889
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid
|
5891
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid blend mode (expected one of :default, :add, "
|
5890
5892
|
":multiply)");
|
5891
5893
|
}
|
5892
5894
|
}
|
@@ -6625,7 +6627,7 @@ _wrap_Image_draw(int argc, VALUE *argv, VALUE self) {
|
|
6625
6627
|
double arg5 = (double) 1 ;
|
6626
6628
|
double arg6 = (double) 1 ;
|
6627
6629
|
Gosu::Color arg7 = (Gosu::Color) Gosu::Color::WHITE ;
|
6628
|
-
Gosu::
|
6630
|
+
Gosu::BlendMode arg8 = (Gosu::BlendMode) Gosu::BM_DEFAULT ;
|
6629
6631
|
void *argp1 = 0 ;
|
6630
6632
|
int res1 = 0 ;
|
6631
6633
|
double val2 ;
|
@@ -6703,16 +6705,16 @@ _wrap_Image_draw(int argc, VALUE *argv, VALUE self) {
|
|
6703
6705
|
const char* cstr = Gosu::cstr_from_symbol(argv[6]);
|
6704
6706
|
|
6705
6707
|
if (!strcmp(cstr, "default")) {
|
6706
|
-
arg8 = Gosu::
|
6708
|
+
arg8 = Gosu::BM_DEFAULT;
|
6707
6709
|
}
|
6708
6710
|
else if (!strcmp(cstr, "add") || !strcmp(cstr, "additive")) {
|
6709
|
-
arg8 = Gosu::
|
6711
|
+
arg8 = Gosu::BM_ADD;
|
6710
6712
|
}
|
6711
6713
|
else if (!strcmp(cstr, "multiply")) {
|
6712
|
-
arg8 = Gosu::
|
6714
|
+
arg8 = Gosu::BM_MULTIPLY;
|
6713
6715
|
}
|
6714
6716
|
else {
|
6715
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid
|
6717
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid blend mode (expected one of :default, :add, "
|
6716
6718
|
":multiply)");
|
6717
6719
|
}
|
6718
6720
|
}
|
@@ -6743,7 +6745,7 @@ _wrap_Image_draw_mod(int argc, VALUE *argv, VALUE self) {
|
|
6743
6745
|
Gosu::Color arg8 ;
|
6744
6746
|
Gosu::Color arg9 ;
|
6745
6747
|
Gosu::Color arg10 ;
|
6746
|
-
Gosu::
|
6748
|
+
Gosu::BlendMode arg11 = (Gosu::BlendMode) Gosu::BM_DEFAULT ;
|
6747
6749
|
void *argp1 = 0 ;
|
6748
6750
|
int res1 = 0 ;
|
6749
6751
|
double val2 ;
|
@@ -6867,16 +6869,16 @@ _wrap_Image_draw_mod(int argc, VALUE *argv, VALUE self) {
|
|
6867
6869
|
const char* cstr = Gosu::cstr_from_symbol(argv[9]);
|
6868
6870
|
|
6869
6871
|
if (!strcmp(cstr, "default")) {
|
6870
|
-
arg11 = Gosu::
|
6872
|
+
arg11 = Gosu::BM_DEFAULT;
|
6871
6873
|
}
|
6872
6874
|
else if (!strcmp(cstr, "add") || !strcmp(cstr, "additive")) {
|
6873
|
-
arg11 = Gosu::
|
6875
|
+
arg11 = Gosu::BM_ADD;
|
6874
6876
|
}
|
6875
6877
|
else if (!strcmp(cstr, "multiply")) {
|
6876
|
-
arg11 = Gosu::
|
6878
|
+
arg11 = Gosu::BM_MULTIPLY;
|
6877
6879
|
}
|
6878
6880
|
else {
|
6879
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid
|
6881
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid blend mode (expected one of :default, :add, "
|
6880
6882
|
":multiply)");
|
6881
6883
|
}
|
6882
6884
|
}
|
@@ -6907,7 +6909,7 @@ _wrap_Image_draw_rot(int argc, VALUE *argv, VALUE self) {
|
|
6907
6909
|
double arg8 = (double) 1 ;
|
6908
6910
|
double arg9 = (double) 1 ;
|
6909
6911
|
Gosu::Color arg10 = (Gosu::Color) Gosu::Color::WHITE ;
|
6910
|
-
Gosu::
|
6912
|
+
Gosu::BlendMode arg11 = (Gosu::BlendMode) Gosu::BM_DEFAULT ;
|
6911
6913
|
void *argp1 = 0 ;
|
6912
6914
|
int res1 = 0 ;
|
6913
6915
|
double val2 ;
|
@@ -7012,16 +7014,16 @@ _wrap_Image_draw_rot(int argc, VALUE *argv, VALUE self) {
|
|
7012
7014
|
const char* cstr = Gosu::cstr_from_symbol(argv[9]);
|
7013
7015
|
|
7014
7016
|
if (!strcmp(cstr, "default")) {
|
7015
|
-
arg11 = Gosu::
|
7017
|
+
arg11 = Gosu::BM_DEFAULT;
|
7016
7018
|
}
|
7017
7019
|
else if (!strcmp(cstr, "add") || !strcmp(cstr, "additive")) {
|
7018
|
-
arg11 = Gosu::
|
7020
|
+
arg11 = Gosu::BM_ADD;
|
7019
7021
|
}
|
7020
7022
|
else if (!strcmp(cstr, "multiply")) {
|
7021
|
-
arg11 = Gosu::
|
7023
|
+
arg11 = Gosu::BM_MULTIPLY;
|
7022
7024
|
}
|
7023
7025
|
else {
|
7024
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid
|
7026
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid blend mode (expected one of :default, :add, "
|
7025
7027
|
":multiply)");
|
7026
7028
|
}
|
7027
7029
|
}
|
@@ -7101,7 +7103,7 @@ _wrap_Image_draw_as_quad(int argc, VALUE *argv, VALUE self) {
|
|
7101
7103
|
double arg12 ;
|
7102
7104
|
Gosu::Color arg13 ;
|
7103
7105
|
Gosu::ZPos arg14 ;
|
7104
|
-
Gosu::
|
7106
|
+
Gosu::BlendMode arg15 = (Gosu::BlendMode) Gosu::BM_DEFAULT ;
|
7105
7107
|
void *argp1 = 0 ;
|
7106
7108
|
int res1 = 0 ;
|
7107
7109
|
double val2 ;
|
@@ -7253,16 +7255,16 @@ _wrap_Image_draw_as_quad(int argc, VALUE *argv, VALUE self) {
|
|
7253
7255
|
const char* cstr = Gosu::cstr_from_symbol(argv[13]);
|
7254
7256
|
|
7255
7257
|
if (!strcmp(cstr, "default")) {
|
7256
|
-
arg15 = Gosu::
|
7258
|
+
arg15 = Gosu::BM_DEFAULT;
|
7257
7259
|
}
|
7258
7260
|
else if (!strcmp(cstr, "add") || !strcmp(cstr, "additive")) {
|
7259
|
-
arg15 = Gosu::
|
7261
|
+
arg15 = Gosu::BM_ADD;
|
7260
7262
|
}
|
7261
7263
|
else if (!strcmp(cstr, "multiply")) {
|
7262
|
-
arg15 = Gosu::
|
7264
|
+
arg15 = Gosu::BM_MULTIPLY;
|
7263
7265
|
}
|
7264
7266
|
else {
|
7265
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid
|
7267
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid blend mode (expected one of :default, :add, "
|
7266
7268
|
":multiply)");
|
7267
7269
|
}
|
7268
7270
|
}
|
@@ -10987,7 +10989,7 @@ _wrap_draw_line(int argc, VALUE *argv, VALUE self) {
|
|
10987
10989
|
double arg5 ;
|
10988
10990
|
Gosu::Color arg6 ;
|
10989
10991
|
Gosu::ZPos arg7 = (Gosu::ZPos) 0 ;
|
10990
|
-
Gosu::
|
10992
|
+
Gosu::BlendMode arg8 = (Gosu::BlendMode) Gosu::BM_DEFAULT ;
|
10991
10993
|
double val1 ;
|
10992
10994
|
int ecode1 = 0 ;
|
10993
10995
|
double val2 ;
|
@@ -11070,16 +11072,16 @@ _wrap_draw_line(int argc, VALUE *argv, VALUE self) {
|
|
11070
11072
|
const char* cstr = Gosu::cstr_from_symbol(argv[7]);
|
11071
11073
|
|
11072
11074
|
if (!strcmp(cstr, "default")) {
|
11073
|
-
arg8 = Gosu::
|
11075
|
+
arg8 = Gosu::BM_DEFAULT;
|
11074
11076
|
}
|
11075
11077
|
else if (!strcmp(cstr, "add") || !strcmp(cstr, "additive")) {
|
11076
|
-
arg8 = Gosu::
|
11078
|
+
arg8 = Gosu::BM_ADD;
|
11077
11079
|
}
|
11078
11080
|
else if (!strcmp(cstr, "multiply")) {
|
11079
|
-
arg8 = Gosu::
|
11081
|
+
arg8 = Gosu::BM_MULTIPLY;
|
11080
11082
|
}
|
11081
11083
|
else {
|
11082
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid
|
11084
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid blend mode (expected one of :default, :add, "
|
11083
11085
|
":multiply)");
|
11084
11086
|
}
|
11085
11087
|
}
|
@@ -11110,7 +11112,7 @@ _wrap_draw_triangle(int argc, VALUE *argv, VALUE self) {
|
|
11110
11112
|
double arg8 ;
|
11111
11113
|
Gosu::Color arg9 ;
|
11112
11114
|
Gosu::ZPos arg10 = (Gosu::ZPos) 0 ;
|
11113
|
-
Gosu::
|
11115
|
+
Gosu::BlendMode arg11 = (Gosu::BlendMode) Gosu::BM_DEFAULT ;
|
11114
11116
|
double val1 ;
|
11115
11117
|
int ecode1 = 0 ;
|
11116
11118
|
double val2 ;
|
@@ -11225,16 +11227,16 @@ _wrap_draw_triangle(int argc, VALUE *argv, VALUE self) {
|
|
11225
11227
|
const char* cstr = Gosu::cstr_from_symbol(argv[10]);
|
11226
11228
|
|
11227
11229
|
if (!strcmp(cstr, "default")) {
|
11228
|
-
arg11 = Gosu::
|
11230
|
+
arg11 = Gosu::BM_DEFAULT;
|
11229
11231
|
}
|
11230
11232
|
else if (!strcmp(cstr, "add") || !strcmp(cstr, "additive")) {
|
11231
|
-
arg11 = Gosu::
|
11233
|
+
arg11 = Gosu::BM_ADD;
|
11232
11234
|
}
|
11233
11235
|
else if (!strcmp(cstr, "multiply")) {
|
11234
|
-
arg11 = Gosu::
|
11236
|
+
arg11 = Gosu::BM_MULTIPLY;
|
11235
11237
|
}
|
11236
11238
|
else {
|
11237
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid
|
11239
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid blend mode (expected one of :default, :add, "
|
11238
11240
|
":multiply)");
|
11239
11241
|
}
|
11240
11242
|
}
|
@@ -11268,7 +11270,7 @@ _wrap_draw_quad(int argc, VALUE *argv, VALUE self) {
|
|
11268
11270
|
double arg11 ;
|
11269
11271
|
Gosu::Color arg12 ;
|
11270
11272
|
Gosu::ZPos arg13 = (Gosu::ZPos) 0 ;
|
11271
|
-
Gosu::
|
11273
|
+
Gosu::BlendMode arg14 = (Gosu::BlendMode) Gosu::BM_DEFAULT ;
|
11272
11274
|
double val1 ;
|
11273
11275
|
int ecode1 = 0 ;
|
11274
11276
|
double val2 ;
|
@@ -11415,16 +11417,16 @@ _wrap_draw_quad(int argc, VALUE *argv, VALUE self) {
|
|
11415
11417
|
const char* cstr = Gosu::cstr_from_symbol(argv[13]);
|
11416
11418
|
|
11417
11419
|
if (!strcmp(cstr, "default")) {
|
11418
|
-
arg14 = Gosu::
|
11420
|
+
arg14 = Gosu::BM_DEFAULT;
|
11419
11421
|
}
|
11420
11422
|
else if (!strcmp(cstr, "add") || !strcmp(cstr, "additive")) {
|
11421
|
-
arg14 = Gosu::
|
11423
|
+
arg14 = Gosu::BM_ADD;
|
11422
11424
|
}
|
11423
11425
|
else if (!strcmp(cstr, "multiply")) {
|
11424
|
-
arg14 = Gosu::
|
11426
|
+
arg14 = Gosu::BM_MULTIPLY;
|
11425
11427
|
}
|
11426
11428
|
else {
|
11427
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid
|
11429
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid blend mode (expected one of :default, :add, "
|
11428
11430
|
":multiply)");
|
11429
11431
|
}
|
11430
11432
|
}
|
@@ -11451,7 +11453,7 @@ _wrap_draw_rect(int argc, VALUE *argv, VALUE self) {
|
|
11451
11453
|
double arg4 ;
|
11452
11454
|
Gosu::Color arg5 ;
|
11453
11455
|
Gosu::ZPos arg6 = (Gosu::ZPos) 0 ;
|
11454
|
-
Gosu::
|
11456
|
+
Gosu::BlendMode arg7 = (Gosu::BlendMode) Gosu::BM_DEFAULT ;
|
11455
11457
|
double val1 ;
|
11456
11458
|
int ecode1 = 0 ;
|
11457
11459
|
double val2 ;
|
@@ -11516,16 +11518,16 @@ _wrap_draw_rect(int argc, VALUE *argv, VALUE self) {
|
|
11516
11518
|
const char* cstr = Gosu::cstr_from_symbol(argv[6]);
|
11517
11519
|
|
11518
11520
|
if (!strcmp(cstr, "default")) {
|
11519
|
-
arg7 = Gosu::
|
11521
|
+
arg7 = Gosu::BM_DEFAULT;
|
11520
11522
|
}
|
11521
11523
|
else if (!strcmp(cstr, "add") || !strcmp(cstr, "additive")) {
|
11522
|
-
arg7 = Gosu::
|
11524
|
+
arg7 = Gosu::BM_ADD;
|
11523
11525
|
}
|
11524
11526
|
else if (!strcmp(cstr, "multiply")) {
|
11525
|
-
arg7 = Gosu::
|
11527
|
+
arg7 = Gosu::BM_MULTIPLY;
|
11526
11528
|
}
|
11527
11529
|
else {
|
11528
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid
|
11530
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid blend mode (expected one of :default, :add, "
|
11529
11531
|
":multiply)");
|
11530
11532
|
}
|
11531
11533
|
}
|
@@ -12518,7 +12520,7 @@ SWIGEXPORT void Init_gosu(void) {
|
|
12518
12520
|
rb_define_const(mGosu, "VERSION", SWIG_From_std_string(static_cast< std::string >(Gosu::VERSION)));
|
12519
12521
|
rb_define_const(mGosu, "LICENSES", SWIG_From_std_string(static_cast< std::string >(Gosu::LICENSES)));
|
12520
12522
|
rb_define_const(mGosu, "MAJOR_VERSION", SWIG_From_int(static_cast< int >(1)));
|
12521
|
-
rb_define_const(mGosu, "MINOR_VERSION", SWIG_From_int(static_cast< int >(
|
12523
|
+
rb_define_const(mGosu, "MINOR_VERSION", SWIG_From_int(static_cast< int >(2)));
|
12522
12524
|
rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(0)));
|
12523
12525
|
rb_define_module_function(mGosu, "milliseconds", VALUEFUNC(_wrap_milliseconds), -1);
|
12524
12526
|
rb_define_module_function(mGosu, "random", VALUEFUNC(_wrap_random), -1);
|
@@ -12532,7 +12534,7 @@ SWIGEXPORT void Init_gosu(void) {
|
|
12532
12534
|
rb_define_module_function(mGosu, "distance", VALUEFUNC(_wrap_distance), -1);
|
12533
12535
|
rb_define_module_function(mGosu, "default_font_name", VALUEFUNC(_wrap_default_font_name), -1);
|
12534
12536
|
rb_define_const(mGosu, "MAX_TEXTURE_SIZE", SWIG_From_unsigned_SS_int(static_cast< unsigned int >(Gosu::MAX_TEXTURE_SIZE)));
|
12535
|
-
rb_define_module_function(mGosu, "
|
12537
|
+
rb_define_module_function(mGosu, "user_languages", VALUEFUNC(_wrap_user_languages), -1);
|
12536
12538
|
rb_define_module_function(mGosu, "enable_undocumented_retrofication", VALUEFUNC(_wrap_enable_undocumented_retrofication), -1);
|
12537
12539
|
|
12538
12540
|
SwigClassColor.klass = rb_define_class_under(mGosu, "Color", rb_cObject);
|
data/src/RubyGosu.h
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* ----------------------------------------------------------------------------
|
2
2
|
* This file was automatically generated by SWIG (http://www.swig.org).
|
3
|
-
* Version 4.
|
3
|
+
* Version 4.0.2
|
4
4
|
*
|
5
5
|
* This file is not intended to be easily readable and contains a number of
|
6
6
|
* coding conventions designed to improve portability and efficiency. Do not make
|
@@ -28,7 +28,7 @@ public:
|
|
28
28
|
class SwigDirector_Window : public Gosu::Window, public Swig::Director {
|
29
29
|
|
30
30
|
public:
|
31
|
-
SwigDirector_Window(VALUE self,int width,int height,unsigned int window_flags=Gosu::WF_WINDOWED,double update_interval=16.666666);
|
31
|
+
SwigDirector_Window(VALUE self, int width, int height, unsigned int window_flags = Gosu::WF_WINDOWED, double update_interval = 16.666666);
|
32
32
|
virtual ~SwigDirector_Window();
|
33
33
|
virtual void show();
|
34
34
|
virtual bool tick();
|
data/src/TexChunk.cpp
CHANGED
@@ -44,7 +44,7 @@ Gosu::TexChunk::~TexChunk()
|
|
44
44
|
}
|
45
45
|
|
46
46
|
void Gosu::TexChunk::draw(double x1, double y1, Color c1, double x2, double y2, Color c2,
|
47
|
-
double x3, double y3, Color c3, double x4, double y4, Color c4, ZPos z,
|
47
|
+
double x3, double y3, Color c3, double x4, double y4, Color c4, ZPos z, BlendMode mode) const
|
48
48
|
{
|
49
49
|
DrawOp op;
|
50
50
|
op.render_state.texture = texture;
|
data/src/TexChunk.hpp
CHANGED
@@ -29,7 +29,7 @@ public:
|
|
29
29
|
double x2, double y2, Color c2,
|
30
30
|
double x3, double y3, Color c3,
|
31
31
|
double x4, double y4, Color c4,
|
32
|
-
ZPos z,
|
32
|
+
ZPos z, BlendMode mode) const override;
|
33
33
|
|
34
34
|
const GLTexInfo* gl_tex_info() const override { return &info; }
|
35
35
|
|
data/src/TrueTypeFontApple.cpp
CHANGED
@@ -24,8 +24,8 @@ const unsigned char* Gosu::ttf_data_by_name(const string& font_name, unsigned fo
|
|
24
24
|
log("Trying to find a font named '%s', flags=%x", font_name.c_str(), font_flags);
|
25
25
|
|
26
26
|
unsigned symbolic_traits = 0;
|
27
|
-
if (font_flags & Gosu::FF_BOLD) symbolic_traits |=
|
28
|
-
if (font_flags & Gosu::FF_ITALIC) symbolic_traits |=
|
27
|
+
if (font_flags & Gosu::FF_BOLD) symbolic_traits |= kCTFontTraitBold;
|
28
|
+
if (font_flags & Gosu::FF_ITALIC) symbolic_traits |= kCTFontTraitItalic;
|
29
29
|
|
30
30
|
NSDictionary *attributes = @{
|
31
31
|
((__bridge id) kCTFontNameAttribute): [NSString stringWithUTF8String:font_name.c_str()],
|
@@ -39,6 +39,14 @@ const unsigned char* Gosu::ttf_data_by_name(const string& font_name, unsigned fo
|
|
39
39
|
if (descriptor) {
|
40
40
|
CTFontRef font = CTFontCreateWithFontDescriptorAndOptions(descriptor, 20, nullptr, 0);
|
41
41
|
if (font) {
|
42
|
+
if ((CTFontGetSymbolicTraits(font) & symbolic_traits) != symbolic_traits) {
|
43
|
+
// For some reason the initial call to CTFontCreateWithFontDescriptorAndOptions does
|
44
|
+
// not respect the requested font traits. Explicitly requesting the traits again
|
45
|
+
// seems to help. Tested on macOS 11.2.2.
|
46
|
+
CTFontRef correct_font = CTFontCreateCopyWithSymbolicTraits(font, 0.0, nullptr, symbolic_traits, symbolic_traits);
|
47
|
+
CFRelease(font);
|
48
|
+
font = correct_font;
|
49
|
+
}
|
42
50
|
NSURL *url = CFBridgingRelease(CTFontCopyAttribute(font, kCTFontURLAttribute));
|
43
51
|
if (url && url.fileSystemRepresentation) {
|
44
52
|
log("Loading file '%s'", url.fileSystemRepresentation);
|
data/src/Utility.cpp
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
#include <Gosu/Utility.hpp>
|
2
|
-
#include <Gosu/Platform.hpp>
|
3
2
|
|
3
|
+
#include <SDL.h>
|
4
4
|
#include <utf8proc.h>
|
5
5
|
|
6
6
|
#include <cstring>
|
7
|
+
#include <memory>
|
7
8
|
#include <stdexcept>
|
8
|
-
using namespace std;
|
9
9
|
|
10
|
-
u32string Gosu::utf8_to_composed_utc4(const string& utf8)
|
10
|
+
std::u32string Gosu::utf8_to_composed_utc4(const std::string& utf8)
|
11
11
|
{
|
12
|
-
u32string utc4;
|
12
|
+
std::u32string utc4;
|
13
13
|
utc4.reserve(utf8.size());
|
14
|
-
|
15
|
-
auto* current_byte = reinterpret_cast<const utf8proc_uint8_t*>(utf8.data());
|
14
|
+
|
15
|
+
const auto* current_byte = reinterpret_cast<const utf8proc_uint8_t*>(utf8.data());
|
16
16
|
auto remaining_length = utf8.length();
|
17
|
-
|
17
|
+
|
18
18
|
// First convert from UTF-8 to UTC-4.
|
19
19
|
utf8proc_int32_t codepoint;
|
20
20
|
while (remaining_length) {
|
@@ -30,35 +30,35 @@ u32string Gosu::utf8_to_composed_utc4(const string& utf8)
|
|
30
30
|
remaining_length -= bytes_read;
|
31
31
|
}
|
32
32
|
}
|
33
|
-
|
33
|
+
|
34
34
|
// Now compose characters in-place.
|
35
|
-
auto utc4_data = reinterpret_cast<
|
36
|
-
// Note that this const_cast will not be necessary anymore in C++17.
|
37
|
-
auto writable_utc4_data = const_cast<utf8proc_int32_t*>(utc4_data);
|
35
|
+
auto* utc4_data = reinterpret_cast<utf8proc_int32_t*>(utc4.data());
|
38
36
|
auto options = static_cast<utf8proc_option_t>(UTF8PROC_NLF2LF | UTF8PROC_COMPOSE);
|
39
|
-
auto new_length = utf8proc_normalize_utf32(
|
37
|
+
auto new_length = utf8proc_normalize_utf32(utc4_data, utc4.length(), options);
|
40
38
|
if (new_length < 0) {
|
41
|
-
throw runtime_error
|
39
|
+
throw std::runtime_error{"Could not normalize '" + utf8 +
|
40
|
+
"': " + utf8proc_errmsg(new_length)};
|
42
41
|
}
|
43
42
|
utc4.resize(new_length);
|
44
|
-
|
43
|
+
|
45
44
|
return utc4;
|
46
45
|
}
|
47
46
|
|
48
|
-
bool Gosu::has_extension(string_view filename, string_view extension)
|
47
|
+
bool Gosu::has_extension(std::string_view filename, std::string_view extension)
|
49
48
|
{
|
50
|
-
size_t ext_len = extension.length();
|
49
|
+
std::size_t ext_len = extension.length();
|
51
50
|
if (ext_len > filename.length()) {
|
52
51
|
return false;
|
53
52
|
}
|
54
53
|
|
55
|
-
string_view::iterator filename_iter = filename.end();
|
56
|
-
string_view::iterator ext_iter = extension.end();
|
54
|
+
std::string_view::iterator filename_iter = filename.end();
|
55
|
+
std::string_view::iterator ext_iter = extension.end();
|
57
56
|
while (ext_len--) {
|
58
57
|
--filename_iter;
|
59
58
|
--ext_iter;
|
60
59
|
|
61
|
-
if (tolower((
|
60
|
+
if (std::tolower(static_cast<int>(*filename_iter)) !=
|
61
|
+
std::tolower(static_cast<int>(*ext_iter))) {
|
62
62
|
return false;
|
63
63
|
}
|
64
64
|
}
|
@@ -66,10 +66,39 @@ bool Gosu::has_extension(string_view filename, string_view extension)
|
|
66
66
|
return true;
|
67
67
|
}
|
68
68
|
|
69
|
-
#if
|
70
|
-
string Gosu::
|
69
|
+
#if SDL_VERSION_ATLEAST(2, 0, 14)
|
70
|
+
std::vector<std::string> Gosu::user_languages()
|
71
|
+
{
|
72
|
+
std::vector<std::string> user_languages;
|
73
|
+
|
74
|
+
std::unique_ptr<SDL_Locale, decltype(SDL_free)*> locales{SDL_GetPreferredLocales(), SDL_free};
|
75
|
+
if (!locales) return user_languages;
|
76
|
+
|
77
|
+
for (const SDL_Locale* locale = locales.get(); locale->language != nullptr; ++locale) {
|
78
|
+
std::string language = locale->language;
|
79
|
+
if (locale->country) {
|
80
|
+
language += "_";
|
81
|
+
language += locale->country;
|
82
|
+
}
|
83
|
+
user_languages.emplace_back(std::move(language));
|
84
|
+
}
|
85
|
+
|
86
|
+
return user_languages;
|
87
|
+
}
|
88
|
+
#else
|
89
|
+
#include <cstdlib>
|
90
|
+
#include <regex>
|
91
|
+
|
92
|
+
std::vector<std::string> Gosu::user_languages()
|
71
93
|
{
|
72
|
-
const
|
73
|
-
|
94
|
+
static const std::regex language_regex{"[a-z]{2}_[A-Z]{2}([^A-Z].*)?"};
|
95
|
+
|
96
|
+
const char* locale = std::getenv("LANG");
|
97
|
+
|
98
|
+
if (locale && std::regex_match(locale, language_regex)) {
|
99
|
+
return {std::string{locale, locale + 5}};
|
100
|
+
}
|
101
|
+
|
102
|
+
return {};
|
74
103
|
}
|
75
104
|
#endif
|
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.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Raschke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
2D game development library.
|
@@ -286,8 +286,6 @@ files:
|
|
286
286
|
- src/TrueTypeFontUnix.cpp
|
287
287
|
- src/TrueTypeFontWin.cpp
|
288
288
|
- src/Utility.cpp
|
289
|
-
- src/UtilityApple.cpp
|
290
|
-
- src/UtilityWin.cpp
|
291
289
|
- src/Version.cpp
|
292
290
|
- src/WinUtility.cpp
|
293
291
|
- src/WinUtility.hpp
|
data/src/UtilityApple.cpp
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#include <Gosu/Platform.hpp>
|
2
|
-
#if defined(GOSU_IS_MAC)
|
3
|
-
|
4
|
-
#import <Gosu/Utility.hpp>
|
5
|
-
#import <Foundation/Foundation.h>
|
6
|
-
using namespace std;
|
7
|
-
|
8
|
-
string Gosu::language()
|
9
|
-
{
|
10
|
-
@autoreleasepool {
|
11
|
-
NSString* language = [NSLocale preferredLanguages][0];
|
12
|
-
return language.UTF8String ?: "en";
|
13
|
-
}
|
14
|
-
}
|
15
|
-
|
16
|
-
#endif
|
data/src/UtilityWin.cpp
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
#include <Gosu/Platform.hpp>
|
2
|
-
#if defined(GOSU_IS_WIN)
|
3
|
-
|
4
|
-
#include <Gosu/Utility.hpp>
|
5
|
-
#include "WinUtility.hpp"
|
6
|
-
#include <windows.h>
|
7
|
-
using namespace std;
|
8
|
-
|
9
|
-
string Gosu::language()
|
10
|
-
{
|
11
|
-
LCID lcid = GetUserDefaultLCID();
|
12
|
-
char buffer[9];
|
13
|
-
winapi_check(GetLocaleInfoA(lcid, LOCALE_SISO639LANGNAME, buffer, sizeof buffer));
|
14
|
-
return buffer;
|
15
|
-
}
|
16
|
-
|
17
|
-
#endif
|