texplay 0.2.983pre2-i386-mingw32 → 0.3.0-i386-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/Rakefile +41 -49
  2. data/examples/common.rb +13 -2
  3. data/examples/example_alpha_blend.rb +1 -3
  4. data/examples/example_bezier.rb +1 -2
  5. data/examples/example_blank.rb +1 -3
  6. data/examples/example_cache.rb +1 -3
  7. data/examples/example_color_transform.rb +1 -3
  8. data/examples/example_color_transform_circle.rb +1 -3
  9. data/examples/example_darken.rb +1 -4
  10. data/examples/example_dup.rb +1 -4
  11. data/examples/example_each.rb +1 -4
  12. data/examples/example_effect.rb +1 -2
  13. data/examples/example_fill.rb +1 -2
  14. data/examples/example_fill_old.rb +1 -2
  15. data/examples/example_fluent.rb +1 -3
  16. data/examples/example_font.rb +1 -3
  17. data/examples/example_gen_eval.rb +1 -2
  18. data/examples/example_hash_arguments.rb +1 -2
  19. data/examples/example_ippa.rb +1 -3
  20. data/examples/example_light.rb +1 -3
  21. data/examples/example_light_multiply.rb +1 -3
  22. data/examples/example_lsystem.rb +1 -1
  23. data/examples/example_melt.rb +1 -3
  24. data/examples/example_meyet.rb +1 -3
  25. data/examples/example_polyline.rb +1 -2
  26. data/examples/example_scale.rb +1 -3
  27. data/examples/example_select.rb +1 -3
  28. data/examples/example_select2.rb +1 -4
  29. data/examples/example_simple.rb +1 -3
  30. data/examples/example_splice.rb +2 -4
  31. data/examples/example_sync.rb +1 -2
  32. data/examples/example_tiles.rb +1 -3
  33. data/examples/example_trace.rb +1 -2
  34. data/examples/example_transparent.rb +1 -3
  35. data/examples/example_transparent2.rb +1 -3
  36. data/examples/example_transparent3.rb +1 -3
  37. data/examples/example_turtle.rb +1 -2
  38. data/examples/example_weird.rb +1 -2
  39. data/examples/example_window_render_to_image.rb +41 -0
  40. data/examples/example_window_to_blob.rb +2 -5
  41. data/ext/texplay/actions.c +1006 -0
  42. data/ext/texplay/actions.h +60 -0
  43. data/ext/texplay/bindings.c +1186 -0
  44. data/ext/texplay/bindings.h +46 -0
  45. data/ext/texplay/cache.c +118 -0
  46. data/ext/texplay/cache.h +24 -0
  47. data/ext/texplay/compat.h +27 -0
  48. data/ext/texplay/extconf.rb +28 -0
  49. data/ext/texplay/gen_eval.c +211 -0
  50. data/ext/texplay/gen_eval.h +20 -0
  51. data/ext/texplay/graphics_utils.c +1244 -0
  52. data/ext/texplay/graphics_utils.h +22 -0
  53. data/ext/texplay/object2module.c +171 -0
  54. data/ext/texplay/object2module.h +11 -0
  55. data/ext/texplay/texplay.c +216 -0
  56. data/ext/texplay/texplay.h +148 -0
  57. data/ext/texplay/utils.c +887 -0
  58. data/ext/texplay/utils.h +153 -0
  59. data/lib/1.8/texplay.so +0 -0
  60. data/lib/1.9/texplay.so +0 -0
  61. data/lib/texplay.rb +271 -165
  62. data/lib/texplay/c_function_docs.rb +189 -0
  63. data/lib/texplay/version.rb +1 -1
  64. metadata +33 -21
  65. data/examples/example_window_to_texture.rb +0 -55
  66. data/lib/texplay/patches.rb +0 -4
data/Rakefile CHANGED
@@ -5,45 +5,14 @@ require 'rake/gempackagetask'
5
5
  #require 'rake/extensiontask'
6
6
 
7
7
  # get the texplay version
8
- require 'lib/texplay/version'
8
+ require './lib/texplay/version'
9
9
 
10
- $dlext = Config::CONFIG['DLEXT']
10
+ dlext = Config::CONFIG['DLEXT']
11
11
 
12
- CLEAN.include("ext/**/*.#{$dlext}", "ext/**/*.log", "ext/**/*.o", "ext/**/*~", "ext/**/*#*", "ext/**/*.obj", "ext/**/*.def", "ext/**/*.pdb")
13
- CLOBBER.include("**/*.#{$dlext}", "**/*~", "**/*#*", "**/*.log", "**/*.o")
12
+ CLEAN.include("ext/**/*.#{dlext}", "ext/**/*.log", "ext/**/*.o", "ext/**/*~", "ext/**/*#*", "ext/**/*.obj", "ext/**/*.def", "ext/**/*.pdb")
13
+ CLOBBER.include("**/*.#{dlext}", "**/*~", "**/*#*", "**/*.log", "**/*.o")
14
14
 
15
- # specification = Gem::Specification.new do |s|
16
- # s.name = "texplay"
17
- # s.summary = "TexPlay is a light-weight image manipulation framework for Ruby and Gosu"
18
- # s.version = TexPlay::VERSION
19
- # s.date = Time.now.strftime '%Y-%m-%d'
20
- # s.author = "John Mair (banisterfiend)"
21
- # s.email = 'jrmair@gmail.com'
22
- # s.description = s.summary
23
- # s.require_path = 'lib'
24
- # s.add_dependency("gosu",">=0.7.20")
25
- # s.platform = Gem::Platform::RUBY
26
- # s.homepage = "http://banisterfiend.wordpress.com/2008/08/23/texplay-an-image-manipulation-tool-for-ruby-and-gosu/"
27
- # s.has_rdoc = false
28
-
29
- # s.extensions = ["ext/texplay/extconf.rb"]
30
- # s.files = ["Rakefile", "README.markdown", "CHANGELOG",
31
- # "lib/texplay.rb", "lib/texplay-contrib.rb", "lib/texplay/version.rb", "lib/texplay/patches.rb"] +
32
- # FileList["ext/**/extconf.rb", "ext/**/*.h", "ext/**/*.c", "examples/*.rb", "examples/media/*", "spec/*.rb"].to_a
33
- # end
34
-
35
- # Rake::ExtensionTask.new('texplay', specification) do |ext|
36
- # ext.config_script = 'extconf.rb'
37
- # ext.cross_compile = true
38
- # ext.cross_platform = 'i386-mswin32'
39
- # ext.platform = 'i386-mswin32'
40
- # end
41
-
42
-
43
- #comment this when want to build normal gems.
44
- #only have this code uncommented when building mswin32 and mingw32
45
- #binary gems
46
- specification = Gem::Specification.new do |s|
15
+ def apply_spec_defaults(s)
47
16
  s.name = "texplay"
48
17
  s.summary = "TexPlay is a light-weight image manipulation framework for Ruby and Gosu"
49
18
  s.version = TexPlay::VERSION
@@ -53,25 +22,48 @@ specification = Gem::Specification.new do |s|
53
22
  s.description = s.summary
54
23
  s.require_path = 'lib'
55
24
  s.add_dependency("gosu",">=0.7.20")
56
- s.platform = 'i386-mingw32'
57
25
  s.homepage = "http://banisterfiend.wordpress.com/2008/08/23/texplay-an-image-manipulation-tool-for-ruby-and-gosu/"
58
- s.has_rdoc = false
59
-
60
- s.files = ["Rakefile", "README.markdown", "CHANGELOG",
61
- "lib/texplay.rb", "lib/texplay-contrib.rb",
62
- "lib/texplay/version.rb",
63
- "lib/texplay/patches.rb",
64
- "lib/1.8/texplay.so",
65
- "lib/1.9/texplay.so"] +
66
- FileList["examples/*.rb", "examples/media/*", "spec/*.rb"].to_a
26
+ s.has_rdoc = 'yard'
27
+ s.files = FileList["Rakefile", "README.markdown", "CHANGELOG",
28
+ "lib/**/*.rb", "ext/**/extconf.rb", "ext/**/*.h", "ext/**/*.c",
29
+ "examples/*.rb", "examples/media/*", "spec/*.rb"].to_a
67
30
  end
68
31
 
69
- Rake::GemPackageTask.new(specification) do |package|
70
- package.need_zip = false
71
- package.need_tar = false
32
+
33
+ [:mingw32, :mswin32].each do |v|
34
+ namespace v do
35
+ spec = Gem::Specification.new do |s|
36
+ apply_spec_defaults(s)
37
+ s.platform = "i386-#{v}"
38
+ s.files += FileList["lib/**/*.#{dlext}"].to_a
39
+ end
40
+
41
+ Rake::GemPackageTask.new(spec) do |pkg|
42
+ pkg.need_zip = false
43
+ pkg.need_tar = false
44
+ end
45
+ end
72
46
  end
73
47
 
48
+ namespace :ruby do
49
+ spec = Gem::Specification.new do |s|
50
+ apply_spec_defaults(s)
51
+ s.platform = Gem::Platform::RUBY
52
+ s.extensions = ["ext/texplay/extconf.rb"]
53
+ end
54
+
55
+ Rake::GemPackageTask.new(spec) do |pkg|
56
+ pkg.need_zip = false
57
+ pkg.need_tar = false
58
+ end
59
+ end
60
+
74
61
  desc "Run rspec 2.0"
75
62
  task :rspec do
76
63
  system "rspec spec/**/*_spec.rb"
77
64
  end
65
+
66
+ desc "Create yard docs"
67
+ task :doc do
68
+ system "yard doc lib --output doc/yard --files doc/texplay_manual"
69
+ end
data/examples/common.rb CHANGED
@@ -1,7 +1,18 @@
1
- $LOAD_PATH.push(File.dirname(__FILE__) + '/../lib/')
1
+ EXAMPLES_DIR = File.dirname(File.expand_path(__FILE__))
2
2
 
3
+ # Ensure that the texplay loaded is the one in this repository, not any gem installed.
4
+ $LOAD_PATH.unshift File.expand_path(File.join(EXAMPLES_DIR, '..', 'lib'))
5
+
6
+ begin
7
+ require 'rubygems'
8
+ rescue LoadError => ex
9
+ end
10
+
11
+ require 'gosu'
3
12
  require 'texplay'
4
13
 
5
14
  module Common
6
- MEDIA = File.dirname(__FILE__) + '/media'
15
+ MEDIA = File.join(EXAMPLES_DIR, 'media')
7
16
  end
17
+
18
+
@@ -1,7 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'texplay'
4
-
5
3
 
6
4
  class W < Gosu::Window
7
5
  def initialize
@@ -1,6 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'texplay'
4
3
 
5
4
 
6
5
  class W < Gosu::Window
@@ -1,7 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'gosu'
4
- require 'texplay'
5
3
 
6
4
 
7
5
  class W < Gosu::Window
@@ -1,7 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'gosu'
4
- require 'texplay'
5
3
 
6
4
  class W < Gosu::Window
7
5
  def initialize
@@ -1,7 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'gosu'
4
- require 'texplay'
5
3
  #require 'devil/gosu'
6
4
 
7
5
  class W < Gosu::Window
@@ -1,7 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'gosu'
4
- require 'texplay'
5
3
 
6
4
  class W < Gosu::Window
7
5
  def initialize
@@ -1,8 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'gosu'
4
- require 'texplay'
5
-
6
3
 
7
4
  class W < Gosu::Window
8
5
  def initialize
@@ -1,8 +1,5 @@
1
-
2
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
3
2
  require 'common'
4
- require 'gosu'
5
- require 'texplay'
6
3
 
7
4
 
8
5
  class W < Gosu::Window
@@ -1,8 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'gosu'
4
- require 'texplay'
5
-
6
3
 
7
4
  class W < Gosu::Window
8
5
  def initialize
@@ -1,6 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'texplay'
4
3
 
5
4
 
6
5
  class W < Gosu::Window
@@ -1,6 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'texplay'
4
3
 
5
4
 
6
5
  class W < Gosu::Window
@@ -1,6 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'texplay'
4
3
 
5
4
  class W < Gosu::Window
6
5
  def initialize
@@ -1,7 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'gosu'
4
- require 'texplay'
5
3
 
6
4
  class W < Gosu::Window
7
5
  def initialize
@@ -1,7 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'gosu'
4
- require 'texplay'
5
3
 
6
4
 
7
5
 
@@ -1,6 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'texplay'
4
3
 
5
4
 
6
5
  class W < Gosu::Window
@@ -1,6 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'texplay'
4
3
 
5
4
 
6
5
  class W < Gosu::Window
@@ -1,7 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'gosu'
4
- require 'texplay'
5
3
 
6
4
  class Window < Gosu::Window
7
5
  def initialize
@@ -1,7 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'gosu'
4
- require 'texplay'
5
3
 
6
4
  class W < Gosu::Window
7
5
  def initialize
@@ -1,7 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'gosu'
4
- require 'texplay'
5
3
 
6
4
  class W < Gosu::Window
7
5
  def initialize
@@ -1,5 +1,5 @@
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
1
2
  require 'common'
2
- require 'gosu'
3
3
 
4
4
  Dragon = TexPlay::LSystem.new do
5
5
  rule "F" => "F"
@@ -1,7 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'gosu'
4
- require 'texplay'
5
3
 
6
4
 
7
5
  class W < Gosu::Window
@@ -1,7 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'gosu'
4
- require 'texplay'
5
3
 
6
4
 
7
5
 
@@ -1,6 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'texplay'
4
3
 
5
4
 
6
5
  class W < Gosu::Window
@@ -1,7 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'gosu'
4
- require 'texplay'
5
3
 
6
4
 
7
5
  class W < Gosu::Window
@@ -1,7 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'gosu'
4
- require 'texplay'
5
3
 
6
4
 
7
5
  class W < Gosu::Window
@@ -1,8 +1,5 @@
1
-
2
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
3
2
  require 'common'
4
- require 'gosu'
5
- require 'texplay'
6
3
  require 'benchmark'
7
4
 
8
5
 
@@ -1,7 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'gosu'
4
- require 'texplay'
5
3
 
6
4
 
7
5
  class W < Gosu::Window
@@ -1,7 +1,5 @@
1
-
2
- require 'rubygems'
3
- require './common'
4
- require 'texplay'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
+ require 'common'
5
3
 
6
4
 
7
5
  class W < Gosu::Window
@@ -1,6 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'texplay'
4
3
 
5
4
 
6
5
  class W < Gosu::Window
@@ -1,7 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'gosu'
4
- require 'texplay'
5
3
 
6
4
  class Gosu::Image
7
5
  # so we can use the old TexPlay to_blob -- appears to segfault?!
@@ -1,6 +1,5 @@
1
- require 'rubygems'
1
+ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
2
  require 'common'
3
- require 'texplay'
4
3
 
5
4
 
6
5
  class W < Gosu::Window