gosu 0.7.23 → 0.7.24

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,6 +14,7 @@
14
14
  #include <Gosu/IO.hpp>
15
15
  #include <Gosu/Platform.hpp>
16
16
  #include <boost/scoped_ptr.hpp>
17
+ #include <boost/shared_ptr.hpp>
17
18
  #include <string>
18
19
 
19
20
  namespace Gosu
@@ -61,8 +62,8 @@ namespace Gosu
61
62
  class Sample
62
63
  {
63
64
  struct SampleData;
64
- boost::scoped_ptr<SampleData> data;
65
-
65
+ boost::shared_ptr<SampleData> data;
66
+
66
67
  public:
67
68
  //! Constructs a sample that can be played on the specified audio
68
69
  //! system and loads the sample from a file.
@@ -72,8 +73,6 @@ namespace Gosu
72
73
  //! system and loads the sample data from a stream.
73
74
  explicit Sample(Reader reader);
74
75
 
75
- ~Sample();
76
-
77
76
  //! Plays the sample without panning.
78
77
  //! \param volume Can be anything from 0.0 (silence) to 1.0 (full
79
78
  //! volume).
@@ -109,6 +108,7 @@ namespace Gosu
109
108
  class ModuleData;
110
109
  class StreamData;
111
110
  boost::scoped_ptr<BaseData> data;
111
+
112
112
  public:
113
113
  //! There are two types of songs that can be loaded as a Song: Streamed
114
114
  //! songs (like OGG) and modules (like MOD or XM).
@@ -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/scoped_ptr.hpp>
11
+ #include <boost/shared_ptr.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::scoped_ptr<Impl> pimpl;
23
+ boost::shared_ptr<Impl> pimpl;
24
24
 
25
25
  public:
26
26
  //! Constructs a font that can be drawn onto the graphics object.
@@ -31,7 +31,6 @@ namespace Gosu
31
31
  //! the font.
32
32
  Font(Graphics& graphics, const std::wstring& fontName,
33
33
  unsigned fontHeight, unsigned fontFlags = ffBold);
34
- ~Font();
35
34
 
36
35
  //! Returns the name of the font that was used to create it.
37
36
  std::wstring name() const;
@@ -65,7 +65,7 @@ namespace Gosu
65
65
  //! Resets Gosu into its default rendering state.
66
66
  void endGL();
67
67
  //! Enables clipping to a specified rectangle.
68
- void beginClipping(int x, int y, unsigned width, unsigned height);
68
+ void beginClipping(double x, double y, double width, double height);
69
69
  //! Disables clipping.
70
70
  void endClipping();
71
71
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  #include <Gosu/Fwd.hpp>
8
8
  #include <Gosu/Bitmap.hpp>
9
- #include <boost/scoped_ptr.hpp>
9
+ #include <boost/shared_ptr.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::scoped_ptr<ImageData> data;
17
+ boost::shared_ptr<ImageData> data;
18
18
 
19
19
  public:
20
20
  //! Loads an image from a given filename that can be drawn onto
@@ -46,8 +46,6 @@ namespace Gosu
46
46
  //! Creates an Image from a user-supplied instance of the ImageData interface.
47
47
  explicit Image(std::auto_ptr<ImageData> data);
48
48
 
49
- ~Image();
50
-
51
49
  unsigned width() const;
52
50
  unsigned height() const;
53
51
 
@@ -19,7 +19,7 @@ namespace Gosu
19
19
  //! drawText with the same arguments. This is a very low-level function that does not understand
20
20
  //! any of Gosu's HTML-like markup.
21
21
  //! \param text Unformatted text.
22
- //! \param fontName Name of a system font, or a filename to a TTF file (must contain '/', does not work on Linux).
22
+ //! \param fontName Name of a system font, or a filename to a TTF file (must contain '/').
23
23
  unsigned textWidth(const std::wstring& text,
24
24
  const std::wstring& fontName, unsigned fontHeight,
25
25
  unsigned fontFlags = 0);
@@ -27,7 +27,7 @@ namespace Gosu
27
27
  //! Draws a line of unformatted text on a bitmap. This is a very low-level function that does not understand
28
28
  //! any of Gosu's HTML-like markup.
29
29
  //! \param text Unformatted text.
30
- //! \param fontName Name of a system font, or a filename to a TTF file (must contain '/', does not work on Linux).
30
+ //! \param fontName Name of a system font, or a filename to a TTF file (must contain '/').
31
31
  //! \param fontHeight Height, in pixels, of the text.
32
32
  //! \param fontFlags Binary combination of members of the FontFlags
33
33
  //! enum.
@@ -38,7 +38,7 @@ namespace Gosu
38
38
  //! Creates a bitmap that is filled with a line of formatted text given to the function.
39
39
  //! The line can contain line breaks and HTML-like markup.
40
40
  //! \param text Formatted text.
41
- //! \param fontName Name of a system font, or a filename to a TTF file (must contain '/', does not work on Linux).
41
+ //! \param fontName Name of a system font, or a filename to a TTF file (must contain '/').
42
42
  //! \param fontHeight Height of the font in pixels.
43
43
  //! \param fontFlags Binary combination of members of the FontFlags
44
44
  //! enum.
@@ -49,7 +49,7 @@ namespace Gosu
49
49
  //! Creates a bitmap that is filled with the formatted text given to the function.
50
50
  //! The line can contain line breaks and HTML-like markup.
51
51
  //! \param text Formatted text.
52
- //! \param fontName Name of a system font, or a filename to a TTF file (must contain '/', does not work on Linux).
52
+ //! \param fontName Name of a system font, or a filename to a TTF file (must contain '/').
53
53
  //! \param fontHeight Height of the font in pixels.
54
54
  //! \param lineSpacing Spacing between two lines of text in pixels. Can be negative to make
55
55
  //! text stick together more closely.
@@ -3,7 +3,7 @@
3
3
 
4
4
  #define GOSU_MAJOR_VERSION 0
5
5
  #define GOSU_MINOR_VERSION 7
6
- #define GOSU_POINT_VERSION 23
7
- #define GOSU_VERSION "0.7.23"
6
+ #define GOSU_POINT_VERSION 24
7
+ #define GOSU_VERSION "0.7.24"
8
8
 
9
9
  #endif
@@ -12,6 +12,7 @@
12
12
  #include <boost/algorithm/string.hpp>
13
13
  #include <boost/lexical_cast.hpp>
14
14
  #include <boost/optional.hpp>
15
+ #include <boost/scoped_ptr.hpp>
15
16
 
16
17
  #include <cassert>
17
18
  #include <cstdlib>
@@ -207,10 +208,6 @@ Gosu::Sample::Sample(Reader reader)
207
208
  }
208
209
  }
209
210
 
210
- Gosu::Sample::~Sample()
211
- {
212
- }
213
-
214
211
  Gosu::SampleInstance Gosu::Sample::play(double volume, double speed,
215
212
  bool looping) const
216
213
  {
@@ -137,9 +137,6 @@ Gosu::Sample::Sample(Reader reader)
137
137
  throwLastSDLError();
138
138
  }
139
139
 
140
- Gosu::Sample::~Sample() {
141
- }
142
-
143
140
  Gosu::SampleInstance Gosu::Sample::play(double volume, double speed,
144
141
  bool looping) const {
145
142
  int channel;
@@ -166,10 +166,6 @@ Gosu::Sample::Sample(Reader reader)
166
166
  throwLastFMODError();
167
167
  }
168
168
 
169
- Gosu::Sample::~Sample()
170
- {
171
- }
172
-
173
169
  Gosu::SampleInstance Gosu::Sample::play(double volume, double speed,
174
170
  bool looping) const
175
171
  {
@@ -100,10 +100,6 @@ Gosu::Font::Font(Graphics& graphics, const wstring& fontName, unsigned fontHeigh
100
100
  pimpl->flags = fontFlags;
101
101
  }
102
102
 
103
- Gosu::Font::~Font()
104
- {
105
- }
106
-
107
103
  std::wstring Gosu::Font::name() const
108
104
  {
109
105
  return pimpl->name;
@@ -217,7 +217,7 @@ void Gosu::Graphics::endGL()
217
217
  #endif
218
218
  }
219
219
 
220
- void Gosu::Graphics::beginClipping(int x, int y, unsigned width, unsigned height)
220
+ void Gosu::Graphics::beginClipping(double x, double y, double width, double height)
221
221
  {
222
222
  if (pimpl->queues.size() > 1)
223
223
  throw std::logic_error("Clipping not allowed while creating a macro");
@@ -38,10 +38,6 @@ Gosu::Image::Image(std::auto_ptr<ImageData> data)
38
38
  {
39
39
  }
40
40
 
41
- Gosu::Image::~Image()
42
- {
43
- }
44
-
45
41
  unsigned Gosu::Image::width() const
46
42
  {
47
43
  return data->width();
@@ -110,22 +110,12 @@ wstring Gosu::defaultFontName()
110
110
  #ifndef GOSU_IS_IPHONE
111
111
  namespace
112
112
  {
113
- NSDictionary* attributeDictionary(NSFont* font, Gosu::Color color, unsigned fontFlags)
113
+ NSDictionary* attributeDictionary(NSFont* font, unsigned fontFlags)
114
114
  {
115
- static std::map<Gosu::Color, NSColor*> colorCache;
116
-
117
- // Because of the way we later copy the buffer directly to a Gosu::Bitmap, we
118
- // need to swap the color components already.
119
- color = color.abgr();
120
-
121
- if (!colorCache[color])
122
- colorCache[color] = [[NSColor colorWithDeviceRed:color.red()/255.0
123
- green:color.green()/255.0 blue:color.blue()/255.0 alpha:color.alpha()/255.0] retain];
124
-
125
115
  NSMutableDictionary* dict =
126
116
  [[NSMutableDictionary alloc] initWithObjectsAndKeys:
127
117
  font, NSFontAttributeName,
128
- colorCache[color], NSForegroundColorAttributeName,
118
+ [NSColor whiteColor], NSForegroundColorAttributeName,
129
119
  nil];
130
120
  if (fontFlags & Gosu::ffUnderline)
131
121
  {
@@ -146,7 +136,7 @@ unsigned Gosu::textWidth(const wstring& text,
146
136
  // the method expects point.
147
137
  ObjRef<NSString> string([[NSString alloc] initWithUTF8String: wstringToUTF8(text).c_str()]);
148
138
  #ifndef GOSU_IS_IPHONE
149
- ObjRef<NSDictionary> attributes(attributeDictionary(font, 0xffffffff, fontFlags));
139
+ ObjRef<NSDictionary> attributes(attributeDictionary(font, fontFlags));
150
140
  NSSize size = [string.obj() sizeWithAttributes: attributes.get()];
151
141
  #else
152
142
  CGSize size = [string.obj() sizeWithFont: font];
@@ -165,18 +155,17 @@ void Gosu::drawText(Bitmap& bitmap, const wstring& text, int x, int y,
165
155
 
166
156
  // This will, of course, compute a too large size; fontHeight is in pixels, the method expects point.
167
157
  #ifndef GOSU_IS_IPHONE
168
- ObjRef<NSDictionary> attributes(attributeDictionary(font, c, fontFlags));
158
+ ObjRef<NSDictionary> attributes(attributeDictionary(font, fontFlags));
169
159
  NSSize size = [string.obj() sizeWithAttributes: attributes.get()];
170
160
  #else
171
161
  CGSize size = [string.obj() sizeWithFont: font];
172
162
  #endif
173
163
 
174
- unsigned width = ceil(size.width / size.height * fontHeight);
164
+ unsigned width = round(size.width / size.height * fontHeight);
175
165
 
176
166
  // Get the width and height of the image
177
167
  Bitmap bmp;
178
168
  bmp.resize(width, fontHeight);
179
- bmp.insert(bitmap, -x, -y);
180
169
 
181
170
  // Use a temporary context to draw the CGImage to the buffer.
182
171
  CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
@@ -187,7 +176,7 @@ void Gosu::drawText(Bitmap& bitmap, const wstring& text, int x, int y,
187
176
  kCGImageAlphaPremultipliedLast);
188
177
  CGColorSpaceRelease(colorSpace);
189
178
  #ifdef GOSU_IS_IPHONE
190
- CGFloat color[] = { c.green() / 255.0, c.blue() / 255.0, c.red() / 255.0, 0 };
179
+ CGFloat color[] = { 1.f, 1.f, 1.f, 0.f };
191
180
  CGContextSetStrokeColor(context, color);
192
181
  CGContextSetFillColor(context, color);
193
182
  #endif
@@ -203,7 +192,7 @@ void Gosu::drawText(Bitmap& bitmap, const wstring& text, int x, int y,
203
192
  UIGraphicsPopContext();
204
193
  #else
205
194
  NSPoint NSPointZero = { 0, 0 };
206
- attributes.reset(attributeDictionary(font, c, fontFlags));
195
+ attributes.reset(attributeDictionary(font, fontFlags));
207
196
 
208
197
  [NSGraphicsContext saveGraphicsState];
209
198
  [NSGraphicsContext setCurrentContext:
@@ -213,8 +202,14 @@ void Gosu::drawText(Bitmap& bitmap, const wstring& text, int x, int y,
213
202
  #endif
214
203
  CGContextRelease(context);
215
204
 
216
- // Done!
217
- bitmap.insert(bmp, x, y);
205
+ // Now copy the set pixels back.
206
+ for (unsigned srcY = 0; srcY < fontHeight; ++srcY)
207
+ for (unsigned srcX = 0; srcX < width; ++srcX)
208
+ {
209
+ c.setAlpha(bmp.getPixel(srcX, srcY).alpha());
210
+ if (c.alpha())
211
+ bitmap.setPixel(x + srcX, y + srcY, c);
212
+ }
218
213
  }
219
214
 
220
215
  #endif
@@ -420,7 +420,7 @@ namespace Gosu {
420
420
  %newobject fromText7;
421
421
  static Gosu::Image* fromText7(Gosu::Window& window, const std::wstring& text,
422
422
  const std::wstring& fontName, unsigned fontHeight,
423
- unsigned lineSpacing, unsigned maxWidth, TextAlign align) {
423
+ int lineSpacing, unsigned maxWidth, TextAlign align) {
424
424
  Gosu::Bitmap bmp = Gosu::createText(text, fontName, fontHeight, lineSpacing, maxWidth, align);
425
425
  return new Gosu::Image(window.graphics(), bmp);
426
426
  }
@@ -589,7 +589,7 @@ namespace Gosu {
589
589
  rb_yield(Qnil);
590
590
  $self->graphics().endGL();
591
591
  }
592
- void clipTo(int x, int y, unsigned width, unsigned height) {
592
+ void clipTo(double x, double y, double width, double height) {
593
593
  $self->graphics().beginClipping(x, y, width, height);
594
594
  rb_yield(Qnil);
595
595
  $self->graphics().endClipping();
@@ -2596,7 +2596,7 @@ SWIGINTERN Gosu::Image *Gosu_Image_fromText4(Gosu::Window &window,std::wstring c
2596
2596
  Gosu::Bitmap bmp = Gosu::createText(text, fontName, fontHeight);
2597
2597
  return new Gosu::Image(window.graphics(), bmp);
2598
2598
  }
2599
- SWIGINTERN Gosu::Image *Gosu_Image_fromText7(Gosu::Window &window,std::wstring const &text,std::wstring const &fontName,unsigned int fontHeight,unsigned int lineSpacing,unsigned int maxWidth,Gosu::TextAlign align){
2599
+ SWIGINTERN Gosu::Image *Gosu_Image_fromText7(Gosu::Window &window,std::wstring const &text,std::wstring const &fontName,unsigned int fontHeight,int lineSpacing,unsigned int maxWidth,Gosu::TextAlign align){
2600
2600
  Gosu::Bitmap bmp = Gosu::createText(text, fontName, fontHeight, lineSpacing, maxWidth, align);
2601
2601
  return new Gosu::Image(window.graphics(), bmp);
2602
2602
  }
@@ -2691,7 +2691,7 @@ SWIGINTERN void Gosu_Window_gl(Gosu::Window *self){
2691
2691
  rb_yield(Qnil);
2692
2692
  self->graphics().endGL();
2693
2693
  }
2694
- SWIGINTERN void Gosu_Window_clipTo(Gosu::Window *self,int x,int y,unsigned int width,unsigned int height){
2694
+ SWIGINTERN void Gosu_Window_clipTo(Gosu::Window *self,double x,double y,double width,double height){
2695
2695
  self->graphics().beginClipping(x, y, width, height);
2696
2696
  rb_yield(Qnil);
2697
2697
  self->graphics().endClipping();
@@ -4801,12 +4801,6 @@ _wrap_cyan_get(VALUE self) {
4801
4801
 
4802
4802
  swig_class SwigClassFont;
4803
4803
 
4804
- SWIGINTERN void
4805
- free_Gosu_Font(Gosu::Font *arg1) {
4806
- SWIG_RubyRemoveTracking(arg1);
4807
- delete arg1;
4808
- }
4809
-
4810
4804
  SWIGINTERN VALUE
4811
4805
  _wrap_Font_name(int argc, VALUE *argv, VALUE self) {
4812
4806
  Gosu::Font *arg1 = (Gosu::Font *) 0 ;
@@ -5354,6 +5348,12 @@ fail:
5354
5348
  }
5355
5349
 
5356
5350
 
5351
+ SWIGINTERN void
5352
+ free_Gosu_Font(Gosu::Font *arg1) {
5353
+ SWIG_RubyRemoveTracking(arg1);
5354
+ delete arg1;
5355
+ }
5356
+
5357
5357
  swig_class SwigClassGLTexInfo;
5358
5358
 
5359
5359
  SWIGINTERN VALUE
@@ -5669,12 +5669,6 @@ free_Gosu_GLTexInfo(Gosu::GLTexInfo *arg1) {
5669
5669
 
5670
5670
  swig_class SwigClassImage;
5671
5671
 
5672
- SWIGINTERN void
5673
- free_Gosu_Image(Gosu::Image *arg1) {
5674
- SWIG_RubyRemoveTracking(arg1);
5675
- delete arg1;
5676
- }
5677
-
5678
5672
  SWIGINTERN VALUE
5679
5673
  _wrap_Image_width(int argc, VALUE *argv, VALUE self) {
5680
5674
  Gosu::Image *arg1 = (Gosu::Image *) 0 ;
@@ -6594,7 +6588,7 @@ _wrap_Image_from_text7(int argc, VALUE *argv, VALUE self) {
6594
6588
  std::wstring *arg2 = 0 ;
6595
6589
  std::wstring *arg3 = 0 ;
6596
6590
  unsigned int arg4 ;
6597
- unsigned int arg5 ;
6591
+ int arg5 ;
6598
6592
  unsigned int arg6 ;
6599
6593
  Gosu::TextAlign arg7 ;
6600
6594
  void *argp1 = 0 ;
@@ -6603,7 +6597,7 @@ _wrap_Image_from_text7(int argc, VALUE *argv, VALUE self) {
6603
6597
  std::wstring temp3 ;
6604
6598
  unsigned int val4 ;
6605
6599
  int ecode4 = 0 ;
6606
- unsigned int val5 ;
6600
+ int val5 ;
6607
6601
  int ecode5 = 0 ;
6608
6602
  unsigned int val6 ;
6609
6603
  int ecode6 = 0 ;
@@ -6636,11 +6630,11 @@ _wrap_Image_from_text7(int argc, VALUE *argv, VALUE self) {
6636
6630
  SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "unsigned int","Gosu_Image_fromText7", 4, argv[3] ));
6637
6631
  }
6638
6632
  arg4 = static_cast< unsigned int >(val4);
6639
- ecode5 = SWIG_AsVal_unsigned_SS_int(argv[4], &val5);
6633
+ ecode5 = SWIG_AsVal_int(argv[4], &val5);
6640
6634
  if (!SWIG_IsOK(ecode5)) {
6641
- SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "unsigned int","Gosu_Image_fromText7", 5, argv[4] ));
6635
+ SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "int","Gosu_Image_fromText7", 5, argv[4] ));
6642
6636
  }
6643
- arg5 = static_cast< unsigned int >(val5);
6637
+ arg5 = static_cast< int >(val5);
6644
6638
  ecode6 = SWIG_AsVal_unsigned_SS_int(argv[5], &val6);
6645
6639
  if (!SWIG_IsOK(ecode6)) {
6646
6640
  SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "unsigned int","Gosu_Image_fromText7", 6, argv[5] ));
@@ -6828,6 +6822,12 @@ fail:
6828
6822
  }
6829
6823
 
6830
6824
 
6825
+ SWIGINTERN void
6826
+ free_Gosu_Image(Gosu::Image *arg1) {
6827
+ SWIG_RubyRemoveTracking(arg1);
6828
+ delete arg1;
6829
+ }
6830
+
6831
6831
  swig_class SwigClassSampleInstance;
6832
6832
 
6833
6833
  #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
@@ -7187,12 +7187,6 @@ fail:
7187
7187
  }
7188
7188
 
7189
7189
 
7190
- SWIGINTERN void
7191
- free_Gosu_Sample(Gosu::Sample *arg1) {
7192
- SWIG_RubyRemoveTracking(arg1);
7193
- delete arg1;
7194
- }
7195
-
7196
7190
  SWIGINTERN VALUE
7197
7191
  _wrap_Sample_play(int argc, VALUE *argv, VALUE self) {
7198
7192
  Gosu::Sample *arg1 = (Gosu::Sample *) 0 ;
@@ -7321,6 +7315,12 @@ fail:
7321
7315
  }
7322
7316
 
7323
7317
 
7318
+ SWIGINTERN void
7319
+ free_Gosu_Sample(Gosu::Sample *arg1) {
7320
+ SWIG_RubyRemoveTracking(arg1);
7321
+ delete arg1;
7322
+ }
7323
+
7324
7324
  swig_class SwigClassSong;
7325
7325
 
7326
7326
  #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
@@ -9440,19 +9440,19 @@ fail:
9440
9440
  SWIGINTERN VALUE
9441
9441
  _wrap_Window_clip_to(int argc, VALUE *argv, VALUE self) {
9442
9442
  Gosu::Window *arg1 = (Gosu::Window *) 0 ;
9443
- int arg2 ;
9444
- int arg3 ;
9445
- unsigned int arg4 ;
9446
- unsigned int arg5 ;
9443
+ double arg2 ;
9444
+ double arg3 ;
9445
+ double arg4 ;
9446
+ double arg5 ;
9447
9447
  void *argp1 = 0 ;
9448
9448
  int res1 = 0 ;
9449
- int val2 ;
9449
+ double val2 ;
9450
9450
  int ecode2 = 0 ;
9451
- int val3 ;
9451
+ double val3 ;
9452
9452
  int ecode3 = 0 ;
9453
- unsigned int val4 ;
9453
+ double val4 ;
9454
9454
  int ecode4 = 0 ;
9455
- unsigned int val5 ;
9455
+ double val5 ;
9456
9456
  int ecode5 = 0 ;
9457
9457
 
9458
9458
  if ((argc < 4) || (argc > 4)) {
@@ -9463,26 +9463,26 @@ _wrap_Window_clip_to(int argc, VALUE *argv, VALUE self) {
9463
9463
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","clipTo", 1, self ));
9464
9464
  }
9465
9465
  arg1 = reinterpret_cast< Gosu::Window * >(argp1);
9466
- ecode2 = SWIG_AsVal_int(argv[0], &val2);
9466
+ ecode2 = SWIG_AsVal_double(argv[0], &val2);
9467
9467
  if (!SWIG_IsOK(ecode2)) {
9468
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","clipTo", 2, argv[0] ));
9468
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","clipTo", 2, argv[0] ));
9469
9469
  }
9470
- arg2 = static_cast< int >(val2);
9471
- ecode3 = SWIG_AsVal_int(argv[1], &val3);
9470
+ arg2 = static_cast< double >(val2);
9471
+ ecode3 = SWIG_AsVal_double(argv[1], &val3);
9472
9472
  if (!SWIG_IsOK(ecode3)) {
9473
- SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","clipTo", 3, argv[1] ));
9473
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","clipTo", 3, argv[1] ));
9474
9474
  }
9475
- arg3 = static_cast< int >(val3);
9476
- ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
9475
+ arg3 = static_cast< double >(val3);
9476
+ ecode4 = SWIG_AsVal_double(argv[2], &val4);
9477
9477
  if (!SWIG_IsOK(ecode4)) {
9478
- SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "unsigned int","clipTo", 4, argv[2] ));
9478
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","clipTo", 4, argv[2] ));
9479
9479
  }
9480
- arg4 = static_cast< unsigned int >(val4);
9481
- ecode5 = SWIG_AsVal_unsigned_SS_int(argv[3], &val5);
9480
+ arg4 = static_cast< double >(val4);
9481
+ ecode5 = SWIG_AsVal_double(argv[3], &val5);
9482
9482
  if (!SWIG_IsOK(ecode5)) {
9483
- SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "unsigned int","clipTo", 5, argv[3] ));
9483
+ SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","clipTo", 5, argv[3] ));
9484
9484
  }
9485
- arg5 = static_cast< unsigned int >(val5);
9485
+ arg5 = static_cast< double >(val5);
9486
9486
  {
9487
9487
  try {
9488
9488
  Gosu_Window_clipTo(arg1,arg2,arg3,arg4,arg5);
@@ -10274,8 +10274,8 @@ SWIGEXPORT void Init_gosu(void) {
10274
10274
  SWIG_RubyInitializeTrackings();
10275
10275
  rb_define_const(mGosu, "MAJOR_VERSION", SWIG_From_int(static_cast< int >(0)));
10276
10276
  rb_define_const(mGosu, "MINOR_VERSION", SWIG_From_int(static_cast< int >(7)));
10277
- rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(23)));
10278
- rb_define_const(mGosu, "VERSION", SWIG_FromCharPtr("0.7.23"));
10277
+ rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(24)));
10278
+ rb_define_const(mGosu, "VERSION", SWIG_FromCharPtr("0.7.24"));
10279
10279
  rb_define_module_function(mGosu, "milliseconds", VALUEFUNC(_wrap_milliseconds), -1);
10280
10280
  rb_define_module_function(mGosu, "random", VALUEFUNC(_wrap_random), -1);
10281
10281
  rb_define_module_function(mGosu, "degrees_to_radians", VALUEFUNC(_wrap_degrees_to_radians), -1);
@@ -42,8 +42,7 @@ struct Gosu::Window::Impl {
42
42
 
43
43
  Gosu::Window& windowInstance();
44
44
 
45
- @interface GosuAppDelegate : NSObject <UIApplicationDelegate> {
46
- }
45
+ @interface GosuAppDelegate : NSObject <UIApplicationDelegate>
47
46
  @end
48
47
 
49
48
  namespace
@@ -55,6 +54,21 @@ namespace
55
54
  }
56
55
 
57
56
  @implementation GosuAppDelegate
57
+ // Required according to docs...
58
+ - (void)applicationProtectedDataWillBecomeUnavailable:(UIApplication *)application
59
+ {
60
+ }
61
+
62
+ // Required according to docs...
63
+ - (void)applicationProtectedDataDidBecomeAvailable:(UIApplication *)application
64
+ {
65
+ }
66
+
67
+ // Required according to docs...
68
+ - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
69
+ {
70
+ }
71
+
58
72
  - (void)applicationDidFinishLaunching:(UIApplication *)application {
59
73
  [UIDevice.currentDevice beginGeneratingDeviceOrientationNotifications];
60
74
  UIApplication.sharedApplication.idleTimerDisabled = YES;
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: 45
4
+ hash: 51
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 23
10
- version: 0.7.23
9
+ - 24
10
+ version: 0.7.24
11
11
  platform: ruby
12
12
  authors:
13
13
  - Julian Raschke
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-08-23 00:00:00 +08:00
19
+ date: 2010-09-08 00:00:00 +08:00
20
20
  default_executable:
21
21
  dependencies: []
22
22