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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Sep 2 15:21:39 CEST 2009


Revision: 43909
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43909&view=rev
Author:   thebluegr
Date:     2009-09-02 13:21:38 +0000 (Wed, 02 Sep 2009)

Log Message:
-----------
Removed the dirty rectangle option of updating one huge rectangle, and only left the algorithm of updating the screen with multiple small rectangles, like we do in all the other engines that support dirty rectangle screen updates

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gfx/gfx_options.h
    scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp
    scummvm/trunk/engines/sci/gfx/gfx_widgets.h
    scummvm/trunk/engines/sci/gfx/operations.cpp
    scummvm/trunk/engines/sci/gfx/operations.h
    scummvm/trunk/engines/sci/sci.cpp

Modified: scummvm/trunk/engines/sci/gfx/gfx_options.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_options.h	2009-09-02 12:02:37 UTC (rev 43908)
+++ scummvm/trunk/engines/sci/gfx/gfx_options.h	2009-09-02 13:21:38 UTC (rev 43909)
@@ -39,12 +39,6 @@
 
 namespace Sci {
 
-/** Dirty rectangle heuristics. */
-enum {
-	GFXOP_DIRTY_FRAMES_ONE = 1, /**< One: Redraw one rectangle surrounding the dirty area (insert is O(1)) */
-	GFXOP_DIRTY_FRAMES_CLUSTERS = 2 /**< Clusters: Accumulate dirty rects, merging those that overlap (insert is O(n))  */
-};
-
 /**
  * All user options to the rendering pipeline
  *
@@ -72,8 +66,6 @@
 	gfx_xlate_filter_t text_xlate_filter;
 	gfx_res_fullconf_t res_conf; /* Resource customisation: Per-resource palettes etc. */
 
-	int dirty_frames;	// Dirty frames management
-
 	int workarounds;	// Workaround flags - see below
 #endif
 };

Modified: scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp	2009-09-02 12:02:37 UTC (rev 43908)
+++ scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp	2009-09-02 13:21:38 UTC (rev 43909)
@@ -1195,7 +1195,7 @@
 #endif
 
 	DDIRTY(stderr, "Effectively adding dirty %d,%d,%d,%d %d to ID %d\n", GFX_PRINT_RECT(dirty), propagate, container->_ID);
-	gfxdr_add_dirty(container->_dirtyRects, dirty, GFXW_DIRTY_STRATEGY);
+	gfxdr_add_dirty(container->_dirtyRects, dirty);
 	return 0;
 }
 
@@ -1463,7 +1463,7 @@
 
 		DDIRTY(stderr, "Adding multiple dirty to #%d\n", _decorations->_ID);
 		for (DirtyRectList::iterator dirty = _dirtyRects.begin(); dirty != _dirtyRects.end(); ++dirty) {
-			gfxdr_add_dirty(_decorations->_dirtyRects, *dirty, GFXW_DIRTY_STRATEGY);
+			gfxdr_add_dirty(_decorations->_dirtyRects, *dirty);
 		}
 
 		if (_decorations->draw(gfxw_point_zero)) {

Modified: scummvm/trunk/engines/sci/gfx/gfx_widgets.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_widgets.h	2009-09-02 12:02:37 UTC (rev 43908)
+++ scummvm/trunk/engines/sci/gfx/gfx_widgets.h	2009-09-02 13:21:38 UTC (rev 43909)
@@ -55,9 +55,6 @@
 ** of members (/SLOW/) */
 //#define GFXW_DEBUG_WIDGETS 2048
 
-/* Our strategy for dirty rectangle management */
-#define GFXW_DIRTY_STRATEGY GFXOP_DIRTY_FRAMES_CLUSTERS
-
 /* Terminology
 **
 ** Two special terms are used in here: /equivalent/ and /clear/. Their meanings
@@ -123,8 +120,6 @@
 ** Returns   : (int) 0
 ** Transparent containers will usually pass this value to their next ancestor,
 ** because areas below them might have to be redrawn.
-** The dirty rectangle management strategy is defined in this file in
-** GFXW_DIRTY_STRATEGY.
 **
 **
 ** -- add_dirty_rel(GfxContainer *self, rect_t dirty, int propagate)
@@ -137,8 +132,6 @@
 ** Returns   : (int) 0
 ** Transparent containers will usually pass this value to their next ancestor,
 ** because areas below them might have to be redrawn.
-** The dirty rectangle management strategy is defined in this file in
-** GFXW_DIRTY_STRATEGY.
 **
 **
 ** -- add(GfxContainer *self, GfxWidget *widget)

Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp	2009-09-02 12:02:37 UTC (rev 43908)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp	2009-09-02 13:21:38 UTC (rev 43909)
@@ -308,7 +308,7 @@
 	_gfxop_buffer_propagate_box(state, box, GFX_BUFFER_FRONT);
 }
 
-void gfxdr_add_dirty(DirtyRectList &list, rect_t box, int strategy) {
+void gfxdr_add_dirty(DirtyRectList &list, rect_t box) {
 	if (box.width < 0) {
 		box.x += box.width;
 		box.width = - box.width;
@@ -325,50 +325,25 @@
 	if (_gfxop_clip(&box, gfx_rect(0, 0, 320, 200)))
 		return;
 
-	switch (strategy) {
+	DirtyRectList::iterator dirty = list.begin();
+	while (dirty != list.end()) {
+		if (gfx_rects_overlap(*dirty, box)) {
+			Common::Rect tmp = toCommonRect(box);
+			tmp.extend(toCommonRect(*dirty));
+			box = toSCIRect(tmp);
 
-	case GFXOP_DIRTY_FRAMES_ONE:
-		if (!list.empty()) {
-			Common::Rect tmp = toCommonRect(list.front());
-			tmp.extend(toCommonRect(box));
-			list.front() = toSCIRect(tmp);
-		} else {
-			list.push_back(box);
-		}
-		break;
-
-	case GFXOP_DIRTY_FRAMES_CLUSTERS: {
-		DirtyRectList::iterator dirty = list.begin();
-		while (dirty != list.end()) {
-			if (gfx_rects_overlap(*dirty, box)) {
-				Common::Rect tmp = toCommonRect(box);
-				tmp.extend(toCommonRect(*dirty));
-				box = toSCIRect(tmp);
-
-				dirty = list.erase(dirty);
-			} else
-				++dirty;
-		}
-		list.push_back(box);
-
-		}
-		break;
-
-	default:
-		error("Attempt to use invalid dirty frame mode %d!\nPlease refer to gfx_options.h", strategy);
-
+			dirty = list.erase(dirty);
+		} else
+			++dirty;
 	}
+	list.push_back(box);
 }
 
 static void _gfxop_add_dirty(GfxState *state, rect_t box) {
 	if (state->disable_dirty)
 		return;
 
-#ifdef CUSTOM_GRAPHICS_OPTIONS
-	gfxdr_add_dirty(state->_dirtyRects, box, state->options->dirty_frames);
-#else
-	gfxdr_add_dirty(state->_dirtyRects, box, GFXOP_DIRTY_FRAMES_CLUSTERS);
-#endif
+	gfxdr_add_dirty(state->_dirtyRects, box);
 }
 
 static void _gfxop_add_dirty_x(GfxState *state, rect_t box) {

Modified: scummvm/trunk/engines/sci/gfx/operations.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.h	2009-09-02 12:02:37 UTC (rev 43908)
+++ scummvm/trunk/engines/sci/gfx/operations.h	2009-09-02 13:21:38 UTC (rev 43909)
@@ -698,9 +698,8 @@
  *
  * @param[in] list		the list to add to
  * @param[in] box		the dirty frame to addable
- * @param[in] strategy	the dirty frame heuristic to use (see gfx_options.h)
  */
-void gfxdr_add_dirty(DirtyRectList &list, rect_t box, int strategy);
+void gfxdr_add_dirty(DirtyRectList &list, rect_t box);
 
 /**
  * Clips a rectangle against another one.

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2009-09-02 12:02:37 UTC (rev 43908)
+++ scummvm/trunk/engines/sci/sci.cpp	2009-09-02 13:21:38 UTC (rev 43909)
@@ -181,7 +181,6 @@
 	gfx_options.view_xlate_filter = (gfx_xlate_filter_t)ConfMan.getInt("view_filter");
 	gfx_options.pic_xlate_filter = (gfx_xlate_filter_t)ConfMan.getInt("pic_filter");
 	gfx_options.text_xlate_filter = (gfx_xlate_filter_t)ConfMan.getInt("text_filter");
-	gfx_options.dirty_frames = GFXOP_DIRTY_FRAMES_CLUSTERS;
 	for (int i = 0; i < GFX_RESOURCE_TYPES_NR; i++) {
 		gfx_options.res_conf.assign[i] = NULL;
 		gfx_options.res_conf.mod[i] = NULL;


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