gosu 0.7.40-x86-mingw32 → 0.7.41-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
data/Gosu/Image.hpp CHANGED
@@ -5,9 +5,11 @@
5
5
  #define GOSU_IMAGE_HPP
6
6
 
7
7
  #include <Gosu/Fwd.hpp>
8
- #include <Gosu/Bitmap.hpp>
8
+ #include <Gosu/Color.hpp>
9
+ #include <Gosu/GraphicsBase.hpp>
9
10
  #include <Gosu/TR1.hpp>
10
11
  #include <memory>
12
+ #include <vector>
11
13
 
12
14
  namespace Gosu
13
15
  {
@@ -79,7 +81,10 @@ namespace Gosu
79
81
  //! Provides access to the underlying image data object.
80
82
  ImageData& getData() const;
81
83
  };
82
-
84
+
85
+ std::vector<Gosu::Image> loadTiles(Graphics& graphics, const Bitmap& bmp, int tileWidth, int tileHeight, bool tileable);
86
+ std::vector<Gosu::Image> loadTiles(Graphics& graphics, const std::wstring& bmp, int tileWidth, int tileHeight, bool tileable);
87
+
83
88
  //! Convenience function that splits a BMP or PNG file into an array
84
89
  //! of small rectangles and creates images from them.
85
90
  //! \param tileWidth If positive, specifies the width of one tile in
@@ -89,14 +94,13 @@ namespace Gosu
89
94
  //! Must provide a push_back member function; vector<tr1::shared_ptr<Image>>
90
95
  //! or boost::ptr_vector<Image> are good choices.
91
96
  template<typename Container>
92
- void imagesFromTiledBitmap(Graphics& graphics, const std::wstring& filename,
93
- int tileWidth, int tileHeight, bool tileable, Container& appendTo)
97
+ void imagesFromTiledBitmap(Graphics& graphics, const std::wstring& filename, int tileWidth, int tileHeight, bool tileable, Container& appendTo)
94
98
  {
95
- Bitmap bmp;
96
- loadImageFile(bmp, filename);
97
- imagesFromTiledBitmap(graphics, bmp, tileWidth, tileHeight, tileable, appendTo);
99
+ std::vector<Gosu::Image> tiles = loadTiles(graphics, filename, tileWidth, tileHeight, tileable);
100
+ for (int i = 0, num = tiles.size(); i < num; ++i)
101
+ appendTo.push_back(typename Container::value_type(new Gosu::Image(tiles[i])));
98
102
  }
99
-
103
+
100
104
  //! Convenience function that splits a bitmap into an area of array
101
105
  //! rectangles and creates images from them.
102
106
  //! \param tileWidth If positive, specifies the width of one tile in
@@ -109,29 +113,9 @@ namespace Gosu
109
113
  void imagesFromTiledBitmap(Graphics& graphics, const Bitmap& bmp,
110
114
  int tileWidth, int tileHeight, bool tileable, Container& appendTo)
111
115
  {
112
- int tilesX, tilesY;
113
-
114
- if (tileWidth > 0)
115
- tilesX = bmp.width() / tileWidth;
116
- else
117
- {
118
- tilesX = -tileWidth;
119
- tileWidth = bmp.width() / tilesX;
120
- }
121
-
122
- if (tileHeight > 0)
123
- tilesY = bmp.height() / tileHeight;
124
- else
125
- {
126
- tilesY = -tileHeight;
127
- tileHeight = bmp.height() / tilesY;
128
- }
129
-
130
- for (int y = 0; y < tilesY; ++y)
131
- for (int x = 0; x < tilesX; ++x)
132
- appendTo.push_back(typename Container::value_type(new Image(graphics, bmp,
133
- x * tileWidth, y * tileHeight, tileWidth, tileHeight,
134
- tileable)));
116
+ std::vector<Gosu::Image> tiles = loadTiles(graphics, bmp, tileWidth, tileHeight, tileable);
117
+ for (int i = 0, num = tiles.size(); i < num; ++i)
118
+ appendTo.push_back(typename Container::value_type(new Gosu::Image(tiles[i])));
135
119
  }
136
120
  }
137
121
 
data/Gosu/TR1.hpp CHANGED
@@ -1,26 +1,34 @@
1
1
  //! \file TR1.hpp
2
- //! Includes all parts of C++03 (TR1) that are relevant for Gosu.
2
+ //! Includes all parts of C++03 (TR1) that are relevant for Gosu. It makes available the following members of the std::tr1 namespace: array, bind, function, shared_ptr, uint*_t and int*_t.
3
3
 
4
4
  #ifndef GOSU_TR1_HPP
5
5
  #define GOSU_TR1_HPP
6
6
 
7
- #ifdef _MSC_VER
7
+ #include <memory>
8
+
9
+ #if defined(_MSC_VER) || defined(_LIBCPP_MEMORY)
8
10
  #include <array>
9
- #include <memory>
10
11
  #include <functional>
11
12
  namespace std
12
13
  {
13
14
  namespace tr1
14
15
  {
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
- }
16
+ typedef unsigned char uint8_t;
17
+ typedef unsigned short uint16_t;
18
+ typedef unsigned int uint32_t;
19
+ typedef unsigned long long uint64_t;
20
+ typedef signed char int8_t;
21
+ typedef signed short int16_t;
22
+ typedef signed int int32_t;
23
+ typedef signed long long int64_t;
24
+
25
+ #ifdef _LIBCPP_MEMORY
26
+ using std::array;
27
+ using std::bind;
28
+ using std::function;
29
+ using std::shared_ptr;
30
+ #endif
31
+ }
24
32
  }
25
33
  #else
26
34
  #include <tr1/array>
@@ -32,7 +40,7 @@
32
40
  {
33
41
  namespace tr1
34
42
  {
35
- using ::int8_t; using ::int16_t; using ::int32_t; using ::int64_t;
43
+ using ::int8_t; using ::int16_t; using ::int32_t; using ::int64_t;
36
44
  using ::uint8_t; using ::uint16_t; using ::uint32_t; using ::uint64_t;
37
45
  }
38
46
  }
data/Gosu/Version.hpp CHANGED
@@ -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 40
7
- #define GOSU_VERSION "0.7.40"
6
+ #define GOSU_POINT_VERSION 41
7
+ #define GOSU_VERSION "0.7.41"
8
8
 
9
9
  #define GOSU_COPYRIGHT_NOTICE \
10
10
  " " \
data/Gosu/Window.hpp CHANGED
@@ -105,6 +105,7 @@ namespace Gosu
105
105
  #endif
106
106
 
107
107
  #ifdef GOSU_IS_IPHONE
108
+ void* rootViewController() const;
108
109
  // iPhone-only callbacks for touch events.
109
110
  // Note that it does not hurt to override them even if you compile
110
111
  // for another platform; if you don't specify "virtual" the code
@@ -121,4 +122,8 @@ namespace Gosu
121
122
  };
122
123
  }
123
124
 
125
+ #ifdef GOSU_IS_IPHONE
126
+ Gosu::Window& windowInstance();
127
+ #endif
128
+
124
129
  #endif
data/lib/gosu.for_1_8.so CHANGED
Binary file
data/lib/gosu.for_1_9.so CHANGED
Binary file
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: 83
4
+ hash: 81
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 40
10
- version: 0.7.40
9
+ - 41
10
+ version: 0.7.41
11
11
  platform: x86-mingw32
12
12
  authors:
13
13
  - Julian Raschke
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-19 00:00:00 Z
18
+ date: 2011-12-17 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  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"