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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Feb 23 01:39:00 CET 2009


Revision: 38800
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38800&view=rev
Author:   thebluegr
Date:     2009-02-23 00:39:00 +0000 (Mon, 23 Feb 2009)

Log Message:
-----------
Removed unused antialiasing code (plus, we do antialiasing at the OSystem graphics backend)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gfx/gfx_options.h
    scummvm/trunk/engines/sci/gfx/gfx_tools.h
    scummvm/trunk/engines/sci/gfx/resmgr.cpp
    scummvm/trunk/engines/sci/module.mk
    scummvm/trunk/engines/sci/sci.cpp

Removed Paths:
-------------
    scummvm/trunk/engines/sci/gfx/antialias.cpp

Deleted: scummvm/trunk/engines/sci/gfx/antialias.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/antialias.cpp	2009-02-23 00:14:51 UTC (rev 38799)
+++ scummvm/trunk/engines/sci/gfx/antialias.cpp	2009-02-23 00:39:00 UTC (rev 38800)
@@ -1,163 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-/** Antialiasing code **/
-
-#include "sci/gfx/gfx_system.h"
-#include "sci/gfx/gfx_tools.h"
-
-namespace Sci {
-
-static void antialiase_simple(gfx_pixmap_t *pixmap, int mask[], int shift_const, gfx_mode_t *mode) {
-	int x, y, c;
-	int bytespp = mode->bytespp;
-	int line_size = bytespp * pixmap->xl;
-	char *lastline[2];
-	char *lastline_p = NULL;
-	char *data_p = (char *)pixmap->data;
-
-	lastline[0] = (char *)sci_malloc(line_size);
-	lastline[1] = (char *)sci_malloc(line_size);
-
-	for (y = 0; y < pixmap->yl; y++) {
-		int visimode = (y > 0 && y + 1 < pixmap->yl) ? 1 : 0;
-		unsigned long last_pixel = 0;
-
-		memcpy(lastline[y & 1], data_p, line_size);
-		lastline_p = lastline[(y & 1)^1];
-
-		for (x = 0; x < pixmap->xl; x++) {
-			unsigned long result = 0;
-
-			if (x == 1)
-				visimode++;
-			else if (x + 1 == pixmap->xl)
-				visimode--;
-
-			for (c = 0; c < 3; c++) {
-				unsigned long accum = 0;
-				unsigned long reader = 0;
-				int y_mode;
-
-				/* Yes, bad compilers will read three times as often as neccessary.
-				** This optimization is straightforward to detect (common subexpression
-				** elemination), so I prefer to write the stuff semi-legibly...
-				*/
-				for (y_mode = 0; y_mode < 2; y_mode++)
-					if ((y_mode == 0 && y > 0)
-					        || (y_mode == 1 && y + 1 < pixmap->yl)) {
-
-						char *src = (y_mode) ? data_p + line_size : lastline_p;
-
-						if (x > 0) {
-							memcpy(&reader, src - bytespp, bytespp);
-							accum += ((reader >> shift_const) & mask[c]) << 0;
-						}
-
-						memcpy(&reader, src, bytespp);
-						accum += ((reader >> shift_const) & mask[c]) << 1;
-
-						if (x + 1 < pixmap->xl) {
-							memcpy(&reader, src + bytespp, bytespp);
-							accum += ((reader >> shift_const) & mask[c]) << 0;
-						}
-					}
-
-				if (x > 0)
-					accum += ((last_pixel >> shift_const) & mask[c]) << 1;
-
-				memcpy(&reader, data_p, bytespp);
-				if (c == 2)
-					last_pixel = reader;
-				accum += ((reader >> shift_const) & mask[c]) << 2;
-
-				if (x + 1 < pixmap->xl) {
-					memcpy(&reader, data_p + bytespp, bytespp);
-					accum += ((reader >> shift_const) & mask[c]) << 1;
-				}
-
-				switch (visimode) {
-
-				case 0:
-					accum /= 9; // Only happens twelve times
-					break;
-
-				case 1:
-					accum = (accum >> 6) + (accum >> 4); // 15/16 intensity
-					break;
-
-				case 2:
-					accum >>= 4;
-					break;
-
-				default:
-					accum = (c == 0) ? 0xffffffff : 0; // Error: mark as red
-				}
-
-				result |= (accum & mask[c]);
-			}
-
-			result <<= shift_const;
-			memcpy(data_p, &result, bytespp);
-
-			data_p += bytespp;
-			lastline_p += bytespp;
-		}
-	}
-
-	free(lastline[0]);
-	free(lastline[1]);
-}
-
-void gfxr_antialiase(gfx_pixmap_t *pixmap, gfx_mode_t *mode, gfxr_antialiasing_t type) {
-	int masks[3];
-	int shift_const = 0;
-
-#ifdef SCUMM_BIG_ENDIAN
-	shift_const = (sizeof(unsigned long) - mode->bytespp) << 3;
-#endif
-
-	masks[0] = mode->red_mask;
-	masks[1] = mode->green_mask;
-	masks[2] = mode->blue_mask;
-
-	if (mode->palette)
-		return;
-
-	switch (type) {
-
-	case GFXR_ANTIALIASING_NONE:
-		break;
-
-	case GFXR_ANTIALIASING_SIMPLE:
-		antialiase_simple(pixmap, masks, shift_const, mode);
-		break;
-
-	default:
-		GFXERROR("Invalid antialiasing mode %d (internal error)\n", type);
-	}
-}
-
-} // End of namespace Sci

Modified: scummvm/trunk/engines/sci/gfx/gfx_options.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_options.h	2009-02-23 00:14:51 UTC (rev 38799)
+++ scummvm/trunk/engines/sci/gfx/gfx_options.h	2009-02-23 00:39:00 UTC (rev 38800)
@@ -67,8 +67,6 @@
 	gfx_xlate_filter_t text_xlate_filter;
 	gfxr_font_scale_filter_t fixed_font_xlate_filter; /* Scale filter for systems that provide font support which isn't scaled */
 
-	gfxr_antialiasing_t pic0_antialiasing;
-
 	gfx_res_fullconf_t res_conf; /* Resource customisation: Per-resource palettes etc. */
 
 	int dirty_frames;

Modified: scummvm/trunk/engines/sci/gfx/gfx_tools.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_tools.h	2009-02-23 00:14:51 UTC (rev 38799)
+++ scummvm/trunk/engines/sci/gfx/gfx_tools.h	2009-02-23 00:39:00 UTC (rev 38800)
@@ -40,12 +40,7 @@
 	GFX_XLATE_FILTER_TRILINEAR
 } gfx_xlate_filter_t;
 
-typedef enum {
-	GFXR_ANTIALIASING_NONE,
-	GFXR_ANTIALIASING_SIMPLE
-} gfxr_antialiasing_t;
 
-
 extern int gfx_crossblit_alpha_threshold; /* Crossblitting functions use this value as threshold
 					  ** for distinguishing between transparent and opaque
 					  ** wrt alpha values */
@@ -189,14 +184,6 @@
 ** Returns   : (void)
 */
 
-void gfxr_antialiase(gfx_pixmap_t *pixmap, gfx_mode_t *mode, gfxr_antialiasing_t type);
-/* Performs antialiasing on a pixmap
-** Parameters: (gfx_pixmap_t *) pixmap: The pixmap to antialiase
-**             (gfx_mode_t *) mode: The current mode
-**             (gfxr_antialiasing_t) type: Antialiasing algorithm to use
-** Returns   : (void)
-*/
-
 #define GFX_CROSSBLIT_FLAG_DATA_IS_HOMED (1<<0)
 /* Means that the first byte in the visual data refers to the
 ** point corresponding to (dest.x, dest.y) */

Modified: scummvm/trunk/engines/sci/gfx/resmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/resmgr.cpp	2009-02-23 00:14:51 UTC (rev 38799)
+++ scummvm/trunk/engines/sci/gfx/resmgr.cpp	2009-02-23 00:39:00 UTC (rev 38800)
@@ -335,9 +335,6 @@
 
 
 	if (must_post_process_pic) {
-		if (scaled || state->options->pic0_unscaled && maps & GFX_MASK_VISUAL)
-			gfxr_antialiase(npic->visual_map, state->driver->mode, state->options->pic0_antialiasing);
-
 		gfxr_endianness_adjust(npic->visual_map, state->driver->mode);
 	}
 
@@ -439,9 +436,6 @@
 		set_pic_id(res, old_ID);
 	}
 
-	if (scaled || state->options->pic0_unscaled && maps & GFX_MASK_VISUAL)
-		gfxr_antialiase(pic->visual_map, state->driver->mode, state->options->pic0_antialiasing);
-
 	return pic;
 }
 

Modified: scummvm/trunk/engines/sci/module.mk
===================================================================
--- scummvm/trunk/engines/sci/module.mk	2009-02-23 00:14:51 UTC (rev 38799)
+++ scummvm/trunk/engines/sci/module.mk	2009-02-23 00:39:00 UTC (rev 38800)
@@ -31,7 +31,6 @@
 	engine/seg_manager.o \
 	engine/sys_strings.o \
 	engine/vm.o \
-	gfx/antialias.o \
 	gfx/font.o \
 	gfx/gfx_driver.o \
 	gfx/gfx_res_options.o \

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2009-02-23 00:14:51 UTC (rev 38799)
+++ scummvm/trunk/engines/sci/sci.cpp	2009-02-23 00:39:00 UTC (rev 38800)
@@ -278,7 +278,6 @@
 	gfx_options.pic_xlate_filter = GFX_XLATE_FILTER_NONE;
 	gfx_options.text_xlate_filter = GFX_XLATE_FILTER_NONE;
 	gfx_options.dirty_frames = GFXOP_DIRTY_FRAMES_CLUSTERS;
-	gfx_options.pic0_antialiasing = GFXR_ANTIALIASING_NONE;
 	gfx_options.pic_port_bounds = gfx_rect(0, 10, 320, 190);
 	for (int i = 0; i < GFX_RESOURCE_TYPES_NR; i++) {
 		gfx_options.res_conf.assign[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