rays 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/rays/color.rb +5 -1
- data/src/painter.cpp +17 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1bf7da19550049740231cdf6e1a34d0e1a6d909
|
4
|
+
data.tar.gz: 83d5339ab0a17d45f65370e201dd82e0c5d7b3fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bab971985a901c2f4d5eee67e89bc156abb90e193ce2a4ab7e3a4f790962f571ae0cbe6b164aac14fdbeae78e25341d5d057d4d1f4cf0864cc0151f2e2b307d
|
7
|
+
data.tar.gz: 09edff46e0bdf981b6782ebdb7e06250f884ae00e698f9ad5eb1be2aa77c1876f255b0a676e4ef567147d8a6faedbee60bf1f4edb8f249717b35ff4687f56cee
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.11
|
data/lib/rays/color.rb
CHANGED
@@ -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
|
-
"
|
85
|
+
"#<#{self.class.name} #{to_s}>"
|
82
86
|
end
|
83
87
|
|
84
88
|
COLORS = {
|
data/src/painter.cpp
CHANGED
@@ -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
|
-
|
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.
|
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
|
11
|
+
date: 2015-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|