rays 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/rays/color.rb +5 -1
  4. data/src/painter.cpp +17 -2
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e230aa24b23fc3613e532f8a99f86f8e2bb8c7a1
4
- data.tar.gz: 01c21244f0c0865cba464c9df735423c83b1bbf4
3
+ metadata.gz: f1bf7da19550049740231cdf6e1a34d0e1a6d909
4
+ data.tar.gz: 83d5339ab0a17d45f65370e201dd82e0c5d7b3fd
5
5
  SHA512:
6
- metadata.gz: ec8c73e68609daef267718abf45481454e675797c99e405748e032c1b330706125408fd3a00079de35db730259caccfe8ad79b2fa2adca7cd2f539a517e6ce87
7
- data.tar.gz: d7443ae673e5c62792dda760dc81e0f6bc9ddcc1110951b00acb15301e5ae1eb575442092752a0cb982c0d4d885b63c5fc0c86518e95b2750602388201df53bf
6
+ metadata.gz: 4bab971985a901c2f4d5eee67e89bc156abb90e193ce2a4ab7e3a4f790962f571ae0cbe6b164aac14fdbeae78e25341d5d057d4d1f4cf0864cc0151f2e2b307d
7
+ data.tar.gz: 09edff46e0bdf981b6782ebdb7e06250f884ae00e698f9ad5eb1be2aa77c1876f255b0a676e4ef567147d8a6faedbee60bf1f4edb8f249717b35ff4687f56cee
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.10
1
+ 0.1.11
@@ -46,6 +46,10 @@ module Rays
46
46
  [red, green, blue, alpha]
47
47
  end
48
48
 
49
+ def to_s ()
50
+ to_a.map {|o| o.to_s}
51
+ end
52
+
49
53
  def [] (index)
50
54
  case index
51
55
  when 0 then red
@@ -78,7 +82,7 @@ module Rays
78
82
  end
79
83
 
80
84
  def inspect ()
81
- "#<Rays::Color r=#{red}, g=#{green}, b=#{blue}, a=#{alpha}>"
85
+ "#<#{self.class.name} #{to_s}>"
82
86
  end
83
87
 
84
88
  COLORS = {
@@ -82,11 +82,13 @@ namespace Rays
82
82
 
83
83
  FrameBuffer frame_buffer;
84
84
 
85
+ float scale_factor;
86
+
85
87
  mutable Matrix matrix_tmp;
86
88
 
87
89
  Data ()
88
90
  : painting(false), prev_matrix_mode(0), current_texture(0),
89
- text_image(1, 1, GRAY, true)
91
+ text_image(1, 1, GRAY, true), scale_factor(1)
90
92
  {
91
93
  attrs.init();
92
94
  }
@@ -172,6 +174,16 @@ namespace Rays
172
174
  };// Painter::Data
173
175
 
174
176
 
177
+ void
178
+ set_painter_scale_factor (Painter* painter, float factor)
179
+ {
180
+ if (!painter)
181
+ argument_error(__FILE__, __LINE__, "invalid texture.");
182
+
183
+ painter->self->scale_factor = factor;
184
+ }
185
+
186
+
175
187
  Painter::Painter ()
176
188
  {
177
189
  }
@@ -252,7 +264,10 @@ namespace Rays
252
264
  push_shader();
253
265
 
254
266
  const Bounds& vp = self->viewport;
255
- glViewport((int) vp.x, (int) vp.y, (int) vp.width, (int) vp.height);
267
+ float scale = self->scale_factor;
268
+ glViewport(
269
+ (int) vp.x, (int) vp.y,
270
+ (int) vp.width * scale, (int) vp.height * scale);
256
271
 
257
272
  coord x1 = vp.x, x2 = vp.x + vp.width;
258
273
  coord y1 = vp.y, y2 = vp.y + vp.height;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rays
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - snori
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-28 00:00:00.000000000 Z
11
+ date: 2015-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake