gosu 1.0.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/COPYING +1 -1
  3. data/ext/gosu/extconf.rb +5 -1
  4. data/include/Gosu/Font.hpp +7 -9
  5. data/include/Gosu/Graphics.hpp +6 -4
  6. data/include/Gosu/GraphicsBase.hpp +6 -6
  7. data/include/Gosu/Image.hpp +3 -3
  8. data/include/Gosu/ImageData.hpp +1 -1
  9. data/include/Gosu/Text.hpp +4 -4
  10. data/include/Gosu/Utility.hpp +10 -8
  11. data/include/Gosu/Version.hpp +1 -1
  12. data/include/Gosu/Window.hpp +23 -9
  13. data/lib/gosu/compat.rb +4 -0
  14. data/lib/gosu/swig_patches.rb +11 -10
  15. data/rdoc/gosu.rb +14 -1
  16. data/src/EmptyImageData.hpp +1 -1
  17. data/src/Font.cpp +4 -4
  18. data/src/Graphics.cpp +4 -4
  19. data/src/Image.cpp +4 -3
  20. data/src/Input.cpp +1 -10
  21. data/src/LargeImageData.cpp +1 -1
  22. data/src/LargeImageData.hpp +1 -1
  23. data/src/Macro.cpp +100 -143
  24. data/src/Macro.hpp +1 -1
  25. data/src/RenderState.hpp +5 -5
  26. data/src/Resolution.cpp +111 -63
  27. data/src/RubyGosu.cxx +222 -124
  28. data/src/RubyGosu.h +2 -2
  29. data/src/TexChunk.cpp +1 -1
  30. data/src/TexChunk.hpp +1 -1
  31. data/src/TrueTypeFontApple.cpp +10 -2
  32. data/src/TrueTypeFontWin.cpp +3 -3
  33. data/src/Utility.cpp +52 -23
  34. data/src/Window.cpp +60 -31
  35. data/src/WindowUIKit.cpp +21 -9
  36. metadata +3 -25
  37. data/include/Gosu/Channel.h +0 -25
  38. data/include/Gosu/Color.h +0 -38
  39. data/include/Gosu/Font.h +0 -36
  40. data/include/Gosu/Gosu.h +0 -82
  41. data/include/Gosu/Image.h +0 -54
  42. data/include/Gosu/Sample.h +0 -19
  43. data/include/Gosu/Song.h +0 -24
  44. data/include/Gosu/TextInput.h +0 -30
  45. data/include/Gosu/Window.h +0 -63
  46. data/src/ChannelWrapper.cpp +0 -50
  47. data/src/ColorWrapper.cpp +0 -126
  48. data/src/Constants.cpp +0 -338
  49. data/src/FontWrapper.cpp +0 -74
  50. data/src/GosuWrapper.cpp +0 -251
  51. data/src/ImageWrapper.cpp +0 -168
  52. data/src/MPEGFile.hpp +0 -90
  53. data/src/SampleWrapper.cpp +0 -30
  54. data/src/SongWrapper.cpp +0 -52
  55. data/src/TextInputWrapper.cpp +0 -101
  56. data/src/UtilityApple.cpp +0 -16
  57. data/src/UtilityWin.cpp +0 -17
  58. data/src/WindowWrapper.cpp +0 -317
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c9b393a63015707256dca78e9079b01dbc004d85b89c6bf68d021085f65a905
4
- data.tar.gz: 60396892082e2fa81a7ab03f8662fe00630745f84b1e0a47e9abcd7bed5c7692
3
+ metadata.gz: b9f867c68587f182be0ba872daf669724376a55b6f7e0c3853eca5f350dc413f
4
+ data.tar.gz: f24639563ba937303f9a81dd22a78ad5a22fa9243d980c629d163605656be0b2
5
5
  SHA512:
6
- metadata.gz: fb477140be8f524abfeb3694277bd815690c4c0ae432ac011956a43640f49309aca3c0a9b3619c17cc83461ae5c9c9b6fb1bfa155e72f1be19b4f166e23b3022
7
- data.tar.gz: 24707e94f193a4fe949a447a01b732057860eb271a8a0d61ba6c45a0b1b5da8c2894ffc65d3ff3fe2b97fe7e8b9c5b38b9995d4d443d014fe6059f520f900393
6
+ metadata.gz: 6bb10eafcfa8742066e246e607ada383af5d2f3a461910e386064b27788d5620ab289b2081e0e4652240df9faf7cb1bb8d669fb95b7bcfbfb040e767c4354edd
7
+ data.tar.gz: dc56b6a28a0f8980027c3f3bc5fd110e806617a4b22b3d6e918fa24f99d59cea98cd03d85af875968bcc7b98bc283ac810aca7a37e199ff1f4aaaaea1de7fc80
data/COPYING CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (C) 2001-2020 Julian Raschke, Jan Lücker and all contributors.
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}"
@@ -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 font_name Name of a system font, or a filename to a TTF
26
- //! file (must contain '/', does not work on Linux).
27
- //! \param font_height Height of the font, in pixels.
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
- AlphaMode mode = AM_DEFAULT) const;
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
- AlphaMode mode = AM_DEFAULT) const;
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, AlphaMode mode = AM_DEFAULT) const;
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, AlphaMode mode = AM_DEFAULT) const;
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.
@@ -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, AlphaMode mode = AM_DEFAULT);
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, AlphaMode mode = AM_DEFAULT);
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, AlphaMode mode = AM_DEFAULT);
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, AlphaMode mode = AM_DEFAULT);
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 AlphaMode
18
+ enum BlendMode
19
19
  {
20
- AM_DEFAULT,
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
- AM_INTERPOLATE = AM_DEFAULT,
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
- AM_ADD,
27
+ BM_ADD,
28
28
  //! The color's channels will be multiplied with each other.
29
- AM_MULTIPLY
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 if_tileable for
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,
@@ -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, AlphaMode mode = AM_DEFAULT) const;
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, AlphaMode mode = AM_DEFAULT) const;
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, AlphaMode mode = AM_DEFAULT) const;
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.
@@ -44,7 +44,7 @@ namespace Gosu
44
44
  double x2, double y2, Color c2,
45
45
  double x3, double y3, Color c3,
46
46
  double x4, double y4, Color c4,
47
- ZPos z, AlphaMode mode) const = 0;
47
+ ZPos z, BlendMode mode) const = 0;
48
48
 
49
49
  virtual const GLTexInfo* gl_tex_info() const = 0;
50
50
 
@@ -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 unformatted text on a bitmap. This is a low-level function that does not
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 formatted text given to the function.
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 Formatted 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 text Formatted text.
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
@@ -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
- //! Returns true if the filename has the given extension.
10
- //! The comparison is case-insensitive, but you must pass the extension in lower case.
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
- //! Returns the user's preferred language, at the moment of calling the function. Expect return
14
- //! values such as 'en_US', 'de_DE.UTF-8', 'ja', 'zh-Hans'.
15
- //! The first two letters will always be a language code.
16
- std::string language();
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
  {
@@ -3,7 +3,7 @@
3
3
  #include <string>
4
4
 
5
5
  #define GOSU_MAJOR_VERSION 1
6
- #define GOSU_MINOR_VERSION 0
6
+ #define GOSU_MINOR_VERSION 2
7
7
  #define GOSU_POINT_VERSION 0
8
8
 
9
9
  namespace Gosu
@@ -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(unsigned width, unsigned height, bool fullscreen = false,
27
- double update_interval = 16.666666, bool resizable = false);
35
+ Window(int width, int height, unsigned window_flags = WF_WINDOWED,
36
+ double update_interval = 16.666666);
28
37
  virtual ~Window();
29
38
 
30
- unsigned width() const;
31
- unsigned height() const;
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 resize(unsigned width, unsigned height, bool fullscreen);
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
- unsigned screen_width(Window* window = nullptr);
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
- unsigned screen_height(Window* window = nullptr);
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
- unsigned available_width(Window* window = nullptr);
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
- unsigned available_height(Window* window = nullptr);
163
+ int available_height(Window* window = nullptr);
150
164
  }
data/lib/gosu/compat.rb CHANGED
@@ -202,4 +202,8 @@ module Gosu
202
202
  # Also import old-style constants into Gosu::Button.
203
203
  Gosu::Button.const_set old_name, Gosu.const_get(new_name)
204
204
  end
205
+
206
+ def self.language
207
+ @language_cache ||= (user_languages.first || "en_US")
208
+ end
205
209
  end
@@ -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 :initialize_without_hash, :initialize
6
+ alias_method :initialize_with_bitmask, :initialize
7
7
 
8
- def initialize width, height, *args
9
- if args.empty? or args.first.is_a? Hash
10
- options = args.first || {}
11
- fullscreen = options[:fullscreen]
12
- update_interval = options[:update_interval]
13
- resizable = options[:resizable]
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
- fullscreen, update_interval = *args
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
 
@@ -22,7 +22,7 @@ namespace Gosu
22
22
  double, double, Color,
23
23
  double, double, Color,
24
24
  double, double, Color,
25
- ZPos, AlphaMode) const override
25
+ ZPos, BlendMode) const override
26
26
  {
27
27
  }
28
28
 
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, AlphaMode mode) const
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, AlphaMode mode) const
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, AlphaMode mode) const
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, AlphaMode mode) const
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, AlphaMode mode)
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, AlphaMode mode)
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, AlphaMode mode)
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::AlphaMode mode)
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
  }