[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.223,2.224 resource_v2.cpp,1.37,1.38 resource_v3.cpp,1.23,1.24 saveload.cpp,1.113,1.114 scumm.h,1.312,1.313 scummvm.cpp,2.434,2.435

Max Horn fingolfin at users.sourceforge.net
Sun Oct 12 10:34:03 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv16574

Modified Files:
	gfx.cpp resource_v2.cpp resource_v3.cpp saveload.cpp scumm.h 
	scummvm.cpp 
Log Message:
code simplification

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.223
retrieving revision 2.224
diff -u -d -r2.223 -r2.224
--- gfx.cpp	12 Oct 2003 12:03:17 -0000	2.223
+++ gfx.cpp	12 Oct 2003 17:33:28 -0000	2.224
@@ -1770,7 +1770,7 @@
 		int x = 8;
 		do {
 			FILL_BITS;
-			*dst++ = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod;
+			*dst++ = _vm->_roomPalette[color + _palette_mod];
 
 		againPos:
 			if (!READ_BIT) {
@@ -1795,7 +1795,7 @@
 							if (!--height)
 								return;
 						}
-						*dst++ = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod;
+						*dst++ = _vm->_roomPalette[color + _palette_mod];
 					} while (--reps);
 					bits >>= 8;
 					bits |= (*src++) << (cl - 8);
@@ -1819,7 +1819,7 @@
 		do {
 			FILL_BITS;
 			if (color != _transparentColor)
-				*dst = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod;
+				*dst = _vm->_roomPalette[color + _palette_mod];
 			dst++;
 
 		againPos:
@@ -1846,7 +1846,7 @@
 								return;
 						}
 						if (color != _transparentColor)
-							*dst = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod;
+							*dst = _vm->_roomPalette[color + _palette_mod];
 						dst++;
 					} while (--reps);
 					bits >>= 8;
@@ -1870,7 +1870,7 @@
 		int x = 8;
 		do {
 			FILL_BITS;
-			*dst++ = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod;
+			*dst++ = _vm->_roomPalette[color + _palette_mod];
 			if (!READ_BIT) {
 			} else if (!READ_BIT) {
 				FILL_BITS;
@@ -1901,7 +1901,7 @@
 		do {
 			FILL_BITS;
 			if (color != _transparentColor)
-				*dst = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod;
+				*dst = _vm->_roomPalette[color + _palette_mod];
 			dst++;
 			if (!READ_BIT) {
 			} else if (!READ_BIT) {
@@ -1933,7 +1933,7 @@
 		int h = height;
 		do {
 			FILL_BITS;
-			*dst = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod;
+			*dst = _vm->_roomPalette[color + _palette_mod];
 			dst += _vm->_screenWidth;
 			if (!READ_BIT) {
 			} else if (!READ_BIT) {
@@ -1966,7 +1966,7 @@
 		do {
 			FILL_BITS;
 			if (color != _transparentColor)
-				*dst = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod;
+				*dst = _vm->_roomPalette[color + _palette_mod];
 			dst += _vm->_screenWidth;
 			if (!READ_BIT) {
 			} else if (!READ_BIT) {

Index: resource_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource_v2.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- resource_v2.cpp	5 Oct 2003 17:32:38 -0000	1.37
+++ resource_v2.cpp	12 Oct 2003 17:33:28 -0000	1.38
@@ -196,7 +196,6 @@
 
 	_shadowPaletteSize = 256;
 
-	_roomPalette = (byte *) calloc(_shadowPaletteSize, 1);		// FIXME - needs to be removed later
 	_shadowPalette = (byte *) calloc(_shadowPaletteSize, 1);	// FIXME - needs to be removed later
 	allocateArrays();
 }

Index: resource_v3.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource_v3.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- resource_v3.cpp	3 Oct 2003 18:33:55 -0000	1.23
+++ resource_v3.cpp	12 Oct 2003 17:33:28 -0000	1.24
@@ -208,7 +208,6 @@
 
 	_shadowPaletteSize = 256;
 
-	_roomPalette = (byte *) calloc(_shadowPaletteSize, 1);		// FIXME - needs to be removed later
 	_shadowPalette = (byte *) calloc(_shadowPaletteSize, 1);	// FIXME - needs to be removed later
 	allocateArrays();
 }

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -d -r1.113 -r1.114
--- saveload.cpp	8 Oct 2003 21:59:22 -0000	1.113
+++ saveload.cpp	12 Oct 2003 17:33:28 -0000	1.114
@@ -615,7 +615,7 @@
 		s->saveLoadArrayOf(_shadowPalette, _shadowPaletteSize, 1, sleByte);
 		// _roomPalette didn't show up until V21 save games
 		if (savegameVersion >= VER(21) && _version < 5)
-			s->saveLoadArrayOf (_roomPalette, _shadowPaletteSize, 1, sleByte);
+			s->saveLoadArrayOf(_roomPalette, sizeof(_roomPalette), 1, sleByte);
 	}
 
 	// PalManip data was not saved before V10 save games

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.312
retrieving revision 1.313
diff -u -d -r1.312 -r1.313
--- scumm.h	6 Oct 2003 19:21:18 -0000	1.312
+++ scumm.h	12 Oct 2003 17:33:29 -0000	1.313
@@ -950,7 +950,7 @@
 
 public:
 	byte _proc_special_palette[256];
-	byte *_roomPalette;
+	byte _roomPalette[256];
 	byte *_shadowPalette;
 
 protected:

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.434
retrieving revision 2.435
diff -u -d -r2.434 -r2.435
--- scummvm.cpp	12 Oct 2003 17:25:27 -0000	2.434
+++ scummvm.cpp	12 Oct 2003 17:33:29 -0000	2.435
@@ -276,6 +276,7 @@
 	// Init all vars - maybe now we can get rid of our custom new/delete operators?
 	_imuse = NULL;
 	_imuseDigital = NULL;
+	_musicEngine = NULL;
 	_features = 0;
 	_verbs = NULL;
 	_objs = NULL;
@@ -429,7 +430,6 @@
 	_palManipPalette = NULL;
 	_palManipIntermediatePal = NULL;
 	memset(gfxUsageBits, 0, sizeof(gfxUsageBits));
-	_roomPalette = NULL;
 	_shadowPalette = NULL;
 	_shadowPaletteSize = 0;
 	memset(_currentPalette, 0, sizeof(_currentPalette));
@@ -664,9 +664,6 @@
 	_mixer->setMusicVolume(kDefaultMusicVolume);
 
 	// Init iMuse
-	_imuse = NULL;
-	_imuseDigital = NULL;
-	_musicEngine = NULL;
 	if (_features & GF_DIGI_IMUSE) {
 		_musicEngine = _imuseDigital = new IMuseDigital(this);
 #ifndef __PALM_OS__
@@ -754,8 +751,6 @@
 			fp.close();
 		}
 	}
-
-	_audioNames = NULL;
 }
 
 ScummEngine::~ScummEngine() {
@@ -780,7 +775,6 @@
 
 	delete _costumeRenderer;
 
-	free(_roomPalette);
 	free(_shadowPalette);
 	
 	freeResources();
@@ -1900,8 +1894,7 @@
 
 	if (_version < 7) {
 		for (i = 0; i < 256; i++) {
-			if (_features & GF_SMALL_HEADER)
-				_roomPalette[i] = i;
+			_roomPalette[i] = i;
 			_shadowPalette[i] = i;
 		}
 		if (_features & GF_SMALL_HEADER)





More information about the Scummvm-git-logs mailing list