[Scummvm-cvs-logs] SF.net SVN: scummvm:[39819] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Apr 4 00:03:07 CEST 2009


Revision: 39819
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39819&view=rev
Author:   thebluegr
Date:     2009-04-03 22:03:06 +0000 (Fri, 03 Apr 2009)

Log Message:
-----------
Removed the non-working Chrono port code, after discussing with Lars

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/gfx/gfx_state_internal.h
    scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-04-03 21:32:50 UTC (rev 39818)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-04-03 22:03:06 UTC (rev 39819)
@@ -1026,7 +1026,6 @@
 		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 @@
 
 		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 @@
 	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);

Modified: scummvm/trunk/engines/sci/gfx/gfx_state_internal.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_state_internal.h	2009-04-03 21:32:50 UTC (rev 39818)
+++ scummvm/trunk/engines/sci/gfx/gfx_state_internal.h	2009-04-03 22:03:06 UTC (rev 39819)
@@ -202,7 +202,6 @@
 	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,

Modified: scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp	2009-04-03 21:32:50 UTC (rev 39818)
+++ scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp	2009-04-03 22:03:06 UTC (rev 39819)
@@ -1811,7 +1811,6 @@
 	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 @@
 	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


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list