gosu 0.8.7.2-x86-mingw32 → 0.9.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gosu/Audio.hpp +1 -0
- data/Gosu/Font.hpp +8 -4
- data/Gosu/Graphics.hpp +28 -18
- data/Gosu/GraphicsBase.hpp +17 -13
- data/Gosu/Image.hpp +54 -45
- data/Gosu/Input.hpp +5 -5
- data/Gosu/Version.hpp +3 -3
- data/Gosu/Window.hpp +1 -8
- data/lib/1.8/gosu.so +0 -0
- data/lib/1.9/gosu.so +0 -0
- data/lib/2.0/gosu.so +0 -0
- data/lib/2.1/gosu.so +0 -0
- data/lib/gosu/patches.rb +71 -35
- data/lib/gosu/preview.rb +9 -142
- data/lib/gosu/swig_patches.rb +20 -10
- metadata +3 -26
- data/examples/ChipmunkIntegration.rb +0 -275
- data/examples/CptnRuby.rb +0 -223
- data/examples/GosuZen.rb +0 -68
- data/examples/MoreChipmunkAndRMagick.rb +0 -155
- data/examples/OpenGLIntegration.rb +0 -226
- data/examples/RMagickIntegration.rb +0 -417
- data/examples/TextInput.rb +0 -154
- data/examples/Tutorial.rb +0 -131
- data/examples/media/Beep.wav +0 -0
- data/examples/media/CptnRuby Gem.png +0 -0
- data/examples/media/CptnRuby Map.txt +0 -25
- data/examples/media/CptnRuby Tileset.png +0 -0
- data/examples/media/CptnRuby.png +0 -0
- data/examples/media/Cursor.png +0 -0
- data/examples/media/Earth.png +0 -0
- data/examples/media/Explosion.wav +0 -0
- data/examples/media/Landscape.svg +0 -10
- data/examples/media/LargeStar.png +0 -0
- data/examples/media/Smoke.png +0 -0
- data/examples/media/Soldier.png +0 -0
- data/examples/media/Space.png +0 -0
- data/examples/media/Star.png +0 -0
- data/examples/media/Starfighter.bmp +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9bf6db63e179ce1295a017f4b3ca4d64bc53207
|
4
|
+
data.tar.gz: 6aef82cda1def8d81db61e5de500080aa854963d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 779236f756b27a6931bd192a6eb50cd4cf2ff7ebbc4c18fba0885443161311867f624e7d3597fef691e73c58aac3d1ffc67ddc2327a1deadf9bd5ffcdcbf216a
|
7
|
+
data.tar.gz: 62e5571f594024e02e06a57b4a3122b7a1ff8a65539dafce3b5e669ebd0f54107d45385367dab400299f25f626aef510b22e07962c26ef0c0869e09efa94fbd3
|
data/Gosu/Audio.hpp
CHANGED
data/Gosu/Font.hpp
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
#include <Gosu/Color.hpp>
|
9
9
|
#include <Gosu/GraphicsBase.hpp>
|
10
10
|
#include <Gosu/Platform.hpp>
|
11
|
+
#include <Gosu/Text.hpp>
|
11
12
|
#include <Gosu/TR1.hpp>
|
12
13
|
#include <string>
|
13
14
|
|
@@ -29,8 +30,8 @@ namespace Gosu
|
|
29
30
|
//! \param fontHeight Height of the font, in pixels.
|
30
31
|
//! \param fontFlags Flags used to render individual characters of
|
31
32
|
//! the font.
|
32
|
-
Font(
|
33
|
-
unsigned
|
33
|
+
Font(unsigned fontHeight, const std::wstring& fontName = defaultFontName(),
|
34
|
+
unsigned fontFlags = ffBold);
|
34
35
|
|
35
36
|
//! Returns the name of the font that was used to create it.
|
36
37
|
std::wstring name() const;
|
@@ -70,10 +71,13 @@ namespace Gosu
|
|
70
71
|
void setImage(wchar_t wc, const Gosu::Image& image);
|
71
72
|
|
72
73
|
#ifndef SWIG
|
74
|
+
GOSU_DEPRECATED Font(Graphics& graphics, const std::wstring& fontName,
|
75
|
+
unsigned fontHeight, unsigned fontFlags = ffBold);
|
76
|
+
|
73
77
|
GOSU_DEPRECATED
|
74
78
|
#endif
|
75
|
-
//! DEPRECATED: Analogous to draw, but rotates the text by a given angle.
|
76
|
-
//!
|
79
|
+
//! DEPRECATED: Analogous to draw, but rotates the text by a given angle.
|
80
|
+
//! Use Graphics::pushTransform to achieve the same effect.
|
77
81
|
void drawRot(const std::wstring& text, double x, double y, ZPos z, double angle,
|
78
82
|
double factorX = 1, double factorY = 1,
|
79
83
|
Color c = Color::WHITE, AlphaMode mode = amDefault) const;
|
data/Gosu/Graphics.hpp
CHANGED
@@ -12,6 +12,8 @@
|
|
12
12
|
|
13
13
|
namespace Gosu
|
14
14
|
{
|
15
|
+
struct DrawOp;
|
16
|
+
|
15
17
|
//! Returns the maximum size of an texture that will be allocated
|
16
18
|
//! internally by Gosu.
|
17
19
|
//! Useful when extending Gosu using OpenGL.
|
@@ -20,9 +22,15 @@ namespace Gosu
|
|
20
22
|
//! Serves as the target of all drawing and provides primitive drawing
|
21
23
|
//! functionality.
|
22
24
|
//! Usually created internally by Gosu::Window.
|
25
|
+
//
|
26
|
+
// TODO: This class should be separated into a Gosu::Viewport class, which
|
27
|
+
// carries the width/height/fullscreen attributes, and global Gosu::drawFoo
|
28
|
+
// functions. A Window then has a Viewport, and in theory, multiple windows
|
29
|
+
// could have their own viewports etc.
|
23
30
|
class Graphics
|
24
31
|
{
|
25
32
|
struct Impl;
|
33
|
+
|
26
34
|
const GOSU_UNIQUE_PTR<Impl> pimpl;
|
27
35
|
|
28
36
|
#if defined(GOSU_CPP11_ENABLED)
|
@@ -37,7 +45,6 @@ namespace Gosu
|
|
37
45
|
Graphics(unsigned physicalWidth, unsigned physicalHeight, bool fullscreen);
|
38
46
|
~Graphics();
|
39
47
|
|
40
|
-
// TODO: Replace by setBaseTransform()
|
41
48
|
void setResolution(unsigned virtualWidth, unsigned virtualHeight,
|
42
49
|
double horizontalBlackBarWidth = 0, double verticalBlackBarHeight = 0);
|
43
50
|
|
@@ -50,65 +57,68 @@ namespace Gosu
|
|
50
57
|
bool begin(Color clearWithColor = Color::BLACK);
|
51
58
|
//! Every call to begin must have a matching call to end.
|
52
59
|
void end();
|
60
|
+
|
53
61
|
//! Flushes the Z queue to the screen and starts a new one.
|
54
62
|
//! Useful for games that are *very* composite in nature (splitscreen).
|
55
|
-
void flush();
|
63
|
+
static void flush();
|
56
64
|
|
57
65
|
//! Finishes all pending Gosu drawing operations and executes
|
58
66
|
//! the following OpenGL code in a clean environment.
|
59
|
-
void beginGL();
|
67
|
+
static void beginGL();
|
60
68
|
//! Resets Gosu into its default rendering state.
|
61
|
-
void endGL();
|
69
|
+
static void endGL();
|
62
70
|
//! Schedules a custom GL functor to be executed at a certain Z level.
|
63
71
|
//! The functor is called in a clean GL context (as given by beginGL/endGL).
|
64
72
|
//! Gosu's rendering up to the Z level may not yet have been glFlush()ed.
|
65
73
|
//! Note: You may not call any Gosu rendering functions from within the
|
66
74
|
//! functor, and you must schedule it from within Window::draw's call tree.
|
67
|
-
void scheduleGL(const std::tr1::function<void()>& functor, ZPos z);
|
75
|
+
static void scheduleGL(const std::tr1::function<void()>& functor, ZPos z);
|
68
76
|
|
69
77
|
//! Enables clipping to a specified rectangle.
|
70
|
-
void beginClipping(double x, double y, double width, double height);
|
78
|
+
static void beginClipping(double x, double y, double width, double height);
|
71
79
|
//! Disables clipping.
|
72
|
-
void endClipping();
|
80
|
+
static void endClipping();
|
73
81
|
|
74
82
|
//! Starts recording a macro. Cannot be nested.
|
75
|
-
void beginRecording();
|
83
|
+
static void beginRecording();
|
76
84
|
//! Finishes building the macro and returns it as a drawable object.
|
77
85
|
//! The width and height affect nothing about the recording process,
|
78
86
|
//! the resulting macro will simply return these values when you ask
|
79
87
|
//! it.
|
80
88
|
//! Most usually, the return value is passed to Image::Image().
|
81
|
-
GOSU_UNIQUE_PTR<Gosu::ImageData> endRecording(int width, int height);
|
89
|
+
static GOSU_UNIQUE_PTR<Gosu::ImageData> endRecording(int width, int height);
|
82
90
|
|
83
91
|
//! Pushes one transformation onto the transformation stack.
|
84
|
-
void pushTransform(const Transform& transform);
|
92
|
+
static void pushTransform(const Transform& transform);
|
85
93
|
//! Pops one transformation from the transformation stack.
|
86
|
-
void popTransform();
|
94
|
+
static void popTransform();
|
87
95
|
|
88
96
|
//! Draws a line from one point to another (last pixel exclusive).
|
89
97
|
//! Note: OpenGL lines are not reliable at all and may have a missing pixel at the start
|
90
98
|
//! or end point. Please only use this for debugging purposes. Otherwise, use a quad or
|
91
99
|
//! image to simulate lines, or contribute a better drawLine to Gosu.
|
92
|
-
void drawLine(double x1, double y1, Color c1,
|
100
|
+
static void drawLine(double x1, double y1, Color c1,
|
93
101
|
double x2, double y2, Color c2,
|
94
102
|
ZPos z, AlphaMode mode = amDefault);
|
95
103
|
|
96
|
-
void drawTriangle(double x1, double y1, Color c1,
|
104
|
+
static void drawTriangle(double x1, double y1, Color c1,
|
97
105
|
double x2, double y2, Color c2,
|
98
106
|
double x3, double y3, Color c3,
|
99
107
|
ZPos z, AlphaMode mode = amDefault);
|
100
108
|
|
101
|
-
void drawQuad(double x1, double y1, Color c1,
|
109
|
+
static void drawQuad(double x1, double y1, Color c1,
|
102
110
|
double x2, double y2, Color c2,
|
103
111
|
double x3, double y3, Color c3,
|
104
112
|
double x4, double y4, Color c4,
|
105
113
|
ZPos z, AlphaMode mode = amDefault);
|
114
|
+
|
115
|
+
//! For internal use only.
|
116
|
+
static void scheduleDrawOp(const DrawOp& op);
|
106
117
|
|
107
|
-
//! Turns a portion of a bitmap into something that can be drawn on
|
108
|
-
|
109
|
-
GOSU_UNIQUE_PTR<ImageData> createImage(const Bitmap& src,
|
118
|
+
//! Turns a portion of a bitmap into something that can be drawn on a Graphics object.
|
119
|
+
static GOSU_UNIQUE_PTR<ImageData> createImage(const Bitmap& src,
|
110
120
|
unsigned srcX, unsigned srcY, unsigned srcWidth, unsigned srcHeight,
|
111
|
-
unsigned
|
121
|
+
unsigned imageFlags);
|
112
122
|
};
|
113
123
|
}
|
114
124
|
|
data/Gosu/GraphicsBase.hpp
CHANGED
@@ -31,11 +31,11 @@ namespace Gosu
|
|
31
31
|
//! The color's channels will be multiplied with each other.
|
32
32
|
MULTIPLY
|
33
33
|
};
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
constexpr AlphaMode amDefault = AlphaMode::DEFAULT;
|
35
|
+
constexpr AlphaMode amInterpolate = AlphaMode::INTERPOLATE;
|
36
|
+
constexpr AlphaMode amAdd = AlphaMode::ADD;
|
37
|
+
constexpr AlphaMode amAdditive = AlphaMode::ADD;
|
38
|
+
constexpr AlphaMode amMultiply = AlphaMode::MULTIPLY;
|
39
39
|
#else
|
40
40
|
enum AlphaMode
|
41
41
|
{
|
@@ -68,15 +68,19 @@ namespace Gosu
|
|
68
68
|
taJustify
|
69
69
|
};
|
70
70
|
|
71
|
-
|
72
|
-
enum BorderFlags
|
71
|
+
enum ImageFlags
|
73
72
|
{
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
73
|
+
//! Flags that affect the tileability of an image.
|
74
|
+
ifSmooth = 0,
|
75
|
+
// Note: No constant for '1', but Gosu treats '1' as ifTileable for
|
76
|
+
// backward compatibility reasons (this used to be a bool).
|
77
|
+
ifTileableLeft = 2,
|
78
|
+
ifTileableTop = 4,
|
79
|
+
ifTileableRight = 8,
|
80
|
+
ifTileableBottom = 16,
|
81
|
+
ifTileable = ifTileableLeft | ifTileableTop | ifTileableRight | ifTileableBottom
|
82
|
+
|
83
|
+
// TODO - ifNearestNeighbor to replace undocumentedRetrofication.
|
80
84
|
};
|
81
85
|
|
82
86
|
#ifdef GOSU_IS_MAC
|
data/Gosu/Image.hpp
CHANGED
@@ -19,31 +19,29 @@ namespace Gosu
|
|
19
19
|
std::tr1::shared_ptr<ImageData> data;
|
20
20
|
|
21
21
|
public:
|
22
|
-
//! Loads an image from a given filename
|
23
|
-
//!
|
24
|
-
//!
|
25
|
-
//!
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
//! Loads a portion of the the image at the given filename
|
30
|
-
//!
|
31
|
-
//!
|
32
|
-
//!
|
33
|
-
|
34
|
-
Image(Graphics& graphics, const std::wstring& filename, unsigned srcX,
|
22
|
+
//! Loads an image from a given filename.
|
23
|
+
//!
|
24
|
+
//! A color key of #ff00ff is automatically applied to BMP image files.
|
25
|
+
//! For more flexibility, use the corresponding constructor that uses a Bitmap object.
|
26
|
+
explicit Image(const std::wstring& filename,
|
27
|
+
unsigned imageFlags = ifSmooth);
|
28
|
+
|
29
|
+
//! Loads a portion of the the image at the given filename..
|
30
|
+
//!
|
31
|
+
//! A color key of #ff00ff is automatically applied to BMP image files.
|
32
|
+
//! For more flexibility, use the corresponding constructor that uses a Bitmap object.
|
33
|
+
Image(const std::wstring& filename, unsigned srcX,
|
35
34
|
unsigned srcY, unsigned srcWidth, unsigned srcHeight,
|
36
|
-
|
35
|
+
unsigned imageFlags = ifSmooth);
|
37
36
|
|
38
|
-
//! Converts the given bitmap into an image
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
//! Converts a portion of the given bitmap into an image
|
43
|
-
|
44
|
-
Image(Graphics& graphics, const Bitmap& source, unsigned srcX,
|
37
|
+
//! Converts the given bitmap into an image.
|
38
|
+
explicit Image(const Bitmap& source,
|
39
|
+
unsigned imageFlags = ifSmooth);
|
40
|
+
|
41
|
+
//! Converts a portion of the given bitmap into an image.
|
42
|
+
Image(const Bitmap& source, unsigned srcX,
|
45
43
|
unsigned srcY, unsigned srcWidth, unsigned srcHeight,
|
46
|
-
|
44
|
+
unsigned imageFlags = ifSmooth);
|
47
45
|
|
48
46
|
//! Creates an Image from a user-supplied instance of the ImageData interface.
|
49
47
|
explicit Image(GOSU_UNIQUE_PTR<ImageData> data);
|
@@ -56,8 +54,8 @@ namespace Gosu
|
|
56
54
|
double factorX = 1, double factorY = 1,
|
57
55
|
Color c = Color::WHITE,
|
58
56
|
AlphaMode mode = amDefault) const;
|
59
|
-
//! Like draw(), but
|
60
|
-
//!
|
57
|
+
//! Like draw(), but with modulation colors for all four corners.
|
58
|
+
//! TODO: This can be an overload of draw() - in any case the name is terrible.
|
61
59
|
void drawMod(double x, double y, ZPos z,
|
62
60
|
double factorX, double factorY,
|
63
61
|
Color c1, Color c2, Color c3, Color c4,
|
@@ -77,46 +75,57 @@ namespace Gosu
|
|
77
75
|
double factorX = 1, double factorY = 1,
|
78
76
|
Color c = Color::WHITE,
|
79
77
|
AlphaMode mode = amDefault) const;
|
80
|
-
|
78
|
+
|
79
|
+
#ifndef SWIG
|
81
80
|
//! Provides access to the underlying image data object.
|
82
81
|
ImageData& getData() const;
|
82
|
+
|
83
|
+
GOSU_DEPRECATED Image(Graphics& graphics, const std::wstring& filename,
|
84
|
+
bool tileable = false);
|
85
|
+
GOSU_DEPRECATED Image(Graphics& graphics, const std::wstring& filename, unsigned srcX,
|
86
|
+
unsigned srcY, unsigned srcWidth, unsigned srcHeight,
|
87
|
+
bool tileable = false);
|
88
|
+
GOSU_DEPRECATED Image(Graphics& graphics, const Bitmap& source,
|
89
|
+
bool tileable = false);
|
90
|
+
GOSU_DEPRECATED Image(Graphics& graphics, const Bitmap& source, unsigned srcX,
|
91
|
+
unsigned srcY, unsigned srcWidth, unsigned srcHeight,
|
92
|
+
bool tileable = false);
|
93
|
+
#endif
|
83
94
|
};
|
84
95
|
|
85
|
-
|
86
|
-
|
96
|
+
#ifndef SWIG
|
97
|
+
//! Convenience function that slices an image file into a grid and creates images from them.
|
98
|
+
//! \param tileWidth If positive, specifies the width of one tile in pixels.
|
99
|
+
//! If negative, the bitmap is divided into -tileWidth rows.
|
100
|
+
//! \param tileHeight See tileWidth.
|
101
|
+
std::vector<Gosu::Image> loadTiles(const Bitmap& bmp,
|
102
|
+
int tileWidth, int tileHeight, unsigned imageFlags = ifSmooth);
|
87
103
|
|
88
|
-
//! Convenience function that
|
89
|
-
//!
|
90
|
-
//!
|
91
|
-
//! pixels. If negative, the bitmap is divided into -tileWidth rows.
|
104
|
+
//! Convenience function that slices a bitmap into a grid and creates images from them.
|
105
|
+
//! \param tileWidth If positive, specifies the width of one tile in pixels.
|
106
|
+
//! If negative, the bitmap is divided into -tileWidth rows.
|
92
107
|
//! \param tileHeight See tileWidth.
|
93
|
-
|
94
|
-
|
95
|
-
|
108
|
+
std::vector<Gosu::Image> loadTiles(const std::wstring& filename,
|
109
|
+
int tileWidth, int tileHeight, unsigned imageFlags = ifSmooth);
|
110
|
+
|
111
|
+
GOSU_DEPRECATED std::vector<Gosu::Image> loadTiles(Graphics& graphics, const Bitmap& bmp, int tileWidth, int tileHeight, bool tileable);
|
112
|
+
GOSU_DEPRECATED std::vector<Gosu::Image> loadTiles(Graphics& graphics, const std::wstring& bmp, int tileWidth, int tileHeight, bool tileable);
|
96
113
|
template<typename Container>
|
97
|
-
void imagesFromTiledBitmap(Graphics& graphics, const std::wstring& filename, int tileWidth, int tileHeight, bool tileable, Container& appendTo)
|
114
|
+
GOSU_DEPRECATED void imagesFromTiledBitmap(Graphics& graphics, const std::wstring& filename, int tileWidth, int tileHeight, bool tileable, Container& appendTo)
|
98
115
|
{
|
99
116
|
std::vector<Gosu::Image> tiles = loadTiles(graphics, filename, tileWidth, tileHeight, tileable);
|
100
117
|
for (int i = 0, num = tiles.size(); i < num; ++i)
|
101
118
|
appendTo.push_back(typename Container::value_type(new Gosu::Image(tiles[i])));
|
102
119
|
}
|
103
|
-
|
104
|
-
//! Convenience function that splits a bitmap into an area of array
|
105
|
-
//! rectangles and creates images from them.
|
106
|
-
//! \param tileWidth If positive, specifies the width of one tile in
|
107
|
-
//! pixels. If negative, the bitmap is divided into -tileWidth rows.
|
108
|
-
//! \param tileHeight See tileWidth.
|
109
|
-
//! \param appendTo STL container to which the images will be appended.
|
110
|
-
//! Must provide a push_back member function; std::vector<std::tr1::shared_ptr<Image>>
|
111
|
-
//! or boost::ptr_vector<Image> are good choices.
|
112
120
|
template<typename Container>
|
113
|
-
void imagesFromTiledBitmap(Graphics& graphics, const Bitmap& bmp,
|
121
|
+
GOSU_DEPRECATED void imagesFromTiledBitmap(Graphics& graphics, const Bitmap& bmp,
|
114
122
|
int tileWidth, int tileHeight, bool tileable, Container& appendTo)
|
115
123
|
{
|
116
124
|
std::vector<Gosu::Image> tiles = loadTiles(graphics, bmp, tileWidth, tileHeight, tileable);
|
117
125
|
for (int i = 0, num = tiles.size(); i < num; ++i)
|
118
126
|
appendTo.push_back(typename Container::value_type(new Gosu::Image(tiles[i])));
|
119
127
|
}
|
128
|
+
#endif
|
120
129
|
}
|
121
130
|
|
122
131
|
#endif
|
data/Gosu/Input.hpp
CHANGED
@@ -103,7 +103,7 @@ namespace Gosu
|
|
103
103
|
|
104
104
|
//! Returns true if a button is currently pressed.
|
105
105
|
//! Updated every tick.
|
106
|
-
bool down(Button btn)
|
106
|
+
static bool down(Button btn);
|
107
107
|
|
108
108
|
//! Returns the horizontal position of the mouse relative to the top
|
109
109
|
//! left corner of the window given to Input's constructor.
|
@@ -112,8 +112,8 @@ namespace Gosu
|
|
112
112
|
double mouseY() const;
|
113
113
|
|
114
114
|
//! Immediately moves the mouse as far towards the desired position
|
115
|
-
//! as possible. x and y are
|
116
|
-
//!
|
115
|
+
//! as possible. x and y are relative to the window, just as in mouseX()
|
116
|
+
//! and mouseY(), so (0, 0) is the top left corner of the window..
|
117
117
|
void setMousePosition(double x, double y);
|
118
118
|
|
119
119
|
// Undocumented for the moment. Also applies to currentTouches().
|
@@ -132,11 +132,11 @@ namespace Gosu
|
|
132
132
|
void update();
|
133
133
|
|
134
134
|
//! Assignable events that are called by update. You can bind these to your own functions.
|
135
|
-
//! If you use the Window class, it will assign
|
135
|
+
//! If you use the Window class, it will assign these to its own methods.
|
136
136
|
std::tr1::function<void (Button)> onButtonDown, onButtonUp;
|
137
137
|
|
138
138
|
//! Assignable events that are called by update. You can bind these to your own functions.
|
139
|
-
//! If you use the Window class, it will assign
|
139
|
+
//! If you use the Window class, it will assign these to its own methods.
|
140
140
|
std::tr1::function<void (Touch)> onTouchBegan, onTouchMoved, onTouchEnded;
|
141
141
|
|
142
142
|
//! Returns the currently active TextInput instance, or 0.
|
data/Gosu/Version.hpp
CHANGED
@@ -2,9 +2,9 @@
|
|
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 9
|
6
|
+
#define GOSU_POINT_VERSION 0
|
7
|
+
#define GOSU_VERSION "0.9.0"
|
8
8
|
|
9
9
|
#define GOSU_COPYRIGHT_NOTICE \
|
10
10
|
"This software uses the following third-party libraries:\n" \
|
data/Gosu/Window.hpp
CHANGED
@@ -57,7 +57,7 @@ namespace Gosu
|
|
57
57
|
//! \param height See width.
|
58
58
|
//! \param updateInterval Interval in milliseconds between two calls
|
59
59
|
//! to the update member function.
|
60
|
-
Window(unsigned width, unsigned height, bool fullscreen,
|
60
|
+
Window(unsigned width, unsigned height, bool fullscreen = false,
|
61
61
|
double updateInterval = 16.666666);
|
62
62
|
virtual ~Window();
|
63
63
|
|
@@ -113,13 +113,6 @@ namespace Gosu
|
|
113
113
|
const Input& input() const;
|
114
114
|
Input& input();
|
115
115
|
|
116
|
-
#ifdef GOSU_IS_UNIX
|
117
|
-
// Context for creating shared contexts.
|
118
|
-
// Only on Unices (so far).
|
119
|
-
typedef std::tr1::shared_ptr<std::tr1::function<void()> > SharedContext;
|
120
|
-
SharedContext createSharedContext();
|
121
|
-
#endif
|
122
|
-
|
123
116
|
#ifdef GOSU_IS_IPHONE
|
124
117
|
void* rootViewController() const;
|
125
118
|
// iPhone-only callbacks for touch events.
|
data/lib/1.8/gosu.so
CHANGED
Binary file
|
data/lib/1.9/gosu.so
CHANGED
Binary file
|
data/lib/2.0/gosu.so
CHANGED
Binary file
|
data/lib/2.1/gosu.so
CHANGED
Binary file
|
data/lib/gosu/patches.rb
CHANGED
@@ -1,76 +1,112 @@
|
|
1
|
-
# Extend Numeric with simple angle conversion methods
|
1
|
+
# Extend Numeric with simple angle conversion methods,
|
2
|
+
# for easier integration with Chipmunk.
|
2
3
|
class ::Numeric
|
3
4
|
def degrees_to_radians
|
4
5
|
self * Math::PI / 180.0
|
5
6
|
end
|
7
|
+
|
6
8
|
def radians_to_degrees
|
7
9
|
self * 180.0 / Math::PI
|
8
10
|
end
|
11
|
+
|
9
12
|
def gosu_to_radians
|
10
13
|
(self - 90) * Math::PI / 180.0
|
11
14
|
end
|
15
|
+
|
12
16
|
def radians_to_gosu
|
13
17
|
self * 180.0 / Math::PI + 90
|
14
18
|
end
|
15
19
|
end
|
16
|
-
|
17
|
-
# Backwards compatibility:
|
20
|
+
|
21
|
+
# Backwards compatibility:
|
22
|
+
# Import constants into Gosu::Button.
|
18
23
|
module Gosu::Button
|
19
24
|
Gosu.constants.each { |c| const_set(c, Gosu.const_get(c)) }
|
20
25
|
end
|
21
26
|
|
22
|
-
# Backwards compatibility:
|
27
|
+
# Backwards compatibility:
|
28
|
+
# The old version of from_text has been deprecated in Gosu 0.9.
|
29
|
+
class Gosu::Image
|
30
|
+
class << self
|
31
|
+
alias from_text_without_window from_text
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.from_text(*args)
|
35
|
+
if args.size == 4
|
36
|
+
from_text_without_window(args[1], args[3], :font => args[2])
|
37
|
+
elsif args.size == 7
|
38
|
+
from_text_without_window(args[1], args[3], :font => args[2],
|
39
|
+
:spacing => args[4], :width => args[5], :align => args[6])
|
40
|
+
else
|
41
|
+
from_text_without_window(*args)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Backwards compatibility:
|
47
|
+
# Passing a Window Sample#initialize has been deprecated in Gosu 0.7.17.
|
23
48
|
class Gosu::Sample
|
24
|
-
alias
|
49
|
+
alias initialize_without_window initialize
|
25
50
|
|
26
51
|
def initialize(*args)
|
27
52
|
args.shift if args.first.is_a? Gosu::Window
|
28
|
-
|
53
|
+
initialize_without_window(*args)
|
29
54
|
end
|
30
55
|
end
|
56
|
+
|
57
|
+
# Backwards compatibility:
|
58
|
+
# Passing a Window to Song#initialize has been deprecated in Gosu 0.7.17.
|
31
59
|
class Gosu::Song
|
32
|
-
alias
|
60
|
+
alias initialize_without_window initialize
|
33
61
|
|
34
62
|
def initialize(*args)
|
35
63
|
args.shift if args.first.is_a? Gosu::Window
|
36
|
-
|
64
|
+
initialize_without_window(*args)
|
37
65
|
end
|
38
66
|
end
|
39
67
|
|
40
|
-
# Color constants
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
def red=; end
|
46
|
-
def green=; end
|
47
|
-
def blue=; end
|
48
|
-
def hue=; end
|
49
|
-
def saturation=; end
|
50
|
-
def value=; end
|
68
|
+
# Color constants.
|
69
|
+
# This is cleaner than having SWIG define them.
|
70
|
+
module Gosu
|
71
|
+
class ImmutableColor < Color
|
72
|
+
private :alpha=, :red=, :green=, :blue=, :hue=, :saturation=, :value=
|
51
73
|
end
|
52
74
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
75
|
+
class Color
|
76
|
+
NONE = Gosu::ImmutableColor.new(0x00_000000)
|
77
|
+
BLACK = Gosu::ImmutableColor.new(0xff_000000)
|
78
|
+
GRAY = Gosu::ImmutableColor.new(0xff_808080)
|
79
|
+
WHITE = Gosu::ImmutableColor.new(0xff_ffffff)
|
80
|
+
AQUA = Gosu::ImmutableColor.new(0xff_00ffff)
|
81
|
+
RED = Gosu::ImmutableColor.new(0xff_ff0000)
|
82
|
+
GREEN = Gosu::ImmutableColor.new(0xff_00ff00)
|
83
|
+
BLUE = Gosu::ImmutableColor.new(0xff_0000ff)
|
84
|
+
YELLOW = Gosu::ImmutableColor.new(0xff_ffff00)
|
85
|
+
FUCHSIA = Gosu::ImmutableColor.new(0xff_ff00ff)
|
86
|
+
CYAN = Gosu::ImmutableColor.new(0xff_00ffff)
|
87
|
+
end
|
64
88
|
end
|
65
89
|
|
66
|
-
# Instance methods for button_id_to_char and char_to_button_id
|
67
90
|
class Gosu::Window
|
68
|
-
|
69
|
-
|
91
|
+
# Backwards compatibility:
|
92
|
+
# Class methods that have been turned into module methods.
|
93
|
+
def self.button_id_to_char(id)
|
94
|
+
Gosu.button_id_to_char(id)
|
95
|
+
end
|
96
|
+
|
97
|
+
def self.char_to_button_id(ch)
|
98
|
+
Gosu.char_to_button_id(ch)
|
70
99
|
end
|
71
100
|
|
72
|
-
|
73
|
-
|
101
|
+
# Backwards compatibility:
|
102
|
+
# Instance methods taht have been turned into module methods.
|
103
|
+
%w(draw_line draw_triangle draw_quad
|
104
|
+
flush gl clip_to record
|
105
|
+
transform translate rotate scale
|
106
|
+
button_id_to_char char_to_button_id button_down?).each do |method|
|
107
|
+
define_method method.to_sym do |*args, &block|
|
108
|
+
Gosu.send method, *args, &block
|
109
|
+
end
|
74
110
|
end
|
75
111
|
end
|
76
112
|
|