gosu 0.7.48 → 0.7.49

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +7 -7
  2. data/.yardopts +1 -1
  3. data/Gosu/Audio.hpp +11 -3
  4. data/Gosu/Buttons.hpp +1 -1
  5. data/Gosu/Color.hpp +11 -11
  6. data/Gosu/Graphics.hpp +11 -3
  7. data/Gosu/GraphicsBase.hpp +21 -0
  8. data/Gosu/IO.hpp +12 -2
  9. data/Gosu/Image.hpp +1 -1
  10. data/Gosu/ImageData.hpp +2 -1
  11. data/Gosu/Input.hpp +8 -1
  12. data/Gosu/Platform.hpp +21 -5
  13. data/Gosu/Sockets.hpp +22 -3
  14. data/Gosu/TR1.hpp +4 -0
  15. data/Gosu/TextInput.hpp +7 -1
  16. data/Gosu/Version.hpp +2 -2
  17. data/Gosu/Window.hpp +7 -1
  18. data/GosuImpl/Audio/ALChannelManagement.hpp +11 -1
  19. data/GosuImpl/Audio/AudioOpenAL.cpp +1 -1
  20. data/GosuImpl/Graphics/BitmapApple.mm +16 -2
  21. data/GosuImpl/Graphics/BlockAllocator.hpp +2 -1
  22. data/GosuImpl/Graphics/Color.cpp +11 -11
  23. data/GosuImpl/Graphics/DrawOpQueue.hpp +0 -2
  24. data/GosuImpl/Graphics/Font.cpp +2 -2
  25. data/GosuImpl/Graphics/GosuView.hpp +1 -17
  26. data/GosuImpl/Graphics/GosuView.mm +68 -32
  27. data/GosuImpl/Graphics/Graphics.cpp +14 -63
  28. data/GosuImpl/Graphics/Image.cpp +1 -1
  29. data/GosuImpl/Graphics/LargeImageData.hpp +3 -2
  30. data/GosuImpl/Graphics/Macro.hpp +7 -6
  31. data/GosuImpl/Graphics/TexChunk.cpp +2 -2
  32. data/GosuImpl/Graphics/TexChunk.hpp +1 -1
  33. data/GosuImpl/Graphics/Texture.cpp +3 -3
  34. data/GosuImpl/Graphics/Texture.hpp +1 -1
  35. data/GosuImpl/Iconv.hpp +0 -5
  36. data/GosuImpl/InputTouch.mm +2 -12
  37. data/GosuImpl/WindowTouch.mm +70 -34
  38. data/GosuImpl/WindowWin.cpp +2 -2
  39. data/GosuImpl/WindowX.cpp +4 -4
  40. data/linux/extconf.rb +10 -2
  41. data/reference/gosu.rb +848 -266
  42. metadata +26 -46
  43. data/Gosu/Async.hpp +0 -50
  44. data/GosuImpl/Async.cpp +0 -38
  45. data/GosuImpl/Orientation.hpp +0 -15
  46. data/GosuImpl/Orientation.mm +0 -34
  47. data/GosuImpl/RubyGosuStub.mm +0 -52
  48. data/reference/Drawing_with_Colors.rdoc +0 -5
  49. data/reference/Order_of_Corners.rdoc +0 -5
  50. data/reference/Tileability.rdoc +0 -11
  51. data/reference/Z_Ordering.rdoc +0 -5
metadata CHANGED
@@ -1,30 +1,32 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: gosu
3
- version: !ruby/object:Gem::Version
4
- version: 0.7.48
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.7.49
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Julian Raschke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
-
12
- date: 2013-07-14 00:00:00 Z
11
+ date: 2013-10-28 00:00:00.000000000 Z
13
12
  dependencies: []
13
+ description: |2
14
+ 2D game development library.
15
+
16
+ Gosu features easy to use and game-friendly interfaces to 2D graphics
17
+ and text (accelerated by 3D hardware), sound samples and music as well as
18
+ keyboard, mouse and gamepad/joystick input.
14
19
 
15
- 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 OpenGL.\n"
20
+ Also includes demos for integration with RMagick, Chipmunk and OpenGL.
16
21
  email: julian@raschke.de
17
22
  executables: []
18
-
19
- extensions:
23
+ extensions:
20
24
  - linux/extconf.rb
21
25
  extra_rdoc_files: []
22
-
23
- files:
26
+ files:
24
27
  - .yardopts
25
28
  - COPYING
26
29
  - README.txt
27
- - Gosu/Async.hpp
28
30
  - Gosu/Audio.hpp
29
31
  - Gosu/AutoLink.hpp
30
32
  - Gosu/Bitmap.hpp
@@ -82,11 +84,6 @@ files:
82
84
  - examples/media/Star.png
83
85
  - examples/media/Starfighter.bmp
84
86
  - reference/gosu.rb
85
- - reference/Drawing_with_Colors.rdoc
86
- - reference/Order_of_Corners.rdoc
87
- - reference/Tileability.rdoc
88
- - reference/Z_Ordering.rdoc
89
- - GosuImpl/Async.cpp
90
87
  - GosuImpl/Audio/ALChannelManagement.hpp
91
88
  - GosuImpl/Audio/AudioFile.hpp
92
89
  - GosuImpl/Audio/AudioOpenAL.cpp
@@ -147,10 +144,7 @@ files:
147
144
  - GosuImpl/Inspection.cpp
148
145
  - GosuImpl/MacUtility.hpp
149
146
  - GosuImpl/Math.cpp
150
- - GosuImpl/Orientation.hpp
151
- - GosuImpl/Orientation.mm
152
147
  - GosuImpl/RubyGosu.swg
153
- - GosuImpl/RubyGosuStub.mm
154
148
  - GosuImpl/RubyGosu_SWIG_GC_PATCH.patch
155
149
  - GosuImpl/RubyGosu_SWIG_RENAME_PATCH.patch
156
150
  - GosuImpl/RubyGosu_wrap.cxx
@@ -260,35 +254,22 @@ files:
260
254
  - dependencies/ogg_vorbis.license
261
255
  homepage: http://www.libgosu.org/
262
256
  licenses: []
263
-
264
257
  metadata: {}
265
-
266
258
  post_install_message:
267
- rdoc_options:
268
- - README.txt
269
- - COPYING
270
- - reference/gosu.rb
271
- - reference/Drawing_with_Colors.rdoc
272
- - reference/Order_of_Corners.rdoc
273
- - reference/Tileability.rdoc
274
- - reference/Z_Ordering.rdoc
275
- - --title
276
- - Gosu
277
- - --main
278
- - README.txt
279
- require_paths:
259
+ rdoc_options: []
260
+ require_paths:
280
261
  - lib
281
- required_ruby_version: !ruby/object:Gem::Requirement
282
- requirements:
283
- - - ">="
284
- - !ruby/object:Gem::Version
262
+ required_ruby_version: !ruby/object:Gem::Requirement
263
+ requirements:
264
+ - - '>='
265
+ - !ruby/object:Gem::Version
285
266
  version: 1.8.2
286
- required_rubygems_version: !ruby/object:Gem::Requirement
287
- requirements:
288
- - - ">="
289
- - !ruby/object:Gem::Version
290
- version: "0"
291
- requirements:
267
+ required_rubygems_version: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - '>='
270
+ - !ruby/object:Gem::Version
271
+ version: '0'
272
+ requirements:
292
273
  - See https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux
293
274
  rubyforge_project:
294
275
  rubygems_version: 2.0.3
@@ -296,4 +277,3 @@ signing_key:
296
277
  specification_version: 4
297
278
  summary: 2D game development library.
298
279
  test_files: []
299
-
@@ -1,50 +0,0 @@
1
- // Undocumented for the first few iterations. Interface may change rapidly.
2
- // This is mainly a proof of concept. Stability will be the highest on OS X.
3
-
4
- #if 0
5
- #ifndef GOSU_ASYNC_HPP
6
- #define GOSU_ASYNC_HPP
7
-
8
- #include <Gosu/Fwd.hpp>
9
- #include <Gosu/TR1.hpp>
10
- #include <thread>
11
- #include <memory>
12
- #include <string>
13
-
14
- namespace Gosu
15
- {
16
- template<typename Result>
17
- class AsyncResult
18
- {
19
- std::tr1::shared_ptr<std::tr1::try_mutex> mutex;
20
- std::tr1::shared_ptr<std::auto_ptr<Result> > result;
21
-
22
- public:
23
- AsyncResult(const std::tr1::shared_ptr<std::tr1::try_mutex>& mutex,
24
- const std::tr1::shared_ptr<std::auto_ptr<Result> >& result)
25
- : mutex(mutex), result(result)
26
- {
27
- }
28
-
29
- bool hasValue() const
30
- {
31
- std::tr1::try_mutex::scoped_try_lock lock(*mutex);
32
- return lock && result->get();
33
- }
34
-
35
- std::auto_ptr<Result> takeValue()
36
- {
37
- std::tr1::try_mutex::scoped_lock lock(*mutex);
38
- return *result;
39
- }
40
- };
41
-
42
- // TODO: Will only work if the window doesn't die inbetween.
43
- // TODO: More functions to come; or a general interface?
44
-
45
- AsyncResult<Image>
46
- asyncNewImage(Window& window, const std::wstring& filename);
47
- }
48
-
49
- #endif
50
- #endif
@@ -1,38 +0,0 @@
1
- #include <Gosu/Async.hpp>
2
- #include <Gosu/Graphics.hpp>
3
- #include <Gosu/Image.hpp>
4
- #include <Gosu/TR1.hpp>
5
- #include <Gosu/Window.hpp>
6
-
7
- using namespace std;
8
- using namespace std::tr1;
9
-
10
- namespace Gosu
11
- {
12
- namespace
13
- {
14
- void asyncNewImage_Impl(Window& window, std::wstring filename,
15
- Window::SharedContext context,
16
- shared_ptr<try_mutex> mutex,
17
- shared_ptr<std::auto_ptr<Image> > result)
18
- {
19
- try_mutex::scoped_lock lock(*mutex);
20
- (*context)();
21
- result->reset(new Image(window.graphics(), filename));
22
- }
23
- }
24
- }
25
-
26
- Gosu::AsyncResult<Gosu::Image>
27
- Gosu::asyncNewImage(Window& window, const std::wstring& filename)
28
- {
29
- shared_ptr<try_mutex> mutex(new try_mutex);
30
- shared_ptr<auto_ptr<Image> > image(new std::auto_ptr<Image>);
31
- thread thread(bind(asyncNewImage_Impl,
32
- ref(window),
33
- filename,
34
- window.createSharedContext(),
35
- mutex,
36
- image));
37
- return AsyncResult<Image>(mutex, image);
38
- }
@@ -1,15 +0,0 @@
1
- #ifndef GOSUIMPL_ORIENTATION_HPP
2
- #define GOSUIMPL_ORIENTATION_HPP
3
-
4
- namespace Gosu
5
- {
6
- enum Orientation
7
- {
8
- orLandscapeLeft,
9
- orLandscapeRight
10
- };
11
-
12
- Orientation currentOrientation();
13
- }
14
-
15
- #endif
@@ -1,34 +0,0 @@
1
- #include "Orientation.hpp"
2
- #include <Gosu/Timing.hpp>
3
- #import <UIKit/UIKit.h>
4
-
5
- namespace
6
- {
7
- static const unsigned CHANGE_AFTER_MS = 500;
8
-
9
- Gosu::Orientation orientationToGosu(UIDeviceOrientation orientation)
10
- {
11
- return orientation == UIDeviceOrientationLandscapeLeft ? Gosu::orLandscapeLeft : Gosu::orLandscapeRight;
12
- }
13
- }
14
-
15
- Gosu::Orientation Gosu::currentOrientation()
16
- {
17
- UIDeviceOrientation newOrientation = [[UIDevice currentDevice] orientation];
18
- unsigned now = Gosu::milliseconds();
19
-
20
- static Orientation orientation = Gosu::Orientation(-1);
21
- static unsigned waitingForChangeSince = now;
22
-
23
- if (not UIDeviceOrientationIsLandscape(newOrientation) or orientationToGosu(newOrientation) == orientation)
24
- waitingForChangeSince = now;
25
-
26
- if (now - waitingForChangeSince >= CHANGE_AFTER_MS or orientation == Gosu::Orientation(-1))
27
- {
28
- orientation = orientationToGosu(newOrientation);
29
- [UIApplication sharedApplication].statusBarOrientation =
30
- (newOrientation == UIDeviceOrientationLandscapeLeft ? UIInterfaceOrientationLandscapeRight : UIInterfaceOrientationLandscapeLeft);
31
- }
32
-
33
- return orientation;
34
- }
@@ -1,52 +0,0 @@
1
- #include <Gosu/Directories.hpp>
2
- #include <Gosu/Utility.hpp>
3
- #include <unistd.h>
4
- #include "ruby.h"
5
-
6
- extern "C" void Init_gosu();
7
-
8
- /*#include "oniguruma.h"
9
-
10
- extern "C" int rb_enc_register(const char *, OnigEncodingType*);
11
- extern "C" void rb_encdb_declare(const char *name);
12
- extern OnigEncodingType OnigEncodingASCII;
13
- extern OnigEncodingType OnigEncodingUS_ASCII;
14
- extern OnigEncodingType OnigEncodingUTF_8;
15
- extern OnigEncodingType OnigEncodingUTF_16BE;
16
- extern OnigEncodingType OnigEncodingUTF_16LE;
17
- extern OnigEncodingType OnigEncodingUTF_32BE;
18
- extern OnigEncodingType OnigEncodingUTF_32LE;*/
19
-
20
- int main()
21
- {
22
- std::string resourcePath = Gosu::wstringToUTF8(Gosu::resourcePrefix());
23
- chdir(resourcePath.c_str());
24
-
25
- std::string mainPath = resourcePath + "gosu/run.rb";
26
-
27
- char* argv[] = { "ruby", const_cast<char*>(mainPath.c_str()), 0 };
28
- int argc = 2;
29
-
30
- char** argvPointer = argv;
31
- ruby_sysinit(&argc, &argvPointer);
32
- {
33
- RUBY_INIT_STACK;
34
-
35
- ruby_init();
36
-
37
- Init_gosu();
38
-
39
- /*rb_encdb_declare(OnigEncodingASCII.name);
40
- rb_encdb_declare(OnigEncodingUS_ASCII.name);
41
- rb_encdb_declare(OnigEncodingUTF_8.name);
42
- rb_enc_register(OnigEncodingUTF_16BE.name, &OnigEncodingUTF_16BE);
43
- rb_enc_register(OnigEncodingUTF_16LE.name, &OnigEncodingUTF_16LE);
44
- rb_enc_register(OnigEncodingUTF_32BE.name, &OnigEncodingUTF_32BE);
45
- rb_enc_register(OnigEncodingUTF_32LE.name, &OnigEncodingUTF_32LE);*/
46
-
47
- rb_eval_string("$LOADED_FEATURES << 'gosu.bundle'");
48
- rb_eval_string("$LOADED_FEATURES << 'rubygems.rb'");
49
-
50
- return ruby_run_node(ruby_options(argc, argv));
51
- }
52
- }
@@ -1,5 +0,0 @@
1
- = Drawing with Colors
2
-
3
- Almost all image drawing functions accept modulation colors. The colors of all pixels on the source image will be multiplied with these colors, where a channel value of 255 corresponds to the maximum value of 1.0. This means modulation colors can be used only to reduce particular channels of an image.
4
-
5
- The most obvious use of this is to supply a color with an alpha value less than 255 so the image will drawn transparently, but you can also use this to darken images or to draw them in a different hue (which works best if the original image is mostly grayscale).
@@ -1,5 +0,0 @@
1
- = Order of Corners
2
-
3
- In all functions that expect arguments for all four corners of a rectangle or quadrilateral, you can either pass clockwise coordinates, or coordinates in the following order (a Z shape):
4
-
5
- http://www.libgosu.org/wiki_images/corner_indices.png
@@ -1,11 +0,0 @@
1
- = Tileability
2
-
3
- Functions related to image creation accept a boolean "tileable" argument. This is a consequence of using 3D hardware acceleration. Try to notice the subtle difference between these two, overstretched images:
4
-
5
- http://www.libgosu.org/wiki_images/hard_borders.png
6
-
7
- When you draw an image with stretching factors other than 1.0 (10.0 in this case) or at odd coordinates, it will become interpolated—which, in general, is much better than getting all pixel-y.
8
-
9
- But take a look at the image's borders. The image of the left girl was created with tileable set to 'false' (the default) and the borders fade out. The image of the right girl, which was created with tileable set to 'true, does not fade out at all, but just ends on its borders.
10
-
11
- While most images should not be tileable, you should always pass true for map tiles.
@@ -1,5 +0,0 @@
1
- = Z-Ordering
2
-
3
- All drawing operations in Gosu accept a floating-point value called "z" (technically, a double). Things drawn with a higher z position will be drawn over those with a lower one. If two things have the same z position, they will be drawn in the order the drawing functions were called.
4
-
5
- If you do not wish to use z ordering, just pass the same constant all the time.