dxruby_sdl 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- Mzg1MmJhMGFhODU4MmYzZmY5M2QyOTdjYWJiMGJmNWI0ZTA3MmZmMg==
5
- data.tar.gz: !binary |-
6
- ZmUwNmU2ZjgwZWY1NTIyMmRjMzBhNDg2MzY0OGU5NDBiNDhkZjhlZA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- YzFhNGIyM2E0Y2MxMmE3N2RhYTE0NmY4MzhkYzg2NTAzOTY1MTg5Yzc3NmNl
10
- MDAyMzJkOGI3ZTFhNjgwNzVmZWUzNDI4NTU5Y2VkNjYwNTgyOWU0NDNmYzE2
11
- NTliNWY0NDhmY2MxMDE0MTQzNjI0MTA2OGQ4YWJiNWRlNGJmOWM=
12
- data.tar.gz: !binary |-
13
- OTllMjA5YzFjZGM3M2JiZGZjYjA5Y2JjNGUzMjY3NzY4OGE2ZDVjNTVlMmEz
14
- YWMyMDI5ZDU3MDRiYTM5NDFhZWM2N2MxNzg1ZGJiMzY5M2U3NjQ0YzI5YTQ0
15
- YWMxNDVjYmIxMDgwODZmMTJhMGY0NTVlNWMzN2UwYjM1ZjZlNzI=
2
+ SHA1:
3
+ metadata.gz: 02beb7103ebbde40ba0fe3b1461640d787c3732b
4
+ data.tar.gz: b8324b05c450b7e9b76906c7e09389c2fe5777c0
5
+ SHA512:
6
+ metadata.gz: 7512f56bffa89bfe77a51eb32018bf115117a0c0b4f637ac072b22c683c453b492a80724f00c777534c7be65909d15670240b2bcf4a6f851450f71e5f34072a0
7
+ data.tar.gz: bb6fca1612208632d3d94953fefa4f5aded63f76c497dc1ff97edb41ff3b46d7644647a6ddea81bace1caecbb681cc8114af2c43e740b7636c79c07fe6b23eea
@@ -121,33 +121,34 @@ module DXRubySDL
121
121
  ],
122
122
  %w[
123
123
  IPA\ Pゴシック
124
- /usr/share/fonts/opentype/ipafont-gothic/ipagp.ttf
124
+ /usr/share/fonts/opentype/ipafont-gothic/ipagp.ttf:/usr/share/fonts/ipa-pgothic/ipagp.ttf
125
125
  IPA\ PGothic
126
126
  ipagp
127
127
  ],
128
128
  %w[
129
129
  IPA\ ゴシック
130
- /usr/share/fonts/opentype/ipafont-gothic/ipag.ttf
130
+ /usr/share/fonts/opentype/ipafont-gothic/ipag.ttf:/usr/share/fonts/ipa-gothic/ipag.ttf
131
131
  IPA\ Gothic
132
132
  ipag
133
133
  ],
134
134
  %w[
135
135
  IPA\ P明朝
136
- /usr/share/fonts/opentype/ipafont-mincho/ipamp.ttf
136
+ /usr/share/fonts/opentype/ipafont-mincho/ipamp.ttf:/usr/share/fonts/ipa-pmincho/ipamp.ttf
137
137
  IPA\ PMincho
138
138
  ipamp
139
139
  ],
140
140
  %w[
141
141
  IPA\ 明朝
142
- /usr/share/fonts/opentype/ipafont-mincho/ipam.ttf
142
+ /usr/share/fonts/opentype/ipafont-mincho/ipam.ttf:/usr/share/fonts/ipa-mincho/ipam.ttf
143
143
  IPA\ Mincho
144
144
  ipam
145
145
  ],
146
146
  ]
147
147
  end
148
148
  # :nocov:
149
- font_info.each do |name, path, *aliases|
150
- if File.exist?(path)
149
+ font_info.each do |name, paths, *aliases|
150
+ path = paths.split(':').find { |s| File.exist?(s) }
151
+ if path
151
152
  FONTS[name] = path
152
153
  aliases.each do |a|
153
154
  FONT_ALIASES[a] = path
@@ -31,7 +31,6 @@ module DXRubySDL
31
31
 
32
32
  def initialize(width, height, color = [0, 0, 0, 0])
33
33
  @color = color
34
- @_surface_is_dirty = false
35
34
 
36
35
  if width == 0 && height == 0
37
36
  return
@@ -40,14 +39,6 @@ module DXRubySDL
40
39
  @_surface =
41
40
  SDL::Surface.new(SDL::SWSURFACE, width, height, Window.send(:screen))
42
41
  @_surface.fill_rect(0, 0, width, height, @color)
43
- @_surface_is_dirty = true
44
- end
45
-
46
- def _surface_display_format_alpha
47
- if @_surface_is_dirty
48
- @_surface = @_surface.display_format_alpha
49
- @_surface_is_dirty = false
50
- end
51
42
  end
52
43
 
53
44
  def width
@@ -60,7 +51,7 @@ module DXRubySDL
60
51
 
61
52
  def set_color_key(color)
62
53
  @_surface.set_color_key(SDL::SRCCOLORKEY | SDL::RLEACCEL, color)
63
- @_surface_is_dirty = true
54
+ @_surface = @_surface.display_format_alpha
64
55
  end
65
56
 
66
57
  def compare(x, y, color)
@@ -80,7 +71,6 @@ module DXRubySDL
80
71
  @_surface.draw_line(x1, y1, x2, y2,
81
72
  to_sdl_color(color), true, to_sdl_alpha(color))
82
73
  end
83
- @_surface_is_dirty = true
84
74
  return self
85
75
  end
86
76
 
@@ -89,7 +79,6 @@ module DXRubySDL
89
79
  @_surface.draw_circle(x, y, r, to_sdl_color(color), false, true,
90
80
  to_sdl_alpha(color))
91
81
  end
92
- @_surface_is_dirty = true
93
82
  return self
94
83
  end
95
84
 
@@ -98,7 +87,6 @@ module DXRubySDL
98
87
  @_surface.draw_circle(x, y, r, to_sdl_color(color), true, false,
99
88
  to_sdl_alpha(color))
100
89
  end
101
- @_surface_is_dirty = true
102
90
  return self
103
91
  end
104
92
 
@@ -111,7 +99,6 @@ module DXRubySDL
111
99
  @_surface.draw_rect(x, y, w, h, to_sdl_color(color), false,
112
100
  to_sdl_alpha(color))
113
101
  end
114
- @_surface_is_dirty = true
115
102
  return self
116
103
  end
117
104
 
@@ -124,15 +111,9 @@ module DXRubySDL
124
111
  @_surface.draw_rect(x, y, w, h, to_sdl_color(color), true,
125
112
  to_sdl_alpha(color))
126
113
  end
127
- @_surface_is_dirty = true
128
114
  return self
129
115
  end
130
116
 
131
- def clear
132
- @_surface.fill_rect(0, 0, width, height, @color)
133
- @_surface_is_dirty = true
134
- end
135
-
136
117
  def draw_font(x, y, string, font, color = [255, 255, 255])
137
118
  if string.empty?
138
119
  return
@@ -146,7 +127,6 @@ module DXRubySDL
146
127
  end
147
128
  font._ttf.draw_blended_utf8(@_surface, line, x, y + i * h, r, g, b)
148
129
  end
149
- @_surface_is_dirty = true
150
130
  return self
151
131
  end
152
132
 
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module DXRubySDL
4
- VERSION = '0.0.5'
4
+ VERSION = '0.0.6'
5
5
  end
@@ -63,7 +63,6 @@ module DXRubySDL
63
63
  if z != 0
64
64
  raise NotImplementedError, 'Window.draw(x, y, image, z != 0)'
65
65
  end
66
- image._surface_display_format_alpha
67
66
  screen.put(image._surface, x, y)
68
67
  end
69
68
 
@@ -71,7 +70,6 @@ module DXRubySDL
71
70
  if hash[:z] && hash[:z] != 0
72
71
  raise NotImplementedError, 'Window.draw_ex(x, y, image, z: != 0)'
73
72
  end
74
- image._surface_display_format_alpha
75
73
  option = {
76
74
  angle: 0,
77
75
  scale_x: 1,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dxruby_sdl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouji Takao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-23 00:00:00.000000000 Z
11
+ date: 2013-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -28,129 +28,115 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: coveralls
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: travis-lint
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: guard-rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ! '>='
101
+ - - '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ! '>='
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: guard-rubocop
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ! '>='
115
+ - - '>='
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ! '>='
122
+ - - '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rubysdl
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ! '>='
129
+ - - '>='
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ! '>='
136
+ - - '>='
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: rsdl
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ! '>='
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :runtime
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ! '>='
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
- description: ! '`dxruby-sdl` is a ruby library for 2D graphics and game. It has same
139
+ description: '`dxruby-sdl` is a ruby library for 2D graphics and game. It has same
154
140
  DXRuby API. It use SDL/Ruby.'
155
141
  email:
156
142
  - kouji.takao@gmail.com
@@ -225,17 +211,17 @@ require_paths:
225
211
  - lib
226
212
  required_ruby_version: !ruby/object:Gem::Requirement
227
213
  requirements:
228
- - - ! '>='
214
+ - - '>='
229
215
  - !ruby/object:Gem::Version
230
216
  version: '0'
231
217
  required_rubygems_version: !ruby/object:Gem::Requirement
232
218
  requirements:
233
- - - ! '>='
219
+ - - '>='
234
220
  - !ruby/object:Gem::Version
235
221
  version: '0'
236
222
  requirements: []
237
223
  rubyforge_project:
238
- rubygems_version: 2.0.7
224
+ rubygems_version: 2.0.14
239
225
  signing_key:
240
226
  specification_version: 4
241
227
  summary: 2D graphics and game library
@@ -257,3 +243,4 @@ test_files:
257
243
  - spec/lib/dxruby_spec.rb
258
244
  - spec/spec_helper.rb
259
245
  - spec/support/fixture_helper.rb
246
+ has_rdoc: