gosu 1.0.0.pre1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/gosu/extconf.rb +4 -24
- data/include/Gosu/Buttons.hpp +18 -17
- data/include/Gosu/Font.hpp +1 -1
- data/include/Gosu/Fwd.hpp +0 -5
- data/include/Gosu/Input.hpp +13 -40
- data/include/Gosu/Utility.hpp +14 -3
- data/include/Gosu/Version.hpp +3 -3
- data/include/Gosu/Window.hpp +25 -21
- data/lib/OpenAL32.dll +0 -0
- data/lib/gosu/patches.rb +0 -14
- data/lib/gosu/preview.rb +1 -3
- data/lib/gosu/swig_patches.rb +11 -10
- data/lib64/OpenAL32.dll +0 -0
- data/rdoc/gosu.rb +20 -6
- data/src/AudioFile.hpp +3 -0
- data/src/Input.cpp +28 -38
- data/src/Resolution.cpp +8 -8
- data/src/RubyGosu.cxx +646 -91
- data/src/RubyGosu.h +1 -1
- data/src/TrueTypeFontWin.cpp +3 -3
- data/src/Window.cpp +60 -31
- data/src/WindowUIKit.cpp +21 -9
- metadata +5 -31
- data/include/Gosu/AutoLink.hpp +0 -14
- data/include/Gosu/Channel.h +0 -25
- data/include/Gosu/Color.h +0 -38
- data/include/Gosu/Font.h +0 -36
- data/include/Gosu/Gosu.h +0 -82
- data/include/Gosu/Image.h +0 -54
- data/include/Gosu/Sample.h +0 -19
- data/include/Gosu/Song.h +0 -24
- data/include/Gosu/TextInput.h +0 -30
- data/include/Gosu/Window.h +0 -63
- data/lib/gosu/zen.rb +0 -89
- data/lib/libmpg123.dll +0 -0
- data/lib/libsndfile.dll +0 -0
- data/lib64/libmpg123.dll +0 -0
- data/lib64/libsndfile.dll +0 -0
- data/src/ChannelWrapper.cpp +0 -50
- data/src/ColorWrapper.cpp +0 -126
- data/src/Constants.cpp +0 -334
- data/src/FontWrapper.cpp +0 -74
- data/src/GosuWrapper.cpp +0 -251
- data/src/ImageWrapper.cpp +0 -168
- data/src/MPEGFile.hpp +0 -90
- data/src/SampleWrapper.cpp +0 -30
- data/src/SongWrapper.cpp +0 -52
- data/src/TextInputWrapper.cpp +0 -101
- data/src/WindowWrapper.cpp +0 -317
data/lib64/OpenAL32.dll
CHANGED
File without changes
|
data/rdoc/gosu.rb
CHANGED
@@ -32,8 +32,8 @@ module Gosu
|
|
32
32
|
KB_DOWN = :an_integer
|
33
33
|
KB_END = :an_integer
|
34
34
|
|
35
|
-
|
36
|
-
|
35
|
+
KB_PRINT_SCREEN = :an_integer
|
36
|
+
KB_SCROLL_LOCK = :an_integer
|
37
37
|
KB_PAUSE = :an_integer
|
38
38
|
|
39
39
|
##
|
@@ -75,7 +75,7 @@ module Gosu
|
|
75
75
|
KB_RIGHT_SHIFT = :an_integer
|
76
76
|
KB_SEMICOLON = :an_integer
|
77
77
|
KB_SLASH = :an_integer
|
78
|
-
|
78
|
+
KB_CAPS_LOCK = :an_integer
|
79
79
|
KB_SPACE = :an_integer
|
80
80
|
KB_TAB = :an_integer
|
81
81
|
KB_UP = :an_integer
|
@@ -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
|
|
@@ -875,7 +888,7 @@ module Gosu
|
|
875
888
|
def draw; end
|
876
889
|
|
877
890
|
##
|
878
|
-
# This method can be
|
891
|
+
# This method can be overridden to give the game a chance to opt out of a call to {#draw}; however, the operating system can still force a redraw for any reason.
|
879
892
|
#
|
880
893
|
# @return [true, false] whether the window needs to be redrawn.
|
881
894
|
#
|
@@ -883,7 +896,8 @@ module Gosu
|
|
883
896
|
def needs_redraw?; end
|
884
897
|
|
885
898
|
##
|
886
|
-
# This method can be
|
899
|
+
# This method can be overridden to control the visibility of the system cursor over your window.
|
900
|
+
# The base class implementation returns true.
|
887
901
|
#
|
888
902
|
# @return [true, false] whether the system cursor should be shown.
|
889
903
|
def needs_cursor?; end
|
data/src/AudioFile.hpp
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
#include <Gosu/IO.hpp>
|
4
4
|
|
5
5
|
#ifdef GOSU_IS_MAC
|
6
|
+
// Ignore OpenAL deprecation warnings. If macOS stops shipping OpenAL, it's more likely that we bundle our own version
|
7
|
+
// of it than that we switch to another audio API.
|
8
|
+
#define OPENAL_DEPRECATED
|
6
9
|
#include <OpenAL/al.h>
|
7
10
|
#else
|
8
11
|
#include <AL/al.h>
|
data/src/Input.cpp
CHANGED
@@ -26,8 +26,7 @@ static void require_sdl_video()
|
|
26
26
|
|
27
27
|
static const unsigned NUM_BUTTONS_PER_GAMEPAD =
|
28
28
|
(Gosu::GP_RANGE_END - Gosu::GP_RANGE_BEGIN + 1 - 4) / (Gosu::NUM_GAMEPADS + 1) - 3;
|
29
|
-
static const unsigned NUM_AXES_PER_GAMEPAD =
|
30
|
-
(Gosu::GP_AXES_RANGE_END - Gosu::GP_AXES_RANGE_BEGIN + 1) / (Gosu::NUM_GAMEPADS + 1);
|
29
|
+
static const unsigned NUM_AXES_PER_GAMEPAD = Gosu::NUM_AXES / (Gosu::NUM_GAMEPADS + 1);
|
31
30
|
static const unsigned NUM_BUTTONS = Gosu::GP_RANGE_END + 1;
|
32
31
|
|
33
32
|
static array<bool, NUM_BUTTONS> button_states = {false};
|
@@ -79,20 +78,11 @@ struct Gosu::Input::Impl
|
|
79
78
|
|
80
79
|
void update_mouse_position()
|
81
80
|
{
|
82
|
-
#if SDL_VERSION_ATLEAST(2, 0, 5)
|
83
|
-
// SDL_GetGlobalMouseState was added in SDL 2.0.4, but it only started using the same
|
84
|
-
// coordinate system as SDL_GetWindowPosition on X11 in 2.0.5.
|
85
81
|
int x, y, window_x, window_y;
|
86
82
|
SDL_GetWindowPosition(window, &window_x, &window_y);
|
87
83
|
SDL_GetGlobalMouseState(&x, &y);
|
88
84
|
mouse_x = x - window_x;
|
89
85
|
mouse_y = y - window_y;
|
90
|
-
#else
|
91
|
-
int x, y;
|
92
|
-
SDL_GetMouseState(&x, &y);
|
93
|
-
mouse_x = x;
|
94
|
-
mouse_y = y;
|
95
|
-
#endif
|
96
86
|
}
|
97
87
|
|
98
88
|
void set_mouse_position(double x, double y)
|
@@ -101,7 +91,7 @@ struct Gosu::Input::Impl
|
|
101
91
|
static_cast<int>((x - mouse_offset_x) / mouse_scale_x),
|
102
92
|
static_cast<int>((y - mouse_offset_y) / mouse_scale_y));
|
103
93
|
|
104
|
-
#if
|
94
|
+
#if !defined(GOSU_IS_X)
|
105
95
|
// On systems where we have a working GetGlobalMouseState, we can warp the mouse and
|
106
96
|
// retrieve its position directly afterwards.
|
107
97
|
update_mouse_position();
|
@@ -416,17 +406,17 @@ private:
|
|
416
406
|
GamepadBuffer gamepad;
|
417
407
|
|
418
408
|
// Poll axes first.
|
419
|
-
gamepad.axes[GP_LEFT_STICK_X_AXIS
|
409
|
+
gamepad.axes[GP_LEFT_STICK_X_AXIS] =
|
420
410
|
scale_axis(SDL_GameControllerGetAxis(controller, SDL_CONTROLLER_AXIS_LEFTX));
|
421
|
-
gamepad.axes[GP_LEFT_STICK_Y_AXIS
|
411
|
+
gamepad.axes[GP_LEFT_STICK_Y_AXIS] =
|
422
412
|
scale_axis(SDL_GameControllerGetAxis(controller, SDL_CONTROLLER_AXIS_LEFTY));
|
423
|
-
gamepad.axes[GP_RIGHT_STICK_X_AXIS
|
413
|
+
gamepad.axes[GP_RIGHT_STICK_X_AXIS] =
|
424
414
|
scale_axis(SDL_GameControllerGetAxis(controller, SDL_CONTROLLER_AXIS_RIGHTX));
|
425
|
-
gamepad.axes[GP_RIGHT_STICK_Y_AXIS
|
415
|
+
gamepad.axes[GP_RIGHT_STICK_Y_AXIS] =
|
426
416
|
scale_axis(SDL_GameControllerGetAxis(controller, SDL_CONTROLLER_AXIS_RIGHTY));
|
427
|
-
gamepad.axes[GP_LEFT_TRIGGER_AXIS
|
417
|
+
gamepad.axes[GP_LEFT_TRIGGER_AXIS] =
|
428
418
|
scale_axis(SDL_GameControllerGetAxis(controller, SDL_CONTROLLER_AXIS_TRIGGERLEFT));
|
429
|
-
gamepad.axes[GP_RIGHT_TRIGGER_AXIS
|
419
|
+
gamepad.axes[GP_RIGHT_TRIGGER_AXIS] =
|
430
420
|
scale_axis(SDL_GameControllerGetAxis(controller, SDL_CONTROLLER_AXIS_TRIGGERRIGHT));
|
431
421
|
|
432
422
|
gamepad.buttons[GP_DPAD_LEFT - GP_RANGE_BEGIN] =
|
@@ -460,19 +450,19 @@ private:
|
|
460
450
|
// Just guess that the first four axes are equivalent to two analog sticks.
|
461
451
|
int axes = SDL_JoystickNumAxes(joystick);
|
462
452
|
if (axes > 0) {
|
463
|
-
gamepad.axes[GP_LEFT_STICK_X_AXIS
|
453
|
+
gamepad.axes[GP_LEFT_STICK_X_AXIS] =
|
464
454
|
scale_axis(SDL_JoystickGetAxis(joystick, 0));
|
465
455
|
}
|
466
456
|
if (axes > 1) {
|
467
|
-
gamepad.axes[GP_LEFT_STICK_Y_AXIS
|
457
|
+
gamepad.axes[GP_LEFT_STICK_Y_AXIS] =
|
468
458
|
scale_axis(SDL_JoystickGetAxis(joystick, 1));
|
469
459
|
}
|
470
460
|
if (axes > 2) {
|
471
|
-
gamepad.axes[GP_RIGHT_STICK_X_AXIS
|
461
|
+
gamepad.axes[GP_RIGHT_STICK_X_AXIS] =
|
472
462
|
scale_axis(SDL_JoystickGetAxis(joystick, 2));
|
473
463
|
}
|
474
464
|
if (axes > 3) {
|
475
|
-
gamepad.axes[GP_RIGHT_STICK_Y_AXIS
|
465
|
+
gamepad.axes[GP_RIGHT_STICK_Y_AXIS] =
|
476
466
|
scale_axis(SDL_JoystickGetAxis(joystick, 3));
|
477
467
|
}
|
478
468
|
|
@@ -501,20 +491,20 @@ private:
|
|
501
491
|
{
|
502
492
|
gamepad.directions[0] =
|
503
493
|
gamepad.buttons[GP_DPAD_LEFT - GP_RANGE_BEGIN] ||
|
504
|
-
gamepad.axes[GP_LEFT_STICK_X_AXIS
|
505
|
-
gamepad.axes[GP_RIGHT_STICK_X_AXIS
|
494
|
+
gamepad.axes[GP_LEFT_STICK_X_AXIS] <= -0.5 ||
|
495
|
+
gamepad.axes[GP_RIGHT_STICK_X_AXIS] <= -0.5;
|
506
496
|
gamepad.directions[1] =
|
507
497
|
gamepad.buttons[GP_DPAD_RIGHT - GP_RANGE_BEGIN] ||
|
508
|
-
gamepad.axes[GP_LEFT_STICK_X_AXIS
|
509
|
-
gamepad.axes[GP_RIGHT_STICK_X_AXIS
|
498
|
+
gamepad.axes[GP_LEFT_STICK_X_AXIS] >= +0.5 ||
|
499
|
+
gamepad.axes[GP_RIGHT_STICK_X_AXIS] >= +0.5;
|
510
500
|
gamepad.directions[2] =
|
511
501
|
gamepad.buttons[GP_DPAD_UP - GP_RANGE_BEGIN] ||
|
512
|
-
gamepad.axes[GP_LEFT_STICK_Y_AXIS
|
513
|
-
gamepad.axes[GP_RIGHT_STICK_Y_AXIS
|
502
|
+
gamepad.axes[GP_LEFT_STICK_Y_AXIS] <= -0.5 ||
|
503
|
+
gamepad.axes[GP_RIGHT_STICK_Y_AXIS] <= -0.5;
|
514
504
|
gamepad.directions[3] =
|
515
505
|
gamepad.buttons[GP_DPAD_DOWN - GP_RANGE_BEGIN] ||
|
516
|
-
gamepad.axes[GP_LEFT_STICK_Y_AXIS
|
517
|
-
gamepad.axes[GP_RIGHT_STICK_Y_AXIS
|
506
|
+
gamepad.axes[GP_LEFT_STICK_Y_AXIS] >= +0.5 ||
|
507
|
+
gamepad.axes[GP_RIGHT_STICK_Y_AXIS] >= +0.5;
|
518
508
|
}
|
519
509
|
};
|
520
510
|
|
@@ -537,12 +527,12 @@ string Gosu::Input::id_to_char(Button btn)
|
|
537
527
|
{
|
538
528
|
require_sdl_video();
|
539
529
|
|
540
|
-
if (btn
|
530
|
+
if (btn > KB_RANGE_END) return "";
|
541
531
|
|
542
532
|
// SDL_GetKeyName returns "Space" for this value, but we want the character value.
|
543
|
-
if (btn
|
533
|
+
if (btn == KB_SPACE) return " ";
|
544
534
|
|
545
|
-
SDL_Keycode keycode = SDL_GetKeyFromScancode(static_cast<SDL_Scancode>(btn
|
535
|
+
SDL_Keycode keycode = SDL_GetKeyFromScancode(static_cast<SDL_Scancode>(btn));
|
546
536
|
if (keycode == SDLK_UNKNOWN) return "";
|
547
537
|
|
548
538
|
const char* name = SDL_GetKeyName(keycode);
|
@@ -573,7 +563,7 @@ std::string Gosu::Input::button_name(Button btn)
|
|
573
563
|
{
|
574
564
|
require_sdl_video();
|
575
565
|
|
576
|
-
SDL_Keycode keycode = SDL_GetKeyFromScancode(static_cast<SDL_Scancode>(btn
|
566
|
+
SDL_Keycode keycode = SDL_GetKeyFromScancode(static_cast<SDL_Scancode>(btn));
|
577
567
|
return SDL_GetKeyName(keycode);
|
578
568
|
}
|
579
569
|
|
@@ -601,17 +591,17 @@ std::string Gosu::Input::gamepad_name(int index)
|
|
601
591
|
|
602
592
|
bool Gosu::Input::down(Gosu::Button btn)
|
603
593
|
{
|
604
|
-
if (btn == NO_BUTTON || btn
|
594
|
+
if (btn == NO_BUTTON || btn >= NUM_BUTTONS) return false;
|
605
595
|
|
606
|
-
return button_states[btn
|
596
|
+
return button_states[btn];
|
607
597
|
}
|
608
598
|
|
609
599
|
double Gosu::Input::axis(Gosu::Button btn)
|
610
600
|
{
|
611
|
-
unsigned axis_id = btn
|
601
|
+
unsigned axis_id = btn - GP_LEFT_STICK_X_AXIS;
|
612
602
|
|
613
603
|
if (axis_id >= axis_states.size()) {
|
614
|
-
throw std::out_of_range("Invalid axis ID: " + std::to_string(btn
|
604
|
+
throw std::out_of_range("Invalid axis ID: " + std::to_string(btn));
|
615
605
|
}
|
616
606
|
|
617
607
|
return axis_states[axis_id];
|
data/src/Resolution.cpp
CHANGED
@@ -18,12 +18,12 @@ static SDL_DisplayMode display_mode(Gosu::Window* window)
|
|
18
18
|
return result;
|
19
19
|
}
|
20
20
|
|
21
|
-
|
21
|
+
int Gosu::screen_width(Window* window)
|
22
22
|
{
|
23
23
|
return display_mode(window).w;
|
24
24
|
}
|
25
25
|
|
26
|
-
|
26
|
+
int Gosu::screen_height(Window* window)
|
27
27
|
{
|
28
28
|
return display_mode(window).h;
|
29
29
|
}
|
@@ -41,12 +41,12 @@ static NSSize max_window_size(Gosu::Window* window)
|
|
41
41
|
return [NSWindow contentRectForFrameRect:screen_frame styleMask:style].size;
|
42
42
|
}
|
43
43
|
|
44
|
-
|
44
|
+
int Gosu::available_width(Window* window)
|
45
45
|
{
|
46
46
|
return max_window_size(window).width;
|
47
47
|
}
|
48
48
|
|
49
|
-
|
49
|
+
int Gosu::available_height(Window* window)
|
50
50
|
{
|
51
51
|
return max_window_size(window).height;
|
52
52
|
}
|
@@ -90,12 +90,12 @@ static SIZE max_window_size(Gosu::Window* window)
|
|
90
90
|
return size;
|
91
91
|
}
|
92
92
|
|
93
|
-
|
93
|
+
int Gosu::available_width(Window* window)
|
94
94
|
{
|
95
95
|
return max_window_size(window).cx;
|
96
96
|
}
|
97
97
|
|
98
|
-
|
98
|
+
int Gosu::available_height(Window* window)
|
99
99
|
{
|
100
100
|
return max_window_size(window).cy;
|
101
101
|
}
|
@@ -104,12 +104,12 @@ unsigned Gosu::available_height(Window* window)
|
|
104
104
|
#ifdef GOSU_IS_X
|
105
105
|
// Pessimistic fallback implementation for available_width / available_height.
|
106
106
|
// TODO: Look at this NET_WORKAREA based implementation: https://github.com/glfw/glfw/pull/989/files
|
107
|
-
|
107
|
+
int Gosu::available_width(Window* window)
|
108
108
|
{
|
109
109
|
return static_cast<unsigned>(Gosu::screen_width(window) * 0.9);
|
110
110
|
}
|
111
111
|
|
112
|
-
|
112
|
+
int Gosu::available_height(Window* window)
|
113
113
|
{
|
114
114
|
return static_cast<unsigned>(Gosu::screen_height(window) * 0.8);
|
115
115
|
}
|
data/src/RubyGosu.cxx
CHANGED
@@ -2174,22 +2174,21 @@ namespace Swig {
|
|
2174
2174
|
|
2175
2175
|
/* -------- TYPES TABLE (BEGIN) -------- */
|
2176
2176
|
|
2177
|
-
#define
|
2178
|
-
#define
|
2179
|
-
#define
|
2180
|
-
#define
|
2181
|
-
#define
|
2182
|
-
#define
|
2183
|
-
#define
|
2184
|
-
#define
|
2185
|
-
#define
|
2186
|
-
#define
|
2187
|
-
#define
|
2188
|
-
#define
|
2189
|
-
#define
|
2190
|
-
|
2191
|
-
static
|
2192
|
-
static swig_module_info swig_module = {swig_types, 14, 0, 0, 0, 0};
|
2177
|
+
#define SWIGTYPE_p_Gosu__Channel swig_types[0]
|
2178
|
+
#define SWIGTYPE_p_Gosu__Color swig_types[1]
|
2179
|
+
#define SWIGTYPE_p_Gosu__Font swig_types[2]
|
2180
|
+
#define SWIGTYPE_p_Gosu__GLTexInfo swig_types[3]
|
2181
|
+
#define SWIGTYPE_p_Gosu__Image swig_types[4]
|
2182
|
+
#define SWIGTYPE_p_Gosu__Sample swig_types[5]
|
2183
|
+
#define SWIGTYPE_p_Gosu__Song swig_types[6]
|
2184
|
+
#define SWIGTYPE_p_Gosu__TextInput swig_types[7]
|
2185
|
+
#define SWIGTYPE_p_Gosu__Window swig_types[8]
|
2186
|
+
#define SWIGTYPE_p_char swig_types[9]
|
2187
|
+
#define SWIGTYPE_p_double swig_types[10]
|
2188
|
+
#define SWIGTYPE_p_std__arrayT_double_16_t swig_types[11]
|
2189
|
+
#define SWIGTYPE_p_std__string swig_types[12]
|
2190
|
+
static swig_type_info *swig_types[14];
|
2191
|
+
static swig_module_info swig_module = {swig_types, 13, 0, 0, 0, 0};
|
2193
2192
|
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
|
2194
2193
|
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
|
2195
2194
|
|
@@ -2857,11 +2856,19 @@ SWIGINTERN Gosu::Font *new_Gosu_Font__SWIG_1(int height,VALUE options=0){
|
|
2857
2856
|
|
2858
2857
|
return new Gosu::Font(height, font_name, font_flags);
|
2859
2858
|
}
|
2859
|
+
SWIGINTERN double Gosu_Font_text_width(Gosu::Font *self,std::string const &markup,double scale_x=1.0){
|
2860
|
+
static bool issued_warning = false;
|
2861
|
+
if (scale_x != 1.0 && !issued_warning) {
|
2862
|
+
issued_warning = true;
|
2863
|
+
rb_warn("The second argument to Gosu::Font#text_width is deprecated, multiply the result instead");
|
2864
|
+
}
|
2865
|
+
return self->text_width(markup) * scale_x;
|
2866
|
+
}
|
2860
2867
|
SWIGINTERN double Gosu_Font_markup_width(Gosu::Font *self,std::string const &markup,double scale_x=1.0){
|
2861
2868
|
static bool issued_warning = false;
|
2862
2869
|
if (scale_x != 1.0 && !issued_warning) {
|
2863
2870
|
issued_warning = true;
|
2864
|
-
rb_warn("The second argument to Font#markup_width
|
2871
|
+
rb_warn("The second argument to Gosu::Font#markup_width is deprecated, multiply the result instead");
|
2865
2872
|
}
|
2866
2873
|
return self->markup_width(markup) * scale_x;
|
2867
2874
|
}
|
@@ -2927,7 +2934,81 @@ SWIGINTERN Gosu::Image *Gosu_Image_subimage(Gosu::Image *self,int x,int y,int w,
|
|
2927
2934
|
std::unique_ptr<Gosu::ImageData> image_data = self->data().subimage(x, y, w, h);
|
2928
2935
|
return image_data.get() ? new Gosu::Image(std::move(image_data)) : nullptr;
|
2929
2936
|
}
|
2930
|
-
SWIGINTERN Gosu::Image *Gosu_Image_from_text(std::string const &
|
2937
|
+
SWIGINTERN Gosu::Image *Gosu_Image_from_text(std::string const &text,double font_height,VALUE options=0){
|
2938
|
+
std::string font = Gosu::default_font_name();
|
2939
|
+
int width = -1;
|
2940
|
+
double spacing = 0;
|
2941
|
+
Gosu::Alignment align = Gosu::AL_LEFT;
|
2942
|
+
unsigned image_flags = 0;
|
2943
|
+
unsigned font_flags = 0;
|
2944
|
+
|
2945
|
+
if (options) {
|
2946
|
+
Check_Type(options, T_HASH);
|
2947
|
+
|
2948
|
+
VALUE keys = rb_funcall(options, rb_intern("keys"), 0, NULL);
|
2949
|
+
int keys_size = NUM2INT(rb_funcall(keys, rb_intern("size"), 0, NULL));
|
2950
|
+
|
2951
|
+
for (int i = 0; i < keys_size; ++i) {
|
2952
|
+
VALUE key = rb_ary_entry(keys, i);
|
2953
|
+
const char* key_string = Gosu::cstr_from_symbol(key);
|
2954
|
+
|
2955
|
+
VALUE value = rb_hash_aref(options, key);
|
2956
|
+
if (!strcmp(key_string, "font")) {
|
2957
|
+
font = StringValuePtr(value);
|
2958
|
+
}
|
2959
|
+
else if (!strcmp(key_string, "bold")) {
|
2960
|
+
if (RTEST(value)) font_flags |= Gosu::FF_BOLD;
|
2961
|
+
}
|
2962
|
+
else if (!strcmp(key_string, "italic")) {
|
2963
|
+
if (RTEST(value)) font_flags |= Gosu::FF_ITALIC;
|
2964
|
+
}
|
2965
|
+
else if (!strcmp(key_string, "underline")) {
|
2966
|
+
if (RTEST(value)) font_flags |= Gosu::FF_UNDERLINE;
|
2967
|
+
}
|
2968
|
+
else if (!strcmp(key_string, "align")) {
|
2969
|
+
const char* cstr = Gosu::cstr_from_symbol(value);
|
2970
|
+
|
2971
|
+
if (!strcmp(cstr, "left")) {
|
2972
|
+
align = Gosu::AL_LEFT;
|
2973
|
+
}
|
2974
|
+
else if (!strcmp(cstr, "center")) {
|
2975
|
+
align = Gosu::AL_CENTER;
|
2976
|
+
}
|
2977
|
+
else if (!strcmp(cstr, "right")) {
|
2978
|
+
align = Gosu::AL_RIGHT;
|
2979
|
+
}
|
2980
|
+
else if (!strcmp(cstr, "justify")) {
|
2981
|
+
align = Gosu::AL_JUSTIFY;
|
2982
|
+
}
|
2983
|
+
else {
|
2984
|
+
rb_raise(rb_eArgError, "Argument passed to :align must be a valid text "
|
2985
|
+
"alignment (:left, :center, :right, :justify)");
|
2986
|
+
}
|
2987
|
+
}
|
2988
|
+
else if (!strcmp(key_string, "width")) {
|
2989
|
+
width = NUM2INT(value);
|
2990
|
+
}
|
2991
|
+
else if (!strcmp(key_string, "spacing")) {
|
2992
|
+
spacing = NUM2DBL(value);
|
2993
|
+
}
|
2994
|
+
else if (!strcmp(key_string, "retro")) {
|
2995
|
+
if (RTEST(value)) image_flags |= Gosu::IF_RETRO;
|
2996
|
+
}
|
2997
|
+
else {
|
2998
|
+
static bool issued_warning = false;
|
2999
|
+
if (!issued_warning) {
|
3000
|
+
issued_warning = true;
|
3001
|
+
rb_warn("Unknown keyword argument: :%s", key_string);
|
3002
|
+
}
|
3003
|
+
}
|
3004
|
+
}
|
3005
|
+
}
|
3006
|
+
|
3007
|
+
Gosu::Bitmap bitmap = Gosu::layout_text(text, font, font_height, spacing, width,
|
3008
|
+
align, font_flags);
|
3009
|
+
return new Gosu::Image(bitmap, image_flags);
|
3010
|
+
}
|
3011
|
+
SWIGINTERN Gosu::Image *Gosu_Image_from_markup(std::string const &markup,double font_height,VALUE options=0){
|
2931
3012
|
std::string font = Gosu::default_font_name();
|
2932
3013
|
int width = -1;
|
2933
3014
|
double spacing = 0;
|
@@ -3219,7 +3300,7 @@ std::string SwigDirector_TextInput::filter(std::string text) const {
|
|
3219
3300
|
}
|
3220
3301
|
|
3221
3302
|
|
3222
|
-
SwigDirector_Window::SwigDirector_Window(VALUE 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) {
|
3223
3304
|
|
3224
3305
|
}
|
3225
3306
|
|
@@ -3320,7 +3401,7 @@ void SwigDirector_Window::button_down(Gosu::Button arg0) {
|
|
3320
3401
|
VALUE SWIGUNUSED result;
|
3321
3402
|
|
3322
3403
|
{
|
3323
|
-
obj0 = arg0 == Gosu::NO_BUTTON ? Qnil : LONG2NUM(
|
3404
|
+
obj0 = arg0 == Gosu::NO_BUTTON ? Qnil : LONG2NUM(arg0);
|
3324
3405
|
}
|
3325
3406
|
result = rb_funcall(swig_get_self(), rb_intern("protected_button_down"), 1,obj0);
|
3326
3407
|
}
|
@@ -3331,7 +3412,7 @@ void SwigDirector_Window::button_up(Gosu::Button arg0) {
|
|
3331
3412
|
VALUE SWIGUNUSED result;
|
3332
3413
|
|
3333
3414
|
{
|
3334
|
-
obj0 = arg0 == Gosu::NO_BUTTON ? Qnil : LONG2NUM(
|
3415
|
+
obj0 = arg0 == Gosu::NO_BUTTON ? Qnil : LONG2NUM(arg0);
|
3335
3416
|
}
|
3336
3417
|
result = rb_funcall(swig_get_self(), rb_intern("protected_button_up"), 1,obj0);
|
3337
3418
|
}
|
@@ -5282,6 +5363,134 @@ fail:
|
|
5282
5363
|
}
|
5283
5364
|
|
5284
5365
|
|
5366
|
+
SWIGINTERN VALUE
|
5367
|
+
_wrap_Font_draw_text(int argc, VALUE *argv, VALUE self) {
|
5368
|
+
Gosu::Font *arg1 = (Gosu::Font *) 0 ;
|
5369
|
+
std::string *arg2 = 0 ;
|
5370
|
+
double arg3 ;
|
5371
|
+
double arg4 ;
|
5372
|
+
Gosu::ZPos arg5 ;
|
5373
|
+
double arg6 = (double) 1 ;
|
5374
|
+
double arg7 = (double) 1 ;
|
5375
|
+
Gosu::Color arg8 = (Gosu::Color) Gosu::Color::WHITE ;
|
5376
|
+
Gosu::AlphaMode arg9 = (Gosu::AlphaMode) Gosu::AM_DEFAULT ;
|
5377
|
+
void *argp1 = 0 ;
|
5378
|
+
int res1 = 0 ;
|
5379
|
+
int res2 = SWIG_OLDOBJ ;
|
5380
|
+
double val3 ;
|
5381
|
+
int ecode3 = 0 ;
|
5382
|
+
double val4 ;
|
5383
|
+
int ecode4 = 0 ;
|
5384
|
+
double val5 ;
|
5385
|
+
int ecode5 = 0 ;
|
5386
|
+
double val6 ;
|
5387
|
+
int ecode6 = 0 ;
|
5388
|
+
double val7 ;
|
5389
|
+
int ecode7 = 0 ;
|
5390
|
+
|
5391
|
+
if ((argc < 4) || (argc > 8)) {
|
5392
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
|
5393
|
+
}
|
5394
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Font, 0 | 0 );
|
5395
|
+
if (!SWIG_IsOK(res1)) {
|
5396
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Font const *","draw_text", 1, self ));
|
5397
|
+
}
|
5398
|
+
arg1 = reinterpret_cast< Gosu::Font * >(argp1);
|
5399
|
+
{
|
5400
|
+
std::string *ptr = (std::string *)0;
|
5401
|
+
res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
|
5402
|
+
if (!SWIG_IsOK(res2)) {
|
5403
|
+
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","draw_text", 2, argv[0] ));
|
5404
|
+
}
|
5405
|
+
if (!ptr) {
|
5406
|
+
SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","draw_text", 2, argv[0]));
|
5407
|
+
}
|
5408
|
+
arg2 = ptr;
|
5409
|
+
}
|
5410
|
+
ecode3 = SWIG_AsVal_double(argv[1], &val3);
|
5411
|
+
if (!SWIG_IsOK(ecode3)) {
|
5412
|
+
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","draw_text", 3, argv[1] ));
|
5413
|
+
}
|
5414
|
+
arg3 = static_cast< double >(val3);
|
5415
|
+
ecode4 = SWIG_AsVal_double(argv[2], &val4);
|
5416
|
+
if (!SWIG_IsOK(ecode4)) {
|
5417
|
+
SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","draw_text", 4, argv[2] ));
|
5418
|
+
}
|
5419
|
+
arg4 = static_cast< double >(val4);
|
5420
|
+
ecode5 = SWIG_AsVal_double(argv[3], &val5);
|
5421
|
+
if (!SWIG_IsOK(ecode5)) {
|
5422
|
+
SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "Gosu::ZPos","draw_text", 5, argv[3] ));
|
5423
|
+
}
|
5424
|
+
arg5 = static_cast< Gosu::ZPos >(val5);
|
5425
|
+
if (argc > 4) {
|
5426
|
+
ecode6 = SWIG_AsVal_double(argv[4], &val6);
|
5427
|
+
if (!SWIG_IsOK(ecode6)) {
|
5428
|
+
SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","draw_text", 6, argv[4] ));
|
5429
|
+
}
|
5430
|
+
arg6 = static_cast< double >(val6);
|
5431
|
+
}
|
5432
|
+
if (argc > 5) {
|
5433
|
+
ecode7 = SWIG_AsVal_double(argv[5], &val7);
|
5434
|
+
if (!SWIG_IsOK(ecode7)) {
|
5435
|
+
SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "double","draw_text", 7, argv[5] ));
|
5436
|
+
}
|
5437
|
+
arg7 = static_cast< double >(val7);
|
5438
|
+
}
|
5439
|
+
if (argc > 6) {
|
5440
|
+
{
|
5441
|
+
if (TYPE(argv[6]) == T_FIXNUM || TYPE(argv[6]) == T_BIGNUM) {
|
5442
|
+
arg8 = Gosu::Color(NUM2ULONG(argv[6]));
|
5443
|
+
}
|
5444
|
+
else {
|
5445
|
+
void* ptr;
|
5446
|
+
int res = SWIG_ConvertPtr(argv[6], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
5447
|
+
if (!SWIG_IsOK(res)) {
|
5448
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
5449
|
+
}
|
5450
|
+
else if (ptr == nullptr) {
|
5451
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
5452
|
+
}
|
5453
|
+
else {
|
5454
|
+
arg8 = *reinterpret_cast<Gosu::Color*>(ptr);
|
5455
|
+
}
|
5456
|
+
}
|
5457
|
+
}
|
5458
|
+
}
|
5459
|
+
if (argc > 7) {
|
5460
|
+
{
|
5461
|
+
const char* cstr = Gosu::cstr_from_symbol(argv[7]);
|
5462
|
+
|
5463
|
+
if (!strcmp(cstr, "default")) {
|
5464
|
+
arg9 = Gosu::AM_DEFAULT;
|
5465
|
+
}
|
5466
|
+
else if (!strcmp(cstr, "add") || !strcmp(cstr, "additive")) {
|
5467
|
+
arg9 = Gosu::AM_ADD;
|
5468
|
+
}
|
5469
|
+
else if (!strcmp(cstr, "multiply")) {
|
5470
|
+
arg9 = Gosu::AM_MULTIPLY;
|
5471
|
+
}
|
5472
|
+
else {
|
5473
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid alpha mode (expected one of :default, :add, "
|
5474
|
+
":multiply)");
|
5475
|
+
}
|
5476
|
+
}
|
5477
|
+
}
|
5478
|
+
{
|
5479
|
+
try {
|
5480
|
+
((Gosu::Font const *)arg1)->draw_text((std::string const &)*arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
|
5481
|
+
}
|
5482
|
+
catch (const std::exception& e) {
|
5483
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
5484
|
+
}
|
5485
|
+
}
|
5486
|
+
if (SWIG_IsNewObj(res2)) delete arg2;
|
5487
|
+
return Qnil;
|
5488
|
+
fail:
|
5489
|
+
if (SWIG_IsNewObj(res2)) delete arg2;
|
5490
|
+
return Qnil;
|
5491
|
+
}
|
5492
|
+
|
5493
|
+
|
5285
5494
|
SWIGINTERN VALUE
|
5286
5495
|
_wrap_Font_draw_markup(int argc, VALUE *argv, VALUE self) {
|
5287
5496
|
Gosu::Font *arg1 = (Gosu::Font *) 0 ;
|
@@ -5353,16 +5562,160 @@ _wrap_Font_draw_markup(int argc, VALUE *argv, VALUE self) {
|
|
5353
5562
|
if (!SWIG_IsOK(ecode7)) {
|
5354
5563
|
SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "double","draw_markup", 7, argv[5] ));
|
5355
5564
|
}
|
5356
|
-
arg7 = static_cast< double >(val7);
|
5565
|
+
arg7 = static_cast< double >(val7);
|
5566
|
+
}
|
5567
|
+
if (argc > 6) {
|
5568
|
+
{
|
5569
|
+
if (TYPE(argv[6]) == T_FIXNUM || TYPE(argv[6]) == T_BIGNUM) {
|
5570
|
+
arg8 = Gosu::Color(NUM2ULONG(argv[6]));
|
5571
|
+
}
|
5572
|
+
else {
|
5573
|
+
void* ptr;
|
5574
|
+
int res = SWIG_ConvertPtr(argv[6], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
5575
|
+
if (!SWIG_IsOK(res)) {
|
5576
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
5577
|
+
}
|
5578
|
+
else if (ptr == nullptr) {
|
5579
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
5580
|
+
}
|
5581
|
+
else {
|
5582
|
+
arg8 = *reinterpret_cast<Gosu::Color*>(ptr);
|
5583
|
+
}
|
5584
|
+
}
|
5585
|
+
}
|
5586
|
+
}
|
5587
|
+
if (argc > 7) {
|
5588
|
+
{
|
5589
|
+
const char* cstr = Gosu::cstr_from_symbol(argv[7]);
|
5590
|
+
|
5591
|
+
if (!strcmp(cstr, "default")) {
|
5592
|
+
arg9 = Gosu::AM_DEFAULT;
|
5593
|
+
}
|
5594
|
+
else if (!strcmp(cstr, "add") || !strcmp(cstr, "additive")) {
|
5595
|
+
arg9 = Gosu::AM_ADD;
|
5596
|
+
}
|
5597
|
+
else if (!strcmp(cstr, "multiply")) {
|
5598
|
+
arg9 = Gosu::AM_MULTIPLY;
|
5599
|
+
}
|
5600
|
+
else {
|
5601
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid alpha mode (expected one of :default, :add, "
|
5602
|
+
":multiply)");
|
5603
|
+
}
|
5604
|
+
}
|
5605
|
+
}
|
5606
|
+
{
|
5607
|
+
try {
|
5608
|
+
((Gosu::Font const *)arg1)->draw_markup((std::string const &)*arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
|
5609
|
+
}
|
5610
|
+
catch (const std::exception& e) {
|
5611
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
5612
|
+
}
|
5613
|
+
}
|
5614
|
+
if (SWIG_IsNewObj(res2)) delete arg2;
|
5615
|
+
return Qnil;
|
5616
|
+
fail:
|
5617
|
+
if (SWIG_IsNewObj(res2)) delete arg2;
|
5618
|
+
return Qnil;
|
5619
|
+
}
|
5620
|
+
|
5621
|
+
|
5622
|
+
SWIGINTERN VALUE
|
5623
|
+
_wrap_Font_draw_text_rel(int argc, VALUE *argv, VALUE self) {
|
5624
|
+
Gosu::Font *arg1 = (Gosu::Font *) 0 ;
|
5625
|
+
std::string *arg2 = 0 ;
|
5626
|
+
double arg3 ;
|
5627
|
+
double arg4 ;
|
5628
|
+
Gosu::ZPos arg5 ;
|
5629
|
+
double arg6 ;
|
5630
|
+
double arg7 ;
|
5631
|
+
double arg8 = (double) 1 ;
|
5632
|
+
double arg9 = (double) 1 ;
|
5633
|
+
Gosu::Color arg10 = (Gosu::Color) Gosu::Color::WHITE ;
|
5634
|
+
Gosu::AlphaMode arg11 = (Gosu::AlphaMode) Gosu::AM_DEFAULT ;
|
5635
|
+
void *argp1 = 0 ;
|
5636
|
+
int res1 = 0 ;
|
5637
|
+
int res2 = SWIG_OLDOBJ ;
|
5638
|
+
double val3 ;
|
5639
|
+
int ecode3 = 0 ;
|
5640
|
+
double val4 ;
|
5641
|
+
int ecode4 = 0 ;
|
5642
|
+
double val5 ;
|
5643
|
+
int ecode5 = 0 ;
|
5644
|
+
double val6 ;
|
5645
|
+
int ecode6 = 0 ;
|
5646
|
+
double val7 ;
|
5647
|
+
int ecode7 = 0 ;
|
5648
|
+
double val8 ;
|
5649
|
+
int ecode8 = 0 ;
|
5650
|
+
double val9 ;
|
5651
|
+
int ecode9 = 0 ;
|
5652
|
+
|
5653
|
+
if ((argc < 6) || (argc > 10)) {
|
5654
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
|
5655
|
+
}
|
5656
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Font, 0 | 0 );
|
5657
|
+
if (!SWIG_IsOK(res1)) {
|
5658
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Font const *","draw_text_rel", 1, self ));
|
5659
|
+
}
|
5660
|
+
arg1 = reinterpret_cast< Gosu::Font * >(argp1);
|
5661
|
+
{
|
5662
|
+
std::string *ptr = (std::string *)0;
|
5663
|
+
res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
|
5664
|
+
if (!SWIG_IsOK(res2)) {
|
5665
|
+
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","draw_text_rel", 2, argv[0] ));
|
5666
|
+
}
|
5667
|
+
if (!ptr) {
|
5668
|
+
SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","draw_text_rel", 2, argv[0]));
|
5669
|
+
}
|
5670
|
+
arg2 = ptr;
|
5671
|
+
}
|
5672
|
+
ecode3 = SWIG_AsVal_double(argv[1], &val3);
|
5673
|
+
if (!SWIG_IsOK(ecode3)) {
|
5674
|
+
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","draw_text_rel", 3, argv[1] ));
|
5675
|
+
}
|
5676
|
+
arg3 = static_cast< double >(val3);
|
5677
|
+
ecode4 = SWIG_AsVal_double(argv[2], &val4);
|
5678
|
+
if (!SWIG_IsOK(ecode4)) {
|
5679
|
+
SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","draw_text_rel", 4, argv[2] ));
|
5680
|
+
}
|
5681
|
+
arg4 = static_cast< double >(val4);
|
5682
|
+
ecode5 = SWIG_AsVal_double(argv[3], &val5);
|
5683
|
+
if (!SWIG_IsOK(ecode5)) {
|
5684
|
+
SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "Gosu::ZPos","draw_text_rel", 5, argv[3] ));
|
5685
|
+
}
|
5686
|
+
arg5 = static_cast< Gosu::ZPos >(val5);
|
5687
|
+
ecode6 = SWIG_AsVal_double(argv[4], &val6);
|
5688
|
+
if (!SWIG_IsOK(ecode6)) {
|
5689
|
+
SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","draw_text_rel", 6, argv[4] ));
|
5690
|
+
}
|
5691
|
+
arg6 = static_cast< double >(val6);
|
5692
|
+
ecode7 = SWIG_AsVal_double(argv[5], &val7);
|
5693
|
+
if (!SWIG_IsOK(ecode7)) {
|
5694
|
+
SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "double","draw_text_rel", 7, argv[5] ));
|
5695
|
+
}
|
5696
|
+
arg7 = static_cast< double >(val7);
|
5697
|
+
if (argc > 6) {
|
5698
|
+
ecode8 = SWIG_AsVal_double(argv[6], &val8);
|
5699
|
+
if (!SWIG_IsOK(ecode8)) {
|
5700
|
+
SWIG_exception_fail(SWIG_ArgError(ecode8), Ruby_Format_TypeError( "", "double","draw_text_rel", 8, argv[6] ));
|
5701
|
+
}
|
5702
|
+
arg8 = static_cast< double >(val8);
|
5703
|
+
}
|
5704
|
+
if (argc > 7) {
|
5705
|
+
ecode9 = SWIG_AsVal_double(argv[7], &val9);
|
5706
|
+
if (!SWIG_IsOK(ecode9)) {
|
5707
|
+
SWIG_exception_fail(SWIG_ArgError(ecode9), Ruby_Format_TypeError( "", "double","draw_text_rel", 9, argv[7] ));
|
5708
|
+
}
|
5709
|
+
arg9 = static_cast< double >(val9);
|
5357
5710
|
}
|
5358
|
-
if (argc >
|
5711
|
+
if (argc > 8) {
|
5359
5712
|
{
|
5360
|
-
if (TYPE(argv[
|
5361
|
-
|
5713
|
+
if (TYPE(argv[8]) == T_FIXNUM || TYPE(argv[8]) == T_BIGNUM) {
|
5714
|
+
arg10 = Gosu::Color(NUM2ULONG(argv[8]));
|
5362
5715
|
}
|
5363
5716
|
else {
|
5364
5717
|
void* ptr;
|
5365
|
-
int res = SWIG_ConvertPtr(argv[
|
5718
|
+
int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
5366
5719
|
if (!SWIG_IsOK(res)) {
|
5367
5720
|
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
5368
5721
|
}
|
@@ -5370,23 +5723,23 @@ _wrap_Font_draw_markup(int argc, VALUE *argv, VALUE self) {
|
|
5370
5723
|
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
5371
5724
|
}
|
5372
5725
|
else {
|
5373
|
-
|
5726
|
+
arg10 = *reinterpret_cast<Gosu::Color*>(ptr);
|
5374
5727
|
}
|
5375
5728
|
}
|
5376
5729
|
}
|
5377
5730
|
}
|
5378
|
-
if (argc >
|
5731
|
+
if (argc > 9) {
|
5379
5732
|
{
|
5380
|
-
const char* cstr = Gosu::cstr_from_symbol(argv[
|
5733
|
+
const char* cstr = Gosu::cstr_from_symbol(argv[9]);
|
5381
5734
|
|
5382
5735
|
if (!strcmp(cstr, "default")) {
|
5383
|
-
|
5736
|
+
arg11 = Gosu::AM_DEFAULT;
|
5384
5737
|
}
|
5385
5738
|
else if (!strcmp(cstr, "add") || !strcmp(cstr, "additive")) {
|
5386
|
-
|
5739
|
+
arg11 = Gosu::AM_ADD;
|
5387
5740
|
}
|
5388
5741
|
else if (!strcmp(cstr, "multiply")) {
|
5389
|
-
|
5742
|
+
arg11 = Gosu::AM_MULTIPLY;
|
5390
5743
|
}
|
5391
5744
|
else {
|
5392
5745
|
SWIG_exception_fail(SWIG_ValueError, "invalid alpha mode (expected one of :default, :add, "
|
@@ -5396,7 +5749,7 @@ _wrap_Font_draw_markup(int argc, VALUE *argv, VALUE self) {
|
|
5396
5749
|
}
|
5397
5750
|
{
|
5398
5751
|
try {
|
5399
|
-
((Gosu::Font const *)arg1)->
|
5752
|
+
((Gosu::Font const *)arg1)->draw_text_rel((std::string const &)*arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11);
|
5400
5753
|
}
|
5401
5754
|
catch (const std::exception& e) {
|
5402
5755
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
@@ -5767,6 +6120,62 @@ fail:
|
|
5767
6120
|
}
|
5768
6121
|
|
5769
6122
|
|
6123
|
+
SWIGINTERN VALUE
|
6124
|
+
_wrap_Font_text_width(int argc, VALUE *argv, VALUE self) {
|
6125
|
+
Gosu::Font *arg1 = (Gosu::Font *) 0 ;
|
6126
|
+
std::string *arg2 = 0 ;
|
6127
|
+
double arg3 = (double) 1.0 ;
|
6128
|
+
void *argp1 = 0 ;
|
6129
|
+
int res1 = 0 ;
|
6130
|
+
int res2 = SWIG_OLDOBJ ;
|
6131
|
+
double val3 ;
|
6132
|
+
int ecode3 = 0 ;
|
6133
|
+
double result;
|
6134
|
+
VALUE vresult = Qnil;
|
6135
|
+
|
6136
|
+
if ((argc < 1) || (argc > 2)) {
|
6137
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
6138
|
+
}
|
6139
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Font, 0 | 0 );
|
6140
|
+
if (!SWIG_IsOK(res1)) {
|
6141
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Font *","text_width", 1, self ));
|
6142
|
+
}
|
6143
|
+
arg1 = reinterpret_cast< Gosu::Font * >(argp1);
|
6144
|
+
{
|
6145
|
+
std::string *ptr = (std::string *)0;
|
6146
|
+
res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
|
6147
|
+
if (!SWIG_IsOK(res2)) {
|
6148
|
+
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","text_width", 2, argv[0] ));
|
6149
|
+
}
|
6150
|
+
if (!ptr) {
|
6151
|
+
SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","text_width", 2, argv[0]));
|
6152
|
+
}
|
6153
|
+
arg2 = ptr;
|
6154
|
+
}
|
6155
|
+
if (argc > 1) {
|
6156
|
+
ecode3 = SWIG_AsVal_double(argv[1], &val3);
|
6157
|
+
if (!SWIG_IsOK(ecode3)) {
|
6158
|
+
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","text_width", 3, argv[1] ));
|
6159
|
+
}
|
6160
|
+
arg3 = static_cast< double >(val3);
|
6161
|
+
}
|
6162
|
+
{
|
6163
|
+
try {
|
6164
|
+
result = (double)Gosu_Font_text_width(arg1,(std::string const &)*arg2,arg3);
|
6165
|
+
}
|
6166
|
+
catch (const std::exception& e) {
|
6167
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
6168
|
+
}
|
6169
|
+
}
|
6170
|
+
vresult = SWIG_From_double(static_cast< double >(result));
|
6171
|
+
if (SWIG_IsNewObj(res2)) delete arg2;
|
6172
|
+
return vresult;
|
6173
|
+
fail:
|
6174
|
+
if (SWIG_IsNewObj(res2)) delete arg2;
|
6175
|
+
return Qnil;
|
6176
|
+
}
|
6177
|
+
|
6178
|
+
|
5770
6179
|
SWIGINTERN VALUE
|
5771
6180
|
_wrap_Font_markup_width(int argc, VALUE *argv, VALUE self) {
|
5772
6181
|
Gosu::Font *arg1 = (Gosu::Font *) 0 ;
|
@@ -7016,6 +7425,56 @@ fail:
|
|
7016
7425
|
}
|
7017
7426
|
|
7018
7427
|
|
7428
|
+
SWIGINTERN VALUE
|
7429
|
+
_wrap_Image_from_markup(int argc, VALUE *argv, VALUE self) {
|
7430
|
+
std::string *arg1 = 0 ;
|
7431
|
+
double arg2 ;
|
7432
|
+
VALUE arg3 = (VALUE) 0 ;
|
7433
|
+
int res1 = SWIG_OLDOBJ ;
|
7434
|
+
double val2 ;
|
7435
|
+
int ecode2 = 0 ;
|
7436
|
+
Gosu::Image *result = 0 ;
|
7437
|
+
VALUE vresult = Qnil;
|
7438
|
+
|
7439
|
+
if ((argc < 2) || (argc > 3)) {
|
7440
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
|
7441
|
+
}
|
7442
|
+
{
|
7443
|
+
std::string *ptr = (std::string *)0;
|
7444
|
+
res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
|
7445
|
+
if (!SWIG_IsOK(res1)) {
|
7446
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Gosu_Image_from_markup", 1, argv[0] ));
|
7447
|
+
}
|
7448
|
+
if (!ptr) {
|
7449
|
+
SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Gosu_Image_from_markup", 1, argv[0]));
|
7450
|
+
}
|
7451
|
+
arg1 = ptr;
|
7452
|
+
}
|
7453
|
+
ecode2 = SWIG_AsVal_double(argv[1], &val2);
|
7454
|
+
if (!SWIG_IsOK(ecode2)) {
|
7455
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","Gosu_Image_from_markup", 2, argv[1] ));
|
7456
|
+
}
|
7457
|
+
arg2 = static_cast< double >(val2);
|
7458
|
+
if (argc > 2) {
|
7459
|
+
arg3 = argv[2];
|
7460
|
+
}
|
7461
|
+
{
|
7462
|
+
try {
|
7463
|
+
result = (Gosu::Image *)Gosu_Image_from_markup((std::string const &)*arg1,arg2,arg3);
|
7464
|
+
}
|
7465
|
+
catch (const std::exception& e) {
|
7466
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
7467
|
+
}
|
7468
|
+
}
|
7469
|
+
vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Gosu__Image, SWIG_POINTER_OWN | 0 );
|
7470
|
+
if (SWIG_IsNewObj(res1)) delete arg1;
|
7471
|
+
return vresult;
|
7472
|
+
fail:
|
7473
|
+
if (SWIG_IsNewObj(res1)) delete arg1;
|
7474
|
+
return Qnil;
|
7475
|
+
}
|
7476
|
+
|
7477
|
+
|
7019
7478
|
SWIGINTERN VALUE
|
7020
7479
|
_wrap_Image_load_tiles__SWIG_0(int argc, VALUE *argv, VALUE self) {
|
7021
7480
|
VALUE arg1 = (VALUE) 0 ;
|
@@ -8739,44 +9198,41 @@ _wrap_Window_allocate(int argc, VALUE *argv, VALUE self)
|
|
8739
9198
|
SWIGINTERN VALUE
|
8740
9199
|
_wrap_new_Window(int argc, VALUE *argv, VALUE self) {
|
8741
9200
|
VALUE arg1 = (VALUE) 0 ;
|
8742
|
-
|
8743
|
-
|
8744
|
-
|
9201
|
+
int arg2 ;
|
9202
|
+
int arg3 ;
|
9203
|
+
unsigned int arg4 = (unsigned int) Gosu::WF_WINDOWED ;
|
8745
9204
|
double arg5 = (double) 16.666666 ;
|
8746
|
-
|
8747
|
-
unsigned int val2 ;
|
9205
|
+
int val2 ;
|
8748
9206
|
int ecode2 = 0 ;
|
8749
|
-
|
9207
|
+
int val3 ;
|
8750
9208
|
int ecode3 = 0 ;
|
8751
|
-
|
9209
|
+
unsigned int val4 ;
|
8752
9210
|
int ecode4 = 0 ;
|
8753
9211
|
double val5 ;
|
8754
9212
|
int ecode5 = 0 ;
|
8755
|
-
bool val6 ;
|
8756
|
-
int ecode6 = 0 ;
|
8757
9213
|
const char *classname SWIGUNUSED = "Gosu::Window";
|
8758
9214
|
Gosu::Window *result = 0 ;
|
8759
9215
|
|
8760
|
-
if ((argc < 2) || (argc >
|
9216
|
+
if ((argc < 2) || (argc > 4)) {
|
8761
9217
|
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
|
8762
9218
|
}
|
8763
9219
|
arg1 = self;
|
8764
|
-
ecode2 =
|
9220
|
+
ecode2 = SWIG_AsVal_int(argv[0], &val2);
|
8765
9221
|
if (!SWIG_IsOK(ecode2)) {
|
8766
|
-
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "
|
9222
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Window", 2, argv[0] ));
|
8767
9223
|
}
|
8768
|
-
arg2 = static_cast<
|
8769
|
-
ecode3 =
|
9224
|
+
arg2 = static_cast< int >(val2);
|
9225
|
+
ecode3 = SWIG_AsVal_int(argv[1], &val3);
|
8770
9226
|
if (!SWIG_IsOK(ecode3)) {
|
8771
|
-
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "
|
9227
|
+
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","Window", 3, argv[1] ));
|
8772
9228
|
}
|
8773
|
-
arg3 = static_cast<
|
9229
|
+
arg3 = static_cast< int >(val3);
|
8774
9230
|
if (argc > 2) {
|
8775
|
-
ecode4 =
|
9231
|
+
ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
|
8776
9232
|
if (!SWIG_IsOK(ecode4)) {
|
8777
|
-
SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "
|
9233
|
+
SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "unsigned int","Window", 4, argv[2] ));
|
8778
9234
|
}
|
8779
|
-
arg4 = static_cast<
|
9235
|
+
arg4 = static_cast< unsigned int >(val4);
|
8780
9236
|
}
|
8781
9237
|
if (argc > 3) {
|
8782
9238
|
ecode5 = SWIG_AsVal_double(argv[3], &val5);
|
@@ -8785,20 +9241,13 @@ _wrap_new_Window(int argc, VALUE *argv, VALUE self) {
|
|
8785
9241
|
}
|
8786
9242
|
arg5 = static_cast< double >(val5);
|
8787
9243
|
}
|
8788
|
-
if (argc > 4) {
|
8789
|
-
ecode6 = SWIG_AsVal_bool(argv[4], &val6);
|
8790
|
-
if (!SWIG_IsOK(ecode6)) {
|
8791
|
-
SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "bool","Window", 6, argv[4] ));
|
8792
|
-
}
|
8793
|
-
arg6 = static_cast< bool >(val6);
|
8794
|
-
}
|
8795
9244
|
{
|
8796
9245
|
try {
|
8797
9246
|
if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
|
8798
9247
|
/* subclassed */
|
8799
|
-
result = (Gosu::Window *)new SwigDirector_Window(arg1,arg2,arg3,arg4,arg5
|
9248
|
+
result = (Gosu::Window *)new SwigDirector_Window(arg1,arg2,arg3,arg4,arg5);
|
8800
9249
|
} else {
|
8801
|
-
result = (Gosu::Window *)new Gosu::Window(arg2,arg3,arg4,arg5
|
9250
|
+
result = (Gosu::Window *)new Gosu::Window(arg2,arg3,arg4,arg5);
|
8802
9251
|
}
|
8803
9252
|
|
8804
9253
|
DATA_PTR(self) = result;
|
@@ -8826,7 +9275,7 @@ _wrap_Window_width(int argc, VALUE *argv, VALUE self) {
|
|
8826
9275
|
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
8827
9276
|
void *argp1 = 0 ;
|
8828
9277
|
int res1 = 0 ;
|
8829
|
-
|
9278
|
+
int result;
|
8830
9279
|
VALUE vresult = Qnil;
|
8831
9280
|
|
8832
9281
|
if ((argc < 0) || (argc > 0)) {
|
@@ -8839,13 +9288,13 @@ _wrap_Window_width(int argc, VALUE *argv, VALUE self) {
|
|
8839
9288
|
arg1 = reinterpret_cast< Gosu::Window * >(argp1);
|
8840
9289
|
{
|
8841
9290
|
try {
|
8842
|
-
result = (
|
9291
|
+
result = (int)((Gosu::Window const *)arg1)->width();
|
8843
9292
|
}
|
8844
9293
|
catch (const std::exception& e) {
|
8845
9294
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
8846
9295
|
}
|
8847
9296
|
}
|
8848
|
-
vresult =
|
9297
|
+
vresult = SWIG_From_int(static_cast< int >(result));
|
8849
9298
|
return vresult;
|
8850
9299
|
fail:
|
8851
9300
|
return Qnil;
|
@@ -8857,7 +9306,7 @@ _wrap_Window_height(int argc, VALUE *argv, VALUE self) {
|
|
8857
9306
|
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
8858
9307
|
void *argp1 = 0 ;
|
8859
9308
|
int res1 = 0 ;
|
8860
|
-
|
9309
|
+
int result;
|
8861
9310
|
VALUE vresult = Qnil;
|
8862
9311
|
|
8863
9312
|
if ((argc < 0) || (argc > 0)) {
|
@@ -8870,13 +9319,13 @@ _wrap_Window_height(int argc, VALUE *argv, VALUE self) {
|
|
8870
9319
|
arg1 = reinterpret_cast< Gosu::Window * >(argp1);
|
8871
9320
|
{
|
8872
9321
|
try {
|
8873
|
-
result = (
|
9322
|
+
result = (int)((Gosu::Window const *)arg1)->height();
|
8874
9323
|
}
|
8875
9324
|
catch (const std::exception& e) {
|
8876
9325
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
8877
9326
|
}
|
8878
9327
|
}
|
8879
|
-
vresult =
|
9328
|
+
vresult = SWIG_From_int(static_cast< int >(result));
|
8880
9329
|
return vresult;
|
8881
9330
|
fail:
|
8882
9331
|
return Qnil;
|
@@ -8945,6 +9394,109 @@ fail:
|
|
8945
9394
|
}
|
8946
9395
|
|
8947
9396
|
|
9397
|
+
SWIGINTERN VALUE
|
9398
|
+
_wrap_Window_resizablee___(int argc, VALUE *argv, VALUE self) {
|
9399
|
+
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
9400
|
+
bool arg2 ;
|
9401
|
+
void *argp1 = 0 ;
|
9402
|
+
int res1 = 0 ;
|
9403
|
+
bool val2 ;
|
9404
|
+
int ecode2 = 0 ;
|
9405
|
+
|
9406
|
+
if ((argc < 1) || (argc > 1)) {
|
9407
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
9408
|
+
}
|
9409
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 );
|
9410
|
+
if (!SWIG_IsOK(res1)) {
|
9411
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","set_resizable", 1, self ));
|
9412
|
+
}
|
9413
|
+
arg1 = reinterpret_cast< Gosu::Window * >(argp1);
|
9414
|
+
ecode2 = SWIG_AsVal_bool(argv[0], &val2);
|
9415
|
+
if (!SWIG_IsOK(ecode2)) {
|
9416
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","set_resizable", 2, argv[0] ));
|
9417
|
+
}
|
9418
|
+
arg2 = static_cast< bool >(val2);
|
9419
|
+
{
|
9420
|
+
try {
|
9421
|
+
(arg1)->set_resizable(arg2);
|
9422
|
+
}
|
9423
|
+
catch (const std::exception& e) {
|
9424
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
9425
|
+
}
|
9426
|
+
}
|
9427
|
+
return Qnil;
|
9428
|
+
fail:
|
9429
|
+
return Qnil;
|
9430
|
+
}
|
9431
|
+
|
9432
|
+
|
9433
|
+
SWIGINTERN VALUE
|
9434
|
+
_wrap_Window_borderlessq___(int argc, VALUE *argv, VALUE self) {
|
9435
|
+
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
9436
|
+
void *argp1 = 0 ;
|
9437
|
+
int res1 = 0 ;
|
9438
|
+
bool result;
|
9439
|
+
VALUE vresult = Qnil;
|
9440
|
+
|
9441
|
+
if ((argc < 0) || (argc > 0)) {
|
9442
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
9443
|
+
}
|
9444
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 );
|
9445
|
+
if (!SWIG_IsOK(res1)) {
|
9446
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","borderless", 1, self ));
|
9447
|
+
}
|
9448
|
+
arg1 = reinterpret_cast< Gosu::Window * >(argp1);
|
9449
|
+
{
|
9450
|
+
try {
|
9451
|
+
result = (bool)((Gosu::Window const *)arg1)->borderless();
|
9452
|
+
}
|
9453
|
+
catch (const std::exception& e) {
|
9454
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
9455
|
+
}
|
9456
|
+
}
|
9457
|
+
vresult = SWIG_From_bool(static_cast< bool >(result));
|
9458
|
+
return vresult;
|
9459
|
+
fail:
|
9460
|
+
return Qnil;
|
9461
|
+
}
|
9462
|
+
|
9463
|
+
|
9464
|
+
SWIGINTERN VALUE
|
9465
|
+
_wrap_Window_borderlesse___(int argc, VALUE *argv, VALUE self) {
|
9466
|
+
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
9467
|
+
bool arg2 ;
|
9468
|
+
void *argp1 = 0 ;
|
9469
|
+
int res1 = 0 ;
|
9470
|
+
bool val2 ;
|
9471
|
+
int ecode2 = 0 ;
|
9472
|
+
|
9473
|
+
if ((argc < 1) || (argc > 1)) {
|
9474
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
9475
|
+
}
|
9476
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 );
|
9477
|
+
if (!SWIG_IsOK(res1)) {
|
9478
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","set_borderless", 1, self ));
|
9479
|
+
}
|
9480
|
+
arg1 = reinterpret_cast< Gosu::Window * >(argp1);
|
9481
|
+
ecode2 = SWIG_AsVal_bool(argv[0], &val2);
|
9482
|
+
if (!SWIG_IsOK(ecode2)) {
|
9483
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","set_borderless", 2, argv[0] ));
|
9484
|
+
}
|
9485
|
+
arg2 = static_cast< bool >(val2);
|
9486
|
+
{
|
9487
|
+
try {
|
9488
|
+
(arg1)->set_borderless(arg2);
|
9489
|
+
}
|
9490
|
+
catch (const std::exception& e) {
|
9491
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
9492
|
+
}
|
9493
|
+
}
|
9494
|
+
return Qnil;
|
9495
|
+
fail:
|
9496
|
+
return Qnil;
|
9497
|
+
}
|
9498
|
+
|
9499
|
+
|
8948
9500
|
SWIGINTERN VALUE
|
8949
9501
|
_wrap_Window_update_interval(int argc, VALUE *argv, VALUE self) {
|
8950
9502
|
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
@@ -10125,7 +10677,7 @@ _wrap_screen_width(int argc, VALUE *argv, VALUE self) {
|
|
10125
10677
|
Gosu::Window *arg1 = (Gosu::Window *) nullptr ;
|
10126
10678
|
void *argp1 = 0 ;
|
10127
10679
|
int res1 = 0 ;
|
10128
|
-
|
10680
|
+
int result;
|
10129
10681
|
VALUE vresult = Qnil;
|
10130
10682
|
|
10131
10683
|
if ((argc < 0) || (argc > 1)) {
|
@@ -10140,13 +10692,13 @@ _wrap_screen_width(int argc, VALUE *argv, VALUE self) {
|
|
10140
10692
|
}
|
10141
10693
|
{
|
10142
10694
|
try {
|
10143
|
-
result = (
|
10695
|
+
result = (int)Gosu::screen_width(arg1);
|
10144
10696
|
}
|
10145
10697
|
catch (const std::exception& e) {
|
10146
10698
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
10147
10699
|
}
|
10148
10700
|
}
|
10149
|
-
vresult =
|
10701
|
+
vresult = SWIG_From_int(static_cast< int >(result));
|
10150
10702
|
return vresult;
|
10151
10703
|
fail:
|
10152
10704
|
return Qnil;
|
@@ -10158,7 +10710,7 @@ _wrap_screen_height(int argc, VALUE *argv, VALUE self) {
|
|
10158
10710
|
Gosu::Window *arg1 = (Gosu::Window *) nullptr ;
|
10159
10711
|
void *argp1 = 0 ;
|
10160
10712
|
int res1 = 0 ;
|
10161
|
-
|
10713
|
+
int result;
|
10162
10714
|
VALUE vresult = Qnil;
|
10163
10715
|
|
10164
10716
|
if ((argc < 0) || (argc > 1)) {
|
@@ -10173,13 +10725,13 @@ _wrap_screen_height(int argc, VALUE *argv, VALUE self) {
|
|
10173
10725
|
}
|
10174
10726
|
{
|
10175
10727
|
try {
|
10176
|
-
result = (
|
10728
|
+
result = (int)Gosu::screen_height(arg1);
|
10177
10729
|
}
|
10178
10730
|
catch (const std::exception& e) {
|
10179
10731
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
10180
10732
|
}
|
10181
10733
|
}
|
10182
|
-
vresult =
|
10734
|
+
vresult = SWIG_From_int(static_cast< int >(result));
|
10183
10735
|
return vresult;
|
10184
10736
|
fail:
|
10185
10737
|
return Qnil;
|
@@ -10191,7 +10743,7 @@ _wrap_available_width(int argc, VALUE *argv, VALUE self) {
|
|
10191
10743
|
Gosu::Window *arg1 = (Gosu::Window *) nullptr ;
|
10192
10744
|
void *argp1 = 0 ;
|
10193
10745
|
int res1 = 0 ;
|
10194
|
-
|
10746
|
+
int result;
|
10195
10747
|
VALUE vresult = Qnil;
|
10196
10748
|
|
10197
10749
|
if ((argc < 0) || (argc > 1)) {
|
@@ -10206,13 +10758,13 @@ _wrap_available_width(int argc, VALUE *argv, VALUE self) {
|
|
10206
10758
|
}
|
10207
10759
|
{
|
10208
10760
|
try {
|
10209
|
-
result = (
|
10761
|
+
result = (int)Gosu::available_width(arg1);
|
10210
10762
|
}
|
10211
10763
|
catch (const std::exception& e) {
|
10212
10764
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
10213
10765
|
}
|
10214
10766
|
}
|
10215
|
-
vresult =
|
10767
|
+
vresult = SWIG_From_int(static_cast< int >(result));
|
10216
10768
|
return vresult;
|
10217
10769
|
fail:
|
10218
10770
|
return Qnil;
|
@@ -10224,7 +10776,7 @@ _wrap_available_height(int argc, VALUE *argv, VALUE self) {
|
|
10224
10776
|
Gosu::Window *arg1 = (Gosu::Window *) nullptr ;
|
10225
10777
|
void *argp1 = 0 ;
|
10226
10778
|
int res1 = 0 ;
|
10227
|
-
|
10779
|
+
int result;
|
10228
10780
|
VALUE vresult = Qnil;
|
10229
10781
|
|
10230
10782
|
if ((argc < 0) || (argc > 1)) {
|
@@ -10239,13 +10791,13 @@ _wrap_available_height(int argc, VALUE *argv, VALUE self) {
|
|
10239
10791
|
}
|
10240
10792
|
{
|
10241
10793
|
try {
|
10242
|
-
result = (
|
10794
|
+
result = (int)Gosu::available_height(arg1);
|
10243
10795
|
}
|
10244
10796
|
catch (const std::exception& e) {
|
10245
10797
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
10246
10798
|
}
|
10247
10799
|
}
|
10248
|
-
vresult =
|
10800
|
+
vresult = SWIG_From_int(static_cast< int >(result));
|
10249
10801
|
return vresult;
|
10250
10802
|
fail:
|
10251
10803
|
return Qnil;
|
@@ -10272,14 +10824,14 @@ _wrap_char_to_button_id(int argc, VALUE *argv, VALUE self) {
|
|
10272
10824
|
}
|
10273
10825
|
{
|
10274
10826
|
try {
|
10275
|
-
result = Gosu::char_to_button_id(arg1);
|
10827
|
+
result = (Gosu::Button)Gosu::char_to_button_id(arg1);
|
10276
10828
|
}
|
10277
10829
|
catch (const std::exception& e) {
|
10278
10830
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
10279
10831
|
}
|
10280
10832
|
}
|
10281
10833
|
{
|
10282
|
-
vresult = result == Gosu::NO_BUTTON ? Qnil : LONG2NUM(
|
10834
|
+
vresult = result == Gosu::NO_BUTTON ? Qnil : LONG2NUM(result);
|
10283
10835
|
}
|
10284
10836
|
return vresult;
|
10285
10837
|
fail:
|
@@ -11651,7 +12203,6 @@ fail:
|
|
11651
12203
|
|
11652
12204
|
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
|
11653
12205
|
|
11654
|
-
static swig_type_info _swigt__p_Gosu__Button = {"_p_Gosu__Button", "Gosu::Button *", 0, 0, (void*)0, 0};
|
11655
12206
|
static swig_type_info _swigt__p_Gosu__Channel = {"_p_Gosu__Channel", "Gosu::Channel *", 0, 0, (void*)0, 0};
|
11656
12207
|
static swig_type_info _swigt__p_Gosu__Color = {"_p_Gosu__Color", "Gosu::Color *", 0, 0, (void*)0, 0};
|
11657
12208
|
static swig_type_info _swigt__p_Gosu__Font = {"_p_Gosu__Font", "Gosu::Font *", 0, 0, (void*)0, 0};
|
@@ -11667,7 +12218,6 @@ static swig_type_info _swigt__p_std__arrayT_double_16_t = {"_p_std__arrayT_doubl
|
|
11667
12218
|
static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)0, 0};
|
11668
12219
|
|
11669
12220
|
static swig_type_info *swig_type_initial[] = {
|
11670
|
-
&_swigt__p_Gosu__Button,
|
11671
12221
|
&_swigt__p_Gosu__Channel,
|
11672
12222
|
&_swigt__p_Gosu__Color,
|
11673
12223
|
&_swigt__p_Gosu__Font,
|
@@ -11683,7 +12233,6 @@ static swig_type_info *swig_type_initial[] = {
|
|
11683
12233
|
&_swigt__p_std__string,
|
11684
12234
|
};
|
11685
12235
|
|
11686
|
-
static swig_cast_info _swigc__p_Gosu__Button[] = { {&_swigt__p_Gosu__Button, 0, 0, 0},{0, 0, 0, 0}};
|
11687
12236
|
static swig_cast_info _swigc__p_Gosu__Channel[] = { {&_swigt__p_Gosu__Channel, 0, 0, 0},{0, 0, 0, 0}};
|
11688
12237
|
static swig_cast_info _swigc__p_Gosu__Color[] = { {&_swigt__p_Gosu__Color, 0, 0, 0},{0, 0, 0, 0}};
|
11689
12238
|
static swig_cast_info _swigc__p_Gosu__Font[] = { {&_swigt__p_Gosu__Font, 0, 0, 0},{0, 0, 0, 0}};
|
@@ -11699,7 +12248,6 @@ static swig_cast_info _swigc__p_std__arrayT_double_16_t[] = { {&_swigt__p_std__
|
|
11699
12248
|
static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}};
|
11700
12249
|
|
11701
12250
|
static swig_cast_info *swig_cast_initial[] = {
|
11702
|
-
_swigc__p_Gosu__Button,
|
11703
12251
|
_swigc__p_Gosu__Channel,
|
11704
12252
|
_swigc__p_Gosu__Color,
|
11705
12253
|
_swigc__p_Gosu__Font,
|
@@ -11969,9 +12517,9 @@ SWIGEXPORT void Init_gosu(void) {
|
|
11969
12517
|
SWIG_RubyInitializeTrackings();
|
11970
12518
|
rb_define_const(mGosu, "VERSION", SWIG_From_std_string(static_cast< std::string >(Gosu::VERSION)));
|
11971
12519
|
rb_define_const(mGosu, "LICENSES", SWIG_From_std_string(static_cast< std::string >(Gosu::LICENSES)));
|
11972
|
-
rb_define_const(mGosu, "MAJOR_VERSION", SWIG_From_int(static_cast< int >(
|
11973
|
-
rb_define_const(mGosu, "MINOR_VERSION", SWIG_From_int(static_cast< int >(
|
11974
|
-
rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(
|
12520
|
+
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 >(1)));
|
12522
|
+
rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(0)));
|
11975
12523
|
rb_define_module_function(mGosu, "milliseconds", VALUEFUNC(_wrap_milliseconds), -1);
|
11976
12524
|
rb_define_module_function(mGosu, "random", VALUEFUNC(_wrap_random), -1);
|
11977
12525
|
rb_define_module_function(mGosu, "degrees_to_radians", VALUEFUNC(_wrap_degrees_to_radians), -1);
|
@@ -12029,9 +12577,12 @@ SWIGEXPORT void Init_gosu(void) {
|
|
12029
12577
|
rb_define_method(SwigClassFont.klass, "name", VALUEFUNC(_wrap_Font_name), -1);
|
12030
12578
|
rb_define_method(SwigClassFont.klass, "height", VALUEFUNC(_wrap_Font_height), -1);
|
12031
12579
|
rb_define_method(SwigClassFont.klass, "flags", VALUEFUNC(_wrap_Font_flags), -1);
|
12580
|
+
rb_define_method(SwigClassFont.klass, "draw_text", VALUEFUNC(_wrap_Font_draw_text), -1);
|
12032
12581
|
rb_define_method(SwigClassFont.klass, "draw_markup", VALUEFUNC(_wrap_Font_draw_markup), -1);
|
12582
|
+
rb_define_method(SwigClassFont.klass, "draw_text_rel", VALUEFUNC(_wrap_Font_draw_text_rel), -1);
|
12033
12583
|
rb_define_method(SwigClassFont.klass, "draw_markup_rel", VALUEFUNC(_wrap_Font_draw_markup_rel), -1);
|
12034
12584
|
rb_define_method(SwigClassFont.klass, "set_image", VALUEFUNC(_wrap_Font_set_image), -1);
|
12585
|
+
rb_define_method(SwigClassFont.klass, "text_width", VALUEFUNC(_wrap_Font_text_width), -1);
|
12035
12586
|
rb_define_method(SwigClassFont.klass, "markup_width", VALUEFUNC(_wrap_Font_markup_width), -1);
|
12036
12587
|
SwigClassFont.mark = 0;
|
12037
12588
|
SwigClassFont.destroy = (void (*)(void *)) free_Gosu_Font;
|
@@ -12068,6 +12619,7 @@ SWIGEXPORT void Init_gosu(void) {
|
|
12068
12619
|
rb_define_method(SwigClassImage.klass, "gl_tex_info", VALUEFUNC(_wrap_Image_gl_tex_info), -1);
|
12069
12620
|
rb_define_method(SwigClassImage.klass, "subimage", VALUEFUNC(_wrap_Image_subimage), -1);
|
12070
12621
|
rb_define_singleton_method(SwigClassImage.klass, "from_text", VALUEFUNC(_wrap_Image_from_text), -1);
|
12622
|
+
rb_define_singleton_method(SwigClassImage.klass, "from_markup", VALUEFUNC(_wrap_Image_from_markup), -1);
|
12071
12623
|
rb_define_singleton_method(SwigClassImage.klass, "load_tiles", VALUEFUNC(_wrap_Image_load_tiles), -1);
|
12072
12624
|
rb_define_method(SwigClassImage.klass, "to_blob", VALUEFUNC(_wrap_Image_to_blob), -1);
|
12073
12625
|
rb_define_method(SwigClassImage.klass, "columns", VALUEFUNC(_wrap_Image_columns), -1);
|
@@ -12163,8 +12715,8 @@ SWIGEXPORT void Init_gosu(void) {
|
|
12163
12715
|
rb_define_const(mGosu, "KB_DOWN", SWIG_From_int(static_cast< int >(Gosu::KB_DOWN)));
|
12164
12716
|
rb_define_const(mGosu, "KB_HOME", SWIG_From_int(static_cast< int >(Gosu::KB_HOME)));
|
12165
12717
|
rb_define_const(mGosu, "KB_END", SWIG_From_int(static_cast< int >(Gosu::KB_END)));
|
12166
|
-
rb_define_const(mGosu, "
|
12167
|
-
rb_define_const(mGosu, "
|
12718
|
+
rb_define_const(mGosu, "KB_PRINT_SCREEN", SWIG_From_int(static_cast< int >(Gosu::KB_PRINT_SCREEN)));
|
12719
|
+
rb_define_const(mGosu, "KB_SCROLL_LOCK", SWIG_From_int(static_cast< int >(Gosu::KB_SCROLL_LOCK)));
|
12168
12720
|
rb_define_const(mGosu, "KB_PAUSE", SWIG_From_int(static_cast< int >(Gosu::KB_PAUSE)));
|
12169
12721
|
rb_define_const(mGosu, "KB_INSERT", SWIG_From_int(static_cast< int >(Gosu::KB_INSERT)));
|
12170
12722
|
rb_define_const(mGosu, "KB_DELETE", SWIG_From_int(static_cast< int >(Gosu::KB_DELETE)));
|
@@ -12182,7 +12734,7 @@ SWIGEXPORT void Init_gosu(void) {
|
|
12182
12734
|
rb_define_const(mGosu, "KB_COMMA", SWIG_From_int(static_cast< int >(Gosu::KB_COMMA)));
|
12183
12735
|
rb_define_const(mGosu, "KB_PERIOD", SWIG_From_int(static_cast< int >(Gosu::KB_PERIOD)));
|
12184
12736
|
rb_define_const(mGosu, "KB_SLASH", SWIG_From_int(static_cast< int >(Gosu::KB_SLASH)));
|
12185
|
-
rb_define_const(mGosu, "
|
12737
|
+
rb_define_const(mGosu, "KB_CAPS_LOCK", SWIG_From_int(static_cast< int >(Gosu::KB_CAPS_LOCK)));
|
12186
12738
|
rb_define_const(mGosu, "KB_A", SWIG_From_int(static_cast< int >(Gosu::KB_A)));
|
12187
12739
|
rb_define_const(mGosu, "KB_B", SWIG_From_int(static_cast< int >(Gosu::KB_B)));
|
12188
12740
|
rb_define_const(mGosu, "KB_C", SWIG_From_int(static_cast< int >(Gosu::KB_C)));
|
@@ -12422,6 +12974,9 @@ SWIGEXPORT void Init_gosu(void) {
|
|
12422
12974
|
rb_define_method(SwigClassWindow.klass, "height", VALUEFUNC(_wrap_Window_height), -1);
|
12423
12975
|
rb_define_method(SwigClassWindow.klass, "fullscreen?", VALUEFUNC(_wrap_Window_fullscreenq___), -1);
|
12424
12976
|
rb_define_method(SwigClassWindow.klass, "resizable?", VALUEFUNC(_wrap_Window_resizableq___), -1);
|
12977
|
+
rb_define_method(SwigClassWindow.klass, "resizable=", VALUEFUNC(_wrap_Window_resizablee___), -1);
|
12978
|
+
rb_define_method(SwigClassWindow.klass, "borderless?", VALUEFUNC(_wrap_Window_borderlessq___), -1);
|
12979
|
+
rb_define_method(SwigClassWindow.klass, "borderless=", VALUEFUNC(_wrap_Window_borderlesse___), -1);
|
12425
12980
|
rb_define_method(SwigClassWindow.klass, "update_interval", VALUEFUNC(_wrap_Window_update_interval), -1);
|
12426
12981
|
rb_define_method(SwigClassWindow.klass, "update_interval=", VALUEFUNC(_wrap_Window_update_intervale___), -1);
|
12427
12982
|
rb_define_method(SwigClassWindow.klass, "caption", VALUEFUNC(_wrap_Window_caption), -1);
|