aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2009-04-03 22:03:06 +0000
committerFilippos Karapetis2009-04-03 22:03:06 +0000
commitc3dc501f23f29ee937a0ee1343814728b9639ac7 (patch)
tree98b7ae16ca9b70813137175d9d1c90b9a479c472 /engines/sci
parent9638c7ec4bc90a8c8df9f6decde9914376f4186b (diff)
downloadscummvm-rg350-c3dc501f23f29ee937a0ee1343814728b9639ac7.tar.gz
scummvm-rg350-c3dc501f23f29ee937a0ee1343814728b9639ac7.tar.bz2
scummvm-rg350-c3dc501f23f29ee937a0ee1343814728b9639ac7.zip
Removed the non-working Chrono port code, after discussing with Lars
svn-id: r39819
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kgraphics.cpp4
-rw-r--r--engines/sci/gfx/gfx_state_internal.h1
-rw-r--r--engines/sci/gfx/gfx_widgets.cpp118
3 files changed, 0 insertions, 123 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 8d77e9306d..92ba8af7db 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -1026,7 +1026,6 @@ reg_t kDrawPic(EngineState *s, int funct_nr, int argc, reg_t *argv) {
GFX_ASSERT(gfxop_new_pic(s->gfx_state, pic_nr, 1, palette));
}
- gfxw_widget_kill_chrono(s->visual, 0);
s->wm_port->widfree(GFXW(s->wm_port));
s->picture_port->widfree(GFXW(s->picture_port));
s->iconbar_port->widfree(GFXW(s->iconbar_port));
@@ -2168,8 +2167,6 @@ static void _k_raise_topmost_in_view_list(EngineState *s, gfxw_list_t *list, gfx
gfxw_remove_widget_from_container(view->parent, GFXW(view));
- gfxw_widget_reparent_chrono(s->visual, GFXW(view), GFXWC(list));
-
if (view->signal & _K_VIEW_SIG_FLAG_HIDDEN)
gfxw_hide_widget(GFXW(view));
else
@@ -2441,7 +2438,6 @@ reg_t kDisposeWindow(EngineState *s, int funct_nr, int argc, reg_t *argv) {
gfxw_port_t *pred;
int id = s->visual->port_refs_nr;
- gfxw_widget_kill_chrono(s->visual, goner_nr);
goner = gfxw_find_port(s->visual, goner_nr);
if ((goner_nr < 3) || (goner == NULL)) {
SCIkwarn(SCIkERROR, "Removal of invalid window %04x requested\n", goner_nr);
diff --git a/engines/sci/gfx/gfx_state_internal.h b/engines/sci/gfx/gfx_state_internal.h
index 4770ce14a9..d3a71d4783 100644
--- a/engines/sci/gfx/gfx_state_internal.h
+++ b/engines/sci/gfx/gfx_state_internal.h
@@ -202,7 +202,6 @@ struct gfxw_port_t : public gfxw_container_t {
gfxw_list_t *decorations; /* optional window decorations- drawn before the contents */
gfxw_widget_t *port_bg; /* Port background widget or NULL */
gfx_color_t color, bgcolor;
- int chrono_port;
int font_nr;
Common::Point draw_pos; /* Drawing position */
gfxw_snapshot_t *restore_snap; /* Snapshot to be restored automagically,
diff --git a/engines/sci/gfx/gfx_widgets.cpp b/engines/sci/gfx/gfx_widgets.cpp
index 6d55a46b28..96dacd76cd 100644
--- a/engines/sci/gfx/gfx_widgets.cpp
+++ b/engines/sci/gfx/gfx_widgets.cpp
@@ -1811,7 +1811,6 @@ gfxw_port_t *gfxw_new_port(gfxw_visual_t *visual, gfxw_port_t *predecessor, rect
widget->bgcolor = bgcolor;
widget->font_nr = visual->font_nr;
widget->ID = _visual_find_free_ID(visual);
- widget->chrono_port = 0;
visual->port_refs[widget->ID] = widget;
_gfxw_set_ops_PORT(GFXWC(widget));
@@ -2024,121 +2023,4 @@ gfxw_dyn_view_t *gfxw_picviewize_dynview(gfxw_dyn_view_t *dynview) {
return dynview;
}
-// Chrono-Ports (tm)
-
-gfxw_port_t *gfxw_get_chrono_port(gfxw_visual_t *visual, gfxw_list_t **temp_widgets_list, int flags) {
- gfxw_port_t *result = NULL;
- gfx_color_t transparent = { PaletteEntry(), 0, -1, -1, 0};
- int id = 0;
-
- if (!(flags & GFXW_CHRONO_NON_TOPMOST)) {
- result = gfxw_find_default_port(visual);
- } else {
- id = visual->port_refs_nr;
- while (id >= 0 && (!visual->port_refs[id] || !visual->port_refs[id]->chrono_port))
- id--;
-
- if (id >= 0)
- result = visual->port_refs[id];
- }
-
- if (!result || !result->chrono_port) {
- if (flags & GFXW_CHRONO_NO_CREATE)
- return NULL;
- result = gfxw_new_port(visual, NULL, gfx_rect(0, 0, 320, 200), transparent, transparent);
- *temp_widgets_list = gfxw_new_list(gfx_rect(0, 0, 320, 200), 1);
- result->add(GFXWC(result), GFXW(*temp_widgets_list));
- result->chrono_port = 1;
- if (temp_widgets_list)
- *temp_widgets_list = GFXWC(result->contents);
- return result;
- };
-
- if (temp_widgets_list)
- *temp_widgets_list = GFXWC(result->contents);
-
- return result;
-}
-
-static int gfxw_check_chrono_overlaps(gfxw_port_t *chrono, gfxw_widget_t *widget) {
- gfxw_widget_t *seeker = GFXWC(chrono->contents)->contents;
-
- while (seeker) {
- if (toCommonRect(seeker->bounds).equals(toCommonRect(widget->bounds))) {
- gfxw_annihilate(GFXW(seeker));
- return 1;
- }
-
- seeker = seeker->next;
- }
-
- return 0;
-}
-
-void gfxw_add_to_chrono(gfxw_visual_t *visual, gfxw_widget_t *widget) {
- gfxw_list_t *tw;
- gfxw_port_t *chrono = gfxw_get_chrono_port(visual, &tw, 0);
-
- gfxw_check_chrono_overlaps(chrono, widget);
- chrono->add(GFXWC(chrono), widget);
-}
-
-static gfxw_widget_t *gfxw_widget_intersects_chrono(gfxw_list_t *tw, gfxw_widget_t *widget) {
- gfxw_widget_t *seeker;
-
- assert(tw->type == GFXW_SORTED_LIST);
-
- seeker = tw->contents;
- while (seeker) {
- Common::Point origin;
- rect_t bounds = widget->bounds;
-
- bounds = widget->bounds;
- origin.x = seeker->parent->zone.x;
- origin.y = seeker->parent->zone.y;
- bounds.x += origin.x;
- bounds.y += origin.y;
-
- if (gfx_rects_overlap(bounds, seeker->bounds))
- return seeker;
-
- seeker = seeker->next;
- }
-
- return 0;
-}
-
-void gfxw_widget_reparent_chrono(gfxw_visual_t *visual, gfxw_widget_t *view, gfxw_list_t *target) {
- gfxw_list_t *tw;
- gfxw_port_t *chrono;
- gfxw_widget_t *intersector;
-
- chrono = gfxw_get_chrono_port(visual, &tw, GFXW_CHRONO_NO_CREATE);
- if (chrono == NULL)
- return;
-
- intersector = gfxw_widget_intersects_chrono(tw, view);
- if (intersector) {
- Common::Point origin = Common::Point(intersector->parent->zone.x, intersector->parent->zone.y);
-
- gfxw_remove_widget_from_container(GFXWC(chrono), GFXW(tw));
- gfxw_remove_widget_from_container(GFXWC(chrono->parent), GFXW(chrono));
- gfxw_annihilate(GFXW(chrono));
-
- tw->zone.x += origin.x;
- tw->zone.y += origin.y;
-
- target->add(GFXWC(target), GFXW(tw));
- }
-}
-
-void gfxw_widget_kill_chrono(gfxw_visual_t *visual, int window) {
- int i;
-
- for (i = window; i < visual->port_refs_nr ; i++) {
- if (visual->port_refs[i] && visual->port_refs[i]->chrono_port)
- gfxw_annihilate(GFXW(visual->port_refs[i]));
- }
-}
-
} // End of namespace Sci