Lines 1-79
Link Here
|
1 |
--- IMG_xcf.c.orig Mon Apr 29 03:01:48 2002 |
|
|
2 |
+++ IMG_xcf.c Mon Apr 29 03:17:07 2002 |
3 |
@@ -166,6 +166,7 @@ |
4 |
|
5 |
Uint32 offset_x; |
6 |
Uint32 offset_y; |
7 |
+ int visible : 1; |
8 |
} xcf_layer; |
9 |
|
10 |
typedef struct { |
11 |
@@ -179,6 +180,7 @@ |
12 |
Uint32 color; |
13 |
Uint32 opacity; |
14 |
int selection : 1; |
15 |
+ int visible : 1; |
16 |
} xcf_channel; |
17 |
|
18 |
typedef struct { |
19 |
@@ -245,7 +247,9 @@ |
20 |
prop->id = SDL_ReadBE32 (src); |
21 |
prop->length = SDL_ReadBE32 (src); |
22 |
|
23 |
+#if 0 |
24 |
printf ("%.8X: %s: %d\n", SDL_RWtell (src), prop->id < 25 ? prop_names [prop->id] : "unknown", prop->length); |
25 |
+#endif |
26 |
|
27 |
switch (prop->id) { |
28 |
case PROP_COLORMAP: |
29 |
@@ -265,6 +269,9 @@ |
30 |
case PROP_COLOR: |
31 |
SDL_RWread (src, &prop->data, prop->length, 1); |
32 |
break; |
33 |
+ case PROP_VISIBLE: |
34 |
+ prop->data.visible = SDL_ReadBE32 (src); |
35 |
+ break; |
36 |
default: |
37 |
// SDL_RWread (src, &prop->data, prop->length, 1); |
38 |
SDL_RWseek (src, prop->length, SEEK_CUR); |
39 |
@@ -332,6 +339,8 @@ |
40 |
if (prop.id == PROP_OFFSETS) { |
41 |
l->offset_x = prop.data.offset.x; |
42 |
l->offset_y = prop.data.offset.y; |
43 |
+ } else if (prop.id == PROP_VISIBLE) { |
44 |
+ l->visible = prop.data.visible ? 1 : 0; |
45 |
} |
46 |
} while (prop.id != PROP_END); |
47 |
|
48 |
@@ -371,6 +380,9 @@ |
49 |
case PROP_SELECTION: |
50 |
l->selection = 1; |
51 |
break; |
52 |
+ case PROP_VISIBLE: |
53 |
+ l->visible = prop.data.visible ? 1 : 0; |
54 |
+ break; |
55 |
default: |
56 |
} |
57 |
} while (prop.id != PROP_END); |
58 |
@@ -724,9 +736,10 @@ |
59 |
rd.y = layer->offset_y; |
60 |
rd.w = layer->width; |
61 |
rd.h = layer->height; |
62 |
- free_xcf_layer (layer); |
63 |
|
64 |
- SDL_BlitSurface (lays, &rs, surface, &rd); |
65 |
+ if (layer->visible) |
66 |
+ SDL_BlitSurface (lays, &rs, surface, &rd); |
67 |
+ free_xcf_layer (layer); |
68 |
} |
69 |
|
70 |
SDL_FreeSurface (lays); |
71 |
@@ -756,7 +769,7 @@ |
72 |
} |
73 |
for (i = 0; i < chnls; i++) { |
74 |
// printf ("CNLBLT %i\n", i); |
75 |
- if (!channel [i]->selection) { |
76 |
+ if (!channel [i]->selection && channel [i]->visible) { |
77 |
create_channel_surface (chs, head->image_type, channel [i]->color, channel [i]->opacity); |
78 |
SDL_BlitSurface (chs, NULL, surface, NULL); |
79 |
} |