retrograph_easy 0.1.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'rake'
2
- require 'rake/gempackagetask'
2
+ require 'rubygems/package_task'
3
3
  begin
4
4
  require 'spec/rake/spectask'
5
5
  have_rspec = true
@@ -9,10 +9,35 @@ rescue LoadError
9
9
  end
10
10
  require 'rake/clean'
11
11
 
12
- GEM_VERSION = '0.1.1'
12
+ CLEAN << 'lib/retrograph/easy/res'
13
+
14
+ GEM_VERSION = '0.2'
13
15
 
14
16
  task :clobber => [:clean]
15
17
 
18
+ task :spec => [:convert_res] if have_rspec
19
+ task :gem => [:convert_res]
20
+ task :package => [:convert_res]
21
+
22
+ directory 'lib/retrograph/easy/res'
23
+
24
+ GENERATED_FILES = []
25
+
26
+ def image_res_task(base_filename, module_name, bpp)
27
+ image_filename = "images/#{base_filename}.png"
28
+ output_filename = "lib/retrograph/easy/res/#{base_filename}.rb"
29
+ file output_filename => [image_filename, 'lib/retrograph/easy/res'] do
30
+ sh "ruby", "-Ilib", "scripts/tileconvert.rb", "-d", "-n", "-p",
31
+ "-b", bpp.to_s,
32
+ "-m", "Retrograph::Easy::Res::#{module_name}",
33
+ image_filename, output_filename
34
+ end
35
+ GENERATED_FILES << output_filename
36
+ task :convert_res => [output_filename]
37
+ end
38
+
39
+ image_res_task('controllers', 'Controllers', 4)
40
+
16
41
  gemspec = Gem::Specification.new do |gemspec|
17
42
  gemspec.name = "retrograph_easy"
18
43
  gemspec.version = GEM_VERSION
@@ -28,21 +53,22 @@ EOS
28
53
  gemspec.rubyforge_project = 'retrograph'
29
54
  gemspec.files = FileList['Rakefile', 'README', 'COPYING', 'lib/**/*.rb',
30
55
  'spec/**/*_spec.rb', 'spec/**/*.case',
31
- 'spec/**/*.png', 'demos/**/*.rb']
56
+ 'spec/**/*.png', 'demos/**/*.rb',
57
+ *GENERATED_FILES]
32
58
  gemspec.require_paths = ['lib']
33
59
  gemspec.platform = Gem::Platform::RUBY
34
60
  gemspec.add_dependency("retrograph", ">= 0.5")
35
61
  end
36
62
 
37
- Rake::GemPackageTask.new(gemspec) do |pkg|
63
+ Gem::PackageTask.new(gemspec) do |pkg|
38
64
  pkg.need_tar = true
39
65
  end
40
66
 
41
67
  def make_demo_task(taskname, filename)
42
68
  namespace :demo do
43
69
  desc "Run the #{taskname} demo"
44
- task taskname.intern do
45
- system 'ruby', '-Ilib', filename
70
+ task taskname.intern => [:convert_res] do
71
+ sh 'ruby', '-Ilib', filename
46
72
  end
47
73
  end
48
74
  end
@@ -0,0 +1,157 @@
1
+ # Retrograph controller demo
2
+ #
3
+ # Copyright (c) 2009 MenTaLguY <mental@rydia.net>
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in
13
+ # all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ # THE SOFTWARE.
22
+ #
23
+ require 'rubygems'
24
+ require 'retrograph/easy'
25
+ require 'retrograph/easy/res/controllers'
26
+
27
+ ControllersData = Retrograph::Easy::Res::Controllers
28
+ NAME_DATA = ControllersData::NAME_DATA
29
+ TILE_DATA = ControllersData::TILE_DATA
30
+ PALETTE_DATA = ControllersData::PALETTE_DATA
31
+
32
+ def name_region(data, x, y, width, height)
33
+ data[y, height].map { |r| r[x*2, width*2] }
34
+ end
35
+
36
+ CONTROLLER_WIDTH = 13
37
+ CONTROLLER_HEIGHT = 9
38
+
39
+ LEFT_MARGIN = (32 - (CONTROLLER_WIDTH - 2)) / 2
40
+ TOP_MARGIN = (26 - CONTROLLER_HEIGHT) / 2
41
+
42
+ DPAD_CENTER_X = 2
43
+ DPAD_CENTER_Y = 4
44
+ UP_X = DPAD_CENTER_X
45
+ UP_Y = DPAD_CENTER_Y - 1
46
+ DOWN_X = DPAD_CENTER_X
47
+ DOWN_Y = DPAD_CENTER_Y + 1
48
+ RIGHT_X = DPAD_CENTER_X + 1
49
+ RIGHT_Y = DPAD_CENTER_Y
50
+ LEFT_X = DPAD_CENTER_X - 1
51
+ LEFT_Y = DPAD_CENTER_Y
52
+
53
+ MENU_X = 5
54
+ MENU_Y = 4
55
+
56
+ SELECT_X = 7
57
+ SELECT_Y = 4
58
+
59
+ ACTION_X = 8
60
+ ACTION_Y = 5
61
+
62
+ FIRE_X = 8
63
+ FIRE_Y = 3
64
+
65
+ def write_controller_names(x, y, data)
66
+ offset = 0x3800 + ((LEFT_MARGIN + x) * 2) + ((TOP_MARGIN + y) * 64)
67
+ write_vdu_2d(offset, 64, data)
68
+ end
69
+
70
+ Retrograph.app do
71
+ title "Retrograph Controller"
72
+
73
+ reset_vdu
74
+ write_vdu_byte(0x7ff8, 0x7)
75
+ write_vdu_byte(0x7ffa, 0x38)
76
+ write_vdu(0x7f00, PALETTE_DATA)
77
+ write_vdu(0x0000, TILE_DATA)
78
+ write_vdu(0x3800, "\000" * 0x0800)
79
+
80
+ left_margin = (32 - (CONTROLLER_WIDTH - 2)) / 2
81
+ top_margin = (26 - CONTROLLER_HEIGHT) / 2
82
+
83
+ controller_neutral = name_region(NAME_DATA, 1, 1, CONTROLLER_WIDTH, CONTROLLER_HEIGHT)
84
+ controller_pressed = name_region(NAME_DATA, 1, 12, CONTROLLER_WIDTH, CONTROLLER_HEIGHT)
85
+
86
+ up_neutral = name_region(controller_neutral, UP_X, UP_Y, 1, 1)
87
+ up_pressed = name_region(controller_pressed, UP_X, UP_Y, 1, 1)
88
+
89
+ down_neutral = name_region(controller_neutral, DOWN_X, DOWN_Y, 1, 1)
90
+ down_pressed = name_region(controller_pressed, DOWN_X, DOWN_Y, 1, 1)
91
+
92
+ right_neutral = name_region(controller_neutral, RIGHT_X, RIGHT_Y, 1, 1)
93
+ right_pressed = name_region(controller_pressed, RIGHT_X, RIGHT_Y, 1, 1)
94
+
95
+ left_neutral = name_region(controller_neutral, LEFT_X, LEFT_Y, 1, 1)
96
+ left_pressed = name_region(controller_pressed, LEFT_X, LEFT_Y, 1, 1)
97
+
98
+ menu_neutral = name_region(controller_neutral, MENU_X, MENU_Y, 1, 1)
99
+ menu_pressed = name_region(controller_pressed, MENU_X, MENU_Y, 1, 1)
100
+
101
+ select_neutral = name_region(controller_neutral, SELECT_X, SELECT_Y, 1, 1)
102
+ select_pressed = name_region(controller_pressed, SELECT_X, SELECT_Y, 1, 1)
103
+
104
+ action_neutral = name_region(controller_neutral, ACTION_X, ACTION_Y, 1, 1)
105
+ action_pressed = name_region(controller_pressed, ACTION_X, ACTION_Y, 1, 1)
106
+
107
+ fire_neutral = name_region(controller_neutral, FIRE_X, FIRE_Y, 2, 2)
108
+ fire_pressed = name_region(controller_pressed, FIRE_X, FIRE_Y, 2, 2)
109
+
110
+ write_controller_names(0, 0, controller_neutral)
111
+ each_frame do
112
+ if controllers.first.vertical < 0
113
+ write_controller_names(UP_X, UP_Y, up_pressed)
114
+ else
115
+ write_controller_names(UP_X, UP_Y, up_neutral)
116
+ end
117
+ if controllers.first.vertical > 0
118
+ write_controller_names(DOWN_X, DOWN_Y, down_pressed)
119
+ else
120
+ write_controller_names(DOWN_X, DOWN_Y, down_neutral)
121
+ end
122
+ if controllers.first.horizontal > 0
123
+ write_controller_names(RIGHT_X, RIGHT_Y, right_pressed)
124
+ else
125
+ write_controller_names(RIGHT_X, RIGHT_Y, right_neutral)
126
+ end
127
+ if controllers.first.horizontal < 0
128
+ write_controller_names(LEFT_X, LEFT_Y, left_pressed)
129
+ else
130
+ write_controller_names(LEFT_X, LEFT_Y, left_neutral)
131
+ end
132
+
133
+ if controllers.first.menu_pressed?
134
+ write_controller_names(MENU_X, MENU_Y, menu_pressed)
135
+ else
136
+ write_controller_names(MENU_X, MENU_Y, menu_neutral)
137
+ end
138
+
139
+ if controllers.first.select_pressed?
140
+ write_controller_names(SELECT_X, SELECT_Y, select_pressed)
141
+ else
142
+ write_controller_names(SELECT_X, SELECT_Y, select_neutral)
143
+ end
144
+
145
+ if controllers.first.action_pressed?
146
+ write_controller_names(ACTION_X, ACTION_Y, action_pressed)
147
+ else
148
+ write_controller_names(ACTION_X, ACTION_Y, action_neutral)
149
+ end
150
+
151
+ if controllers.first.fire_pressed?
152
+ write_controller_names(FIRE_X, FIRE_Y, fire_pressed)
153
+ else
154
+ write_controller_names(FIRE_X, FIRE_Y, fire_neutral)
155
+ end
156
+ end
157
+ end
@@ -257,7 +257,7 @@ def main_game
257
257
  each_frame do
258
258
  break unless lives >= 0
259
259
 
260
- if controller.b_pressed?
260
+ if controller.fire_pressed?
261
261
  start :firing, 6 unless already? :firing
262
262
  else
263
263
  stop :firing
@@ -387,7 +387,7 @@ Retrograph.app do
387
387
 
388
388
  show_retrograph_logo
389
389
  each_of_n_frames(25) do
390
- break if controllers.first.start_pressed?
390
+ break if controllers.first.menu_pressed?
391
391
  end
392
392
 
393
393
  reset_vdu
@@ -28,7 +28,7 @@ Retrograph.app do
28
28
  loop do
29
29
  show_retrograph_logo
30
30
  each_frame do
31
- break if controllers.first.start_pressed?
31
+ break if controllers.first.menu_pressed?
32
32
  end
33
33
  end
34
34
  end
@@ -133,6 +133,11 @@ class App
133
133
  self
134
134
  end
135
135
 
136
+ def write_vdu_2d(offset, stride, data)
137
+ @_retrograph_display.write_vdu_2d(offset, stride, data)
138
+ self
139
+ end
140
+
136
141
  def tile_pattern_1bit(base, index, data)
137
142
  @_retrograph_display.write_vdu(base + index * 8, data)
138
143
  self
@@ -68,7 +68,7 @@ class Rocker
68
68
  end
69
69
  end
70
70
 
71
- button_names = %w(up down left right a b select start)
71
+ button_names = %w(up down left right action fire select menu)
72
72
  controller_fields = button_names.map { |n| "#{n}_pressed".intern } +
73
73
  [:horizontal, :vertical]
74
74
 
@@ -92,23 +92,41 @@ class ControllerManager
92
92
  SDL::Key::DOWN => :down,
93
93
  SDL::Key::LEFT => :left,
94
94
  SDL::Key::RIGHT => :right,
95
- SDL::Key::LCTRL => :a,
96
- SDL::Key::RCTRL => :a,
97
- SDL::Key::SPACE => :b,
95
+ SDL::Key::LCTRL => :action,
96
+ SDL::Key::RCTRL => :action,
97
+ SDL::Key::SPACE => :fire,
98
98
  SDL::Key::LSHIFT => :select,
99
99
  SDL::Key::RSHIFT => :select,
100
100
  SDL::Key::TAB => :select,
101
- SDL::Key::RETURN => :start,
101
+ SDL::Key::RETURN => :menu,
102
102
  SDL::Key::W => :up,
103
103
  SDL::Key::S => :down,
104
104
  SDL::Key::D => :right,
105
105
  SDL::Key::A => :left,
106
- SDL::Key::Z => :select,
107
- SDL::Key::X => :b,
108
- SDL::Key::C => :a,
109
- SDL::Key::COMMA => :a,
110
- SDL::Key::PERIOD => :b,
111
- SDL::Key::SLASH => :select
106
+ SDL::Key::Z => :action,
107
+ SDL::Key::X => :fire,
108
+ SDL::Key::L => :fire,
109
+ SDL::Key::SEMICOLON => :action,
110
+ SDL::Key::COLON => :action,
111
+ SDL::Key::QUOTE => :select,
112
+ SDL::Key::QUOTEDBL => :select,
113
+ SDL::Key::PERIOD => :fire,
114
+ SDL::Key::SLASH => :action,
115
+ SDL::Key::KP0 => :select,
116
+ SDL::Key::KP1 => :fire,
117
+ SDL::Key::KP2 => :action,
118
+ SDL::Key::KP3 => :select,
119
+ SDL::Key::KP4 => :fire,
120
+ SDL::Key::KP5 => :action,
121
+ SDL::Key::KP6 => :select,
122
+ SDL::Key::KP7 => :fire,
123
+ SDL::Key::KP8 => :action,
124
+ SDL::Key::KP9 => :select,
125
+ SDL::Key::KP_DIVIDE => :fire,
126
+ SDL::Key::KP_MULTIPLY => :action,
127
+ SDL::Key::KP_MINUS => :select,
128
+ SDL::Key::KP_PLUS => :menu,
129
+ SDL::Key::KP_ENTER => :menu
112
130
  }
113
131
 
114
132
  def initialize
@@ -139,14 +157,14 @@ class ControllerManager
139
157
  @controllers[0].right_pressed = true
140
158
  @horizontal[0].plus_pressed
141
159
  @controllers[0].horizontal = @horizontal[0].state
142
- when :a
143
- @controllers[0].a_pressed = true
144
- when :b
145
- @controllers[0].b_pressed = true
160
+ when :action
161
+ @controllers[0].action_pressed = true
162
+ when :fire
163
+ @controllers[0].fire_pressed = true
146
164
  when :select
147
165
  @controllers[0].select_pressed = true
148
- when :start
149
- @controllers[0].start_pressed = true
166
+ when :menu
167
+ @controllers[0].menu_pressed = true
150
168
  end
151
169
  end
152
170
 
@@ -154,7 +172,7 @@ class ControllerManager
154
172
  case KEYMAP[key]
155
173
  when :up
156
174
  @controllers[0].up_pressed = false
157
- @vertical[0].minus_pressed
175
+ @vertical[0].minus_released
158
176
  @controllers[0].vertical = @vertical[0].state
159
177
  when :down
160
178
  @controllers[0].down_pressed = false
@@ -168,14 +186,14 @@ class ControllerManager
168
186
  @controllers[0].right_pressed = false
169
187
  @horizontal[0].plus_released
170
188
  @controllers[0].horizontal = @horizontal[0].state
171
- when :a
172
- @controllers[0].a_pressed = false
173
- when :b
174
- @controllers[0].b_pressed = false
189
+ when :action
190
+ @controllers[0].action_pressed = false
191
+ when :fire
192
+ @controllers[0].fire_pressed = false
175
193
  when :select
176
194
  @controllers[0].select_pressed = false
177
- when :start
178
- @controllers[0].start_pressed = false
195
+ when :menu
196
+ @controllers[0].menu_pressed = false
179
197
  end
180
198
  end
181
199
  end
@@ -73,6 +73,13 @@ class Display
73
73
  @vdu.write_byte(offset, byte)
74
74
  end
75
75
 
76
+ def write_vdu_2d(offset, stride, data)
77
+ data.each do |row|
78
+ write_vdu(offset, row)
79
+ offset += stride
80
+ end
81
+ end
82
+
76
83
  def wait_scanlines(count)
77
84
  @vdu.wait_scanlines(count)
78
85
  end
@@ -166,7 +173,7 @@ class Display
166
173
  def _set_mode
167
174
  flags = SDL::HWSURFACE | SDL::DOUBLEBUF
168
175
  flags |= SDL::FULLSCREEN if fullscreen?
169
- @screen = @sdl::Screen.open(OUTPUT_WIDTH, OUTPUT_HEIGHT, 32, flags)
176
+ @screen = @sdl.set_video_mode(OUTPUT_WIDTH, OUTPUT_HEIGHT, 32, flags)
170
177
  @bezel_image = @sdl::Surface.new(0, OUTPUT_WIDTH, OUTPUT_HEIGHT,
171
178
  _surface_format(@screen))
172
179
  _generate_bezel
@@ -0,0 +1,785 @@
1
+ module Retrograph
2
+ module Easy
3
+ module Res
4
+ module Controllers
5
+
6
+ PALETTE_DATA = [0x3f, 0x00, 0x10, 0x20, 0x34, 0x14, 0x29, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].pack('C*')
7
+
8
+ NAME_DATA = [
9
+ [0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000],
10
+ [0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0000, 0x0003, 0x0004, 0x0005, 0x0000, 0x0000, 0x0000, 0x0000],
11
+ [0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x0000, 0x0007, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000],
12
+ [0x0000, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x000b, 0x0010, 0x0011, 0x0000, 0x0000, 0x0000],
13
+ [0x0000, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0016, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x0000],
14
+ [0x0000, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x0029, 0x0000],
15
+ [0x0000, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0000, 0x0000, 0x0000],
16
+ [0x0000, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x0029, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x0000, 0x0000, 0x0000],
17
+ [0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0007, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000],
18
+ [0x0000, 0x0000, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0000, 0x0000, 0x0044, 0x0045, 0x0046, 0x0000, 0x0000, 0x0000],
19
+ [0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000],
20
+ [0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000],
21
+ [0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0000, 0x0003, 0x0004, 0x0005, 0x0000, 0x0000, 0x0000, 0x0000],
22
+ [0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x0000, 0x0007, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000],
23
+ [0x0000, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x000b, 0x0010, 0x0011, 0x0000, 0x0000, 0x0000],
24
+ [0x0000, 0x0012, 0x0013, 0x0047, 0x0015, 0x0016, 0x0017, 0x0016, 0x0018, 0x0048, 0x0049, 0x001b, 0x001c, 0x001d, 0x0000],
25
+ [0x0000, 0x001e, 0x004a, 0x0020, 0x004b, 0x0022, 0x004c, 0x0024, 0x004d, 0x004e, 0x004f, 0x0028, 0x0029, 0x0029, 0x0000],
26
+ [0x0000, 0x002a, 0x002b, 0x0050, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0051, 0x0033, 0x0034, 0x0000, 0x0000, 0x0000],
27
+ [0x0000, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x0029, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x0000, 0x0000, 0x0000],
28
+ [0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0007, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000],
29
+ [0x0000, 0x0000, 0x003f, 0x0040, 0x0041, 0x0042, 0x0052, 0x0000, 0x0000, 0x0044, 0x0045, 0x0046, 0x0000, 0x0000, 0x0000],
30
+ [0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000]
31
+ ].map! { |r| r.pack('v*') }
32
+
33
+ TILE_DATA = [
34
+ 0x00000000,
35
+ 0x00000000,
36
+ 0x00000000,
37
+ 0x00000000,
38
+ 0x00000000,
39
+ 0x00000000,
40
+ 0x00000000,
41
+ 0x00000000,
42
+
43
+ 0x00000000,
44
+ 0x10110161,
45
+ 0x10010111,
46
+ 0x10110121,
47
+ 0x10010101,
48
+ 0x10110101,
49
+ 0x00000000,
50
+ 0x11111111,
51
+
52
+ 0x00000000,
53
+ 0x00101061,
54
+ 0x00101010,
55
+ 0x00101010,
56
+ 0x00101010,
57
+ 0x00515010,
58
+ 0x00000000,
59
+ 0x00111111,
60
+
61
+ 0x00000000,
62
+ 0x11011600,
63
+ 0x01000100,
64
+ 0x11051500,
65
+ 0x01010000,
66
+ 0x11061100,
67
+ 0x00000000,
68
+ 0x11111100,
69
+
70
+ 0x00000000,
71
+ 0x50110010,
72
+ 0x10010010,
73
+ 0x10110010,
74
+ 0x10010010,
75
+ 0x50110110,
76
+ 0x00000000,
77
+ 0x11111111,
78
+
79
+ 0x00000000,
80
+ 0x00011101,
81
+ 0x00001000,
82
+ 0x00001000,
83
+ 0x00001000,
84
+ 0x00001001,
85
+ 0x00000000,
86
+ 0x00011111,
87
+
88
+ 0x00100000,
89
+ 0x00100000,
90
+ 0x00100000,
91
+ 0x00100000,
92
+ 0x00100000,
93
+ 0x00100000,
94
+ 0x00100000,
95
+ 0x00100000,
96
+
97
+ 0x00000100,
98
+ 0x00000100,
99
+ 0x00000100,
100
+ 0x00000100,
101
+ 0x00000100,
102
+ 0x00000100,
103
+ 0x00000100,
104
+ 0x00000100,
105
+
106
+ 0x00000000,
107
+ 0x00000000,
108
+ 0x00000000,
109
+ 0x60000000,
110
+ 0x55000000,
111
+ 0x76500000,
112
+ 0x67650000,
113
+ 0x66756000,
114
+
115
+ 0x55600000,
116
+ 0x77655600,
117
+ 0x66777556,
118
+ 0x66667775,
119
+ 0x66666677,
120
+ 0x66666666,
121
+ 0x66666666,
122
+ 0x66666666,
123
+
124
+ 0x22222222,
125
+ 0x77777777,
126
+ 0x66666666,
127
+ 0x66666666,
128
+ 0x66666666,
129
+ 0x66666666,
130
+ 0x66666666,
131
+ 0x22222255,
132
+
133
+ 0x22222222,
134
+ 0x77777777,
135
+ 0x66666666,
136
+ 0x66666666,
137
+ 0x66666666,
138
+ 0x66666666,
139
+ 0x66666666,
140
+ 0x66666666,
141
+
142
+ 0x52222222,
143
+ 0x77777777,
144
+ 0x66666666,
145
+ 0x66666666,
146
+ 0x66666666,
147
+ 0x66666666,
148
+ 0x66666666,
149
+ 0x66666666,
150
+
151
+ 0x60100006,
152
+ 0x75122226,
153
+ 0x67177776,
154
+ 0x66166666,
155
+ 0x66166666,
156
+ 0x66166666,
157
+ 0x66122556,
158
+ 0x66166665,
159
+
160
+ 0x22222225,
161
+ 0x77777777,
162
+ 0x66666666,
163
+ 0x66666666,
164
+ 0x66666666,
165
+ 0x66666666,
166
+ 0x66666666,
167
+ 0x66666666,
168
+
169
+ 0x22222122,
170
+ 0x77777177,
171
+ 0x66666166,
172
+ 0x66666166,
173
+ 0x66666166,
174
+ 0x66666166,
175
+ 0x66666166,
176
+ 0x66666166,
177
+
178
+ 0x00000652,
179
+ 0x00652277,
180
+ 0x65277766,
181
+ 0x27766666,
182
+ 0x76666666,
183
+ 0x66666666,
184
+ 0x66666666,
185
+ 0x66666666,
186
+
187
+ 0x00000000,
188
+ 0x00000000,
189
+ 0x00000000,
190
+ 0x00000006,
191
+ 0x00000052,
192
+ 0x00000526,
193
+ 0x00005266,
194
+ 0x00062666,
195
+
196
+ 0x66675600,
197
+ 0x66677500,
198
+ 0x66667560,
199
+ 0x66667720,
200
+ 0x66666756,
201
+ 0x66666766,
202
+ 0x66666675,
203
+ 0x66666672,
204
+
205
+ 0x55666666,
206
+ 0x66556666,
207
+ 0x66665666,
208
+ 0x66666566,
209
+ 0x66666656,
210
+ 0x66666656,
211
+ 0x66666665,
212
+ 0x66666665,
213
+
214
+ 0x66666666,
215
+ 0x66666666,
216
+ 0x66666666,
217
+ 0x62222236,
218
+ 0x51222226,
219
+ 0x51231226,
220
+ 0x51233226,
221
+ 0x51222226,
222
+
223
+ 0x66666611,
224
+ 0x66661166,
225
+ 0x66616666,
226
+ 0x66166666,
227
+ 0x65666666,
228
+ 0x66666666,
229
+ 0x66666666,
230
+ 0x66666666,
231
+
232
+ 0x66666666,
233
+ 0x66666666,
234
+ 0x66666666,
235
+ 0x66666666,
236
+ 0x66666666,
237
+ 0x66666666,
238
+ 0x66666666,
239
+ 0x66666666,
240
+
241
+ 0x76155565,
242
+ 0x76165562,
243
+ 0x76156562,
244
+ 0x76166666,
245
+ 0x67177766,
246
+ 0x66166666,
247
+ 0x66166666,
248
+ 0x66166666,
249
+
250
+ 0x66666166,
251
+ 0x66666166,
252
+ 0x66666166,
253
+ 0x66666166,
254
+ 0x66666166,
255
+ 0x66666666,
256
+ 0x66112256,
257
+ 0x62666665,
258
+
259
+ 0x66666666,
260
+ 0x55566666,
261
+ 0x33555666,
262
+ 0x44335566,
263
+ 0x47743566,
264
+ 0x34773556,
265
+ 0x33474356,
266
+ 0x33344356,
267
+
268
+ 0x66666666,
269
+ 0x66666555,
270
+ 0x66655533,
271
+ 0x66523344,
272
+ 0x65134434,
273
+ 0x62133333,
274
+ 0x51333333,
275
+ 0x21333333,
276
+
277
+ 0x00626666,
278
+ 0x00566666,
279
+ 0x06266666,
280
+ 0x05666666,
281
+ 0x62666666,
282
+ 0x62666666,
283
+ 0x55666666,
284
+ 0x25666666,
285
+
286
+ 0x00000000,
287
+ 0x00000000,
288
+ 0x01100000,
289
+ 0x00100000,
290
+ 0x01100000,
291
+ 0x00100000,
292
+ 0x00100000,
293
+ 0x00000000,
294
+
295
+ 0x00000000,
296
+ 0x00000000,
297
+ 0x11061101,
298
+ 0x01010101,
299
+ 0x11061101,
300
+ 0x01010101,
301
+ 0x11010101,
302
+ 0x00000000,
303
+
304
+ 0x56666672,
305
+ 0x56666672,
306
+ 0x26666672,
307
+ 0x26666672,
308
+ 0x26666672,
309
+ 0x26666672,
310
+ 0x26666672,
311
+ 0x26666672,
312
+
313
+ 0x66666666,
314
+ 0x22223666,
315
+ 0x22222666,
316
+ 0x23122666,
317
+ 0x23322666,
318
+ 0x22222666,
319
+ 0x11112666,
320
+ 0x55556666,
321
+
322
+ 0x51222226,
323
+ 0x22222222,
324
+ 0x22211222,
325
+ 0x22222122,
326
+ 0x22322122,
327
+ 0x22232222,
328
+ 0x11222221,
329
+ 0x21222225,
330
+
331
+ 0x66666666,
332
+ 0x66622222,
333
+ 0x66512222,
334
+ 0x66512312,
335
+ 0x66512332,
336
+ 0x66512222,
337
+ 0x66511111,
338
+ 0x66655555,
339
+
340
+ 0x66666667,
341
+ 0x66666667,
342
+ 0x66666667,
343
+ 0x66666667,
344
+ 0x66666667,
345
+ 0x66666667,
346
+ 0x66666667,
347
+ 0x26666667,
348
+
349
+ 0x66666666,
350
+ 0x66577666,
351
+ 0x65777766,
352
+ 0x65777766,
353
+ 0x65577566,
354
+ 0x66555666,
355
+ 0x66666666,
356
+ 0x65265262,
357
+
358
+ 0x56666666,
359
+ 0x65666666,
360
+ 0x62666666,
361
+ 0x62666666,
362
+ 0x61666666,
363
+ 0x61666666,
364
+ 0x26666666,
365
+ 0x66666655,
366
+
367
+ 0x66122256,
368
+ 0x61223325,
369
+ 0x51222632,
370
+ 0x21222232,
371
+ 0x21222222,
372
+ 0x51122221,
373
+ 0x75111116,
374
+ 0x67522566,
375
+
376
+ 0x33344356,
377
+ 0x33334356,
378
+ 0x33343567,
379
+ 0x33343567,
380
+ 0x33332567,
381
+ 0x33115567,
382
+ 0x11255566,
383
+ 0x25555556,
384
+
385
+ 0x11333333,
386
+ 0x11333333,
387
+ 0x21133333,
388
+ 0x51133333,
389
+ 0x52113333,
390
+ 0x65211133,
391
+ 0x65521111,
392
+ 0x65555211,
393
+
394
+ 0x11111166,
395
+ 0x15666666,
396
+ 0x15666666,
397
+ 0x15666666,
398
+ 0x15666666,
399
+ 0x15666666,
400
+ 0x15666666,
401
+ 0x15666666,
402
+
403
+ 0x11111111,
404
+ 0x00000000,
405
+ 0x00000000,
406
+ 0x00000000,
407
+ 0x00000000,
408
+ 0x00000000,
409
+ 0x00000000,
410
+ 0x00000000,
411
+
412
+ 0x66666672,
413
+ 0x66666675,
414
+ 0x66666766,
415
+ 0x66666726,
416
+ 0x66666750,
417
+ 0x66667660,
418
+ 0x66667500,
419
+ 0x66672600,
420
+
421
+ 0x66666661,
422
+ 0x66666661,
423
+ 0x66666616,
424
+ 0x66666616,
425
+ 0x66666166,
426
+ 0x66661666,
427
+ 0x66656666,
428
+ 0x66666666,
429
+
430
+ 0x51222226,
431
+ 0x51231226,
432
+ 0x51233226,
433
+ 0x51222226,
434
+ 0x51111126,
435
+ 0x65555566,
436
+ 0x66666666,
437
+ 0x66666666,
438
+
439
+ 0x76666666,
440
+ 0x76666666,
441
+ 0x67666666,
442
+ 0x67666666,
443
+ 0x66766666,
444
+ 0x66676666,
445
+ 0x66667766,
446
+ 0x66666677,
447
+
448
+ 0x56666666,
449
+ 0x66666666,
450
+ 0x66666666,
451
+ 0x66666666,
452
+ 0x66666666,
453
+ 0x66666666,
454
+ 0x66666666,
455
+ 0x55556666,
456
+
457
+ 0x62565265,
458
+ 0x66666666,
459
+ 0x66666666,
460
+ 0x66666666,
461
+ 0x66666666,
462
+ 0x66666666,
463
+ 0x66666666,
464
+ 0x55555555,
465
+
466
+ 0x66666622,
467
+ 0x66666666,
468
+ 0x66666666,
469
+ 0x66666666,
470
+ 0x66666666,
471
+ 0x66666666,
472
+ 0x66666666,
473
+ 0x66666555,
474
+
475
+ 0x66777766,
476
+ 0x56666666,
477
+ 0x56666666,
478
+ 0x56666666,
479
+ 0x56666666,
480
+ 0x56666666,
481
+ 0x66666666,
482
+ 0x66666666,
483
+
484
+ 0x55122225,
485
+ 0x51223322,
486
+ 0x21222632,
487
+ 0x11222232,
488
+ 0x11222222,
489
+ 0x21122221,
490
+ 0x52111115,
491
+ 0x65211256,
492
+
493
+ 0x66555555,
494
+ 0x66555555,
495
+ 0x66655555,
496
+ 0x66665555,
497
+ 0x66666555,
498
+ 0x66666655,
499
+ 0x66666665,
500
+ 0x66666666,
501
+
502
+ 0x25666666,
503
+ 0x25566666,
504
+ 0x55566666,
505
+ 0x61566666,
506
+ 0x02556666,
507
+ 0x05556666,
508
+ 0x00155666,
509
+ 0x00615566,
510
+
511
+ 0x66656000,
512
+ 0x66550000,
513
+ 0x65500000,
514
+ 0x55000000,
515
+ 0x60000000,
516
+ 0x00000000,
517
+ 0x00000000,
518
+ 0x00000000,
519
+
520
+ 0x66666666,
521
+ 0x66666666,
522
+ 0x66666666,
523
+ 0x66666666,
524
+ 0x66666652,
525
+ 0x66665526,
526
+ 0x55525500,
527
+ 0x12560000,
528
+
529
+ 0x77777777,
530
+ 0x66666666,
531
+ 0x66666666,
532
+ 0x66666666,
533
+ 0x66666666,
534
+ 0x66666666,
535
+ 0x55555555,
536
+ 0x21111111,
537
+
538
+ 0x66666666,
539
+ 0x66666666,
540
+ 0x56666666,
541
+ 0x55566666,
542
+ 0x21555666,
543
+ 0x06215555,
544
+ 0x00062155,
545
+ 0x00000065,
546
+
547
+ 0x12555566,
548
+ 0x00652555,
549
+ 0x00006215,
550
+ 0x00000062,
551
+ 0x00000006,
552
+ 0x00000000,
553
+ 0x00000000,
554
+ 0x00000000,
555
+
556
+ 0x66655521,
557
+ 0x65525600,
558
+ 0x51260000,
559
+ 0x26000000,
560
+ 0x60000000,
561
+ 0x00000000,
562
+ 0x00000000,
563
+ 0x00000000,
564
+
565
+ 0x66666666,
566
+ 0x66666666,
567
+ 0x66666666,
568
+ 0x66666655,
569
+ 0x66665522,
570
+ 0x65552260,
571
+ 0x55226000,
572
+ 0x56000000,
573
+
574
+ 0x66666666,
575
+ 0x66666666,
576
+ 0x66666166,
577
+ 0x66666166,
578
+ 0x66666166,
579
+ 0x66666166,
580
+ 0x55555155,
581
+ 0x11111112,
582
+
583
+ 0x66666666,
584
+ 0x66666666,
585
+ 0x56666666,
586
+ 0x55666666,
587
+ 0x15556666,
588
+ 0x61155556,
589
+ 0x00211255,
590
+ 0x00006521,
591
+
592
+ 0x00061556,
593
+ 0x00002155,
594
+ 0x00000215,
595
+ 0x00000021,
596
+ 0x00000006,
597
+ 0x00000000,
598
+ 0x00000000,
599
+ 0x00000000,
600
+
601
+ 0x11061111,
602
+ 0x11011111,
603
+ 0x11011011,
604
+ 0x11011011,
605
+ 0x11061111,
606
+ 0x11000011,
607
+ 0x11000011,
608
+ 0x00000000,
609
+
610
+ 0x00000000,
611
+ 0x11061110,
612
+ 0x11011000,
613
+ 0x11011160,
614
+ 0x11015010,
615
+ 0x16011110,
616
+ 0x00011160,
617
+ 0x11000000,
618
+
619
+ 0x00000000,
620
+ 0x61160110,
621
+ 0x11110110,
622
+ 0x10510110,
623
+ 0x51110111,
624
+ 0x00110111,
625
+ 0x11160110,
626
+ 0x00000611,
627
+
628
+ 0x00000000,
629
+ 0x00611610,
630
+ 0x00106110,
631
+ 0x00000110,
632
+ 0x00000110,
633
+ 0x00000110,
634
+ 0x00000110,
635
+ 0x00000000,
636
+
637
+ 0x00001160,
638
+ 0x00001116,
639
+ 0x00001100,
640
+ 0x00001100,
641
+ 0x00001100,
642
+ 0x00001100,
643
+ 0x00011110,
644
+ 0x00000000,
645
+
646
+ 0x00000100,
647
+ 0x00100100,
648
+ 0x06260100,
649
+ 0x02020100,
650
+ 0x01110100,
651
+ 0x01010100,
652
+ 0x00000100,
653
+ 0x11111100,
654
+
655
+ 0x00000000,
656
+ 0x10111015,
657
+ 0x10010001,
658
+ 0x10010001,
659
+ 0x10010001,
660
+ 0x10010015,
661
+ 0x00000000,
662
+ 0x11111111,
663
+
664
+ 0x00000000,
665
+ 0x61105150,
666
+ 0x10101010,
667
+ 0x10101010,
668
+ 0x10101010,
669
+ 0x10105150,
670
+ 0x00000000,
671
+ 0x11111111,
672
+
673
+ 0x66666666,
674
+ 0x66666666,
675
+ 0x66666666,
676
+ 0x66666666,
677
+ 0x62223336,
678
+ 0x61221226,
679
+ 0x61233226,
680
+ 0x61222226,
681
+
682
+ 0x66666666,
683
+ 0x55566666,
684
+ 0x33555666,
685
+ 0x33335566,
686
+ 0x44433566,
687
+ 0x47743556,
688
+ 0x34773356,
689
+ 0x33474356,
690
+
691
+ 0x66666666,
692
+ 0x66666555,
693
+ 0x66655533,
694
+ 0x66523333,
695
+ 0x65233344,
696
+ 0x65233334,
697
+ 0x52333333,
698
+ 0x51333333,
699
+
700
+ 0x66666666,
701
+ 0x23666666,
702
+ 0x22223666,
703
+ 0x22223666,
704
+ 0x23123666,
705
+ 0x23222666,
706
+ 0x22222666,
707
+ 0x11112666,
708
+
709
+ 0x66666666,
710
+ 0x66666522,
711
+ 0x66612222,
712
+ 0x66612222,
713
+ 0x66612212,
714
+ 0x66612312,
715
+ 0x66612222,
716
+ 0x66611111,
717
+
718
+ 0x66666666,
719
+ 0x66666666,
720
+ 0x66677666,
721
+ 0x66777766,
722
+ 0x66777766,
723
+ 0x66677666,
724
+ 0x66666666,
725
+ 0x65265262,
726
+
727
+ 0x66122256,
728
+ 0x65222225,
729
+ 0x61223322,
730
+ 0x61222322,
731
+ 0x61222222,
732
+ 0x65122221,
733
+ 0x76511156,
734
+ 0x67666666,
735
+
736
+ 0x33344356,
737
+ 0x33343356,
738
+ 0x33343567,
739
+ 0x33333567,
740
+ 0x33332567,
741
+ 0x33225567,
742
+ 0x12555566,
743
+ 0x55555556,
744
+
745
+ 0x51333333,
746
+ 0x51333333,
747
+ 0x52133333,
748
+ 0x52133333,
749
+ 0x55213333,
750
+ 0x65521133,
751
+ 0x65552211,
752
+ 0x65555555,
753
+
754
+ 0x61222226,
755
+ 0x61222226,
756
+ 0x61211226,
757
+ 0x61232226,
758
+ 0x61111116,
759
+ 0x66666666,
760
+ 0x66666666,
761
+ 0x66666666,
762
+
763
+ 0x55122225,
764
+ 0x52222222,
765
+ 0x52223322,
766
+ 0x51222322,
767
+ 0x51222222,
768
+ 0x52122221,
769
+ 0x55211225,
770
+ 0x65555556,
771
+
772
+ 0x00051160,
773
+ 0x00511156,
774
+ 0x00150065,
775
+ 0x00615000,
776
+ 0x00065160,
777
+ 0x00000616,
778
+ 0x00111111,
779
+ 0x00000000
780
+ ].pack('V*')
781
+
782
+ end
783
+ end
784
+ end
785
+ end
@@ -1,4 +1,4 @@
1
- # retrograph/sdl
1
+ # retrograph/sdl/feature/sdl_image - feature test for SDL_image
2
2
  #
3
3
  # Copyright (c) 2009 MenTaLguY <mental@rydia.net>
4
4
  #
@@ -19,8 +19,13 @@
19
19
  # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
21
  # THE SOFTWARE.
22
+ #
22
23
 
23
- require 'retrograph'
24
24
  require 'sdl'
25
25
 
26
- Retrograph._init_sdl
26
+ begin
27
+ SDL::Surface.load
28
+ rescue NoMethodError
29
+ raise LoadError, "Ruby/SDL was not built with SDL_image"
30
+ rescue ArgumentError
31
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: retrograph_easy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: "0.2"
5
5
  platform: ruby
6
6
  authors:
7
7
  - MenTaLguY <mental@rydia.net>
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-25 00:00:00 -04:00
12
+ date: 2009-08-06 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -38,9 +38,8 @@ files:
38
38
  - Rakefile
39
39
  - README
40
40
  - COPYING
41
- - lib/retrograph.rb
42
41
  - lib/retrograph/easy.rb
43
- - lib/retrograph/sdl.rb
42
+ - lib/retrograph/sdl/feature/sdl_image.rb
44
43
  - lib/retrograph/easy/app.rb
45
44
  - lib/retrograph/easy/logo.rb
46
45
  - lib/retrograph/easy/constants.rb
@@ -51,6 +50,8 @@ files:
51
50
  - spec/easy_spec.rb
52
51
  - demos/defense.rb
53
52
  - demos/logo.rb
53
+ - demos/controller.rb
54
+ - lib/retrograph/easy/res/controllers.rb
54
55
  has_rdoc: true
55
56
  homepage: http://rubyforge.org/projects/retrograph
56
57
  licenses: []
@@ -1,29 +0,0 @@
1
- # retrograph
2
- #
3
- # Copyright (c) 2009 MenTaLguY <mental@rydia.net>
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
22
- #
23
-
24
- # augment search path for fat binary gems
25
- ruby_version = /^\d+\.\d+/.match(RUBY_VERSION)[0]
26
- base_dir = File.dirname(__FILE__)
27
- $:.push File.join(base_dir, ruby_version)
28
-
29
- require 'retrograph.so'