gosu 0.9.2 → 0.10.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/Gosu/Bitmap.hpp +3 -3
- data/Gosu/Directories.hpp +6 -3
- data/Gosu/Gosu.hpp +0 -1
- data/Gosu/GraphicsBase.hpp +12 -8
- data/Gosu/Input.hpp +5 -16
- data/Gosu/Platform.hpp +1 -0
- data/Gosu/Version.hpp +3 -5
- data/Gosu/Window.hpp +7 -8
- data/README.txt +3 -3
- data/ext/gosu/extconf.rb +17 -16
- data/ext/gosu/gosu_wrap.cxx +59 -58
- data/ext/gosu/gosu_wrap.h +1 -1
- data/rdoc/gosu.rb +285 -283
- data/src/{MacUtility.hpp → AppleUtility.hpp} +24 -42
- data/src/Audio/ALChannelManagement.hpp +1 -1
- data/src/Audio/{AudioOpenAL.cpp → Audio.cpp} +6 -7
- data/src/Audio/Audio.mm +1 -0
- data/src/Audio/AudioFile.hpp +2 -2
- data/src/Audio/AudioToolboxFile.hpp +5 -20
- data/src/Audio/OggFile.hpp +44 -56
- data/src/Audio/SndFile.hpp +2 -2
- data/src/Bitmap/Bitmap.cpp +98 -2
- data/src/Bitmap/BitmapIO.cpp +156 -0
- data/src/DirectoriesApple.mm +76 -0
- data/src/DirectoriesUnix.cpp +5 -12
- data/src/DirectoriesWin.cpp +5 -0
- data/src/Graphics/BlockAllocator.hpp +2 -2
- data/src/Graphics/ClipRectStack.hpp +2 -2
- data/src/Graphics/Common.hpp +2 -2
- data/src/Graphics/DrawOp.hpp +2 -2
- data/src/Graphics/DrawOpQueue.hpp +2 -2
- data/src/Graphics/Graphics.cpp +7 -2
- data/src/Graphics/LargeImageData.cpp +6 -6
- data/src/Graphics/LargeImageData.hpp +3 -3
- data/src/Graphics/Macro.hpp +2 -2
- data/src/Graphics/RenderState.hpp +2 -2
- data/src/Graphics/Resolution.cpp +1 -1
- data/src/Graphics/TexChunk.hpp +2 -2
- data/src/Graphics/Texture.cpp +21 -16
- data/src/Graphics/Texture.hpp +7 -5
- data/src/Graphics/TransformStack.hpp +2 -2
- data/src/Iconv.hpp +2 -2
- data/src/Input/Input.cpp +3 -1
- data/src/Input/{InputTouch.mm → InputUIKit.mm} +32 -26
- data/src/Input/TextInput.cpp +1 -1
- data/src/Text/FormattedString.hpp +2 -2
- data/src/Text/TextApple.mm +8 -8
- data/src/Text/TextMac.cpp +1 -1
- data/src/Text/TextUnix.cpp +1 -1
- data/src/UIKit/GosuAppDelegate.h +8 -0
- data/src/UIKit/GosuAppDelegate.mm +24 -0
- data/src/UIKit/GosuGLView.h +8 -0
- data/src/UIKit/GosuGLView.mm +130 -0
- data/src/UIKit/GosuViewController.h +13 -0
- data/src/UIKit/GosuViewController.mm +214 -0
- data/src/UtilityApple.mm +5 -18
- data/src/Window.cpp +1 -3
- data/src/WindowUIKit.mm +124 -0
- data/src/stb_image.h +6437 -0
- data/src/stb_image_write.h +730 -0
- data/src/stb_vorbis.c +5459 -0
- metadata +18 -26
- data/Gosu/Sockets.hpp +0 -156
- data/src/Audio/AudioOpenAL.mm +0 -1
- data/src/Bitmap/BitmapApple.mm +0 -226
- data/src/Bitmap/BitmapBMP.cpp +0 -79
- data/src/Bitmap/BitmapColorKey.cpp +0 -50
- data/src/Bitmap/BitmapFreeImage.cpp +0 -174
- data/src/Bitmap/BitmapGDIplus.cpp +0 -212
- data/src/Bitmap/BitmapUtils.cpp +0 -76
- data/src/DirectoriesMac.mm +0 -38
- data/src/DirectoriesTouch.mm +0 -38
- data/src/GosuView.hpp +0 -15
- data/src/GosuView.mm +0 -208
- data/src/Input/AccelerometerReader.hpp +0 -10
- data/src/Input/AccelerometerReader.mm +0 -31
- data/src/Sockets/CommSocket.cpp +0 -305
- data/src/Sockets/ListenerSocket.cpp +0 -59
- data/src/Sockets/MessageSocket.cpp +0 -128
- data/src/Sockets/Socket.cpp +0 -145
- data/src/Sockets/Socket.hpp +0 -66
- data/src/WindowTouch.mm +0 -243
- data/src/X11vroot.h +0 -118
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29ea42b991f0cdb7184583f5a435defec4f07942
|
4
|
+
data.tar.gz: 44b69037fa96ae7d5cacc38d5c1919b23a87461c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bf4f2486302c435a0b46a420649db290ffb951133a5bbed48e98e0cd9d58738250cf549fc397a632de224e837bc7b58640367db69703c93262780b61539eab2
|
7
|
+
data.tar.gz: 0f0b3b81cb18107cf9253a1757237cbfdd46897bc55bcd108453c748689b36a0bcbe482a2eef5f20d1fa4b3149349433d5851421c18c9e04fa0cdd812d8802c7
|
data/Gosu/Bitmap.hpp
CHANGED
@@ -51,7 +51,7 @@ namespace Gosu
|
|
51
51
|
//! clipped away.
|
52
52
|
void insert(const Bitmap& source, int x, int y, unsigned srcX,
|
53
53
|
unsigned srcY, unsigned srcWidth, unsigned srcHeight);
|
54
|
-
|
54
|
+
|
55
55
|
//! Direct access to the array of color values. May be useful for optimized
|
56
56
|
//! OpenGL operations.
|
57
57
|
const Color* data() const { return &pixels[0]; }
|
@@ -70,7 +70,7 @@ namespace Gosu
|
|
70
70
|
//! Saves a Bitmap to a file.
|
71
71
|
void saveImageFile(const Bitmap& bitmap, const std::wstring& filename);
|
72
72
|
//! Saves a Bitmap to an arbitrary resource.
|
73
|
-
void saveImageFile(const Bitmap& bitmap,
|
73
|
+
void saveImageFile(const Bitmap& bitmap, Writer writer,
|
74
74
|
const std::wstring& formatHint = L"png");
|
75
75
|
|
76
76
|
//! Set the alpha value of all pixels which are equal to the color key
|
@@ -84,7 +84,7 @@ namespace Gosu
|
|
84
84
|
|
85
85
|
void applyBorderFlags(Bitmap& dest, const Bitmap& source,
|
86
86
|
unsigned srcX, unsigned srcY, unsigned srcWidth, unsigned srcHeight,
|
87
|
-
unsigned borderFlags);
|
87
|
+
unsigned borderFlags);
|
88
88
|
|
89
89
|
// Use loadImageFile/saveImageFile instead.
|
90
90
|
GOSU_DEPRECATED Reader loadFromBMP(Bitmap& bmp, Reader reader);
|
data/Gosu/Directories.hpp
CHANGED
@@ -8,16 +8,19 @@
|
|
8
8
|
|
9
9
|
namespace Gosu
|
10
10
|
{
|
11
|
+
//! Changes the current directory to the result of resourcePrefix().
|
12
|
+
void useResourceDirectory();
|
13
|
+
|
11
14
|
//! Prefix for a program's own resources.
|
12
15
|
//! On Windows, the executable's containing directory.
|
13
16
|
//! On OS X, the application's Resources subdirectory.
|
14
|
-
//! On Linux, the current directory.
|
17
|
+
//! On Linux, the current directory (empty string).
|
15
18
|
std::wstring resourcePrefix();
|
16
19
|
|
17
20
|
//! Prefix for resources of a group of programs.
|
18
21
|
//! On Windows, the executable's containing directory.
|
19
22
|
//! On OS X, the application's containing subdirectory.
|
20
|
-
//! On Linux, the current directory.
|
23
|
+
//! On Linux, the current directory (empty string).
|
21
24
|
std::wstring sharedResourcePrefix();
|
22
25
|
|
23
26
|
//! Prefix for user settings.
|
@@ -26,7 +29,7 @@ namespace Gosu
|
|
26
29
|
//! On Linux, the home directory plus a trailing dot for hidden files.
|
27
30
|
std::wstring userSettingsPrefix();
|
28
31
|
|
29
|
-
//! Prefix for user documents, e.g.
|
32
|
+
//! Prefix for user documents, e.g. saved games.
|
30
33
|
//! On Windows, the My Documents folder.
|
31
34
|
//! On OS X, the user's Documents folder.
|
32
35
|
//! On Linux, the home directory.
|
data/Gosu/Gosu.hpp
CHANGED
data/Gosu/GraphicsBase.hpp
CHANGED
@@ -68,19 +68,23 @@ namespace Gosu
|
|
68
68
|
taJustify
|
69
69
|
};
|
70
70
|
|
71
|
+
//! Flags that affect the tileability or interpolation of an image.
|
71
72
|
enum ImageFlags
|
72
73
|
{
|
73
|
-
//! Flags that affect the tileability of an image.
|
74
74
|
ifSmooth = 0,
|
75
|
+
|
75
76
|
// Note: No constant for '1', but Gosu treats '1' as ifTileable for
|
76
|
-
// backward compatibility reasons (this used to be a bool).
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
77
|
+
// backward compatibility reasons (this parameter used to be a bool).
|
78
|
+
|
79
|
+
ifTileableLeft = 1 << 1,
|
80
|
+
ifTileableTop = 1 << 2,
|
81
|
+
ifTileableRight = 1 << 3,
|
82
|
+
ifTileableBottom = 1 << 4,
|
83
|
+
ifTileable = ifTileableLeft | ifTileableTop | ifTileableRight | ifTileableBottom,
|
82
84
|
|
83
|
-
|
85
|
+
//! Apply nearest-neighbor interpolation when scaling this image up or
|
86
|
+
//! down.
|
87
|
+
ifRetro = 1 << 5
|
84
88
|
};
|
85
89
|
|
86
90
|
#ifdef GOSU_IS_MAC
|
data/Gosu/Input.hpp
CHANGED
@@ -9,18 +9,6 @@
|
|
9
9
|
#include <Gosu/Buttons.hpp>
|
10
10
|
#include <Gosu/TR1.hpp>
|
11
11
|
|
12
|
-
#ifdef GOSU_IS_WIN
|
13
|
-
#ifndef NOMINMAX
|
14
|
-
#define NOMINMAX
|
15
|
-
#endif
|
16
|
-
#include <windows.h>
|
17
|
-
#endif
|
18
|
-
|
19
|
-
#ifdef GOSU_IS_X
|
20
|
-
#include <X11/Xlib.h>
|
21
|
-
#include <X11/Xutil.h>
|
22
|
-
#endif
|
23
|
-
|
24
12
|
#include <vector>
|
25
13
|
|
26
14
|
namespace Gosu
|
@@ -123,9 +111,10 @@ namespace Gosu
|
|
123
111
|
const Touches& currentTouches() const;
|
124
112
|
|
125
113
|
//! Accelerometer positions in all three dimensions (smoothened).
|
126
|
-
|
127
|
-
double
|
128
|
-
double
|
114
|
+
//! Note: Not really deprecated - but temporarily defunct.
|
115
|
+
GOSU_DEPRECATED double accelerometerX() const;
|
116
|
+
GOSU_DEPRECATED double accelerometerY() const;
|
117
|
+
GOSU_DEPRECATED double accelerometerZ() const;
|
129
118
|
|
130
119
|
//! Collects new information about which buttons are pressed, where the
|
131
120
|
//! mouse is and calls onButtonUp/onButtonDown, if assigned.
|
@@ -137,7 +126,7 @@ namespace Gosu
|
|
137
126
|
|
138
127
|
//! Assignable events that are called by update. You can bind these to your own functions.
|
139
128
|
//! If you use the Window class, it will assign these to its own methods.
|
140
|
-
std::tr1::function<void (Touch)> onTouchBegan, onTouchMoved, onTouchEnded;
|
129
|
+
std::tr1::function<void (Touch)> onTouchBegan, onTouchMoved, onTouchEnded, onTouchCancelled;
|
141
130
|
|
142
131
|
//! Returns the currently active TextInput instance, or 0.
|
143
132
|
TextInput* textInput() const;
|
data/Gosu/Platform.hpp
CHANGED
data/Gosu/Version.hpp
CHANGED
@@ -2,17 +2,15 @@
|
|
2
2
|
#define GOSU_VERSION_HPP
|
3
3
|
|
4
4
|
#define GOSU_MAJOR_VERSION 0
|
5
|
-
#define GOSU_MINOR_VERSION
|
6
|
-
#define GOSU_POINT_VERSION
|
7
|
-
#define GOSU_VERSION "0.
|
5
|
+
#define GOSU_MINOR_VERSION 10
|
6
|
+
#define GOSU_POINT_VERSION 0
|
7
|
+
#define GOSU_VERSION "0.10.0"
|
8
8
|
|
9
9
|
#define GOSU_COPYRIGHT_NOTICE \
|
10
10
|
"This software uses the following third-party libraries:\n" \
|
11
11
|
"\n" \
|
12
12
|
"Gosu, http://www.libgosu.org, MIT License, http://opensource.org/licenses/MIT\n" \
|
13
13
|
"SDL 2, http://www.libsdl.org, MIT License, http://opensource.org/licenses/MIT\n" \
|
14
|
-
"FreeImage, http://freeimage.sourceforge.net, FreeImage Public License\n" \
|
15
|
-
"libogg & libvorbis, http://www.xiph.org, BSD License, 3-Clause Version, http://www.xiph.org/licenses/bsd\n" \
|
16
14
|
"libsndfile, http://www.mega-nerd.com/libsndfile, GNU LGPL 3, http://www.gnu.org/copyleft/lesser.html\n" \
|
17
15
|
"OpenAL Soft, http://kcat.strangesoft.net/openal.html, GNU LGPL 2, http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html\n"
|
18
16
|
|
data/Gosu/Window.hpp
CHANGED
@@ -107,6 +107,12 @@ namespace Gosu
|
|
107
107
|
// Ignore when SWIG is wrapping this class for Ruby/Gosu.
|
108
108
|
#ifndef SWIG
|
109
109
|
|
110
|
+
// Callbacks for touch events. So far these are only used on iOS.
|
111
|
+
virtual void touchBegan(Touch touch) {}
|
112
|
+
virtual void touchMoved(Touch touch) {}
|
113
|
+
virtual void touchEnded(Touch touch) {}
|
114
|
+
virtual void touchCancelled(Touch touch) {}
|
115
|
+
|
110
116
|
const Graphics& graphics() const;
|
111
117
|
Graphics& graphics();
|
112
118
|
|
@@ -114,14 +120,7 @@ namespace Gosu
|
|
114
120
|
Input& input();
|
115
121
|
|
116
122
|
#ifdef GOSU_IS_IPHONE
|
117
|
-
void*
|
118
|
-
// iPhone-only callbacks for touch events.
|
119
|
-
// Note that it does not hurt to override them even if you compile
|
120
|
-
// for another platform; if you don't specify "virtual" the code
|
121
|
-
// should even be stripped away cleanly.
|
122
|
-
virtual void touchBegan(Touch touch) {}
|
123
|
-
virtual void touchMoved(Touch touch) {}
|
124
|
-
virtual void touchEnded(Touch touch) {}
|
123
|
+
void* UIWindow() const;
|
125
124
|
#endif
|
126
125
|
|
127
126
|
GOSU_DEPRECATED const Audio& audio() const;
|
data/README.txt
CHANGED
@@ -5,11 +5,11 @@ links to all relevant information.
|
|
5
5
|
|
6
6
|
The actual source code, wiki, issue tracker etc. are all hosted on GitHub:
|
7
7
|
|
8
|
-
http://github.com/
|
8
|
+
http://github.com/gosu/gosu/
|
9
9
|
|
10
10
|
The best entry point into Gosu's documentation is the wiki home page:
|
11
11
|
|
12
|
-
http://github.com/
|
12
|
+
http://github.com/gosu/gosu/wiki
|
13
13
|
|
14
14
|
Try doing the tutorial there if you don't know how to start out. Or look at
|
15
15
|
one of the games in the Gosu Users board.
|
@@ -18,7 +18,7 @@ one of the games in the Gosu Users board.
|
|
18
18
|
port and transmogrify all parts of it. The only license that may affect you by
|
19
19
|
indirection is libogg's (BSD-style). If you release a Gosu game in any common
|
20
20
|
binary form, you will need to mention use of libogg and libvorbis somewhere.
|
21
|
-
|
21
|
+
|
22
22
|
Complaints, questions, feedback?
|
23
23
|
* Visit the boards, http://www.libgosu.org/
|
24
24
|
* try your luck in the chat, irc://irc.freenode.org/gosu
|
data/ext/gosu/extconf.rb
CHANGED
@@ -19,8 +19,7 @@ puts
|
|
19
19
|
|
20
20
|
BASE_FILES = %w(
|
21
21
|
Bitmap/Bitmap.cpp
|
22
|
-
Bitmap/
|
23
|
-
Bitmap/BitmapUtils.cpp
|
22
|
+
Bitmap/BitmapIO.cpp
|
24
23
|
DirectoriesUnix.cpp
|
25
24
|
FileUnix.cpp
|
26
25
|
Graphics/BlockAllocator.cpp
|
@@ -45,8 +44,7 @@ BASE_FILES = %w(
|
|
45
44
|
)
|
46
45
|
|
47
46
|
MAC_FILES = %w(
|
48
|
-
Audio/
|
49
|
-
Bitmap/BitmapApple.mm
|
47
|
+
Audio/Audio.mm
|
50
48
|
Graphics/ResolutionApple.mm
|
51
49
|
Text/TextApple.mm
|
52
50
|
Text/TextMac.cpp
|
@@ -55,8 +53,7 @@ MAC_FILES = %w(
|
|
55
53
|
)
|
56
54
|
|
57
55
|
LINUX_FILES = %w(
|
58
|
-
Audio/
|
59
|
-
Bitmap/BitmapFreeImage.cpp
|
56
|
+
Audio/Audio.cpp
|
60
57
|
Text/TextUnix.cpp
|
61
58
|
TimingUnix.cpp
|
62
59
|
)
|
@@ -71,38 +68,43 @@ $CXXFLAGS ||= ''
|
|
71
68
|
$INCFLAGS << " -I../.. -I../../src"
|
72
69
|
|
73
70
|
if `uname`.chomp == 'Darwin' then
|
74
|
-
HOMEBREW_DEPENDENCIES = %w(SDL2
|
75
|
-
FRAMEWORKS = %w(AudioToolbox IOKit OpenAL OpenGL
|
71
|
+
HOMEBREW_DEPENDENCIES = %w(SDL2)
|
72
|
+
FRAMEWORKS = %w(AppKit ApplicationServices AudioToolbox Carbon ForceFeedback Foundation IOKit OpenAL OpenGL)
|
76
73
|
|
77
74
|
SOURCE_FILES = BASE_FILES + MAC_FILES
|
78
75
|
|
79
76
|
# To make everything work with the Objective C runtime
|
80
|
-
$CFLAGS << " -
|
77
|
+
$CFLAGS << " -x objective-c -DNDEBUG"
|
81
78
|
# Compile all C++ files as Objective C++ on OS X since mkmf does not support .mm
|
82
79
|
# files.
|
83
80
|
# Also undefine two debug flags that cause exceptions to randomly crash, see:
|
84
81
|
# https://trac.macports.org/ticket/27237#comment:21
|
85
82
|
# http://newartisans.com/2009/10/a-c-gotcha-on-snow-leopard/#comment-893
|
86
|
-
$CXXFLAGS << " -
|
83
|
+
$CXXFLAGS << " -x objective-c++ -U_GLIBCXX_DEBUG -U_GLIBCXX_DEBUG_PEDANTIC"
|
84
|
+
|
85
|
+
# Enable C++ 11 on Mavericks and above.
|
87
86
|
if `uname -r`.to_i >= 13 then
|
87
|
+
$CXXFLAGS << " -std=gnu++11"
|
88
|
+
|
88
89
|
# rvm-specific fix:
|
89
90
|
# Explicitly set libc++ as the C++ standard library. Otherwise the gem will
|
90
91
|
# end up being compiled against libstdc++, but linked against libc++, and
|
91
92
|
# fail to load, see: https://github.com/shawn42/gamebox/issues/96
|
92
93
|
$CXXFLAGS << " -stdlib=libc++"
|
93
|
-
# Enable C++ 11 on Mavericks and above. Gosu will not compile without this,
|
94
|
-
# as
|
95
|
-
$CXXFLAGS << " -std=gnu++11"
|
96
94
|
end
|
97
95
|
|
98
|
-
|
96
|
+
# Dependencies...
|
97
|
+
$CFLAGS << " -I/usr/local/include"
|
98
|
+
$CXXFLAGS << " -I/usr/local/include -I/usr/local/include/SDL2"
|
99
|
+
$LDFLAGS << " -liconv"
|
99
100
|
|
100
101
|
if enable_config('static-homebrew-dependencies') then
|
101
102
|
# TODO: For some reason this only works after deleting both SDL2 dylib files from /usr/local/lib.
|
102
103
|
# Otherwise, the resulting gosu.bundle is still dependent on libSDL2-2.0.0.dylib, see `otool -L gosu.bundle`
|
103
104
|
$LDFLAGS << HOMEBREW_DEPENDENCIES.map { |lib| " /usr/local/lib/lib#{lib}.a" }.join
|
104
105
|
else
|
105
|
-
$LDFLAGS << " -L/usr/local/lib
|
106
|
+
$LDFLAGS << " -L/usr/local/lib"
|
107
|
+
$LDFLAGS << HOMEBREW_DEPENDENCIES.map { |lib| " -l#{lib}" }.join
|
106
108
|
end
|
107
109
|
|
108
110
|
$LDFLAGS << FRAMEWORKS.map { |f| " -framework #{f}" }.join
|
@@ -125,7 +127,6 @@ else
|
|
125
127
|
pkg_config 'sndfile'
|
126
128
|
|
127
129
|
have_header 'SDL_ttf.h' if have_library('SDL2_ttf', 'TTF_RenderUTF8_Blended')
|
128
|
-
have_header 'FreeImage.h' if have_library('freeimage', 'FreeImage_ConvertFromRawBits')
|
129
130
|
have_header 'AL/al.h' if have_library('openal')
|
130
131
|
end
|
131
132
|
|
data/ext/gosu/gosu_wrap.cxx
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* ----------------------------------------------------------------------------
|
2
2
|
* This file was automatically generated by SWIG (http://www.swig.org).
|
3
|
-
* Version 3.0.
|
3
|
+
* Version 3.0.6
|
4
4
|
*
|
5
5
|
* This file is not intended to be easily readable and contains a number of
|
6
6
|
* coding conventions designed to improve portability and efficiency. Do not make
|
@@ -147,6 +147,19 @@ template <typename T> T SwigValueInit() {
|
|
147
147
|
# define _SCL_SECURE_NO_DEPRECATE
|
148
148
|
#endif
|
149
149
|
|
150
|
+
/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
|
151
|
+
#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
|
152
|
+
# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
|
153
|
+
#endif
|
154
|
+
|
155
|
+
/* Intel's compiler complains if a variable which was never initialised is
|
156
|
+
* cast to void, which is a common idiom which we use to indicate that we
|
157
|
+
* are aware a variable isn't used. So we just silence that warning.
|
158
|
+
* See: https://github.com/swig/swig/issues/192 for more discussion.
|
159
|
+
*/
|
160
|
+
#ifdef __INTEL_COMPILER
|
161
|
+
# pragma warning disable 592
|
162
|
+
#endif
|
150
163
|
|
151
164
|
/* -----------------------------------------------------------------------------
|
152
165
|
* This section contains generic SWIG labels for method/variable
|
@@ -256,6 +269,19 @@ template <typename T> T SwigValueInit() {
|
|
256
269
|
# define _SCL_SECURE_NO_DEPRECATE
|
257
270
|
#endif
|
258
271
|
|
272
|
+
/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
|
273
|
+
#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
|
274
|
+
# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
|
275
|
+
#endif
|
276
|
+
|
277
|
+
/* Intel's compiler complains if a variable which was never initialised is
|
278
|
+
* cast to void, which is a common idiom which we use to indicate that we
|
279
|
+
* are aware a variable isn't used. So we just silence that warning.
|
280
|
+
* See: https://github.com/swig/swig/issues/192 for more discussion.
|
281
|
+
*/
|
282
|
+
#ifdef __INTEL_COMPILER
|
283
|
+
# pragma warning disable 592
|
284
|
+
#endif
|
259
285
|
|
260
286
|
/* -----------------------------------------------------------------------------
|
261
287
|
* swigrun.swg
|
@@ -1763,6 +1789,21 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
|
|
1763
1789
|
|
1764
1790
|
#define SWIG_exception(code, msg) do { SWIG_Error(code, msg);; } while(0)
|
1765
1791
|
|
1792
|
+
/* -----------------------------------------------------------------------------
|
1793
|
+
* director_common.swg
|
1794
|
+
*
|
1795
|
+
* This file contains support for director classes which is common between
|
1796
|
+
* languages.
|
1797
|
+
* ----------------------------------------------------------------------------- */
|
1798
|
+
|
1799
|
+
/*
|
1800
|
+
Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the
|
1801
|
+
'Swig' namespace. This could be useful for multi-modules projects.
|
1802
|
+
*/
|
1803
|
+
#ifdef SWIG_DIRECTOR_STATIC
|
1804
|
+
/* Force anonymous (static) namespace */
|
1805
|
+
#define Swig
|
1806
|
+
#endif
|
1766
1807
|
/* -----------------------------------------------------------------------------
|
1767
1808
|
* director.swg
|
1768
1809
|
*
|
@@ -2043,7 +2084,7 @@ namespace Swig {
|
|
2043
2084
|
mutable bool swig_disown_flag;
|
2044
2085
|
|
2045
2086
|
public:
|
2046
|
-
/* wrap a Ruby object
|
2087
|
+
/* wrap a Ruby object. */
|
2047
2088
|
Director(VALUE self) : swig_self(self), swig_disown_flag(false) {
|
2048
2089
|
}
|
2049
2090
|
|
@@ -2142,7 +2183,7 @@ static VALUE mGosu;
|
|
2142
2183
|
#define SWIG_RUBY_THREAD_END_BLOCK
|
2143
2184
|
|
2144
2185
|
|
2145
|
-
#define SWIGVERSION
|
2186
|
+
#define SWIGVERSION 0x030006
|
2146
2187
|
#define SWIG_VERSION SWIGVERSION
|
2147
2188
|
|
2148
2189
|
|
@@ -2173,9 +2214,6 @@ static VALUE mGosu;
|
|
2173
2214
|
#undef uint64_t
|
2174
2215
|
|
2175
2216
|
#include <Gosu/Gosu.hpp>
|
2176
|
-
#ifdef GOSU_IS_WIN
|
2177
|
-
#include <FreeImage.h>
|
2178
|
-
#endif
|
2179
2217
|
#include <Gosu/TR1.hpp>
|
2180
2218
|
|
2181
2219
|
namespace Gosu {
|
@@ -2221,30 +2259,6 @@ namespace
|
|
2221
2259
|
|
2222
2260
|
namespace Gosu
|
2223
2261
|
{
|
2224
|
-
#ifdef GOSU_IS_WIN
|
2225
|
-
void requireFreeImageFor(const char* filename)
|
2226
|
-
{
|
2227
|
-
// Catch lazy loading errors on Windows; from MSDN.
|
2228
|
-
#define FACILITY_VISUALCPP ((LONG)0x6d)
|
2229
|
-
#define VcppException(sev,err) ((sev) | (FACILITY_VISUALCPP<<16) | err)
|
2230
|
-
#define BAD_MOD VcppException(ERROR_SEVERITY_ERROR, ERROR_MOD_NOT_FOUND)
|
2231
|
-
|
2232
|
-
__try
|
2233
|
-
{
|
2234
|
-
FreeImage_GetVersion();
|
2235
|
-
}
|
2236
|
-
__except ((GetExceptionCode() == BAD_MOD) ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH)
|
2237
|
-
{
|
2238
|
-
rb_raise(rb_eRuntimeError,
|
2239
|
-
"Could neither load image %s nor locate FreeImage.dll to retry with it",
|
2240
|
-
filename);
|
2241
|
-
}
|
2242
|
-
#undef BAD_MOD
|
2243
|
-
#undef VcppException
|
2244
|
-
#undef FACILITY_VISUALCPP
|
2245
|
-
}
|
2246
|
-
void loadImageFile_FreeImage(Bitmap& result, const std::wstring& filename);
|
2247
|
-
#endif
|
2248
2262
|
void loadBitmap(Bitmap& bitmap, VALUE val)
|
2249
2263
|
{
|
2250
2264
|
// Try to treat as filename first.
|
@@ -2253,25 +2267,8 @@ namespace Gosu
|
|
2253
2267
|
VALUE to_str = rb_funcall(val, rb_intern("to_str"), 0);
|
2254
2268
|
const char* filenameUTF8 = StringValuePtr(to_str);
|
2255
2269
|
std::wstring filename = Gosu::utf8ToWstring(filenameUTF8);
|
2256
|
-
|
2257
|
-
|
2258
|
-
return;
|
2259
|
-
} catch (const std::exception&) {
|
2260
|
-
#ifdef GOSU_IS_WIN
|
2261
|
-
requireFreeImageFor(filenameUTF8);
|
2262
|
-
try {
|
2263
|
-
loadImageFile_FreeImage(bitmap, filename);
|
2264
|
-
}
|
2265
|
-
catch (const std::runtime_error& error) {
|
2266
|
-
rb_raise(rb_eRuntimeError,
|
2267
|
-
"Could not load image %s using either GDI+ or FreeImage: %s",
|
2268
|
-
filenameUTF8, error.what());
|
2269
|
-
}
|
2270
|
-
return;
|
2271
|
-
#else
|
2272
|
-
throw;
|
2273
|
-
#endif
|
2274
|
-
}
|
2270
|
+
loadImageFile(bitmap, filename);
|
2271
|
+
return;
|
2275
2272
|
}
|
2276
2273
|
|
2277
2274
|
// Otherwise, try to call .to_blob on it (works with RMagick, TexPlay etc).
|
@@ -2484,7 +2481,7 @@ SWIG_ruby_failed(void)
|
|
2484
2481
|
}
|
2485
2482
|
|
2486
2483
|
|
2487
|
-
/*@SWIG:/usr/local/Cellar/swig/3.0.
|
2484
|
+
/*@SWIG:/usr/local/Cellar/swig/3.0.6/share/swig/3.0.6/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2488
2485
|
SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args)
|
2489
2486
|
{
|
2490
2487
|
VALUE obj = args[0];
|
@@ -2526,7 +2523,7 @@ SWIG_From_unsigned_SS_int (unsigned int value)
|
|
2526
2523
|
#include <string>
|
2527
2524
|
|
2528
2525
|
|
2529
|
-
/*@SWIG:/usr/local/Cellar/swig/3.0.
|
2526
|
+
/*@SWIG:/usr/local/Cellar/swig/3.0.6/share/swig/3.0.6/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2530
2527
|
SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
|
2531
2528
|
{
|
2532
2529
|
VALUE obj = args[0];
|
@@ -2625,7 +2622,7 @@ SWIG_From_bool (bool value)
|
|
2625
2622
|
}
|
2626
2623
|
|
2627
2624
|
|
2628
|
-
/*@SWIG:/usr/local/Cellar/swig/3.0.
|
2625
|
+
/*@SWIG:/usr/local/Cellar/swig/3.0.6/share/swig/3.0.6/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2629
2626
|
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
|
2630
2627
|
{
|
2631
2628
|
VALUE obj = args[0];
|
@@ -2781,6 +2778,10 @@ SWIGINTERN Gosu::Image *new_Gosu_Image__SWIG_0(VALUE source,VALUE options=0){
|
|
2781
2778
|
if (RTEST(value))
|
2782
2779
|
flags |= Gosu::ifTileable;
|
2783
2780
|
}
|
2781
|
+
else if (!strcmp(keyString, "retro")) {
|
2782
|
+
if (RTEST(value))
|
2783
|
+
flags |= Gosu::ifRetro;
|
2784
|
+
}
|
2784
2785
|
else if (!strcmp(keyString, "rect")) {
|
2785
2786
|
Check_Type(value, T_ARRAY);
|
2786
2787
|
|
@@ -2847,8 +2848,8 @@ SWIGINTERN Gosu::GLTexInfo *Gosu_Image_glTexInfo(Gosu::Image const *self){
|
|
2847
2848
|
return 0;
|
2848
2849
|
}
|
2849
2850
|
SWIGINTERN Gosu::Image *Gosu_Image_subimage(Gosu::Image *self,int x,int y,int w,int h){
|
2850
|
-
|
2851
|
-
return imageData.get() ? new Gosu::Image(imageData) : 0;
|
2851
|
+
GOSU_UNIQUE_PTR<Gosu::ImageData> imageData = self->getData().subimage(x, y, w, h);
|
2852
|
+
return imageData.get() ? new Gosu::Image(GOSU_MOVE_UNIQUE_PTR(imageData)) : 0;
|
2852
2853
|
}
|
2853
2854
|
SWIGINTERN Gosu::Image *Gosu_Image_fromText(std::wstring const &text,unsigned int fontHeight,VALUE options=0){
|
2854
2855
|
std::wstring font = Gosu::defaultFontName();
|
@@ -11094,10 +11095,10 @@ SWIGEXPORT void Init_gosu(void) {
|
|
11094
11095
|
|
11095
11096
|
SWIG_RubyInitializeTrackings();
|
11096
11097
|
rb_define_const(mGosu, "MAJOR_VERSION", SWIG_From_int(static_cast< int >(0)));
|
11097
|
-
rb_define_const(mGosu, "MINOR_VERSION", SWIG_From_int(static_cast< int >(
|
11098
|
-
rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(
|
11099
|
-
rb_define_const(mGosu, "VERSION", SWIG_FromCharPtr("0.
|
11100
|
-
rb_define_const(mGosu, "GOSU_COPYRIGHT_NOTICE", SWIG_FromCharPtr("This software uses the following third-party libraries:\n\nGosu, http://www.libgosu.org, MIT License, http://opensource.org/licenses/MIT\nSDL 2, http://www.libsdl.org, MIT License, http://opensource.org/licenses/MIT\
|
11098
|
+
rb_define_const(mGosu, "MINOR_VERSION", SWIG_From_int(static_cast< int >(10)));
|
11099
|
+
rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(0)));
|
11100
|
+
rb_define_const(mGosu, "VERSION", SWIG_FromCharPtr("0.10.0"));
|
11101
|
+
rb_define_const(mGosu, "GOSU_COPYRIGHT_NOTICE", SWIG_FromCharPtr("This software uses the following third-party libraries:\n\nGosu, http://www.libgosu.org, MIT License, http://opensource.org/licenses/MIT\nSDL 2, http://www.libsdl.org, MIT License, http://opensource.org/licenses/MIT\nlibsndfile, http://www.mega-nerd.com/libsndfile, GNU LGPL 3, http://www.gnu.org/copyleft/lesser.html\nOpenAL Soft, http://kcat.strangesoft.net/openal.html, GNU LGPL 2, http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html\n"));
|
11101
11102
|
rb_define_module_function(mGosu, "milliseconds", VALUEFUNC(_wrap_milliseconds), -1);
|
11102
11103
|
rb_define_module_function(mGosu, "random", VALUEFUNC(_wrap_random), -1);
|
11103
11104
|
rb_define_module_function(mGosu, "degrees_to_radians", VALUEFUNC(_wrap_degrees_to_radians), -1);
|