rays 0.1.44 → 0.1.45

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/ChangeLog.md +5 -0
  3. data/VERSION +1 -1
  4. data/src/image.cpp +14 -7
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16018c5d00fa4ccd0eb58ca5b3c090130d9c9c8cb1ae1a372b1ca60a1fed3360
4
- data.tar.gz: 678d61c173b4547f6b1486501977d8e0099fde953ce1030c0bb3db9cb3062987
3
+ metadata.gz: de6e5c2c628009735eed4907bd62ec314d315daab2b001e3c37a365f71b6f19b
4
+ data.tar.gz: c18e37667880bd753332a216f56a59c473ce4fbb2e7b65eb98894d6718d4e506
5
5
  SHA512:
6
- metadata.gz: d06d5ea0f2955016ef35d655c242879dfc7615fe0ce814871a465ebfc2ed3b0bb9be96d19bb3216d45e1218f6b7c5e3a416baaa0c6c1a1f2dd970eb9c8ed011f
7
- data.tar.gz: b4674be3a688208f87b11a27fd129a2e3697a81d5ff7c13b4010abda3ca5e866604a15d97155bc28db291cd0f52991eff3658f24cde79b39a00ce5b727332e0e
6
+ metadata.gz: 6e11a2e80087715bf194d3857950386d7cbad58c9273d2d7f85d2701d58e0978c6bc966145c60582f896ffdc2066ead9b58649d41fc41910101028cc02cbd75a
7
+ data.tar.gz: a0db99c72e1dd15a7731ff18a20a452929bf8fa2701a95cd31fd093bfbcdf09451de0cadf9e5d2e327066fd595124966218352fc25d14ccbae9cd6dca47e1728
data/ChangeLog.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # rays ChangeLog
2
2
 
3
3
 
4
+ ## [v0.1.45] - 2023-10-29
5
+
6
+ - Fixed Image class to clear the update flag only when one of the bitmap and texture is being updated
7
+
8
+
4
9
  ## [v0.1.44] - 2023-10-25
5
10
 
6
11
  - Add '#include <assert.h>' to Fix compile errors
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.44
1
+ 0.1.45
data/src/image.cpp CHANGED
@@ -30,6 +30,15 @@ namespace Rays
30
30
  };// Image::Data
31
31
 
32
32
 
33
+ static void
34
+ clear_modified_flags (Image* image)
35
+ {
36
+ Image::Data* self = image->self.get();
37
+
38
+ if (self->bitmap) Bitmap_set_modified(&self->bitmap, false);
39
+ if (self->texture) self->texture.set_modified(false);
40
+ }
41
+
33
42
  static void
34
43
  invalidate_texture (Image* image)
35
44
  {
@@ -64,7 +73,7 @@ namespace Rays
64
73
 
65
74
  Image::Data* self = image->self.get();
66
75
 
67
- if (!image)
76
+ if (!*image)
68
77
  {
69
78
  assert(!self->bitmap);
70
79
  return self->bitmap;
@@ -76,6 +85,7 @@ namespace Rays
76
85
  self->bitmap = Bitmap_from(self->texture);
77
86
  else
78
87
  self->bitmap = Bitmap(self->width, self->height, self->color_space);
88
+ clear_modified_flags(image);
79
89
  }
80
90
  else if (
81
91
  self->texture &&
@@ -83,11 +93,9 @@ namespace Rays
83
93
  !Bitmap_get_modified(self->bitmap))
84
94
  {
85
95
  self->bitmap = Bitmap_from(self->texture);
96
+ clear_modified_flags(image);
86
97
  }
87
98
 
88
- if (self->bitmap) Bitmap_set_modified(&self->bitmap, false);
89
- if (self->texture) self->texture.set_modified(false);
90
-
91
99
  return self->bitmap;
92
100
  }
93
101
 
@@ -117,6 +125,7 @@ namespace Rays
117
125
  p.clear();
118
126
  p.end();
119
127
  }
128
+ clear_modified_flags(&image);
120
129
  }
121
130
  else if (
122
131
  self->bitmap &&
@@ -124,11 +133,9 @@ namespace Rays
124
133
  !self->texture.modified())
125
134
  {
126
135
  self->texture = Texture(self->bitmap);
136
+ clear_modified_flags(&image);
127
137
  }
128
138
 
129
- if (self->bitmap) Bitmap_set_modified(&self->bitmap, false);
130
- if (self->texture) self->texture.set_modified(false);
131
-
132
139
  return self->texture;
133
140
  }
134
141
 
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.44
4
+ version: 0.1.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-24 00:00:00.000000000 Z
11
+ date: 2023-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xot