gosu 1.0.0 → 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/COPYING +1 -1
- data/ext/gosu/extconf.rb +5 -1
- data/include/Gosu/Font.hpp +7 -9
- 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/Text.hpp +4 -4
- data/include/Gosu/Utility.hpp +10 -8
- data/include/Gosu/Version.hpp +1 -1
- data/include/Gosu/Window.hpp +23 -9
- data/lib/gosu/compat.rb +4 -0
- data/lib/gosu/swig_patches.rb +11 -10
- data/rdoc/gosu.rb +14 -1
- 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/Input.cpp +1 -10
- data/src/LargeImageData.cpp +1 -1
- data/src/LargeImageData.hpp +1 -1
- data/src/Macro.cpp +100 -143
- data/src/Macro.hpp +1 -1
- data/src/RenderState.hpp +5 -5
- data/src/Resolution.cpp +111 -63
- data/src/RubyGosu.cxx +222 -124
- 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/TrueTypeFontWin.cpp +3 -3
- data/src/Utility.cpp +52 -23
- data/src/Window.cpp +60 -31
- data/src/WindowUIKit.cpp +21 -9
- metadata +3 -25
- 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/src/ChannelWrapper.cpp +0 -50
- data/src/ColorWrapper.cpp +0 -126
- data/src/Constants.cpp +0 -338
- 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/UtilityApple.cpp +0 -16
- data/src/UtilityWin.cpp +0 -17
- 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: 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/COPYING
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (C) 2001-
|
1
|
+
Copyright (C) 2001-2021 Julian Raschke, Jan Lücker and all contributors.
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a
|
4
4
|
copy of this software and associated documentation files (the "Software"),
|
data/ext/gosu/extconf.rb
CHANGED
@@ -51,7 +51,7 @@ if windows
|
|
51
51
|
else
|
52
52
|
$LDFLAGS << " -L../../dependencies/al_soft/x86 -L../../dependencies/SDL/lib/x86"
|
53
53
|
end
|
54
|
-
$LDFLAGS << " -lgdi32 -lwinmm -lOpenGL32 -lOpenAL32 -lSDL2"
|
54
|
+
$LDFLAGS << " -lgdi32 -lwinmm -ldwmapi -lOpenGL32 -lOpenAL32 -lSDL2"
|
55
55
|
# Link libstdc++ statically to avoid having another DLL dependency when using Ocra.
|
56
56
|
$LDFLAGS << " -static-libstdc++"
|
57
57
|
elsif macos
|
@@ -62,6 +62,10 @@ elsif macos
|
|
62
62
|
# rvm will sometimes try to override this:
|
63
63
|
# https://github.com/shawn42/gamebox/issues/96
|
64
64
|
$CXXFLAGS << " -stdlib=libc++"
|
65
|
+
|
66
|
+
# Disable an error that is disabled by default and prevents Gosu from building with universal Ruby:
|
67
|
+
# https://trac.macports.org/ticket/58255 / https://github.com/gosu/gosu/issues/424
|
68
|
+
$CXXFLAGS << " -Wno-reserved-user-defined-literal"
|
65
69
|
|
66
70
|
# Dependencies.
|
67
71
|
$CFLAGS << " #{`sdl2-config --cflags`.chomp}"
|
data/include/Gosu/Font.hpp
CHANGED
@@ -22,11 +22,9 @@ namespace Gosu
|
|
22
22
|
|
23
23
|
public:
|
24
24
|
//! Constructs a font that can be drawn onto the graphics object.
|
25
|
-
//! \param
|
26
|
-
//!
|
27
|
-
//! \param
|
28
|
-
//! \param font_flags Flags used to render individual characters of
|
29
|
-
//! the font.
|
25
|
+
//! \param name Name of a system font, or a filename to a TTF file.
|
26
|
+
//! \param height Height of the font, in pixels.
|
27
|
+
//! \param flags Flags used to render individual characters of the font.
|
30
28
|
Font(int height, const std::string& name = default_font_name(), unsigned flags = 0);
|
31
29
|
|
32
30
|
//! Returns the name of the font that was used to create it.
|
@@ -46,11 +44,11 @@ namespace Gosu
|
|
46
44
|
//! Draws text so the top left corner of the text is at (x; y).
|
47
45
|
void draw_text(const std::string& text, double x, double y, ZPos z,
|
48
46
|
double scale_x = 1, double scale_y = 1, Color c = Color::WHITE,
|
49
|
-
|
47
|
+
BlendMode mode = BM_DEFAULT) const;
|
50
48
|
//! Draws markup so the top left corner of the text is at (x; y).
|
51
49
|
void draw_markup(const std::string& markup, double x, double y, ZPos z,
|
52
50
|
double scale_x = 1, double scale_y = 1, Color c = Color::WHITE,
|
53
|
-
|
51
|
+
BlendMode mode = BM_DEFAULT) const;
|
54
52
|
|
55
53
|
//! Draws text at a position relative to (x; y).
|
56
54
|
//! \param rel_x Determines where the text is drawn horizontally. If
|
@@ -60,7 +58,7 @@ namespace Gosu
|
|
60
58
|
//! \param rel_y See rel_x.
|
61
59
|
void draw_text_rel(const std::string& text, double x, double y, ZPos z,
|
62
60
|
double rel_x, double rel_y, double scale_x = 1, double scale_y = 1,
|
63
|
-
Color c = Color::WHITE,
|
61
|
+
Color c = Color::WHITE, BlendMode mode = BM_DEFAULT) const;
|
64
62
|
//! Draws text at a position relative to (x; y).
|
65
63
|
//! \param rel_x Determines where the text is drawn horizontally. If
|
66
64
|
//! rel_x is 0.0, the text will be to the right of x, if it is 1.0,
|
@@ -69,7 +67,7 @@ namespace Gosu
|
|
69
67
|
//! \param rel_y See rel_x.
|
70
68
|
void draw_markup_rel(const std::string& markup, double x, double y, ZPos z,
|
71
69
|
double rel_x, double rel_y, double scale_x = 1, double scale_y = 1,
|
72
|
-
Color c = Color::WHITE,
|
70
|
+
Color c = Color::WHITE, BlendMode mode = BM_DEFAULT) const;
|
73
71
|
|
74
72
|
//! Maps a letter to a specific image, instead of generating one using
|
75
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/Text.hpp
CHANGED
@@ -20,7 +20,7 @@ namespace Gosu
|
|
20
20
|
double text_width(const std::u32string& text, const std::string& font_name, double font_height,
|
21
21
|
unsigned font_flags = 0);
|
22
22
|
|
23
|
-
//! Draws a line of
|
23
|
+
//! Draws a line of plain text on a bitmap. This is a low-level function that does not
|
24
24
|
//! understand any of Gosu's HTML-like markup.
|
25
25
|
//! \param text A UCS-4 string, normalization: NFC.
|
26
26
|
//! \param font_name Name of a system font, or filename of a TTF file (must contain '/' or '.').
|
@@ -29,9 +29,9 @@ namespace Gosu
|
|
29
29
|
double draw_text(Bitmap& bitmap, double x, double y, Color c, const std::u32string& text,
|
30
30
|
const std::string& font_name, double font_height, unsigned font_flags = 0);
|
31
31
|
|
32
|
-
//! Creates a bitmap that is filled with the
|
32
|
+
//! Creates a bitmap that is filled with the plain text given to the function.
|
33
33
|
//! The line can contain line breaks and HTML-like markup.
|
34
|
-
//! \param text
|
34
|
+
//! \param text Plain text.
|
35
35
|
//! \param font_name Name of a system font, or filename of a TTF file (must contain '/' or '.').
|
36
36
|
//! \param font_height Height of the font in pixels.
|
37
37
|
//! \param line_spacing Spacing between two lines of text in pixels. Can be negative to make
|
@@ -48,7 +48,7 @@ namespace Gosu
|
|
48
48
|
|
49
49
|
//! Creates a bitmap that is filled with the formatted text given to the function.
|
50
50
|
//! The line can contain line breaks and HTML-like markup.
|
51
|
-
//! \param
|
51
|
+
//! \param markup Formatted text.
|
52
52
|
//! \param font_name Name of a system font, or filename of a TTF file (must contain '/' or '.').
|
53
53
|
//! \param font_height Height of the font in pixels.
|
54
54
|
//! \param line_spacing Spacing between two lines of text in pixels. Can be negative to make
|
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/include/Gosu/Window.hpp
CHANGED
@@ -8,6 +8,14 @@
|
|
8
8
|
|
9
9
|
namespace Gosu
|
10
10
|
{
|
11
|
+
enum WindowFlags
|
12
|
+
{
|
13
|
+
WF_WINDOWED,
|
14
|
+
WF_FULLSCREEN = 1,
|
15
|
+
WF_RESIZABLE = 2,
|
16
|
+
WF_BORDERLESS = 4
|
17
|
+
};
|
18
|
+
|
11
19
|
//! Convenient all-in-one class that serves as the foundation of a standard Gosu application.
|
12
20
|
//! Manages initialization of all of Gosu's core components and provides timing functionality.
|
13
21
|
//! Note that you should really only use one instance of this class at the same time.
|
@@ -21,17 +29,23 @@ namespace Gosu
|
|
21
29
|
//! \param width Width of the window in points; that is, pixels on a normal display, and
|
22
30
|
//! 'points' on a high-resolution display.
|
23
31
|
//! \param height See width.
|
32
|
+
//! \param window_flags A bitmask of values from Gosu::WindowFlags.
|
24
33
|
//! \param update_interval Interval in milliseconds between two calls to the update member
|
25
34
|
//! function.
|
26
|
-
Window(
|
27
|
-
|
35
|
+
Window(int width, int height, unsigned window_flags = WF_WINDOWED,
|
36
|
+
double update_interval = 16.666666);
|
28
37
|
virtual ~Window();
|
29
38
|
|
30
|
-
|
31
|
-
|
39
|
+
int width() const;
|
40
|
+
int height() const;
|
32
41
|
bool fullscreen() const;
|
42
|
+
void resize(int width, int height, bool fullscreen);
|
43
|
+
|
33
44
|
bool resizable() const;
|
34
|
-
void
|
45
|
+
void set_resizable(bool resizable);
|
46
|
+
|
47
|
+
bool borderless() const;
|
48
|
+
void set_borderless(bool borderless);
|
35
49
|
|
36
50
|
double update_interval() const;
|
37
51
|
void set_update_interval(double update_interval);
|
@@ -129,22 +143,22 @@ namespace Gosu
|
|
129
143
|
//! Returns the width (in pixels) of a screen.
|
130
144
|
//! \param window The result describes the screen on which the window is shown, or the
|
131
145
|
//! primary screen if no window is given.
|
132
|
-
|
146
|
+
int screen_width(Window* window = nullptr);
|
133
147
|
|
134
148
|
//! Returns the height (in pixels) of the user's primary screen.
|
135
149
|
//! \param window The result describes the screen on which the window is shown, or the
|
136
150
|
//! primary screen if no window is given.
|
137
|
-
|
151
|
+
int screen_height(Window* window = nullptr);
|
138
152
|
|
139
153
|
//! Returns the maximum width (in 'points') that is available for a non-fullscreen Window.
|
140
154
|
//! All windows larger than this size will automatically be shrunk to fit.
|
141
155
|
//! \param window The result describes the screen on which the window is shown, or the
|
142
156
|
//! primary screen if no window is given.
|
143
|
-
|
157
|
+
int available_width(Window* window = nullptr);
|
144
158
|
|
145
159
|
//! Returns the maximum height (in 'points') that is available for a non-fullscreen Window.
|
146
160
|
//! All windows larger than this size will automatically be shrunk to fit.
|
147
161
|
//! \param window The result describes the screen on which the window is shown, or the
|
148
162
|
//! primary screen if no window is given.
|
149
|
-
|
163
|
+
int available_height(Window* window = nullptr);
|
150
164
|
}
|
data/lib/gosu/compat.rb
CHANGED
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?
|
data/rdoc/gosu.rb
CHANGED
@@ -811,6 +811,18 @@ module Gosu
|
|
811
811
|
# @return [true, false] whether this window is resizable.
|
812
812
|
def resizable?; end
|
813
813
|
|
814
|
+
##
|
815
|
+
# Toggles between resizable and fixed modes.
|
816
|
+
attr_writer :resizable
|
817
|
+
|
818
|
+
##
|
819
|
+
# @return [true, false] whether this window is borderless.
|
820
|
+
def borderless?; end
|
821
|
+
|
822
|
+
##
|
823
|
+
# Toggles between borderless mode and having window chrome.
|
824
|
+
attr_writer :borderless
|
825
|
+
|
814
826
|
##
|
815
827
|
# @return [Float] the interval between calls to {#update}, in milliseconds.
|
816
828
|
attr_accessor :update_interval
|
@@ -828,7 +840,8 @@ module Gosu
|
|
828
840
|
# @param height [Integer] the desired window height.
|
829
841
|
# @param [Hash] options
|
830
842
|
# @option options [true, false] :fullscreen (false) whether to present the window in fullscreen mode.
|
831
|
-
# @option options [true, false] :resizable (false) whether the window can be resized by the user.
|
843
|
+
# @option options [true, false] :resizable (false) whether the window can be resized by the user. Not useful if the window is either fullscreen or borderless.
|
844
|
+
# @option options [true, false] :borderless (false) whether the window should hide all its window chrome. Does not affect fullscreen windows.
|
832
845
|
# @option options [Float] :update_interval (16.666666) the interval between frames, in milliseconds.
|
833
846
|
def initialize(width, height, options); end
|
834
847
|
|
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
|
}
|