gosu 0.7.26.1 → 0.7.27

Sign up to get free protection for your applications and to get access to all the features.
@@ -2230,6 +2230,7 @@ static VALUE mGosu;
2230
2230
  #include <Gosu/Graphics.hpp>
2231
2231
  #include <Gosu/Image.hpp>
2232
2232
  #include <Gosu/ImageData.hpp>
2233
+ #include <Gosu/Inspection.hpp>
2233
2234
  #include <Gosu/Input.hpp>
2234
2235
  #include <Gosu/IO.hpp>
2235
2236
  #include <Gosu/Math.hpp>
@@ -7332,6 +7333,28 @@ free_Gosu_Image(Gosu::Image *arg1) {
7332
7333
  delete arg1;
7333
7334
  }
7334
7335
 
7336
+ SWIGINTERN VALUE
7337
+ _wrap_fps(int argc, VALUE *argv, VALUE self) {
7338
+ int result;
7339
+ VALUE vresult = Qnil;
7340
+
7341
+ if ((argc < 0) || (argc > 0)) {
7342
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
7343
+ }
7344
+ {
7345
+ try {
7346
+ result = (int)Gosu::fps();
7347
+ } catch(const std::runtime_error& e) {
7348
+ SWIG_exception(SWIG_RuntimeError, e.what());
7349
+ }
7350
+ }
7351
+ vresult = SWIG_From_int(static_cast< int >(result));
7352
+ return vresult;
7353
+ fail:
7354
+ return Qnil;
7355
+ }
7356
+
7357
+
7335
7358
  swig_class SwigClassSampleInstance;
7336
7359
 
7337
7360
  #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
@@ -10958,8 +10981,8 @@ SWIGEXPORT void Init_gosu(void) {
10958
10981
  SWIG_RubyInitializeTrackings();
10959
10982
  rb_define_const(mGosu, "MAJOR_VERSION", SWIG_From_int(static_cast< int >(0)));
10960
10983
  rb_define_const(mGosu, "MINOR_VERSION", SWIG_From_int(static_cast< int >(7)));
10961
- rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(26)));
10962
- rb_define_const(mGosu, "VERSION", SWIG_FromCharPtr("0.7.26.1"));
10984
+ rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(27)));
10985
+ rb_define_const(mGosu, "VERSION", SWIG_FromCharPtr("0.7.27"));
10963
10986
  rb_define_module_function(mGosu, "milliseconds", VALUEFUNC(_wrap_milliseconds), -1);
10964
10987
  rb_define_module_function(mGosu, "random", VALUEFUNC(_wrap_random), -1);
10965
10988
  rb_define_module_function(mGosu, "degrees_to_radians", VALUEFUNC(_wrap_degrees_to_radians), -1);
@@ -11082,6 +11105,7 @@ SWIGEXPORT void Init_gosu(void) {
11082
11105
  SwigClassImage.mark = 0;
11083
11106
  SwigClassImage.destroy = (void (*)(void *)) free_Gosu_Image;
11084
11107
  SwigClassImage.trackObjects = 1;
11108
+ rb_define_module_function(mGosu, "fps", VALUEFUNC(_wrap_fps), -1);
11085
11109
 
11086
11110
  SwigClassSampleInstance.klass = rb_define_class_under(mGosu, "SampleInstance", rb_cObject);
11087
11111
  SWIG_TypeClientData(SWIGTYPE_p_Gosu__SampleInstance, (void *) &SwigClassSampleInstance);
@@ -11113,8 +11137,6 @@ SWIGEXPORT void Init_gosu(void) {
11113
11137
  SWIG_TypeClientData(SWIGTYPE_p_Gosu__Song, (void *) &SwigClassSong);
11114
11138
  rb_define_alloc_func(SwigClassSong.klass, _wrap_Song_allocate);
11115
11139
  rb_define_method(SwigClassSong.klass, "initialize", VALUEFUNC(_wrap_new_Song), -1);
11116
- rb_define_const(SwigClassSong.klass, "StStream", SWIG_From_int(static_cast< int >(Gosu::Song::stStream)));
11117
- rb_define_const(SwigClassSong.klass, "StModule", SWIG_From_int(static_cast< int >(Gosu::Song::stModule)));
11118
11140
  rb_define_singleton_method(SwigClassSong.klass, "current_song", VALUEFUNC(_wrap_Song_current_song), -1);
11119
11141
  rb_define_method(SwigClassSong.klass, "play", VALUEFUNC(_wrap_Song_play), -1);
11120
11142
  rb_define_method(SwigClassSong.klass, "pause", VALUEFUNC(_wrap_Song_pause), -1);
@@ -13,7 +13,13 @@
13
13
  #import <boost/bind.hpp>
14
14
  #import <vector>
15
15
 
16
- namespace Gosu {
16
+ namespace Gosu
17
+ {
18
+ namespace FPS
19
+ {
20
+ void registerFrame();
21
+ }
22
+
17
23
  NSRect screenRect = [[[NSScreen screens] objectAtIndex: 0] frame];
18
24
 
19
25
  unsigned screenWidth()
@@ -506,9 +512,9 @@ void Gosu::Window::Impl::doTick(Window& window)
506
512
  window.input().update();
507
513
  window.update();
508
514
 
509
- if (window.needsRedraw() and
510
- window.graphics().begin())
515
+ if (window.needsRedraw() and window.graphics().begin())
511
516
  {
517
+ FPS::registerFrame();
512
518
  window.draw();
513
519
  window.graphics().end();
514
520
  [window.pimpl->context.obj() flushBuffer];
@@ -10,7 +10,8 @@
10
10
  #import <UIKit/UIKit.h>
11
11
  #import <OpenGLES/EAGL.h>
12
12
 
13
- namespace Gosu {
13
+ namespace Gosu
14
+ {
14
15
  CGRect screenRect = [[UIScreen mainScreen] bounds];
15
16
 
16
17
  unsigned screenWidth()
@@ -19,7 +19,10 @@
19
19
 
20
20
  namespace Gosu
21
21
  {
22
- HWND __Gosu_HWND_for_FMOD = 0;
22
+ namespace FPS
23
+ {
24
+ void registerFrame();
25
+ }
23
26
 
24
27
  unsigned screenWidth()
25
28
  {
@@ -217,7 +220,6 @@ Gosu::Window::Window(unsigned width, unsigned height, bool fullscreen,
217
220
  CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0,
218
221
  Win::instance(), 0);
219
222
  Win::check(pimpl->handle);
220
- __Gosu_HWND_for_FMOD = pimpl->handle;
221
223
 
222
224
  pimpl->hdc = GetDC(handle());
223
225
  Win::check(pimpl->hdc);
@@ -293,7 +295,6 @@ Gosu::Window::Window(unsigned width, unsigned height, bool fullscreen,
293
295
  Gosu::Window::~Window()
294
296
  {
295
297
  wglMakeCurrent(0, 0);
296
- __Gosu_HWND_for_FMOD = 0;
297
298
  }
298
299
 
299
300
  std::wstring Gosu::Window::caption() const
@@ -363,7 +364,10 @@ void Gosu::Window::show()
363
364
  SendMessage(handle(), WM_SETCURSOR, reinterpret_cast<WPARAM>(handle()), HTCLIENT);
364
365
  update();
365
366
  if (needsRedraw())
367
+ {
366
368
  ::InvalidateRect(handle(), 0, FALSE);
369
+ FPS::registerFrame();
370
+ }
367
371
  // There probably should be a proper "oncePerTick" handler
368
372
  // system in the future. Right now, this is necessary to give
369
373
  // timeslices to Ruby's green threads in Ruby/Gosu.
data/GosuImpl/WindowX.cpp CHANGED
@@ -61,6 +61,11 @@ namespace
61
61
 
62
62
  namespace Gosu
63
63
  {
64
+ namespace FPS
65
+ {
66
+ void registerFrame();
67
+ }
68
+
64
69
  unsigned screenWidth()
65
70
  {
66
71
  scoped_resource<Display> display(XOpenDisplay(NULL), XCloseDisplay);
@@ -169,6 +174,7 @@ struct Gosu::Window::Impl
169
174
 
170
175
  if (window->needsRedraw() && window->graphics().begin(Colors::black))
171
176
  {
177
+ FPS::registerFrame();
172
178
  window->draw();
173
179
  window->graphics().end();
174
180
  glXSwapBuffers(display, this->window);
data/linux/extconf.rb CHANGED
@@ -17,12 +17,12 @@ SOURCE_FILES =
17
17
  %w(Math.cpp Utility.cpp IO.cpp FileUnix.cpp InputX.cpp TextInputX.cpp TimingUnix.cpp WindowX.cpp
18
18
  Graphics/Bitmap.cpp Graphics/BitmapUtils.cpp Graphics/Color.cpp
19
19
  Graphics/TexChunk.cpp Graphics/Graphics.cpp Graphics/Image.cpp
20
- Graphics/BlockAllocator.cpp
20
+ Graphics/BlockAllocator.cpp Inspection.cpp
21
21
  Graphics/Texture.cpp Graphics/LargeImageData.cpp
22
22
  Graphics/BitmapPNG.cpp Graphics/Font.cpp Graphics/BitmapBMP.cpp
23
23
  Graphics/TextUnix.cpp Graphics/Text.cpp Graphics/Transform.cpp
24
24
  Graphics/BitmapColorKey.cpp DirectoriesUnix.cpp
25
- Audio/AudioSDL.cpp RubyGosu_wrap.cxx)
25
+ Audio/AudioAudiere.cpp RubyGosu_wrap.cxx)
26
26
 
27
27
  require 'mkmf'
28
28
 
@@ -35,11 +35,11 @@ SOURCE_FILES.each { |file| `cp ../GosuImpl/#{file} #{File.basename(file)}` }
35
35
  `ln -s ../linux/gosu.so ../lib/gosu.so`
36
36
 
37
37
  sdl_config = with_config("sdl-config", "sdl-config")
38
+ audiere_config = with_config("audiere-config", "audiere-config")
38
39
  pango_config = "pkg-config pangoft2" # FIXME should probably use with_config
39
40
 
40
- $INCFLAGS << " -I../ -I../GosuImpl `#{sdl_config} --cflags` `#{pango_config} --cflags`"
41
- $LDFLAGS << " `#{sdl_config} --libs` `#{pango_config} --libs` -lX11"
42
- have_header('SDL_mixer.h') if have_library('SDL_mixer', 'Mix_OpenAudio')
41
+ $INCFLAGS << " -I../ -I../GosuImpl `#{sdl_config} --cflags` `#{audiere_config} --cxxflags` `#{pango_config} --cflags`"
42
+ $LDFLAGS << " `#{sdl_config} --libs` `#{audiere_config} --libs` `#{pango_config} --libs` -lX11"
43
43
  have_header('SDL_ttf.h') if have_library('SDL_ttf', 'TTF_RenderUTF8_Blended')
44
44
  have_header('gl.h') if have_library('GL', 'glMatrixMode')
45
45
  have_header('png.h') if have_library('png', 'png_sig_cmp')
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gosu
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
5
- prerelease: false
4
+ hash: 53
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 26
10
- - 1
11
- version: 0.7.26.1
9
+ - 27
10
+ version: 0.7.27
12
11
  platform: ruby
13
12
  authors:
14
13
  - Julian Raschke
@@ -17,7 +16,7 @@ autorequire:
17
16
  bindir: bin
18
17
  cert_chain: []
19
18
 
20
- date: 2011-01-10 00:00:00 +08:00
19
+ date: 2011-01-29 00:00:00 +08:00
21
20
  default_executable:
22
21
  dependencies: []
23
22
 
@@ -49,6 +48,7 @@ files:
49
48
  - Gosu/Image.hpp
50
49
  - Gosu/ImageData.hpp
51
50
  - Gosu/Input.hpp
51
+ - Gosu/Inspection.hpp
52
52
  - Gosu/IO.hpp
53
53
  - Gosu/Math.hpp
54
54
  - Gosu/Platform.hpp
@@ -87,12 +87,12 @@ files:
87
87
  - examples/media/Starfighter.bmp
88
88
  - GosuImpl/Async.cpp
89
89
  - GosuImpl/Audio/ALChannelManagement.hpp
90
+ - GosuImpl/Audio/AudioAudiere.cpp
90
91
  - GosuImpl/Audio/AudioFile.hpp
91
92
  - GosuImpl/Audio/AudioOpenAL.mm
92
93
  - GosuImpl/Audio/AudioSDL.cpp
93
94
  - GosuImpl/Audio/AudioToolboxFile.hpp
94
95
  - GosuImpl/Audio/OggFile.hpp
95
- - GosuImpl/AudioFmod.cpp
96
96
  - GosuImpl/DirectoriesMac.mm
97
97
  - GosuImpl/DirectoriesTouch.mm
98
98
  - GosuImpl/DirectoriesUnix.cpp
@@ -139,6 +139,7 @@ files:
139
139
  - GosuImpl/InputTouch.mm
140
140
  - GosuImpl/InputWin.cpp
141
141
  - GosuImpl/InputX.cpp
142
+ - GosuImpl/Inspection.cpp
142
143
  - GosuImpl/IO.cpp
143
144
  - GosuImpl/MacUtility.hpp
144
145
  - GosuImpl/Math.cpp
@@ -203,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
204
  requirements:
204
205
  - See http://code.google.com/p/gosu/wiki/GettingStartedOnLinux
205
206
  rubyforge_project:
206
- rubygems_version: 1.3.7
207
+ rubygems_version: 1.4.2
207
208
  signing_key:
208
209
  specification_version: 3
209
210
  summary: 2D game development library.