gosu 0.7.33-universal-darwin → 0.7.35-universal-darwin

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +1,13 @@
1
1
  // Undocumented for the first few iterations. Interface may change rapidly.
2
2
  // This is mainly a proof of concept. Stability will be the highest on OS X.
3
3
 
4
+ #if 0
4
5
  #ifndef GOSU_ASYNC_HPP
5
6
  #define GOSU_ASYNC_HPP
6
7
 
7
8
  #include <Gosu/Fwd.hpp>
8
- #include <boost/shared_ptr.hpp>
9
- #include <boost/thread.hpp>
9
+ #include <Gosu/TR1.hpp>
10
+ #include <thread>
10
11
  #include <memory>
11
12
  #include <string>
12
13
 
@@ -15,25 +16,25 @@ namespace Gosu
15
16
  template<typename Result>
16
17
  class AsyncResult
17
18
  {
18
- boost::shared_ptr<boost::try_mutex> mutex;
19
- boost::shared_ptr<std::auto_ptr<Result> > result;
19
+ std::tr1::shared_ptr<std::tr1::try_mutex> mutex;
20
+ std::tr1::shared_ptr<std::auto_ptr<Result> > result;
20
21
 
21
22
  public:
22
- AsyncResult(const boost::shared_ptr<boost::try_mutex>& mutex,
23
- const boost::shared_ptr<std::auto_ptr<Result> >& result)
23
+ AsyncResult(const std::tr1::shared_ptr<std::tr1::try_mutex>& mutex,
24
+ const std::tr1::shared_ptr<std::auto_ptr<Result> >& result)
24
25
  : mutex(mutex), result(result)
25
26
  {
26
27
  }
27
28
 
28
29
  bool hasValue() const
29
30
  {
30
- boost::try_mutex::scoped_try_lock lock(*mutex);
31
+ std::tr1::try_mutex::scoped_try_lock lock(*mutex);
31
32
  return lock && result->get();
32
33
  }
33
34
 
34
35
  std::auto_ptr<Result> takeValue()
35
36
  {
36
- boost::try_mutex::scoped_lock lock(*mutex);
37
+ std::tr1::try_mutex::scoped_lock lock(*mutex);
37
38
  return *result;
38
39
  }
39
40
  };
@@ -46,3 +47,4 @@ namespace Gosu
46
47
  }
47
48
 
48
49
  #endif
50
+ #endif
@@ -13,8 +13,8 @@
13
13
  #include <Gosu/Fwd.hpp>
14
14
  #include <Gosu/IO.hpp>
15
15
  #include <Gosu/Platform.hpp>
16
- #include <boost/scoped_ptr.hpp>
17
- #include <boost/shared_ptr.hpp>
16
+ #include <Gosu/TR1.hpp>
17
+ #include <memory>
18
18
  #include <string>
19
19
 
20
20
  namespace Gosu
@@ -64,7 +64,7 @@ namespace Gosu
64
64
  class Sample
65
65
  {
66
66
  struct SampleData;
67
- boost::shared_ptr<SampleData> data;
67
+ std::tr1::shared_ptr<SampleData> data;
68
68
 
69
69
  public:
70
70
  //! Constructs a sample that can be played on the specified audio
@@ -109,7 +109,9 @@ namespace Gosu
109
109
  class BaseData;
110
110
  class ModuleData;
111
111
  class StreamData;
112
- boost::scoped_ptr<BaseData> data;
112
+ Song(const Song&);
113
+ Song& operator=(const Song&);
114
+ std::auto_ptr<BaseData> data;
113
115
 
114
116
  public:
115
117
  //! Constructs a song that can be played on the provided audio system
File without changes
@@ -8,7 +8,6 @@
8
8
  #include <Gosu/Fwd.hpp>
9
9
  #include <Gosu/GraphicsBase.hpp>
10
10
  #include <Gosu/Platform.hpp>
11
- #include <boost/scoped_ptr.hpp>
12
11
  #include <string>
13
12
  #include <vector>
14
13
 
@@ -63,10 +62,10 @@ namespace Gosu
63
62
  GOSU_DEPRECATED void replace(Color oldColor, Color newColor);
64
63
  };
65
64
 
66
- //! Loads any supported image into a Bitmap.
67
- Bitmap loadImageFile(const std::wstring& filename);
68
- //! Loads any supported image into a Bitmap.
69
- Bitmap loadImageFile(Reader input);
65
+ //! Loads any supported image into a Bitmap.
66
+ void loadImageFile(Bitmap& bitmap, const std::wstring& filename);
67
+ //! Loads any supported image into a Bitmap.
68
+ void loadImageFile(Bitmap& bitmap, Reader input);
70
69
 
71
70
  //! Saves a Bitmap to a file.
72
71
  void saveImageFile(const Bitmap& bitmap, const std::wstring& filename);
@@ -133,7 +133,7 @@ namespace Gosu
133
133
  gpNum = gpRangeEnd - gpRangeBegin + 1,
134
134
 
135
135
  numButtons = gpRangeEnd,
136
- noButton = 0xffffffff
136
+ noButton = 0xffffffff
137
137
  };
138
138
  }
139
139
 
@@ -4,8 +4,8 @@
4
4
  #ifndef GOSU_COLOR_HPP
5
5
  #define GOSU_COLOR_HPP
6
6
 
7
- #include <boost/cstdint.hpp>
8
7
  #include <Gosu/Platform.hpp>
8
+ #include <Gosu/TR1.hpp>
9
9
 
10
10
  namespace Gosu
11
11
  {
@@ -17,7 +17,7 @@ namespace Gosu
17
17
  //! it is 0xaabbggrr.
18
18
  class Color
19
19
  {
20
- boost::uint32_t rep;
20
+ std::tr1::uint32_t rep;
21
21
  #ifdef GOSU_IS_LITTLE_ENDIAN
22
22
  enum { RED_OFFSET = 0, GREEN_OFFSET = 8, BLUE_OFFSET = 16, ALPHA_OFFSET = 24 };
23
23
  #else
@@ -25,7 +25,7 @@ namespace Gosu
25
25
  #endif
26
26
 
27
27
  public:
28
- typedef boost::uint8_t Channel;
28
+ typedef std::tr1::uint8_t Channel;
29
29
  static const unsigned GL_FORMAT = 0x1908; // GL_RGBA
30
30
 
31
31
  //! The default constructor does not initialize the color to any value.
@@ -34,7 +34,7 @@ namespace Gosu
34
34
  }
35
35
 
36
36
  //! Conversion constructor for literals of the form 0xaarrggbb.
37
- Color(boost::uint32_t argb)
37
+ Color(unsigned argb)
38
38
  {
39
39
  *this = Color((argb >> 24) & 0xff, (argb >> 16) & 0xff,
40
40
  (argb >> 8) & 0xff, (argb >> 0) & 0xff);
@@ -121,25 +121,25 @@ namespace Gosu
121
121
  void setValue(double v);
122
122
 
123
123
  //! Returns the color in 0xaarrggbb representation.
124
- boost::uint32_t argb() const
124
+ std::tr1::uint32_t argb() const
125
125
  {
126
126
  return alpha() << 24 | red() << 16 | green() << 8 | blue();
127
127
  }
128
128
 
129
129
  //! Returns the color in 0x00bbggrr representation.
130
- boost::uint32_t bgr() const
130
+ std::tr1::uint32_t bgr() const
131
131
  {
132
132
  return blue() << 16 | green() << 8 | red();
133
133
  }
134
134
 
135
135
  //! Returns the color in 0xaabbggrr representation.
136
- boost::uint32_t abgr() const
136
+ std::tr1::uint32_t abgr() const
137
137
  {
138
138
  return alpha() << 24 | blue() << 16 | green() << 8 | red();
139
139
  }
140
140
 
141
141
  //! Returns the internal representation of the color (RGBA in memory).
142
- boost::uint32_t gl() const
142
+ std::tr1::uint32_t gl() const
143
143
  {
144
144
  return rep;
145
145
  }
@@ -8,7 +8,7 @@
8
8
  #include <Gosu/Color.hpp>
9
9
  #include <Gosu/GraphicsBase.hpp>
10
10
  #include <Gosu/Platform.hpp>
11
- #include <boost/shared_ptr.hpp>
11
+ #include <Gosu/TR1.hpp>
12
12
  #include <string>
13
13
 
14
14
  namespace Gosu
@@ -20,7 +20,7 @@ namespace Gosu
20
20
  class Font
21
21
  {
22
22
  struct Impl;
23
- boost::shared_ptr<Impl> pimpl;
23
+ std::tr1::shared_ptr<Impl> pimpl;
24
24
 
25
25
  public:
26
26
  //! Constructs a font that can be drawn onto the graphics object.
@@ -7,9 +7,7 @@
7
7
  #include <Gosu/Fwd.hpp>
8
8
  #include <Gosu/Color.hpp>
9
9
  #include <Gosu/GraphicsBase.hpp>
10
- #include <boost/array.hpp>
11
- #include <boost/function.hpp>
12
- #include <boost/scoped_ptr.hpp>
10
+ #include <Gosu/TR1.hpp>
13
11
  #include <memory>
14
12
 
15
13
  namespace Gosu
@@ -25,7 +23,7 @@ namespace Gosu
25
23
  //! Useful when extending Gosu using OpenGL.
26
24
  unsigned const MAX_TEXTURE_SIZE = 1024;
27
25
 
28
- typedef boost::array<double, 16> Transform;
26
+ typedef std::tr1::array<double, 16> Transform;
29
27
  Transform translate(double x, double y);
30
28
  Transform rotate(double angle, double aroundX = 0, double aroundY = 0);
31
29
  Transform scale(double factor);
@@ -37,7 +35,7 @@ namespace Gosu
37
35
  class Graphics
38
36
  {
39
37
  struct Impl;
40
- boost::scoped_ptr<Impl> pimpl;
38
+ const std::auto_ptr<Impl> pimpl;
41
39
 
42
40
  public:
43
41
  Graphics(unsigned physicalWidth, unsigned physicalHeight, bool fullscreen);
@@ -73,7 +71,7 @@ namespace Gosu
73
71
  //! of custom GL functors is NOT DEFINED.
74
72
  //! Note: You may not call any Gosu rendering functions from within the
75
73
  //! functor, and you must schedule it from within Window::draw's call tree.
76
- void scheduleGL(const boost::function<void()>& functor, ZPos z);
74
+ void scheduleGL(const std::tr1::function<void()>& functor, ZPos z);
77
75
 
78
76
  //! Enables clipping to a specified rectangle.
79
77
  void beginClipping(double x, double y, double width, double height);
@@ -4,10 +4,9 @@
4
4
  #ifndef GOSU_IO_HPP
5
5
  #define GOSU_IO_HPP
6
6
 
7
- #include <boost/utility.hpp>
8
- #include <boost/scoped_ptr.hpp>
9
7
  #include <cstddef>
10
8
  #include <algorithm>
9
+ #include <memory>
11
10
  #include <string>
12
11
  #include <vector>
13
12
 
@@ -139,9 +138,17 @@ namespace Gosu
139
138
  //! or simply areas of allocated memory.
140
139
  //! A resource always knows its size and can resize itself, thereby either
141
140
  //! truncating its content or allocating room for more data.
142
- class Resource : boost::noncopyable
141
+ class Resource
143
142
  {
143
+ // Non-copyable
144
+ Resource(const Resource&);
145
+ Resource& operator=(const Resource&);
146
+
144
147
  public:
148
+ Resource()
149
+ {
150
+ }
151
+
145
152
  virtual ~Resource()
146
153
  {
147
154
  }
@@ -229,7 +236,7 @@ namespace Gosu
229
236
  class File : public Resource
230
237
  {
231
238
  struct Impl;
232
- boost::scoped_ptr<Impl> pimpl;
239
+ const std::auto_ptr<Impl> pimpl;
233
240
 
234
241
  public:
235
242
  explicit File(const std::wstring& filename, FileMode mode = fmRead);
@@ -6,7 +6,7 @@
6
6
 
7
7
  #include <Gosu/Fwd.hpp>
8
8
  #include <Gosu/Bitmap.hpp>
9
- #include <boost/shared_ptr.hpp>
9
+ #include <Gosu/TR1.hpp>
10
10
  #include <memory>
11
11
 
12
12
  namespace Gosu
@@ -14,7 +14,7 @@ namespace Gosu
14
14
  //! Provides functionality for drawing rectangular images.
15
15
  class Image
16
16
  {
17
- boost::shared_ptr<ImageData> data;
17
+ std::tr1::shared_ptr<ImageData> data;
18
18
 
19
19
  public:
20
20
  //! Loads an image from a given filename that can be drawn onto
@@ -86,13 +86,15 @@ namespace Gosu
86
86
  //! pixels. If negative, the bitmap is divided into -tileWidth rows.
87
87
  //! \param tileHeight See tileWidth.
88
88
  //! \param appendTo STL container to which the images will be appended.
89
- //! Must provide a push_back member function; std::vector<boost::shared_ptr<Image>>
90
- //! or boost::ptr_vector<Image> are good choices.
89
+ //! Must provide a push_back member function; vector<tr1::shared_ptr<Image>>
90
+ //! or std::tr1::ptr_vector<Image> are good choices.
91
91
  template<typename Container>
92
92
  void imagesFromTiledBitmap(Graphics& graphics, const std::wstring& filename,
93
93
  int tileWidth, int tileHeight, bool tileable, Container& appendTo)
94
94
  {
95
- imagesFromTiledBitmap(graphics, loadImageFile(filename), tileWidth, tileHeight, tileable, appendTo);
95
+ Bitmap bmp;
96
+ loadImageFile(bmp, filename);
97
+ imagesFromTiledBitmap(graphics, bmp, tileWidth, tileHeight, tileable, appendTo);
96
98
  }
97
99
 
98
100
  //! Convenience function that splits a bitmap into an area of array
@@ -101,8 +103,8 @@ namespace Gosu
101
103
  //! pixels. If negative, the bitmap is divided into -tileWidth rows.
102
104
  //! \param tileHeight See tileWidth.
103
105
  //! \param appendTo STL container to which the images will be appended.
104
- //! Must provide a push_back member function; std::vector<boost::shared_ptr<Image>>
105
- //! or boost::ptr_vector<Image> are good choices.
106
+ //! Must provide a push_back member function; std::vector<std::tr1::shared_ptr<Image>>
107
+ //! or std::tr1::ptr_vector<Image> are good choices.
106
108
  template<typename Container>
107
109
  void imagesFromTiledBitmap(Graphics& graphics, const Bitmap& bmp,
108
110
  int tileWidth, int tileHeight, bool tileable, Container& appendTo)
@@ -6,8 +6,6 @@
6
6
 
7
7
  #include <Gosu/Color.hpp>
8
8
  #include <Gosu/GraphicsBase.hpp>
9
- #include <boost/optional.hpp>
10
- #include <boost/utility.hpp>
11
9
 
12
10
  namespace Gosu
13
11
  {
@@ -25,9 +23,17 @@ namespace Gosu
25
23
  //! Graphics::createImage and usually only used to implement drawing
26
24
  //! primitives like Image, which then provide a more specialized and
27
25
  //! intuitive drawing interface.
28
- class ImageData : boost::noncopyable
26
+ class ImageData
29
27
  {
28
+ // Non-copyable
29
+ ImageData(const ImageData&);
30
+ ImageData& operator=(const ImageData&);
31
+
30
32
  public:
33
+ ImageData()
34
+ {
35
+ }
36
+
31
37
  virtual ~ImageData()
32
38
  {
33
39
  }
@@ -41,7 +47,7 @@ namespace Gosu
41
47
  double x4, double y4, Color c4,
42
48
  ZPos z, AlphaMode mode) const = 0;
43
49
 
44
- virtual boost::optional<GLTexInfo> glTexInfo() const = 0;
50
+ virtual const GLTexInfo* glTexInfo() const = 0;
45
51
  virtual Bitmap toBitmap() const = 0;
46
52
 
47
53
  //! Experimental and undocumented for now.
@@ -28,8 +28,7 @@
28
28
 
29
29
  #include <Gosu/Platform.hpp>
30
30
  #include <Gosu/Fwd.hpp>
31
- #include <boost/function.hpp>
32
- #include <boost/scoped_ptr.hpp>
31
+ #include <Gosu/TR1.hpp>
33
32
  #include <vector>
34
33
 
35
34
  namespace Gosu
@@ -84,7 +83,7 @@ namespace Gosu
84
83
  class Input
85
84
  {
86
85
  struct Impl;
87
- boost::scoped_ptr<Impl> pimpl;
86
+ const std::auto_ptr<Impl> pimpl;
88
87
 
89
88
  public:
90
89
  #ifdef GOSU_IS_WIN
@@ -146,11 +145,11 @@ namespace Gosu
146
145
 
147
146
  //! Assignable events that are called by update. You can bind these to your own functions.
148
147
  //! If you use the Window class, it will assign forward these to its own methods.
149
- boost::function<void (Button)> onButtonDown, onButtonUp;
148
+ std::tr1::function<void (Button)> onButtonDown, onButtonUp;
150
149
 
151
150
  //! Assignable events that are called by update. You can bind these to your own functions.
152
151
  //! If you use the Window class, it will assign forward these to its own methods.
153
- boost::function<void (Touch)> onTouchBegan, onTouchMoved, onTouchEnded;
152
+ std::tr1::function<void (Touch)> onTouchBegan, onTouchMoved, onTouchEnded;
154
153
 
155
154
  //! Returns the currently active TextInput instance, or 0.
156
155
  TextInput* textInput() const;
@@ -4,19 +4,17 @@
4
4
  #ifndef GOSU_SOCKETS_HPP
5
5
  #define GOSU_SOCKETS_HPP
6
6
 
7
- #include <boost/cstdint.hpp>
8
- #include <boost/function.hpp>
9
- #include <boost/scoped_ptr.hpp>
7
+ #include <Gosu/TR1.hpp>
10
8
  #include <cstddef>
11
9
  #include <string>
12
10
 
13
11
  namespace Gosu
14
12
  {
15
13
  //! Addresses are returned from and given to Gosu functions in host byte order.
16
- typedef boost::uint32_t SocketAddress;
14
+ typedef std::tr1::uint32_t SocketAddress;
17
15
 
18
16
  //! Ports are returned from and given to Gosu functions in host byte order.
19
- typedef boost::uint16_t SocketPort;
17
+ typedef std::tr1::uint16_t SocketPort;
20
18
 
21
19
  //! Constant that can be used as a placeholder for an arbitrary port, e.g. when
22
20
  //! starting to listen.
@@ -37,7 +35,7 @@ namespace Gosu
37
35
  class MessageSocket
38
36
  {
39
37
  struct Impl;
40
- boost::scoped_ptr<Impl> pimpl;
38
+ const std::auto_ptr<Impl> pimpl;
41
39
 
42
40
  public:
43
41
  //! Opens a message socket for listening at the specified port.
@@ -66,7 +64,7 @@ namespace Gosu
66
64
  std::size_t size);*/
67
65
 
68
66
  //! If assigned, will be called by update for every packet received.
69
- boost::function<void (SocketAddress, SocketPort, const void*,
67
+ std::tr1::function<void (SocketAddress, SocketPort, const void*,
70
68
  std::size_t)> onReceive;
71
69
  };
72
70
 
@@ -86,7 +84,7 @@ namespace Gosu
86
84
  class CommSocket
87
85
  {
88
86
  struct Impl;
89
- boost::scoped_ptr<Impl> pimpl;
87
+ const std::auto_ptr<Impl> pimpl;
90
88
 
91
89
  public:
92
90
  CommSocket(CommMode mode, SocketAddress targetAddress,
@@ -110,8 +108,8 @@ namespace Gosu
110
108
  void sendPendingData();
111
109
  std::size_t pendingBytes() const;
112
110
 
113
- boost::function<void (const void*, std::size_t)> onReceive;
114
- boost::function<void ()> onDisconnection;
111
+ std::tr1::function<void (const void*, std::size_t)> onReceive;
112
+ std::tr1::function<void ()> onDisconnection;
115
113
  };
116
114
 
117
115
  //! Wraps a TCP socket that waits on a specific port and can create
@@ -119,7 +117,7 @@ namespace Gosu
119
117
  class ListenerSocket
120
118
  {
121
119
  struct Impl;
122
- boost::scoped_ptr<Impl> pimpl;
120
+ const std::auto_ptr<Impl> pimpl;
123
121
 
124
122
  public:
125
123
  ListenerSocket(SocketPort port);
@@ -132,7 +130,7 @@ namespace Gosu
132
130
 
133
131
  //! This signal is fired by update() whenever someone connects
134
132
  //! to the port which is currently listened on.
135
- boost::function<void (Socket&)> onConnection;
133
+ std::tr1::function<void (Socket&)> onConnection;
136
134
  };
137
135
  }
138
136
 
@@ -0,0 +1,44 @@
1
+ //! \file TR1.hpp
2
+ //! Includes all parts of C++03 (TR1) that are relevant for Gosu.
3
+
4
+ #ifndef GOSU_TR1_HPP
5
+ #define GOSU_TR1_HPP
6
+
7
+ #ifdef _MSC_VER
8
+ #include <array>
9
+ #include <memory>
10
+ #include <functional>
11
+ namespace std
12
+ {
13
+ namespace tr1
14
+ {
15
+ typedef unsigned char uint8_t;
16
+ typedef unsigned short uint16_t;
17
+ typedef unsigned int uint32_t;
18
+ typedef unsigned long long uint64_t;
19
+ typedef signed char int8_t;
20
+ typedef signed short int16_t;
21
+ typedef signed int int32_t;
22
+ typedef signed long long int64_t;
23
+ }
24
+ }
25
+ #else
26
+ #include <tr1/array>
27
+ #include <tr1/memory>
28
+ #include <tr1/functional>
29
+ #if defined(__GNUC__) && (__GNUC__ < 4 || __GNUC_MINOR__ < 2)
30
+ #include <stdint.h>
31
+ namespace std
32
+ {
33
+ namespace tr1
34
+ {
35
+ using ::int8_t; using ::int16_t; using ::int32_t; using ::int64_t;
36
+ using ::uint8_t; using ::uint16_t; using ::uint32_t; using ::uint64_t;
37
+ }
38
+ }
39
+ #else
40
+ #include <tr1/cstdint>
41
+ #endif
42
+ #endif
43
+
44
+ #endif
@@ -6,7 +6,7 @@
6
6
 
7
7
  #include <Gosu/Fwd.hpp>
8
8
  #include <Gosu/Platform.hpp>
9
- #include <boost/scoped_ptr.hpp>
9
+ #include <Gosu/TR1.hpp>
10
10
  #include <string>
11
11
 
12
12
  namespace Gosu
@@ -23,7 +23,7 @@ namespace Gosu
23
23
  class TextInput
24
24
  {
25
25
  struct Impl;
26
- boost::scoped_ptr<Impl> pimpl;
26
+ const std::auto_ptr<Impl> pimpl;
27
27
 
28
28
  public:
29
29
  TextInput();
@@ -3,8 +3,8 @@
3
3
 
4
4
  #define GOSU_MAJOR_VERSION 0
5
5
  #define GOSU_MINOR_VERSION 7
6
- #define GOSU_POINT_VERSION 33
7
- #define GOSU_VERSION "0.7.33"
6
+ #define GOSU_POINT_VERSION 35
7
+ #define GOSU_VERSION "0.7.35"
8
8
 
9
9
  #define GOSU_COPYRIGHT_NOTICE \
10
10
  "May contain `ogg', `vorbis' libraries (c) 2002-2008 Xiph.org Foundation" \
@@ -8,8 +8,7 @@
8
8
 
9
9
  #include <windows.h>
10
10
  #include <Gosu/Platform.hpp>
11
- #include <boost/function.hpp>
12
- #include <boost/shared_ptr.hpp>
11
+ #include <Gosu/TR1.hpp>
13
12
  #include <string>
14
13
 
15
14
  namespace Gosu
@@ -31,7 +30,7 @@ namespace Gosu
31
30
  //! Registers a function to be called by handleMessage and
32
31
  //! processMessages. Every message is passed to the hooks and not
33
32
  //! processed further if any hook function returns true.
34
- void registerMessageHook(const boost::function<bool (MSG&)>& hook);
33
+ void registerMessageHook(const std::tr1::function<bool (MSG&)>& hook);
35
34
 
36
35
  //! Throws an exception according to the error which GetLastError()
37
36
  //! returns, optionally prefixed with "While (action), the following
@@ -58,11 +57,11 @@ namespace Gosu
58
57
  }
59
58
 
60
59
  //! Small helper function that transfers ownership of a COM interface
61
- //! to a boost::shared_ptr.
60
+ //! to a std::tr1::shared_ptr.
62
61
  template<typename T>
63
- inline boost::shared_ptr<T> shareComPtr(T* ptr)
62
+ inline std::tr1::shared_ptr<T> shareComPtr(T* ptr)
64
63
  {
65
- return boost::shared_ptr<T>(ptr, releaseComPtr<T>);
64
+ return std::tr1::shared_ptr<T>(ptr, releaseComPtr<T>);
66
65
  }
67
66
 
68
67
  //! Returns the executable's filename.
@@ -7,9 +7,8 @@
7
7
  #include <Gosu/Fwd.hpp>
8
8
  #include <Gosu/Platform.hpp>
9
9
  #include <Gosu/Input.hpp>
10
- #include <boost/scoped_ptr.hpp>
11
- #include <boost/shared_ptr.hpp>
12
- #include <boost/function.hpp>
10
+ #include <Gosu/TR1.hpp>
11
+ #include <memory>
13
12
  #include <string>
14
13
 
15
14
  #ifdef GOSU_IS_WIN
@@ -24,12 +23,12 @@ namespace Gosu
24
23
  //! Convenient all-in-one class that serves as the foundation of a standard
25
24
  //! Gosu application. Manages initialization of all of Gosu's core components
26
25
  //! and provides timing functionality.
27
- //! Note that you should really only use on instance of this class at the same time.
26
+ //! Note that you should really only use one instance of this class at the same time.
28
27
  //! This may or may not change later.
29
28
  class Window
30
29
  {
31
30
  struct Impl;
32
- boost::scoped_ptr<Impl> pimpl;
31
+ const std::auto_ptr<Impl> pimpl;
33
32
 
34
33
  public:
35
34
  //! Constructs a Window.
@@ -100,7 +99,7 @@ namespace Gosu
100
99
  #ifdef GOSU_IS_UNIX
101
100
  // Context for creating shared contexts.
102
101
  // Only on Unices (so far).
103
- typedef boost::shared_ptr<boost::function<void()> > SharedContext;
102
+ typedef std::tr1::shared_ptr<std::tr1::function<void()> > SharedContext;
104
103
  SharedContext createSharedContext();
105
104
  #endif
106
105
 
Binary file
Binary file
@@ -1,16 +1,18 @@
1
1
  require 'rbconfig'
2
2
 
3
- begin
4
- if defined? RUBY_VERSION and RUBY_VERSION[0..2] == '1.9' then
5
- version = '1_9'
6
- else
7
- version = '1_8'
8
- end
9
- require "#{File.dirname(__FILE__)}/gosu.for_#{version}.#{Config::CONFIG['DLEXT']}"
10
- require "#{File.dirname(__FILE__)}/gosu/swig_patches.rb"
11
- rescue LoadError => e
12
- require "#{File.dirname(__FILE__)}/gosu.#{Config::CONFIG['DLEXT']}"
13
- require "#{File.dirname(__FILE__)}/gosu/swig_patches.rb"
3
+ WINDOWS_HINTS = %w(-win32 win32- mswin mingw32)
4
+
5
+ if defined? RUBY_PLATFORM and WINDOWS_HINTS.any? { |hint| RUBY_PLATFORM.include? hint } then
6
+ ENV['PATH'] = "#{File.dirname(__FILE__)};#{ENV['PATH']}"
7
+ end
8
+
9
+ if File.exist? "#{File.dirname(__FILE__)}/gosu.#{Config::CONFIG['DLEXT']}"
10
+ require "gosu.#{Config::CONFIG['DLEXT']}"
11
+ elsif defined? RUBY_VERSION and RUBY_VERSION.split('.')[1].to_i > 8 then
12
+ require "gosu.for_1_9.#{Config::CONFIG['DLEXT']}"
13
+ else
14
+ require "gosu.for_1_8.#{Config::CONFIG['DLEXT']}"
14
15
  end
15
16
 
16
- require "#{File.dirname(__FILE__)}/gosu/patches.rb"
17
+ require "gosu/swig_patches"
18
+ require "gosu/patches"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gosu
3
3
  version: !ruby/object:Gem::Version
4
- hash: 65
4
+ hash: 69
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 33
10
- version: 0.7.33
9
+ - 35
10
+ version: 0.7.35
11
11
  platform: universal-darwin
12
12
  authors:
13
13
  - Julian Raschke
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-06-13 00:00:00 Z
19
+ date: 2011-08-12 00:00:00 Z
20
20
  dependencies: []
21
21
 
22
22
  description: " 2D game development library.\n\n Gosu features easy to use and game-friendly interfaces to 2D graphics\n and text (accelerated by 3D hardware), sound samples and music as well as\n keyboard, mouse and gamepad/joystick input.\n\n Also includes demos for integration with RMagick, Chipmunk and Ruby-OpenGL.\n"
@@ -55,6 +55,7 @@ files:
55
55
  - Gosu/Text.hpp
56
56
  - Gosu/TextInput.hpp
57
57
  - Gosu/Timing.hpp
58
+ - Gosu/TR1.hpp
58
59
  - Gosu/Utility.hpp
59
60
  - Gosu/Version.hpp
60
61
  - Gosu/Window.hpp
@@ -117,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
118
  requirements: []
118
119
 
119
120
  rubyforge_project:
120
- rubygems_version: 1.8.4
121
+ rubygems_version: 1.8.7
121
122
  signing_key:
122
123
  specification_version: 3
123
124
  summary: 2D game development library.