texplay 0.2.800 → 0.2.900

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/CHANGELOG +138 -119
  2. data/README.markdown +43 -41
  3. data/Rakefile +68 -68
  4. data/examples/common.rb +8 -8
  5. data/examples/example_alpha_blend.rb +31 -31
  6. data/examples/example_bezier.rb +42 -42
  7. data/examples/example_color_control.rb +69 -69
  8. data/examples/example_color_transform.rb +64 -67
  9. data/examples/example_color_transform_circle.rb +65 -0
  10. data/examples/example_dup.rb +75 -75
  11. data/examples/example_each.rb +42 -42
  12. data/examples/example_effect.rb +35 -35
  13. data/examples/example_fill.rb +44 -44
  14. data/examples/example_fill_old.rb +49 -49
  15. data/examples/example_fluent.rb +31 -31
  16. data/examples/example_gen_eval.rb +34 -34
  17. data/examples/example_hash_arguments.rb +47 -47
  18. data/examples/example_light.rb +77 -0
  19. data/examples/example_lsystem.rb +61 -61
  20. data/examples/example_melt.rb +27 -27
  21. data/examples/example_meyet.rb +64 -0
  22. data/examples/example_polyline.rb +43 -43
  23. data/examples/example_scale.rb +29 -29
  24. data/examples/example_simple.rb +48 -38
  25. data/examples/example_sync.rb +60 -60
  26. data/examples/example_trace.rb +1 -1
  27. data/examples/example_turtle.rb +40 -40
  28. data/examples/example_weird.rb +3 -1
  29. data/examples/media/Thumbs.db +0 -0
  30. data/ext/texplay/actions.c +999 -1001
  31. data/ext/texplay/actions.h +60 -60
  32. data/ext/texplay/bindings.c +1162 -1149
  33. data/ext/texplay/bindings.h +46 -46
  34. data/ext/texplay/cache.c +118 -118
  35. data/ext/texplay/cache.h +24 -24
  36. data/ext/texplay/compat.h +27 -27
  37. data/ext/texplay/extconf.rb +28 -28
  38. data/ext/texplay/gen_eval.c +211 -211
  39. data/ext/texplay/gen_eval.h +20 -20
  40. data/ext/texplay/graphics_utils.c +188 -63
  41. data/ext/texplay/graphics_utils.h +0 -1
  42. data/ext/texplay/object2module.c +171 -171
  43. data/ext/texplay/object2module.h +11 -11
  44. data/ext/texplay/texplay.c +169 -169
  45. data/ext/texplay/texplay.h +147 -130
  46. data/ext/texplay/utils.c +816 -752
  47. data/ext/texplay/utils.h +151 -145
  48. data/lib/texplay-contrib.rb +171 -171
  49. data/lib/texplay.rb +162 -137
  50. data/lib/texplay/version.rb +1 -1
  51. metadata +9 -5
data/CHANGELOG CHANGED
@@ -1,119 +1,138 @@
1
- 12/03/10
2
- version 0.2.721
3
- * fixed bug in alpha_blend (now blends alpha channels too)
4
-
5
- 6/12/09
6
- version 0.2.710
7
- * fixed bug in line drawing code (wasn't drawing final pixel)
8
- * fixed bug in filled rect code (wasn't drawing final row)
9
- * fixed bug in flood fill (wasn't drawing on first column)
10
- * added glDisable(GL_TEXTURE_2D) calls to cache.c, and removed 'restore previous texture binding' (i doubt there is any previous binding to restore)
11
- * using version.rb to help manage versions
12
-
13
- 23/11/09
14
- * fixed bug in texplay.rb. Replaced TexPlay::TP_MAX_QUAD_SIZE - 2 with
15
- just TexPlay::TP_MAX_QUAD_SIZE (the -2 is now built into the constant)
16
-
17
- 16/10/09
18
- version 0.2.700
19
- * removed memory leak from Gosu::Image#to_blob, now writing directly to RSTRING_PTR
20
-
21
- 12/10/09
22
- version 0.2.666
23
- * added Gosu::Image#to_blob
24
- * to_blob functionality enables Gosu::Images to work with DevIL library
25
-
26
- 6/10/09
27
- version 0.2.5
28
- * fixed quad_draw flicker bug
29
- * added splice_and_scale (to texplay-contrib.rb)
30
- * now using rake-compiler to run build process
31
-
32
- 15/9/09
33
- version 0.2.4
34
- * added lsystem
35
- * made lsystem both 1.9.1 and 1.8.6 compatible
36
-
37
- 11/9/09
38
- version 0.2.3
39
- * added Ruby 1.8.7 compatibility by modifying extconf.rb to define RUBY_19 macro
40
- * and modified compat.h to get rid of feature test (fails on 1.8.7)
41
-
42
- 8/9/09
43
- version 0.2.2
44
- * fixed color_control bug, action_struct->color was being overwritten (now using a temp).
45
- * fixed faulty error msg where max tex size was being displayed as 1024 but is actually 1022
46
- * added :start_angle parameter to ngon action
47
- * fixed example screen height from 769 to 768
48
- * arity of -1 and 0 now supported for color_control procs
49
- * fixed parameter checks for circle and ngon
50
- * updated documentation to reflect changes, and added details on caching
51
-
52
- 2/9/09
53
- version 0.2.1
54
- * releasing a gem for TexPlay
55
- * bumped version number so can add add gosu 0.7.14 dependency to github gem
56
- * hopefully gem works on both github and rubyforge
57
- 31/8/09
58
- version 0.2.0
59
- * added each iterator
60
- * added alternative to proc for :color_control proc (allowing static linear transforms to pixels)
61
- * no longer segfaulting on windows (no idea why not)
62
- * rewrote EmptyImageStub in ruby, using philomory's code. now alot faster.
63
- * implemented 'shadow' in terms of static :color_control pixel transform
64
- * added more example code demonstrating each iterator (example_each.rb) and new color_control behaviour
65
- i.e example_color_transform.rb
66
- * should be relatively stable now!
67
-
68
- 28/8/09
69
- version 0.1.9.1 (still BETA)
70
- * experimental features: Gosu::Image#dup and Gosu::Image#clone
71
- * also TexPlay::create_blank_image(window, width, height)
72
- * I noticed these features SEG FAULT on my setup in windows, so be warned
73
- * This is a BETA release
74
-
75
- 14/8/09
76
- version 0.1.9.0 (BETA)
77
- * major rewrite. TP now supports beziers, polylines, polygons, and more
78
- * also supports alpha_blending (though still tempermental)
79
- * This is a BETA release
80
-
81
- 1/7/09
82
- version 0.1.6.2
83
- * fixed another subtle bug in constrain_local_boundaries(). Function was
84
- unable to deal with drawing actions that were 100% outside the image
85
- boundaries.
86
-
87
- 28/6/09
88
- version 0.1.6
89
- * gen_eval now working as a replacement for instance_eval in the #paint block. Allows for more user-friendly interface.
90
- * #paint can now be called without a block; if invoked this way it executes any commands in the action queue, e.g
91
- @img.circle 20, 20, 40
92
- @img.pixel 30, 30
93
- @img.paint
94
- * above will function as if: @img.paint { circle 20, 20, 40; pixel 30, 30 }
95
- * collected 1.8.6/1.9.1 compatibility into compat.h
96
-
97
- 16/6/09
98
- version 0.1.4.6
99
- * allowed arity of 0 (as well as -1) for ruby 1.9 compatibility
100
-
101
- 13/6/09
102
- version 0.1.4.5
103
- * major bugfix with TexPlay#splice method (segfaut). Also added new color format parameter: color [1, 1, 0, 1] (e.g purple with full alpha).
104
- Also fixed subtle edge-case bug in constrain_local_boundaries().
105
-
106
- 9/6/09
107
- version 0.1.4
108
- * improved error checking. should work better with later gosu releases
109
-
110
- 20/2/09
111
- version 0.1.1
112
- * rerelease of this version fixing the oversized image bug for refresh_cache (i.e images over 500 x 500
113
-
114
- version 0.1.1
115
- * oops, bug in leftshift/rightshift functions, fixed!
116
-
117
- version 0.1.0
118
- * release!
119
-
1
+ 7/6/10
2
+ version 0.2.900
3
+ * added source_select, source_ignore, dest_select, dest_ignore
4
+ * :chroma_key now deprecated (by above functionality)
5
+ * using Gosu::MAX_TEXTURE_SIZE, hopefully fixes crashes on some linux
6
+ distros
7
+ * Gosu::Color objects now accepted (and optionally returned by get_pixel)
8
+ * Monkey patched Gosu::Image.from_text() for auto-caching
9
+ * bitwise drawing modes no longer affect alpha
10
+ * rows and columns methods added to Gosu::Image, allowed Gosu::Image to be
11
+ reopened by Gosu::Image.new (works with Gosu::Image#to_blob)
12
+
13
+
14
+ 23/03/10
15
+ version 0.2.800
16
+ * added 28 drawing modes (using :mode option)
17
+ * added linear interpolation (:lerp)
18
+ * added 'trace' option to line for efficient pixel-based collision detection
19
+
20
+ 12/03/10
21
+ version 0.2.721
22
+ * fixed bug in alpha_blend (now blends alpha channels too)
23
+
24
+ 6/12/09
25
+ version 0.2.710
26
+ * fixed bug in line drawing code (wasn't drawing final pixel)
27
+ * fixed bug in filled rect code (wasn't drawing final row)
28
+ * fixed bug in flood fill (wasn't drawing on first column)
29
+ * added glDisable(GL_TEXTURE_2D) calls to cache.c, and removed 'restore previous texture binding' (i doubt there is any previous binding to restore)
30
+ * using version.rb to help manage versions
31
+
32
+ 23/11/09
33
+ * fixed bug in texplay.rb. Replaced TexPlay::TP_MAX_QUAD_SIZE - 2 with
34
+ just TexPlay::TP_MAX_QUAD_SIZE (the -2 is now built into the constant)
35
+
36
+ 16/10/09
37
+ version 0.2.700
38
+ * removed memory leak from Gosu::Image#to_blob, now writing directly to RSTRING_PTR
39
+
40
+ 12/10/09
41
+ version 0.2.666
42
+ * added Gosu::Image#to_blob
43
+ * to_blob functionality enables Gosu::Images to work with DevIL library
44
+
45
+ 6/10/09
46
+ version 0.2.5
47
+ * fixed quad_draw flicker bug
48
+ * added splice_and_scale (to texplay-contrib.rb)
49
+ * now using rake-compiler to run build process
50
+
51
+ 15/9/09
52
+ version 0.2.4
53
+ * added lsystem
54
+ * made lsystem both 1.9.1 and 1.8.6 compatible
55
+
56
+ 11/9/09
57
+ version 0.2.3
58
+ * added Ruby 1.8.7 compatibility by modifying extconf.rb to define RUBY_19 macro
59
+ * and modified compat.h to get rid of feature test (fails on 1.8.7)
60
+
61
+ 8/9/09
62
+ version 0.2.2
63
+ * fixed color_control bug, action_struct->color was being overwritten (now using a temp).
64
+ * fixed faulty error msg where max tex size was being displayed as 1024 but is actually 1022
65
+ * added :start_angle parameter to ngon action
66
+ * fixed example screen height from 769 to 768
67
+ * arity of -1 and 0 now supported for color_control procs
68
+ * fixed parameter checks for circle and ngon
69
+ * updated documentation to reflect changes, and added details on caching
70
+
71
+ 2/9/09
72
+ version 0.2.1
73
+ * releasing a gem for TexPlay
74
+ * bumped version number so can add add gosu 0.7.14 dependency to github gem
75
+ * hopefully gem works on both github and rubyforge
76
+ 31/8/09
77
+ version 0.2.0
78
+ * added each iterator
79
+ * added alternative to proc for :color_control proc (allowing static linear transforms to pixels)
80
+ * no longer segfaulting on windows (no idea why not)
81
+ * rewrote EmptyImageStub in ruby, using philomory's code. now alot faster.
82
+ * implemented 'shadow' in terms of static :color_control pixel transform
83
+ * added more example code demonstrating each iterator (example_each.rb) and new color_control behaviour
84
+ i.e example_color_transform.rb
85
+ * should be relatively stable now!
86
+
87
+ 28/8/09
88
+ version 0.1.9.1 (still BETA)
89
+ * experimental features: Gosu::Image#dup and Gosu::Image#clone
90
+ * also TexPlay::create_blank_image(window, width, height)
91
+ * I noticed these features SEG FAULT on my setup in windows, so be warned
92
+ * This is a BETA release
93
+
94
+ 14/8/09
95
+ version 0.1.9.0 (BETA)
96
+ * major rewrite. TP now supports beziers, polylines, polygons, and more
97
+ * also supports alpha_blending (though still tempermental)
98
+ * This is a BETA release
99
+
100
+ 1/7/09
101
+ version 0.1.6.2
102
+ * fixed another subtle bug in constrain_local_boundaries(). Function was
103
+ unable to deal with drawing actions that were 100% outside the image
104
+ boundaries.
105
+
106
+ 28/6/09
107
+ version 0.1.6
108
+ * gen_eval now working as a replacement for instance_eval in the #paint block. Allows for more user-friendly interface.
109
+ * #paint can now be called without a block; if invoked this way it executes any commands in the action queue, e.g
110
+ @img.circle 20, 20, 40
111
+ @img.pixel 30, 30
112
+ @img.paint
113
+ * above will function as if: @img.paint { circle 20, 20, 40; pixel 30, 30 }
114
+ * collected 1.8.6/1.9.1 compatibility into compat.h
115
+
116
+ 16/6/09
117
+ version 0.1.4.6
118
+ * allowed arity of 0 (as well as -1) for ruby 1.9 compatibility
119
+
120
+ 13/6/09
121
+ version 0.1.4.5
122
+ * major bugfix with TexPlay#splice method (segfaut). Also added new color format parameter: color [1, 1, 0, 1] (e.g purple with full alpha).
123
+ Also fixed subtle edge-case bug in constrain_local_boundaries().
124
+
125
+ 9/6/09
126
+ version 0.1.4
127
+ * improved error checking. should work better with later gosu releases
128
+
129
+ 20/2/09
130
+ version 0.1.1
131
+ * rerelease of this version fixing the oversized image bug for refresh_cache (i.e images over 500 x 500
132
+
133
+ version 0.1.1
134
+ * oops, bug in leftshift/rightshift functions, fixed!
135
+
136
+ version 0.1.0
137
+ * release!
138
+
data/README.markdown CHANGED
@@ -1,41 +1,43 @@
1
- ![Alt text](https://dl.getdropbox.com/u/239375/texplay.png)
2
-
3
- *an image manipulation tool for ruby and gosu*
4
-
5
- INSTRUCTIONS
6
- ============
7
-
8
- **TexPlay version 0.2.710**
9
-
10
- Gem installation:
11
-
12
- + sudo gem install texplay
13
-
14
- How to build the gems? (maintainers only)
15
-
16
- + Install rake-compiler (http://github.com/luislavena/rake-compiler)
17
- + Install 1.9.1 and 1.8.6 mingw ruby versions (instructions above)
18
- + Type: rake cross native gem RUBY_CC_VERSION=1.8.6:1.9.1
19
- + Upload new gems to rubyforge and gemcutter.
20
-
21
- How to build from source?
22
- + rake compile
23
-
24
- OR
25
-
26
- + rake19 compile (assuming this is the name of your 1.9.1 version of rake)
27
-
28
- **NB:** be sure to run the version of rake that corresponds to the ruby version you wish to use! on my system I use rake19 for ruby 1.9.1!
29
-
30
- If all goes well, run the example programs:
31
-
32
- + cd examples
33
- + ruby example_melt.rb
34
- + ruby example_simple.rb
35
- + ..etc
36
-
37
- + like any gosu application, gosu.so must be in the current directory (or the gosu gem installed) when running the examples.
38
-
39
-
40
- ---
41
- Enjoy!
1
+ ![Alt text](https://dl.getdropbox.com/u/239375/texplay.png)
2
+
3
+ *an image manipulation tool for ruby and gosu*
4
+
5
+ INSTRUCTIONS
6
+ ============
7
+
8
+ **TexPlay version 0.2.900**
9
+
10
+ [Read The Documentation](http://banisterfiend.wordpress.com/2008/08/23/texplay-an-image-manipulation-tool-for-ruby-and-gosu/)
11
+
12
+ Gem installation:
13
+
14
+ + sudo gem install texplay
15
+
16
+ How to build the gems? (maintainers only)
17
+
18
+ + Install rake-compiler (http://github.com/luislavena/rake-compiler)
19
+ + Install 1.9.1 and 1.8.6 mingw ruby versions (instructions above)
20
+ + Type: rake cross native gem RUBY_CC_VERSION=1.8.6:1.9.1
21
+ + Upload new gems to rubyforge and gemcutter.
22
+
23
+ How to build from source?
24
+ + rake compile
25
+
26
+ OR
27
+
28
+ + rake19 compile (assuming this is the name of your 1.9.1 version of rake)
29
+
30
+ **NB:** be sure to run the version of rake that corresponds to the ruby version you wish to use! on my system I use rake19 for ruby 1.9.1!
31
+
32
+ If all goes well, run the example programs:
33
+
34
+ + cd examples
35
+ + ruby example_melt.rb
36
+ + ruby example_simple.rb
37
+ + ..etc
38
+
39
+ + like any gosu application, gosu.so must be in the current directory (or the gosu gem installed) when running the examples.
40
+
41
+
42
+ ---
43
+ Enjoy!
data/Rakefile CHANGED
@@ -1,68 +1,68 @@
1
-
2
- require 'rake/clean'
3
- require 'rake/gempackagetask'
4
- require 'rake/extensiontask'
5
-
6
- # get the texplay version
7
- require 'lib/texplay/version'
8
-
9
- $dlext = Config::CONFIG['DLEXT']
10
-
11
- CLEAN.include("ext/**/*.#{$dlext}", "ext/**/*.log", "ext/**/*.o", "ext/**/*~", "ext/**/*#*", "ext/**/*.obj", "ext/**/*.def", "ext/**/*.pdb")
12
- CLOBBER.include("**/*.#{$dlext}", "**/*~", "**/*#*", "**/*.log", "**/*.o")
13
-
14
- specification = Gem::Specification.new do |s|
15
- s.name = "texplay"
16
- s.summary = "TexPlay is a light-weight image manipulation framework for Ruby and Gosu"
17
- s.version = TexPlay::VERSION
18
- s.date = Time.now.strftime '%Y-%m-%d'
19
- s.author = "John Mair (banisterfiend)"
20
- s.email = 'jrmair@gmail.com'
21
- s.description = s.summary
22
- s.require_path = 'lib'
23
- s.add_dependency("gosu",">=0.7.14")
24
- s.platform = Gem::Platform::RUBY
25
- s.homepage = "http://banisterfiend.wordpress.com/2008/08/23/texplay-an-image-manipulation-tool-for-ruby-and-gosu/"
26
- s.has_rdoc = false
27
-
28
- s.extensions = ["ext/texplay/extconf.rb"]
29
- s.files = ["Rakefile", "README.markdown", "CHANGELOG",
30
- "lib/texplay.rb", "lib/texplay-contrib.rb", "lib/texplay/version.rb"] +
31
- FileList["ext/**/extconf.rb", "ext/**/*.h", "ext/**/*.c", "examples/*.rb", "examples/media/*"].to_a
32
- end
33
-
34
- Rake::ExtensionTask.new('texplay', specification) do |ext|
35
- # ext.config_script = 'extconf.rb'
36
- # ext.cross_compile = true
37
- #ext.cross_platform = 'i386-mswin32'
38
- # ext.platform = 'i386-mswin32'
39
- end
40
-
41
-
42
- #comment this when want to build normal gems.
43
- #only have this code uncommented when building mswin32 and mingw32
44
- #binary gems
45
- # specification = Gem::Specification.new do |s|
46
- # s.name = "texplay"
47
- # s.summary = "TexPlay is a light-weight image manipulation framework for Ruby and Gosu"
48
- # s.version = TexPlay::VERSION
49
- # s.date = Time.now.strftime '%Y-%m-%d'
50
- # s.author = "John Mair (banisterfiend)"
51
- # s.email = 'jrmair@gmail.com'
52
- # s.description = s.summary
53
- # s.require_path = 'lib'
54
- # s.add_dependency("gosu",">=0.7.14")
55
- # s.platform = 'i386-mswin32'
56
- # s.homepage = "http://banisterfiend.wordpress.com/2008/08/23/texplay-an-image-manipulation-tool-for-ruby-and-gosu/"
57
- # s.has_rdoc = false
58
-
59
- # s.files = ["Rakefile", "README.markdown", "CHANGELOG",
60
- # "lib/texplay.rb", "lib/texplay-contrib.rb", "lib/texplay/version.rb", "lib/1.8/texplay.so",
61
- # "lib/1.9/texplay.so"] +
62
- # FileList["examples/*.rb", "examples/media/*"].to_a
63
- # end
64
-
65
- Rake::GemPackageTask.new(specification) do |package|
66
- package.need_zip = false
67
- package.need_tar = false
68
- end
1
+
2
+ require 'rake/clean'
3
+ require 'rake/gempackagetask'
4
+ require 'rake/extensiontask'
5
+
6
+ # get the texplay version
7
+ require 'lib/texplay/version'
8
+
9
+ $dlext = Config::CONFIG['DLEXT']
10
+
11
+ CLEAN.include("ext/**/*.#{$dlext}", "ext/**/*.log", "ext/**/*.o", "ext/**/*~", "ext/**/*#*", "ext/**/*.obj", "ext/**/*.def", "ext/**/*.pdb")
12
+ CLOBBER.include("**/*.#{$dlext}", "**/*~", "**/*#*", "**/*.log", "**/*.o")
13
+
14
+ specification = Gem::Specification.new do |s|
15
+ s.name = "texplay"
16
+ s.summary = "TexPlay is a light-weight image manipulation framework for Ruby and Gosu"
17
+ s.version = TexPlay::VERSION
18
+ s.date = Time.now.strftime '%Y-%m-%d'
19
+ s.author = "John Mair (banisterfiend)"
20
+ s.email = 'jrmair@gmail.com'
21
+ s.description = s.summary
22
+ s.require_path = 'lib'
23
+ s.add_dependency("gosu",">=0.7.20")
24
+ s.platform = Gem::Platform::RUBY
25
+ s.homepage = "http://banisterfiend.wordpress.com/2008/08/23/texplay-an-image-manipulation-tool-for-ruby-and-gosu/"
26
+ s.has_rdoc = false
27
+
28
+ s.extensions = ["ext/texplay/extconf.rb"]
29
+ s.files = ["Rakefile", "README.markdown", "CHANGELOG",
30
+ "lib/texplay.rb", "lib/texplay-contrib.rb", "lib/texplay/version.rb"] +
31
+ FileList["ext/**/extconf.rb", "ext/**/*.h", "ext/**/*.c", "examples/*.rb", "examples/media/*"].to_a
32
+ end
33
+
34
+ Rake::ExtensionTask.new('texplay', specification) do |ext|
35
+ # ext.config_script = 'extconf.rb'
36
+ # ext.cross_compile = true
37
+ #ext.cross_platform = 'i386-mswin32'
38
+ # ext.platform = 'i386-mswin32'
39
+ end
40
+
41
+
42
+ #comment this when want to build normal gems.
43
+ #only have this code uncommented when building mswin32 and mingw32
44
+ #binary gems
45
+ # specification = Gem::Specification.new do |s|
46
+ # s.name = "texplay"
47
+ # s.summary = "TexPlay is a light-weight image manipulation framework for Ruby and Gosu"
48
+ # s.version = TexPlay::VERSION
49
+ # s.date = Time.now.strftime '%Y-%m-%d'
50
+ # s.author = "John Mair (banisterfiend)"
51
+ # s.email = 'jrmair@gmail.com'
52
+ # s.description = s.summary
53
+ # s.require_path = 'lib'
54
+ # s.add_dependency("gosu",">=0.7.20")
55
+ # s.platform = 'i386-mswin32'
56
+ # s.homepage = "http://banisterfiend.wordpress.com/2008/08/23/texplay-an-image-manipulation-tool-for-ruby-and-gosu/"
57
+ # s.has_rdoc = false
58
+
59
+ # s.files = ["Rakefile", "README.markdown", "CHANGELOG",
60
+ # "lib/texplay.rb", "lib/texplay-contrib.rb", "lib/texplay/version.rb", "lib/1.8/texplay.so",
61
+ # "lib/1.9/texplay.so"] +
62
+ # FileList["examples/*.rb", "examples/media/*"].to_a
63
+ # end
64
+
65
+ Rake::GemPackageTask.new(specification) do |package|
66
+ package.need_zip = false
67
+ package.need_tar = false
68
+ end