ruby-sdl2 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d8a857b0cbcda255f6d6068141a251ad0755ab94
4
- data.tar.gz: 43f3a347ef2666c1bfb7f55dc08f5d2cde9acdfa
2
+ SHA256:
3
+ metadata.gz: 24b39a73c4b06804c2ca9b805812bb17791800a00321df3d6b187a10e6e6f452
4
+ data.tar.gz: fbee5279f4d246026a355804a87c4a5907d6f119f24d2a9762acc2ba92beaa5a
5
5
  SHA512:
6
- metadata.gz: ca1bbda6713f5edc393d31fcd3ed6c2203bef45d3dba4b2ccea895f2f4d9fc63475ab82985f68517640ab8c6aa521d9395c175e445782781e42937419b08bc11
7
- data.tar.gz: 34637797f7d43a31805e12f592fe26b3da8cc661ab35d6a3c88e7da2aaa4ddbf366b4e8b1647e7dd6f5824b79dec88d751658b63e8073ee2732bc2ae1a80cece
6
+ metadata.gz: 2a0459c6671cd2d2cc5b5746082d15dd56bc03270d57317f950567e11a74b83da445666510a173fe8efb0bfb66f422fbf63e18910f20ecd7f68cc0a68123e472
7
+ data.tar.gz: 9c7e4b39e0fb36e31a7b9ba7da1d010b49d4daeb6188ef4848ce3c397bc7e20f526d50354137dfc45758e3dc0d5796c87ffdb9f96814b7ba93a950a079ebe919
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  *.o
2
+ *.bundle
2
3
  *~
3
4
  Makefile
4
5
  *.so
@@ -9,6 +10,7 @@ ttf.c
9
10
  mixer.c
10
11
  joystick.c
11
12
  gamecontroller.c
13
+ extconf.h
12
14
  pkg/
13
15
  TAGS
14
16
  local/
data/Rakefile CHANGED
@@ -1,17 +1,22 @@
1
1
  require 'rubygems'
2
2
  require 'rubygems/package_task'
3
+ require 'rake/clean'
3
4
  require_relative "lib/sdl2/version"
4
5
 
5
6
  C_M4_FILES = Dir.glob("*.c.m4")
6
7
  C_FROM_M4_FILES = C_M4_FILES.map{|path| path.gsub(/\.c\.m4\Z/, ".c") }
7
8
  C_FILES = Dir.glob("*.c") | C_FROM_M4_FILES
8
9
  RB_FILES = Dir.glob("lib/**/*.rb")
10
+ O_FILES = Rake::FileList[*C_FILES].pathmap('%n.o')
9
11
 
10
12
  POT_SOURCES = RB_FILES + ["main.c"] + (C_FILES - ["main.c"])
11
13
  YARD_SOURCES = "-m markdown --main README.md --files COPYING.txt #{POT_SOURCES.join(" ")}"
12
14
 
13
15
  WATCH_TARGETS = (C_FILES - C_FROM_M4_FILES) + C_M4_FILES + ["README.md"]
14
-
16
+
17
+ CLEAN.include(O_FILES)
18
+ CLOBBER.include(*C_FROM_M4_FILES)
19
+
15
20
  locale = ENV["YARD_LOCALE"]
16
21
 
17
22
  def extconf_options
data/event.c CHANGED
@@ -233,7 +233,7 @@ static VALUE Event_inspect(VALUE self)
233
233
  */
234
234
  static VALUE Event_window(VALUE self)
235
235
  {
236
- VALUE window_id = rb_funcall(self, rb_intern("window_id"), 0, 0);
236
+ VALUE window_id = rb_funcall(self, rb_intern("window_id"), 0);
237
237
  return find_window_by_id(NUM2UINT(window_id));
238
238
  }
239
239
 
data/extconf.rb CHANGED
@@ -50,4 +50,9 @@ config("SDL2_mixer", "SDL_mixer.h", ["SDL2_mixer", "SDL_mixer"])
50
50
  config("SDL2_ttf", "SDL_ttf.h", ["SDL2_ttf", "SDL_ttf"])
51
51
  have_header("SDL_filesystem.h")
52
52
 
53
+ have_const("MIX_INIT_MODPLUG", "SDL_mixer.h")
54
+ have_const("MIX_INIT_FLUIDSYNTH", "SDL_mixer.h")
55
+ have_const("MIX_INIT_MID", "SDL_mixer.h")
56
+
57
+ create_header
53
58
  create_makefile('sdl2_ext')
@@ -1,6 +1,6 @@
1
1
  module SDL2
2
2
  # Version string of Ruby/SDL2
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.2"
4
4
  # Version of Ruby/SDL2, [major, minor, patch level]
5
5
  VERSION_NUMBER = VERSION.split(".").map(&:to_i)
6
6
  end
data/mixer.c.m4 CHANGED
@@ -1,5 +1,6 @@
1
1
  /* -*- mode: C -*- */
2
2
  #ifdef HAVE_SDL_MIXER_H
3
+ #include "extconf.h"
3
4
  #include "rubysdl2_internal.h"
4
5
  #include <SDL_mixer.h>
5
6
 
@@ -1071,14 +1072,23 @@ void rubysdl2_init_mixer(void)
1071
1072
  DEFINE_MIX_INIT(FLAC);
1072
1073
  /* Initialize MOD loader */
1073
1074
  DEFINE_MIX_INIT(MOD);
1074
- /* Initialize libmodplug */
1075
- DEFINE_MIX_INIT(MODPLUG);
1076
1075
  /* Initialize MP3 loader */
1077
1076
  DEFINE_MIX_INIT(MP3);
1078
1077
  /* Initialize Ogg vorbis loader */
1079
1078
  DEFINE_MIX_INIT(OGG);
1079
+
1080
+ #if HAVE_CONST_MIX_INIT_MODPLUG
1081
+ /* Initialize libmodplug */
1082
+ DEFINE_MIX_INIT(MODPLUG);
1083
+ #endif
1084
+ #if HAVE_CONST_MIX_INIT_FLUIDSYNTH
1080
1085
  /* Initialize fluidsynth */
1081
1086
  DEFINE_MIX_INIT(FLUIDSYNTH);
1087
+ #endif
1088
+ #if HAVE_CONST_MIX_INIT_MID
1089
+ /* Initialize mid */
1090
+ DEFINE_MIX_INIT(MID);
1091
+ #endif
1082
1092
 
1083
1093
  /* define(`DEFINE_MIX_FORMAT',`rb_define_const(mMixer, "FORMAT_$1", UINT2NUM(AUDIO_$1))') */
1084
1094
  /* Unsiged 8-bit sample format. Used by {Mixer.open} */
@@ -7,7 +7,7 @@ window = SDL2::Window.create("testsprite",
7
7
  640, 480, 0)
8
8
 
9
9
  renderer = window.create_renderer(-1,
10
- SDL2::Renderer::ACCELERATED|SDL2::Renderer::TARGETTEXTURE)
10
+ SDL2::Renderer::Flags::ACCELERATED|SDL2::Renderer::Flags::TARGETTEXTURE)
11
11
  texture = renderer.load_texture("icon.bmp")
12
12
 
13
13
  rect = SDL2::Rect.new(48, 128, 32, 32)
data/video.c.m4 CHANGED
@@ -2254,7 +2254,7 @@ static VALUE Surface_pixel_color(VALUE self, VALUE x, VALUE y)
2254
2254
 
2255
2255
  static Uint32 pixel_value(VALUE val, SDL_PixelFormat* format)
2256
2256
  {
2257
- if (RTEST(rb_funcall(val, rb_intern("integer?"), 0, 0))) {
2257
+ if (RTEST(rb_funcall(val, rb_intern("integer?"), 0))) {
2258
2258
  return NUM2UINT(val);
2259
2259
  } else {
2260
2260
  long len;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-sdl2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ippei Obayashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-28 00:00:00.000000000 Z
11
+ date: 2018-03-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |2
14
14
  Ruby/SDL2 is an extension library to use SDL 2.x
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  requirements: []
101
101
  rubyforge_project:
102
- rubygems_version: 2.6.8
102
+ rubygems_version: 2.7.3
103
103
  signing_key:
104
104
  specification_version: 4
105
105
  summary: The simple ruby extension library for SDL 2.x