freesci-develop
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freesci-develop] r1589 - in freesci/branches/glutton/src: engine gfx in


From: freesci
Subject: [freesci-develop] r1589 - in freesci/branches/glutton/src: engine gfx include
Date: Sat, 02 Dec 2006 17:51:51 +0100

Author: skovmanden
Date: 2006-12-02 17:51:40 +0100 (Sat, 02 Dec 2006)
New Revision: 1589

Modified:
   freesci/branches/glutton/src/engine/kgraphics.c
   freesci/branches/glutton/src/engine/kpathing.c
   freesci/branches/glutton/src/gfx/widgets.c
   freesci/branches/glutton/src/include/gfx_state_internal.h
   freesci/branches/glutton/src/include/gfx_widgets.h
Log:
Implement a feature from the testing branch of Sierra SCI. This fixes
background restoration in PQ3 (ONLY). 

Lars



Modified: freesci/branches/glutton/src/engine/kgraphics.c
===================================================================
--- freesci/branches/glutton/src/engine/kgraphics.c     2006-11-25 15:01:50 UTC 
(rev 1588)
+++ freesci/branches/glutton/src/engine/kgraphics.c     2006-12-02 16:51:40 UTC 
(rev 1589)
@@ -2641,7 +2641,7 @@
        gfx_color_t black;
        gfx_color_t white;
        int priority;
-       int argextra = argc == 13 ? 4 : 0;
+       int argextra = argc == 13 ? 4 : 0; /* Triggers in PQ3 */
 
        y = SKPV(0);
        x = SKPV(1);
@@ -2679,9 +2679,16 @@
                                 fgcolor, bgcolor, s->titlebar_port->font_nr,
                                 white,
                                 black,
-                                argv[4+argextra].segment ? 
kernel_dereference_bulk_pointer(s, argv[4], 0) : NULL, 
+                                argv[4+argextra].segment ? 
kernel_dereference_bulk_pointer(s, argv[4+argextra], 0) : NULL, 
                                 flags);
 
+       /* PQ3 has the interpreter store underBits implicitly.
+          The feature was promptly removed after its release, never to be seen 
again. */
+       if (argextra)
+               gfxw_port_auto_restore_background(s->visual, window, 
+                                                 gfx_rect(SKPV(5), SKPV(4), 
+                                                          SKPV(7)-SKPV(5), 
SKPV(6)-SKPV(4)));
+
        ADD_TO_CURRENT_PORT(window);
        FULL_REDRAW();
 

Modified: freesci/branches/glutton/src/engine/kpathing.c
===================================================================
--- freesci/branches/glutton/src/engine/kpathing.c      2006-11-25 15:01:50 UTC 
(rev 1588)
+++ freesci/branches/glutton/src/engine/kpathing.c      2006-12-02 16:51:40 UTC 
(rev 1589)
@@ -1496,7 +1496,7 @@
        }
 
        oref = sm_alloc_dynmem(&s->seg_manager, POLY_POINT_SIZE * (path_len + 1 
+ p->keep_start + p->keep_end),
-                       "AvoidPath polyline", &output);
+                       AVOIDPATH_DYNMEM_STRING, &output);
 
        /* Sentinel */
        POLY_SET_POINT(oref, path_len + p->keep_start + p->keep_end, 
POLY_LAST_POINT, POLY_LAST_POINT);
@@ -1599,7 +1599,7 @@
                        print_input(s, poly_list, start, end, opt);
                        sciprintf("[avoidpath] Returning direct path from start 
point to end point\n");
                        oref = sm_alloc_dynmem(&s->seg_manager, 
POLY_POINT_SIZE*3,
-                                                    "AvoidPath polyline", 
&output);
+                                                    AVOIDPATH_DYNMEM_STRING, 
&output);
 
                        POLY_SET_POINT(oref, 0, start.x, start.y);
                        POLY_SET_POINT(oref, 1, end.x, end.y);

Modified: freesci/branches/glutton/src/gfx/widgets.c
===================================================================
--- freesci/branches/glutton/src/gfx/widgets.c  2006-11-25 15:01:50 UTC (rev 
1588)
+++ freesci/branches/glutton/src/gfx/widgets.c  2006-12-02 16:51:40 UTC (rev 
1589)
@@ -2221,6 +2221,11 @@
        return widget;
 }
 
+void gfxw_port_auto_restore_background(gfxw_visual_t *visual, gfxw_port_t 
*window, rect_t auto_rect)
+{
+       window->port_flags |= WINDOW_FLAG_AUTO_RESTORE;
+       window->restore_snap = gfxw_make_snapshot(visual, auto_rect);
+}
 
 gfxw_port_t *
 gfxw_remove_port(gfxw_visual_t *visual, gfxw_port_t *port)
@@ -2235,6 +2240,9 @@
        }
 
        parent = (gfxw_port_t *) port->parent;
+       if (port->port_flags & WINDOW_FLAG_AUTO_RESTORE)
+               gfxw_restore_snapshot(visual, port->restore_snap);
+
        if (port->widfree(GFXW(port)))
                return parent;
 

Modified: freesci/branches/glutton/src/include/gfx_state_internal.h
===================================================================
--- freesci/branches/glutton/src/include/gfx_state_internal.h   2006-11-25 
15:01:50 UTC (rev 1588)
+++ freesci/branches/glutton/src/include/gfx_state_internal.h   2006-12-02 
16:51:40 UTC (rev 1589)
@@ -223,6 +223,8 @@
        int chrono_port;
        int font_nr;
        point_t draw_pos; /* Drawing position */
+       gfxw_snapshot_t *restore_snap; /* Snapshot to be restored automagically,
+                                         experimental feature used in the PQ3 
interpreter */
        int port_flags; /* interpreter-dependant flags */
        char *title_text;
        byte gray_text; /* Whether text is 'grayed out' (dithered) */

Modified: freesci/branches/glutton/src/include/gfx_widgets.h
===================================================================
--- freesci/branches/glutton/src/include/gfx_widgets.h  2006-11-25 15:01:50 UTC 
(rev 1588)
+++ freesci/branches/glutton/src/include/gfx_widgets.h  2006-12-02 16:51:40 UTC 
(rev 1589)
@@ -38,6 +38,8 @@
 /* Our strategy for dirty rectangle management */
 #define GFXW_DIRTY_STRATEGY GFXOP_DIRTY_FRAMES_CLUSTERS
 
+/* Properly belongs in sci_widgets.h, but we need it here */
+#define WINDOW_FLAG_AUTO_RESTORE 0x2000000
 
 /* Indicates that a Chrono-Port should not be created even if it doesn't 
exist. */
 #define GFXW_CHRONO_NO_CREATE 1
@@ -449,6 +451,15 @@
 ** or highest-ranking port.
 */
 
+void
+gfxw_port_set_auto_restore(gfxw_visual_t *visual, gfxw_port_t *window, rect_t 
auto_rect);
+/* Sets rectangle to be restored upon port removal
+** Parameters: (state_t *) s: The state to operate on
+               (gfxw_port_t *) window: The affected window
+**             (rect_t) auto_rect: The area to restore
+** Returns   : (void)
+*/
+
 gfxw_port_t *
 gfxw_remove_port(gfxw_visual_t *visual, gfxw_port_t *port);
 /* Removes a port from a visual





reply via email to

[Prev in Thread] Current Thread [Next in Thread]