aboutsummaryrefslogtreecommitdiff
path: root/generic/Group.c
diff options
context:
space:
mode:
authorlemort2007-11-19 16:19:01 +0000
committerlemort2007-11-19 16:19:01 +0000
commit1e335fc694e93bdc6e6560b20ccd35d712f51b74 (patch)
tree5cbb185dba81fc0725f3e15996ab5b43e3a77907 /generic/Group.c
parent8f95e88041057a292ae2f15737815a668aa6236e (diff)
downloadtkzinc-1e335fc694e93bdc6e6560b20ccd35d712f51b74.zip
tkzinc-1e335fc694e93bdc6e6560b20ccd35d712f51b74.tar.gz
tkzinc-1e335fc694e93bdc6e6560b20ccd35d712f51b74.tar.bz2
tkzinc-1e335fc694e93bdc6e6560b20ccd35d712f51b74.tar.xz
Replace #ifdef GL_DAMAGE statement with a new option (-usedamage) of the TkZinc widget
Diffstat (limited to 'generic/Group.c')
-rw-r--r--generic/Group.c62
1 files changed, 41 insertions, 21 deletions
diff --git a/generic/Group.c b/generic/Group.c
index 6031811..8a1f668 100644
--- a/generic/Group.c
+++ b/generic/Group.c
@@ -1057,10 +1057,10 @@ Render(ZnItem item)
GroupItem group = (GroupItem) item;
ZnItem current_item;
ZnWInfo *wi = item->wi;
-#ifdef GL_DAMAGE
+//#ifdef GL_DAMAGE
ZnBBox *clip_box;
ZnBBox bbox, old_damaged_area;
-#endif
+//#endif
unsigned char save_alpha = wi->alpha;
unsigned char save_alpha2;
@@ -1074,23 +1074,43 @@ Render(ZnItem item)
PushTransform(item);
PushClip(group, True);
-#ifdef GL_DAMAGE
- if (ISCLEAR(wi->flags, ZN_CONFIGURE_EVENT) && (group->clip != ZN_NO_ITEM)) {
- old_damaged_area = wi->damaged_area;
- if (ZnCurrentClip(wi, NULL, &clip_box, NULL)) {
- ZnIntersectBBox(&wi->damaged_area, clip_box, &bbox);
- wi->damaged_area = bbox;
+
+ /* Test if we are using damage or not */
+ if (wi->usedamage) {
+ /* Damage is on */
+ if (ISCLEAR(wi->flags, ZN_CONFIGURE_EVENT) && (group->clip != ZN_NO_ITEM)) {
+ old_damaged_area = wi->damaged_area;
+ if (ZnCurrentClip(wi, NULL, &clip_box, NULL)) {
+ ZnIntersectBBox(&wi->damaged_area, clip_box, &bbox);
+ wi->damaged_area = bbox;
+ }
}
- }
-#endif
+ }
current_item = group->tail;
while (current_item != ZN_NO_ITEM) {
if (ISSET(current_item->flags, ZN_VISIBLE_BIT)) {
-#ifdef GL_DAMAGE
- ZnIntersectBBox(&wi->damaged_area, &current_item->item_bounding_box, &bbox);
- if (!ZnIsEmptyBBox(&bbox) || ISSET(wi->flags, ZN_CONFIGURE_EVENT)) {
-#endif
+ /* test if we are using dmaage or not */
+ if (wi->usedamage) {
+ /* Damage is on */
+ ZnIntersectBBox(&wi->damaged_area, &current_item->item_bounding_box, &bbox);
+ if (!ZnIsEmptyBBox(&bbox) || ISSET(wi->flags, ZN_CONFIGURE_EVENT)) {
+
+ if (current_item->class != ZnGroup) {
+ PushTransform(current_item);
+ if (ISCLEAR(current_item->flags, ZN_COMPOSE_ALPHA_BIT)) {
+ wi->alpha = 100;
+ }
+ }
+ current_item->class->Render(current_item);
+ if (current_item->class != ZnGroup) {
+ PopTransform(current_item);
+ wi->alpha = save_alpha2;
+ }
+ }
+
+ } else {
+ /* Damage is off */
if (current_item->class != ZnGroup) {
PushTransform(current_item);
if (ISCLEAR(current_item->flags, ZN_COMPOSE_ALPHA_BIT)) {
@@ -1102,18 +1122,18 @@ Render(ZnItem item)
PopTransform(current_item);
wi->alpha = save_alpha2;
}
-#ifdef GL_DAMAGE
}
-#endif
+
}
current_item = current_item->previous;
}
-#ifdef GL_DAMAGE
- if (ISCLEAR(wi->flags, ZN_CONFIGURE_EVENT) && (group->clip != ZN_NO_ITEM)) {
- wi->damaged_area = old_damaged_area;
- }
-#endif
+ /* Test if we are using damage or not */
+ if (wi->usedamage) {
+ if (ISCLEAR(wi->flags, ZN_CONFIGURE_EVENT) && (group->clip != ZN_NO_ITEM)) {
+ wi->damaged_area = old_damaged_area;
+ }
+ }
PopClip(group, True);
PopTransform(item);