[Scummvm-cvs-logs] SF.net SVN: scummvm: [21573] scummvm/trunk/engines/sword2

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Mon Apr 3 02:55:00 CEST 2006


Revision: 21573
Author:   eriktorbjorn
Date:     2006-04-03 02:54:05 -0700 (Mon, 03 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21573&view=rev

Log Message:
-----------
Merged d_draw.cpp and rdwin.cpp (what little remained of them) into screen.cpp.

Modified Paths:
--------------
    scummvm/trunk/engines/sword2/module.mk
    scummvm/trunk/engines/sword2/screen.cpp

Removed Paths:
-------------
    scummvm/trunk/engines/sword2/d_draw.cpp
    scummvm/trunk/engines/sword2/rdwin.cpp
Deleted: scummvm/trunk/engines/sword2/d_draw.cpp
===================================================================
--- scummvm/trunk/engines/sword2/d_draw.cpp	2006-04-02 21:38:36 UTC (rev 21572)
+++ scummvm/trunk/engines/sword2/d_draw.cpp	2006-04-03 09:54:05 UTC (rev 21573)
@@ -1,73 +0,0 @@
-/* Copyright (C) 1994-1998 Revolution Software Ltd.
- * Copyright (C) 2003-2006 The ScummVM project
- *
- * 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$
- */
-
-#include "common/stdafx.h"
-#include "common/system.h"
-
-#include "sword2/sword2.h"
-#include "sword2/mouse.h"
-#include "sword2/screen.h"
-
-namespace Sword2 {
-
-/**
- * @return the graphics detail setting
- */
-
-int8 Screen::getRenderLevel() {
-	return _renderLevel;
-}
-
-void Screen::setRenderLevel(int8 level) {
-	_renderLevel = level;
-
-	switch (_renderLevel) {
-	case 0:
-		// Lowest setting: no fancy stuff
-		_renderCaps = 0;
-		break;
-	case 1:
-		// Medium-low setting: transparency-blending
-		_renderCaps = RDBLTFX_SPRITEBLEND;
-		break;
-	case 2:
-		// Medium-high setting: transparency-blending + shading
-		_renderCaps = RDBLTFX_SPRITEBLEND | RDBLTFX_SHADOWBLEND;
-		break;
-	case 3:
-		// Highest setting: transparency-blending + shading +
-		// edge-blending + improved stretching
-		_renderCaps = RDBLTFX_SPRITEBLEND | RDBLTFX_SHADOWBLEND | RDBLTFX_EDGEBLEND;
-		break;
-	}
-}
-
-/**
- * Fill the screen buffer with palette colour zero. Note that it does not
- * touch the menu areas of the screen.
- */
-
-void Screen::clearScene() {
-	memset(_buffer + MENUDEEP * _screenWide, 0, _screenWide * RENDERDEEP);
-	_needFullRedraw = true;
-}
-
-} // End of namespace Sword2

Modified: scummvm/trunk/engines/sword2/module.mk
===================================================================
--- scummvm/trunk/engines/sword2/module.mk	2006-04-02 21:38:36 UTC (rev 21572)
+++ scummvm/trunk/engines/sword2/module.mk	2006-04-03 09:54:05 UTC (rev 21573)
@@ -5,7 +5,6 @@
 	anims.o \
 	console.o \
 	controls.o \
-	d_draw.o \
 	debug.o \
 	events.o \
 	function.o \
@@ -20,7 +19,6 @@
 	music.o \
 	palette.o \
 	protocol.o \
-	rdwin.o \
 	render.o \
 	resman.o \
 	router.o \

Deleted: scummvm/trunk/engines/sword2/rdwin.cpp
===================================================================
--- scummvm/trunk/engines/sword2/rdwin.cpp	2006-04-02 21:38:36 UTC (rev 21572)
+++ scummvm/trunk/engines/sword2/rdwin.cpp	2006-04-03 09:54:05 UTC (rev 21573)
@@ -1,120 +0,0 @@
-/* Copyright (C) 1994-1998 Revolution Software Ltd.
- * Copyright (C) 2003-2006 The ScummVM project
- *
- * 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$
- */
-
-#include "common/stdafx.h"
-#include "common/system.h"
-
-#include "sword2/sword2.h"
-#include "sword2/screen.h"
-
-namespace Sword2 {
-
-/**
- * Tell updateDisplay() that the scene needs to be completely updated.
- */
-
-void Screen::setNeedFullRedraw() {
-	_needFullRedraw = true;
-}
-
-/**
- * Mark an area of the screen as dirty, first generation.
- */
-
-void Screen::markAsDirty(int16 x0, int16 y0, int16 x1, int16 y1) {
-	int16 gridX0 = x0 / CELLWIDE;
-	int16 gridY0 = y0 / CELLDEEP;
-	int16 gridX1 = x1 / CELLWIDE;
-	int16 gridY1 = y1 / CELLDEEP;
-
-	for (int16 i = gridY0; i <= gridY1; i++)
-		for (int16 j = gridX0; j <= gridX1; j++)
-			_dirtyGrid[i * _gridWide + j] = 2;
-}
-
-/**
- * This function has two purposes: It redraws the scene, and it handles input
- * events, palette fading, etc. It should be called at a high rate (> 20 per
- * second), but the scene is usually only redrawn about 12 times per second,
- * except when then screen is scrolling.
- *
- * @param redrawScene If true, redraw the scene.
- */
-
-void Screen::updateDisplay(bool redrawScene) {
-	_vm->parseInputEvents();
-	fadeServer();
-
-	if (redrawScene) {
-		int i;
-
-		// Note that the entire scene is always rendered, which is less
-		// than optimal, but at least we can try to be intelligent
-		// about updating the screen afterwards.
-
-		if (_needFullRedraw) {
-			// Update the entire screen. This is necessary when
-			// scrolling, fading, etc.
-
-			_vm->_system->copyRectToScreen(_buffer + MENUDEEP * _screenWide, _screenWide, 0, MENUDEEP, _screenWide, _screenDeep - 2 * MENUDEEP);
-			_needFullRedraw = false;
-		} else {
-			// Update only the dirty areas of the screen
-
-			int j, x, y;
-			int stripWide;
-
-			for (i = 0; i < _gridDeep; i++) {
-				stripWide = 0;
-
-				for (j = 0; j < _gridWide; j++) {
-					if (_dirtyGrid[i * _gridWide + j]) {
-						stripWide++;
-					} else if (stripWide) {
-						x = CELLWIDE * (j - stripWide);
-						y = CELLDEEP * i;
-						_vm->_system->copyRectToScreen(_buffer + y * _screenWide + x, _screenWide, x, y, stripWide * CELLWIDE, CELLDEEP);
-						stripWide = 0;
-					}
-				}
-
-				if (stripWide) {
-					x = CELLWIDE * (j - stripWide);
-					y = CELLDEEP * i;
-					_vm->_system->copyRectToScreen(_buffer + y * _screenWide + x, _screenWide, x, y, stripWide * CELLWIDE, CELLDEEP);
-					stripWide = 0;
-				}
-			}
-		}
-
-		// Age the dirty cells one generation. This way we keep track
-		// of both the cells that were updated this time, and the ones
-		// that were updated the last time.
-
-		for (i = 0; i < _gridWide * _gridDeep; i++)
-			_dirtyGrid[i] >>= 1;
-	}
-
-	// We always need to update because of fades, menu animations, etc.
-	_vm->_system->updateScreen();
-}
-
-} // End of namespace Sword2

Modified: scummvm/trunk/engines/sword2/screen.cpp
===================================================================
--- scummvm/trunk/engines/sword2/screen.cpp	2006-04-02 21:38:36 UTC (rev 21572)
+++ scummvm/trunk/engines/sword2/screen.cpp	2006-04-03 09:54:05 UTC (rev 21573)
@@ -99,6 +99,138 @@
 	free(_lightMask);
 }
 
+/**
+ * @return the graphics detail setting
+ */
+
+int8 Screen::getRenderLevel() {
+	return _renderLevel;
+}
+
+void Screen::setRenderLevel(int8 level) {
+	_renderLevel = level;
+
+	switch (_renderLevel) {
+	case 0:
+		// Lowest setting: no fancy stuff
+		_renderCaps = 0;
+		break;
+	case 1:
+		// Medium-low setting: transparency-blending
+		_renderCaps = RDBLTFX_SPRITEBLEND;
+		break;
+	case 2:
+		// Medium-high setting: transparency-blending + shading
+		_renderCaps = RDBLTFX_SPRITEBLEND | RDBLTFX_SHADOWBLEND;
+		break;
+	case 3:
+		// Highest setting: transparency-blending + shading +
+		// edge-blending + improved stretching
+		_renderCaps = RDBLTFX_SPRITEBLEND | RDBLTFX_SHADOWBLEND | RDBLTFX_EDGEBLEND;
+		break;
+	}
+}
+
+/**
+ * Tell updateDisplay() that the scene needs to be completely updated.
+ */
+
+void Screen::setNeedFullRedraw() {
+	_needFullRedraw = true;
+}
+
+/**
+ * Mark an area of the screen as dirty, first generation.
+ */
+
+void Screen::markAsDirty(int16 x0, int16 y0, int16 x1, int16 y1) {
+	int16 gridX0 = x0 / CELLWIDE;
+	int16 gridY0 = y0 / CELLDEEP;
+	int16 gridX1 = x1 / CELLWIDE;
+	int16 gridY1 = y1 / CELLDEEP;
+
+	for (int16 i = gridY0; i <= gridY1; i++)
+		for (int16 j = gridX0; j <= gridX1; j++)
+			_dirtyGrid[i * _gridWide + j] = 2;
+}
+
+/**
+ * This function has two purposes: It redraws the scene, and it handles input
+ * events, palette fading, etc. It should be called at a high rate (> 20 per
+ * second), but the scene is usually only redrawn about 12 times per second,
+ * except when then screen is scrolling.
+ *
+ * @param redrawScene If true, redraw the scene.
+ */
+
+void Screen::updateDisplay(bool redrawScene) {
+	_vm->parseInputEvents();
+	fadeServer();
+
+	if (redrawScene) {
+		int i;
+
+		// Note that the entire scene is always rendered, which is less
+		// than optimal, but at least we can try to be intelligent
+		// about updating the screen afterwards.
+
+		if (_needFullRedraw) {
+			// Update the entire screen. This is necessary when
+			// scrolling, fading, etc.
+
+			_vm->_system->copyRectToScreen(_buffer + MENUDEEP * _screenWide, _screenWide, 0, MENUDEEP, _screenWide, _screenDeep - 2 * MENUDEEP);
+			_needFullRedraw = false;
+		} else {
+			// Update only the dirty areas of the screen
+
+			int j, x, y;
+			int stripWide;
+
+			for (i = 0; i < _gridDeep; i++) {
+				stripWide = 0;
+
+				for (j = 0; j < _gridWide; j++) {
+					if (_dirtyGrid[i * _gridWide + j]) {
+						stripWide++;
+					} else if (stripWide) {
+						x = CELLWIDE * (j - stripWide);
+						y = CELLDEEP * i;
+						_vm->_system->copyRectToScreen(_buffer + y * _screenWide + x, _screenWide, x, y, stripWide * CELLWIDE, CELLDEEP);
+						stripWide = 0;
+					}
+				}
+
+				if (stripWide) {
+					x = CELLWIDE * (j - stripWide);
+					y = CELLDEEP * i;
+					_vm->_system->copyRectToScreen(_buffer + y * _screenWide + x, _screenWide, x, y, stripWide * CELLWIDE, CELLDEEP);
+					stripWide = 0;
+				}
+			}
+		}
+
+		// Age the dirty cells one generation. This way we keep track
+		// of both the cells that were updated this time, and the ones
+		// that were updated the last time.
+
+		for (i = 0; i < _gridWide * _gridDeep; i++)
+			_dirtyGrid[i] >>= 1;
+	}
+
+	// We always need to update because of fades, menu animations, etc.
+	_vm->_system->updateScreen();
+}
+
+/**
+ * Fill the screen buffer with palette colour zero. Note that it does not
+ * touch the menu areas of the screen.
+ */
+
+void Screen::clearScene() {
+	memset(_buffer + MENUDEEP * _screenWide, 0, _screenWide * RENDERDEEP);
+	_needFullRedraw = true;
+}
+
 void Screen::buildDisplay() {
 	if (_thisScreen.new_palette) {
 		// start the layer palette fading up


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