gosu 0.8.0.pre3 → 0.8.0.pre4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/Gosu/Buttons.hpp +13 -11
  3. data/{linux → ext/gosu}/extconf.rb +25 -47
  4. data/{GosuImpl/RubyGosu_wrap.cxx → ext/gosu/gosu_wrap.cxx} +3 -2
  5. data/{GosuImpl/RubyGosu_wrap.h → ext/gosu/gosu_wrap.h} +0 -0
  6. data/lib/gosu.rb +6 -7
  7. data/lib/gosu/zen.rb +12 -0
  8. data/{GosuImpl → src}/Audio/ALChannelManagement.hpp +0 -0
  9. data/{GosuImpl → src}/Audio/AudioFile.hpp +0 -0
  10. data/{GosuImpl → src}/Audio/AudioOpenAL.cpp +0 -0
  11. data/{GosuImpl → src}/Audio/AudioOpenAL.mm +0 -0
  12. data/{GosuImpl → src}/Audio/AudioToolboxFile.hpp +0 -0
  13. data/{GosuImpl → src}/Audio/OggFile.hpp +0 -0
  14. data/{GosuImpl → src}/Audio/SndFile.hpp +0 -0
  15. data/{GosuImpl/Graphics → src/Bitmap}/Bitmap.cpp +2 -0
  16. data/{GosuImpl/Graphics → src/Bitmap}/BitmapApple.mm +0 -0
  17. data/{GosuImpl/Graphics → src/Bitmap}/BitmapBMP.cpp +0 -0
  18. data/{GosuImpl/Graphics → src/Bitmap}/BitmapColorKey.cpp +0 -0
  19. data/{GosuImpl/Graphics → src/Bitmap}/BitmapFreeImage.cpp +0 -0
  20. data/{GosuImpl/Graphics → src/Bitmap}/BitmapGDIplus.cpp +0 -0
  21. data/{GosuImpl/Graphics → src/Bitmap}/BitmapUtils.cpp +0 -0
  22. data/{GosuImpl → src}/DirectoriesMac.mm +0 -0
  23. data/{GosuImpl → src}/DirectoriesTouch.mm +0 -0
  24. data/{GosuImpl → src}/DirectoriesUnix.cpp +0 -0
  25. data/{GosuImpl → src}/DirectoriesWin.cpp +0 -0
  26. data/{GosuImpl → src}/FileUnix.cpp +0 -0
  27. data/{GosuImpl → src}/FileWin.cpp +0 -0
  28. data/{GosuImpl/Graphics → src}/GosuView.hpp +0 -0
  29. data/{GosuImpl/Graphics → src}/GosuView.mm +0 -0
  30. data/{GosuImpl → src}/Graphics/BlockAllocator.cpp +0 -0
  31. data/{GosuImpl → src}/Graphics/BlockAllocator.hpp +0 -0
  32. data/{GosuImpl → src}/Graphics/ClipRectStack.hpp +0 -0
  33. data/{GosuImpl → src}/Graphics/Color.cpp +0 -0
  34. data/{GosuImpl → src}/Graphics/Common.hpp +0 -0
  35. data/{GosuImpl → src}/Graphics/DrawOp.hpp +0 -0
  36. data/{GosuImpl → src}/Graphics/DrawOpQueue.hpp +0 -0
  37. data/{GosuImpl → src}/Graphics/Graphics.cpp +0 -0
  38. data/{GosuImpl → src}/Graphics/Image.cpp +0 -0
  39. data/{GosuImpl → src}/Graphics/LargeImageData.cpp +0 -0
  40. data/{GosuImpl → src}/Graphics/LargeImageData.hpp +0 -0
  41. data/{GosuImpl → src}/Graphics/Macro.hpp +0 -0
  42. data/{GosuImpl → src}/Graphics/RenderState.hpp +0 -0
  43. data/{GosuImpl → src}/Graphics/TexChunk.cpp +0 -0
  44. data/{GosuImpl → src}/Graphics/TexChunk.hpp +0 -0
  45. data/{GosuImpl → src}/Graphics/Texture.cpp +0 -0
  46. data/{GosuImpl → src}/Graphics/Texture.hpp +0 -0
  47. data/{GosuImpl → src}/Graphics/Transform.cpp +0 -0
  48. data/{GosuImpl → src}/Graphics/TransformStack.hpp +0 -0
  49. data/{GosuImpl → src}/IO.cpp +0 -0
  50. data/{GosuImpl → src}/Iconv.hpp +0 -0
  51. data/{GosuImpl → src}/Input/AccelerometerReader.hpp +0 -0
  52. data/{GosuImpl → src}/Input/AccelerometerReader.mm +0 -0
  53. data/{GosuImpl → src/Input}/Input.cpp +0 -0
  54. data/{GosuImpl → src/Input}/InputTouch.mm +0 -0
  55. data/{GosuImpl → src/Input}/TextInput.cpp +0 -0
  56. data/{GosuImpl → src/Input}/TextInputMac.mm +0 -0
  57. data/{GosuImpl → src}/Inspection.cpp +0 -0
  58. data/{GosuImpl → src}/MacUtility.hpp +0 -0
  59. data/{GosuImpl → src}/Math.cpp +0 -0
  60. data/{GosuImpl → src}/Sockets/CommSocket.cpp +0 -0
  61. data/{GosuImpl → src}/Sockets/ListenerSocket.cpp +0 -0
  62. data/{GosuImpl → src}/Sockets/MessageSocket.cpp +0 -0
  63. data/{GosuImpl → src}/Sockets/Socket.cpp +0 -0
  64. data/{GosuImpl → src}/Sockets/Socket.hpp +0 -0
  65. data/{GosuImpl/Graphics → src/Text}/Font.cpp +1 -1
  66. data/{GosuImpl/Graphics → src/Text}/FormattedString.hpp +0 -0
  67. data/{GosuImpl/Graphics → src/Text}/Text.cpp +1 -1
  68. data/{GosuImpl/Graphics/TextTouch.mm → src/Text/TextApple.mm} +0 -0
  69. data/{GosuImpl/Graphics → src/Text}/TextMac.cpp +1 -1
  70. data/{GosuImpl/Graphics → src/Text}/TextTTFWin.cpp +0 -0
  71. data/{GosuImpl/Graphics → src/Text}/TextUnix.cpp +0 -0
  72. data/{GosuImpl/Graphics → src/Text}/TextWin.cpp +0 -0
  73. data/{GosuImpl → src}/TimingApple.cpp +0 -0
  74. data/{GosuImpl → src}/TimingUnix.cpp +0 -0
  75. data/{GosuImpl → src}/TimingWin.cpp +0 -0
  76. data/{GosuImpl → src}/Utility.cpp +0 -0
  77. data/{GosuImpl → src}/UtilityApple.mm +0 -0
  78. data/{GosuImpl → src}/UtilityWin.cpp +0 -0
  79. data/{GosuImpl → src}/WinMain.cpp +0 -0
  80. data/{GosuImpl → src}/WinUtility.cpp +0 -0
  81. data/{GosuImpl → src}/Window.cpp +0 -0
  82. data/{GosuImpl → src}/WindowTouch.mm +0 -0
  83. data/{GosuImpl → src}/X11vroot.h +0 -0
  84. metadata +97 -193
  85. data/.yardopts +0 -1
  86. data/COPYING +0 -29
  87. data/GosuImpl/InputMac.mm +0 -733
  88. data/GosuImpl/InputWin.cpp +0 -483
  89. data/GosuImpl/InputX.cpp +0 -243
  90. data/GosuImpl/RubyGosu.swg +0 -821
  91. data/GosuImpl/RubyGosu_SWIG_GC_PATCH.patch +0 -126
  92. data/GosuImpl/RubyGosu_SWIG_RENAME_PATCH.patch +0 -62
  93. data/GosuImpl/TextInputWin.cpp +0 -211
  94. data/GosuImpl/TextInputX.cpp +0 -217
  95. data/GosuImpl/WindowWin.cpp +0 -534
  96. data/GosuImpl/WindowX.cpp +0 -458
  97. data/README.txt +0 -25
  98. data/dependencies/libogg/AUTHORS +0 -4
  99. data/dependencies/libogg/CHANGES +0 -70
  100. data/dependencies/libogg/COPYING +0 -28
  101. data/dependencies/libogg/include/ogg/ogg.h +0 -209
  102. data/dependencies/libogg/include/ogg/os_types.h +0 -147
  103. data/dependencies/libogg/src/bitwise.c +0 -857
  104. data/dependencies/libogg/src/framing.c +0 -2089
  105. data/dependencies/libvorbis/AUTHORS +0 -3
  106. data/dependencies/libvorbis/CHANGES +0 -126
  107. data/dependencies/libvorbis/COPYING +0 -28
  108. data/dependencies/libvorbis/include/vorbis/codec.h +0 -243
  109. data/dependencies/libvorbis/include/vorbis/vorbisenc.h +0 -436
  110. data/dependencies/libvorbis/include/vorbis/vorbisfile.h +0 -206
  111. data/dependencies/libvorbis/lib/analysis.c +0 -120
  112. data/dependencies/libvorbis/lib/backends.h +0 -144
  113. data/dependencies/libvorbis/lib/barkmel.c +0 -64
  114. data/dependencies/libvorbis/lib/bitrate.c +0 -253
  115. data/dependencies/libvorbis/lib/bitrate.h +0 -59
  116. data/dependencies/libvorbis/lib/block.c +0 -1046
  117. data/dependencies/libvorbis/lib/books/coupled/res_books_51.h +0 -12257
  118. data/dependencies/libvorbis/lib/books/coupled/res_books_stereo.h +0 -15783
  119. data/dependencies/libvorbis/lib/books/floor/floor_books.h +0 -1547
  120. data/dependencies/libvorbis/lib/books/uncoupled/res_books_uncoupled.h +0 -7758
  121. data/dependencies/libvorbis/lib/codebook.c +0 -479
  122. data/dependencies/libvorbis/lib/codebook.h +0 -119
  123. data/dependencies/libvorbis/lib/codec_internal.h +0 -167
  124. data/dependencies/libvorbis/lib/envelope.c +0 -375
  125. data/dependencies/libvorbis/lib/envelope.h +0 -80
  126. data/dependencies/libvorbis/lib/floor0.c +0 -222
  127. data/dependencies/libvorbis/lib/floor1.c +0 -1099
  128. data/dependencies/libvorbis/lib/highlevel.h +0 -58
  129. data/dependencies/libvorbis/lib/info.c +0 -664
  130. data/dependencies/libvorbis/lib/lookup.c +0 -94
  131. data/dependencies/libvorbis/lib/lookup.h +0 -32
  132. data/dependencies/libvorbis/lib/lookup_data.h +0 -192
  133. data/dependencies/libvorbis/lib/lpc.c +0 -160
  134. data/dependencies/libvorbis/lib/lpc.h +0 -29
  135. data/dependencies/libvorbis/lib/lsp.c +0 -456
  136. data/dependencies/libvorbis/lib/lsp.h +0 -28
  137. data/dependencies/libvorbis/lib/mapping0.c +0 -816
  138. data/dependencies/libvorbis/lib/masking.h +0 -785
  139. data/dependencies/libvorbis/lib/mdct.c +0 -563
  140. data/dependencies/libvorbis/lib/mdct.h +0 -71
  141. data/dependencies/libvorbis/lib/misc.h +0 -57
  142. data/dependencies/libvorbis/lib/modes/floor_all.h +0 -260
  143. data/dependencies/libvorbis/lib/modes/psych_11.h +0 -51
  144. data/dependencies/libvorbis/lib/modes/psych_16.h +0 -133
  145. data/dependencies/libvorbis/lib/modes/psych_44.h +0 -642
  146. data/dependencies/libvorbis/lib/modes/psych_8.h +0 -101
  147. data/dependencies/libvorbis/lib/modes/residue_16.h +0 -163
  148. data/dependencies/libvorbis/lib/modes/residue_44.h +0 -292
  149. data/dependencies/libvorbis/lib/modes/residue_44p51.h +0 -451
  150. data/dependencies/libvorbis/lib/modes/residue_44u.h +0 -318
  151. data/dependencies/libvorbis/lib/modes/residue_8.h +0 -109
  152. data/dependencies/libvorbis/lib/modes/setup_11.h +0 -143
  153. data/dependencies/libvorbis/lib/modes/setup_16.h +0 -153
  154. data/dependencies/libvorbis/lib/modes/setup_22.h +0 -128
  155. data/dependencies/libvorbis/lib/modes/setup_32.h +0 -132
  156. data/dependencies/libvorbis/lib/modes/setup_44.h +0 -117
  157. data/dependencies/libvorbis/lib/modes/setup_44p51.h +0 -74
  158. data/dependencies/libvorbis/lib/modes/setup_44u.h +0 -74
  159. data/dependencies/libvorbis/lib/modes/setup_8.h +0 -149
  160. data/dependencies/libvorbis/lib/modes/setup_X.h +0 -225
  161. data/dependencies/libvorbis/lib/os.h +0 -186
  162. data/dependencies/libvorbis/lib/psy.c +0 -1203
  163. data/dependencies/libvorbis/lib/psy.h +0 -154
  164. data/dependencies/libvorbis/lib/psytune.c +0 -524
  165. data/dependencies/libvorbis/lib/registry.c +0 -45
  166. data/dependencies/libvorbis/lib/registry.h +0 -32
  167. data/dependencies/libvorbis/lib/res0.c +0 -889
  168. data/dependencies/libvorbis/lib/scales.h +0 -90
  169. data/dependencies/libvorbis/lib/sharedbook.c +0 -579
  170. data/dependencies/libvorbis/lib/smallft.c +0 -1255
  171. data/dependencies/libvorbis/lib/smallft.h +0 -34
  172. data/dependencies/libvorbis/lib/synthesis.c +0 -184
  173. data/dependencies/libvorbis/lib/tone.c +0 -54
  174. data/dependencies/libvorbis/lib/vorbisenc.c +0 -1215
  175. data/dependencies/libvorbis/lib/vorbisfile.c +0 -2337
  176. data/dependencies/libvorbis/lib/window.c +0 -2135
  177. data/dependencies/libvorbis/lib/window.h +0 -26
  178. data/dependencies/ogg_vorbis.license +0 -28
  179. data/reference/gosu.rb +0 -1284
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d3b8c63fdb8bac539845da6a18d8f2313d9ba12
4
- data.tar.gz: 65173f1f5bd56bbc78fa4f45c5aaff46fab385a0
3
+ metadata.gz: 9671065f952ce2b0c1c21c05764bf32e21413839
4
+ data.tar.gz: 6bdab075165e4ee1a8d02c82c15d0d9a7bbcd2ac
5
5
  SHA512:
6
- metadata.gz: 33b65ff860f1c76c3256299c7639643e631d2e7afafa3646ed8b6466ecd52d0d028c22eca974ef43ec2e64994996166e299bda930f81602920432571e28681fe
7
- data.tar.gz: 6fe10cb8bba4769f3f6287ad12a30ec5af6503c37d34c016118ec54f7f345139984adf6c60d8adfbfa012c313524f1479aadfa184442bc8e6ac2e88ba8740f8b
6
+ metadata.gz: be621974356bc5a746bafeb2cc4da576a3cc157599fc18d6b6b47a4bb9bb39fbeff4502a4cb4b7f884441e3951b91f6d3cccb95a08a1ebcc48cc31a1b4ea2f6e
7
+ data.tar.gz: 71f034d78c7cf1b5b57d5486b856ff33c69ebfcd05dfd29d9007756d52793fe1a75ac3c324fc5e89614f34d2c3eba67d7f18a4bd82040f3bc3499e4c2d7881b2
@@ -36,16 +36,16 @@ namespace Gosu
36
36
  kbF10 = 67,
37
37
  kbF11 = 68,
38
38
  kbF12 = 69,
39
- kb0 = 30,
40
- kb1 = 31,
41
- kb2 = 32,
42
- kb3 = 33,
43
- kb4 = 34,
44
- kb5 = 35,
45
- kb6 = 36,
46
- kb7 = 37,
47
- kb8 = 38,
48
- kb9 = 39,
39
+ kb0 = 39,
40
+ kb1 = 30,
41
+ kb2 = 31,
42
+ kb3 = 32,
43
+ kb4 = 33,
44
+ kb5 = 34,
45
+ kb6 = 35,
46
+ kb7 = 36,
47
+ kb8 = 37,
48
+ kb9 = 38,
49
49
  kbTab = 43,
50
50
  kbReturn = 40,
51
51
  kbSpace = 44,
@@ -106,6 +106,8 @@ namespace Gosu
106
106
  kbX = 27,
107
107
  kbY = 28,
108
108
  kbZ = 29,
109
+ // ` on US/UK Mac, < on EU Mac, \ in US/UK Windows
110
+ kbISO = 100,
109
111
  kbNumpad0 = 98,
110
112
  kbNumpad1 = 89,
111
113
  kbNumpad2 = 90,
@@ -124,8 +126,8 @@ namespace Gosu
124
126
 
125
127
  msRangeBegin,
126
128
  msLeft = msRangeBegin,
127
- msRight,
128
129
  msMiddle,
130
+ msRight,
129
131
  msWheelUp,
130
132
  msWheelDown,
131
133
  msOther0,
@@ -2,84 +2,71 @@
2
2
 
3
3
  WINDOWS_HINTS = %w(-win32 win32- mswin mingw32)
4
4
 
5
- if defined? RUBY_PLATFORM and WINDOWS_HINTS.any? { |hint| RUBY_PLATFORM.include? hint } then
5
+ if RUBY_PLATFORM =~ /mswin|mingw32|mingw64|win32\-|\-win32/ then
6
6
  puts 'This gem is not meant to be installed on Windows. Instead, please use:'
7
7
  puts 'gem install gosu --platform=i386-mingw32'
8
8
  exit 1
9
9
  end
10
10
 
11
- puts 'The Gosu gem requires some libraries to be installed system-wide.'
12
- puts 'See the following site for a list:'
13
- puts 'https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux'
14
- puts
11
+ if `uname`.chomp != "Darwin" then
12
+ puts 'The Gosu gem requires some libraries to be installed system-wide.'
13
+ puts 'See the following site for a list:'
14
+ puts 'https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux'
15
+ puts
16
+ end
15
17
 
16
18
  BASE_FILES = %w(
19
+ Bitmap/Bitmap.cpp
20
+ Bitmap/BitmapColorKey.cpp
21
+ Bitmap/BitmapUtils.cpp
17
22
  DirectoriesUnix.cpp
18
23
  FileUnix.cpp
19
- Graphics/Bitmap.cpp
20
- Graphics/BitmapColorKey.cpp
21
- Graphics/BitmapUtils.cpp
22
24
  Graphics/BlockAllocator.cpp
23
25
  Graphics/Color.cpp
24
- Graphics/Font.cpp
25
26
  Graphics/Graphics.cpp
26
27
  Graphics/Image.cpp
27
28
  Graphics/LargeImageData.cpp
28
29
  Graphics/TexChunk.cpp
29
- Graphics/Text.cpp
30
30
  Graphics/Texture.cpp
31
31
  Graphics/Transform.cpp
32
- Input.cpp
32
+ Input/Input.cpp
33
+ Input/TextInput.cpp
33
34
  Inspection.cpp
34
35
  IO.cpp
35
36
  Math.cpp
36
- RubyGosu_wrap.cxx
37
+ Text/Font.cpp
38
+ Text/Text.cpp
37
39
  Utility.cpp
38
- TextInput.cpp
39
40
  Window.cpp
40
41
  )
41
42
 
42
43
  MAC_FILES = %w(
43
44
  Audio/AudioOpenAL.mm
44
- Graphics/BitmapApple.mm
45
- Graphics/TextMac.cpp
46
- Graphics/TextTouch.mm
45
+ Bitmap/BitmapApple.mm
46
+ Text/TextApple.mm
47
+ Text/TextMac.cpp
47
48
  TimingApple.cpp
48
49
  UtilityApple.mm
49
50
  )
50
51
 
51
52
  LINUX_FILES = %w(
52
53
  Audio/AudioOpenAL.cpp
53
- Graphics/BitmapFreeImage.cpp
54
- Graphics/TextUnix.cpp
54
+ Bitmap/BitmapFreeImage.cpp
55
+ Text/TextUnix.cpp
55
56
  TimingUnix.cpp
56
57
  )
57
58
 
58
- OGG_VORBIS_FILES = Dir['../dependencies/libogg/src/*.c'] +
59
- Dir['../dependencies/libvorbis/lib/vorbisfile.c'] +
60
- %w(analysis bitrate block codebook envelope floor0 floor1
61
- info lookup lpc lsp mapping0 mdct psy registry res0
62
- sharedbook smallft synthesis window).map do |basename|
63
- "../dependencies/libvorbis/lib/#{basename}.c"
64
- end
65
-
66
59
  require 'mkmf'
67
60
  require 'fileutils'
68
61
 
69
62
  # Silence internal deprecation warnings in Gosu
70
63
  $CFLAGS << " -DGOSU_DEPRECATED="
71
64
 
72
- $INCFLAGS << " -I../ -I../GosuImpl"
65
+ $INCFLAGS << " -I../.. -I../../src"
73
66
 
74
67
  if `uname`.chomp == 'Darwin' then
75
- SOURCE_FILES = BASE_FILES + MAC_FILES + OGG_VORBIS_FILES
68
+ SOURCE_FILES = BASE_FILES + MAC_FILES
76
69
 
77
- # Apple curiously distributes libpng only inside X11
78
- $INCFLAGS << " -I/usr/X11/include"
79
- # Use included libogg, libvorbis to make Gosu easier to install on OS X
80
- $INCFLAGS << " -I../dependencies/libogg/include"
81
- $INCFLAGS << " -I../dependencies/libvorbis/include"
82
- $INCFLAGS << " -I../dependencies/libvorbis/lib"
83
70
  # To make everything work with the Objective C runtime
84
71
  $CFLAGS << " -x objective-c -DNDEBUG"
85
72
  # Compile all C++ files as Objective C++ on OS X since mkmf does not support .mm
@@ -93,25 +80,23 @@ if `uname`.chomp == 'Darwin' then
93
80
  # TODO: This can probably be enabled starting from 10.6?
94
81
  CONFIG['CXXFLAGS'] << " -std=gnu++11"
95
82
  end
96
- $LDFLAGS << " -L/usr/X11/lib -liconv -lSDL2"
83
+ $LDFLAGS << " -liconv -lSDL2 -logg -lvorbis -lvorbisfile"
97
84
  %w(AudioToolbox IOKit OpenAL OpenGL AppKit ApplicationServices Foundation Carbon).each do |f|
98
85
  $LDFLAGS << " -framework #{f}"
99
86
  end
100
87
  else
101
88
  SOURCE_FILES = BASE_FILES + LINUX_FILES
102
89
 
103
- pkg_config 'sdl2'
104
-
105
- if /Raspbian/ =~ `cat /etc/issue` then
90
+ if /Raspbian/ =~ `cat /etc/issue` or /BCM2708/ =~ `cat /proc/cpuinfo` then
106
91
  $INCFLAGS << " -I/opt/vc/include/GLES"
107
92
  $INCFLAGS << " -I/opt/vc/include"
108
- $CFLAGS << " -DGOSU_IS_RASPBERRY_PI"
109
93
  $LDFLAGS << " -L/opt/vc/lib"
110
94
  $LDFLAGS << " -lGLESv1_CM"
111
95
  else
112
96
  pkg_config 'gl'
113
97
  end
114
98
 
99
+ pkg_config 'sdl2'
115
100
  pkg_config 'pangoft2'
116
101
  pkg_config 'vorbisfile'
117
102
  pkg_config 'openal'
@@ -122,13 +107,6 @@ else
122
107
  have_header 'AL/al.h' if have_library('openal')
123
108
  end
124
109
 
125
- # Symlink our pretty gosu.so into ../lib
126
- # TODO gosu.rb should just look in the right place.
127
- unless File.exist? "../lib/gosu.#{RbConfig::CONFIG['DLEXT']}"
128
- FileUtils.ln_s "../linux/gosu.#{RbConfig::CONFIG['DLEXT']}",
129
- "../lib/gosu.#{RbConfig::CONFIG['DLEXT']}"
130
- end
131
-
132
110
  # And now it gets ridiculous (or I am overcomplicating things...):
133
111
  # mkmf will compile all .c/.cpp files in this directory, but if they are nested
134
112
  # inside folders, it will not find the resulting .o files during linking.
@@ -139,7 +117,7 @@ end
139
117
  SOURCE_FILES.each do |file|
140
118
  shim_name = file.gsub('/', '-').sub(/\.mm$/, '.cpp')
141
119
  File.open(shim_name, "w") do |shim|
142
- shim.puts "#include \"../GosuImpl/#{file}\""
120
+ shim.puts "#include \"../../src/#{file}\""
143
121
  end
144
122
  end
145
123
 
@@ -2848,7 +2848,7 @@ SWIGINTERN void Gosu_Window_translate(Gosu::Window *self,double x,double y){
2848
2848
  * C++ director class methods
2849
2849
  * --------------------------------------------------- */
2850
2850
 
2851
- #include "RubyGosu_wrap.h"
2851
+ #include "gosu_wrap.h"
2852
2852
 
2853
2853
  SwigDirector_TextInput::SwigDirector_TextInput(VALUE self): Gosu::TextInput(), Swig::Director(self) {
2854
2854
 
@@ -11073,6 +11073,7 @@ SWIGEXPORT void Init_gosu(void) {
11073
11073
  rb_define_const(mGosu, "KbX", SWIG_From_int(static_cast< int >(Gosu::kbX)));
11074
11074
  rb_define_const(mGosu, "KbY", SWIG_From_int(static_cast< int >(Gosu::kbY)));
11075
11075
  rb_define_const(mGosu, "KbZ", SWIG_From_int(static_cast< int >(Gosu::kbZ)));
11076
+ rb_define_const(mGosu, "KbISO", SWIG_From_int(static_cast< int >(Gosu::kbISO)));
11076
11077
  rb_define_const(mGosu, "KbNumpad0", SWIG_From_int(static_cast< int >(Gosu::kbNumpad0)));
11077
11078
  rb_define_const(mGosu, "KbNumpad1", SWIG_From_int(static_cast< int >(Gosu::kbNumpad1)));
11078
11079
  rb_define_const(mGosu, "KbNumpad2", SWIG_From_int(static_cast< int >(Gosu::kbNumpad2)));
@@ -11088,8 +11089,8 @@ SWIGEXPORT void Init_gosu(void) {
11088
11089
  rb_define_const(mGosu, "KbNumpadMultiply", SWIG_From_int(static_cast< int >(Gosu::kbNumpadMultiply)));
11089
11090
  rb_define_const(mGosu, "KbNumpadDivide", SWIG_From_int(static_cast< int >(Gosu::kbNumpadDivide)));
11090
11091
  rb_define_const(mGosu, "MsLeft", SWIG_From_int(static_cast< int >(Gosu::msLeft)));
11091
- rb_define_const(mGosu, "MsRight", SWIG_From_int(static_cast< int >(Gosu::msRight)));
11092
11092
  rb_define_const(mGosu, "MsMiddle", SWIG_From_int(static_cast< int >(Gosu::msMiddle)));
11093
+ rb_define_const(mGosu, "MsRight", SWIG_From_int(static_cast< int >(Gosu::msRight)));
11093
11094
  rb_define_const(mGosu, "MsWheelUp", SWIG_From_int(static_cast< int >(Gosu::msWheelUp)));
11094
11095
  rb_define_const(mGosu, "MsWheelDown", SWIG_From_int(static_cast< int >(Gosu::msWheelDown)));
11095
11096
  rb_define_const(mGosu, "MsOther0", SWIG_From_int(static_cast< int >(Gosu::msOther0)));
@@ -1,16 +1,15 @@
1
1
  require 'rbconfig'
2
2
 
3
- if defined? RUBY_PLATFORM and
4
- %w(-win32 win32- mswin mingw32).any? { |s| RUBY_PLATFORM.include? s } then
3
+ if RUBY_PLATFORM =~ /mswin|mingw32|mingw64|win32\-|\-win32/ then
4
+ # Add this gem to the PATH on Windows so that DLLs can be found
5
5
  ENV['PATH'] = "#{File.dirname(__FILE__)};#{ENV['PATH']}"
6
6
  end
7
7
 
8
- if File.exist? "#{File.dirname(__FILE__)}/gosu.#{RbConfig::CONFIG['DLEXT']}"
8
+ begin
9
+ RUBY_VERSION =~ /(\d+.\d+)/
10
+ require "#{$1}/gosu.#{RbConfig::CONFIG['DLEXT']}"
11
+ rescue LoadError
9
12
  require "gosu.#{RbConfig::CONFIG['DLEXT']}"
10
- elsif defined? RUBY_VERSION and RUBY_VERSION >= '1.9' then
11
- require "gosu.for_1_9.#{RbConfig::CONFIG['DLEXT']}"
12
- else
13
- require "gosu.for_1_8.#{RbConfig::CONFIG['DLEXT']}"
14
13
  end
15
14
 
16
15
  require "gosu/swig_patches"
@@ -24,6 +24,10 @@ module Gosu
24
24
  end
25
25
  end
26
26
 
27
+ def init &body
28
+ ZenWindow.send :define_method, :init, &body
29
+ end
30
+
27
31
  def button_down id = nil, &body
28
32
  m = id ? "button_down_#{id}" : :button_down_other
29
33
  ZenWindow.send :define_method, m, &body
@@ -57,6 +61,14 @@ module Gosu
57
61
  end
58
62
 
59
63
  class ZenWindow < Window
64
+ def initialize *args
65
+ super
66
+ init
67
+ end
68
+
69
+ def init
70
+ end
71
+
60
72
  def button_down id
61
73
  m = :"button_down_#{id}"
62
74
  respond_to?(m) ? send(m) : button_down_other(id)
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -38,6 +38,8 @@ void Gosu::Bitmap::insert(const Bitmap& source, int x, int y)
38
38
  void Gosu::Bitmap::insert(const Bitmap& source, int x, int y, unsigned srcX,
39
39
  unsigned srcY, unsigned srcWidth, unsigned srcHeight)
40
40
  {
41
+ // TODO: This should use memcpy if possible (x == 0 && srcWidth == this->width())
42
+
41
43
  if (x < 0)
42
44
  {
43
45
  unsigned clipLeft = -x;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -4,7 +4,7 @@
4
4
  #include <Gosu/Math.hpp>
5
5
  #include <Gosu/Text.hpp>
6
6
  #include <Gosu/TR1.hpp>
7
- #include "Common.hpp"
7
+ #include "../Graphics/Common.hpp"
8
8
  #include "FormattedString.hpp"
9
9
  #include <cassert>
10
10
  #include <map>
@@ -5,7 +5,7 @@
5
5
  #include <Gosu/Math.hpp>
6
6
  #include <Gosu/TR1.hpp>
7
7
  #include <Gosu/Utility.hpp>
8
- #include "Common.hpp"
8
+ #include "../Graphics/Common.hpp"
9
9
  #include "FormattedString.hpp"
10
10
  #include <cassert>
11
11
  #include <cmath>
@@ -8,7 +8,7 @@
8
8
  #include <Gosu/Math.hpp>
9
9
  #include <Gosu/Utility.hpp>
10
10
  #include <Gosu/IO.hpp>
11
- #include <GosuImpl/MacUtility.hpp>
11
+ #include "../MacUtility.hpp"
12
12
  #include <cmath>
13
13
  #include <stdexcept>
14
14
  #include <map>