[Scummvm-cvs-logs] SF.net SVN: scummvm: [24543] scummvm/trunk/engines/scumm

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Oct 28 02:46:10 CEST 2006


Revision: 24543
          http://svn.sourceforge.net/scummvm/?rev=24543&view=rev
Author:   fingolfin
Date:     2006-10-27 17:45:58 -0700 (Fri, 27 Oct 2006)

Log Message:
-----------
SCUMM: Got rid of smush/chunk_type.h

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/insane/insane.cpp
    scummvm/trunk/engines/scumm/insane/insane_iact.cpp
    scummvm/trunk/engines/scumm/smush/channel.h
    scummvm/trunk/engines/scumm/smush/imuse_channel.cpp
    scummvm/trunk/engines/scumm/smush/saud_channel.cpp
    scummvm/trunk/engines/scumm/smush/smush_player.cpp

Removed Paths:
-------------
    scummvm/trunk/engines/scumm/smush/chunk_type.h

Modified: scummvm/trunk/engines/scumm/insane/insane.cpp
===================================================================
--- scummvm/trunk/engines/scumm/insane/insane.cpp	2006-10-28 00:18:13 UTC (rev 24542)
+++ scummvm/trunk/engines/scumm/insane/insane.cpp	2006-10-28 00:45:58 UTC (rev 24543)
@@ -37,7 +37,6 @@
 
 #include "scumm/smush/smush_player.h"
 #include "scumm/smush/smush_font.h"
-#include "scumm/smush/chunk_type.h"
 #include "scumm/smush/chunk.h"
 
 #include "scumm/insane/insane.h"
@@ -1320,14 +1319,14 @@
 	_player->_skipNext = false;
 
 	if ((_vm->_game.features & GF_DEMO) && (_vm->_game.platform == Common::kPlatformPC)) {
-		_player->checkBlock(b, TYPE_SKIP, 2);
+		_player->checkBlock(b, MKID_BE('SKIP'), 2);
 		par1 = b.getWord();
 		if (isBitSet(par1))
 			_player->_skipNext = true;
 		return;
 	}
 
-	_player->checkBlock(b, TYPE_SKIP, 4);
+	_player->checkBlock(b, MKID_BE('SKIP'), 4);
 
 	par1 = b.getWord();
 	par2 = b.getWord();

Modified: scummvm/trunk/engines/scumm/insane/insane_iact.cpp
===================================================================
--- scummvm/trunk/engines/scumm/insane/insane_iact.cpp	2006-10-28 00:18:13 UTC (rev 24542)
+++ scummvm/trunk/engines/scumm/insane/insane_iact.cpp	2006-10-28 00:45:58 UTC (rev 24543)
@@ -28,7 +28,6 @@
 #include "scumm/scumm.h"
 
 #include "scumm/smush/smush_player.h"
-#include "scumm/smush/chunk_type.h"
 #include "scumm/smush/chunk.h"
 
 #include "scumm/insane/insane.h"

Modified: scummvm/trunk/engines/scumm/smush/channel.h
===================================================================
--- scummvm/trunk/engines/scumm/smush/channel.h	2006-10-28 00:18:13 UTC (rev 24542)
+++ scummvm/trunk/engines/scumm/smush/channel.h	2006-10-28 00:45:58 UTC (rev 24543)
@@ -80,7 +80,6 @@
 
 public:
 	SaudChannel(int32 track);
-	virtual ~SaudChannel();
 	bool isTerminated() const;
 	bool setParameters(int32 duration, int32 flags, int32 vol1, int32 vol2, int32 index);
 	bool checkParameters(int32 index, int32 duration, int32 flags, int32 vol1, int32 vol2);
@@ -105,7 +104,6 @@
 	int32 _channels;			//!< the number of channels of the original data
 
 protected:
-	int32 decode(int32 size, int32 &ret);
 	void decode();
 	bool handleMap(Chunk &c);
 	bool handleFormat(Chunk &c);
@@ -115,7 +113,6 @@
 
 public:
 	ImuseChannel(int32 track);
-	virtual ~ImuseChannel();
 	bool isTerminated() const;
 	bool setParameters(int32 nbframes, int32 size, int32 track_flags, int32 unk1, int32);
 	bool checkParameters(int32 index, int32 nbframes, int32 size, int32 track_flags, int32 unk1);

Deleted: scummvm/trunk/engines/scumm/smush/chunk_type.h
===================================================================
--- scummvm/trunk/engines/scumm/smush/chunk_type.h	2006-10-28 00:18:13 UTC (rev 24542)
+++ scummvm/trunk/engines/scumm/smush/chunk_type.h	2006-10-28 00:45:58 UTC (rev 24543)
@@ -1,60 +0,0 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2002-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$
- *
- */
-
-#ifndef CHUNK_TYPE_H
-#define CHUNK_TYPE_H
-
-#include "common/scummsys.h"
-#include "scumm/smush/chunk.h"
-
-namespace Scumm {
-
-static const Chunk::type TYPE_ANIM = 'ANIM';
-static const Chunk::type TYPE_AHDR = 'AHDR';
-static const Chunk::type TYPE_FRME = 'FRME';
-static const Chunk::type TYPE_NPAL = 'NPAL';
-static const Chunk::type TYPE_FOBJ = 'FOBJ';
-static const Chunk::type TYPE_ZFOB = 'ZFOB';
-static const Chunk::type TYPE_PSAD = 'PSAD';
-static const Chunk::type TYPE_TRES = 'TRES';
-static const Chunk::type TYPE_XPAL = 'XPAL';
-static const Chunk::type TYPE_IACT = 'IACT';
-static const Chunk::type TYPE_STOR = 'STOR';
-static const Chunk::type TYPE_FTCH = 'FTCH';
-static const Chunk::type TYPE_SKIP = 'SKIP';
-static const Chunk::type TYPE_STRK = 'STRK';
-static const Chunk::type TYPE_SMRK = 'SMRK';
-static const Chunk::type TYPE_SHDR = 'SHDR';
-static const Chunk::type TYPE_SDAT = 'SDAT';
-static const Chunk::type TYPE_SAUD = 'SAUD';
-static const Chunk::type TYPE_iMUS = 'iMUS';
-static const Chunk::type TYPE_FRMT = 'FRMT';
-static const Chunk::type TYPE_TEXT = 'TEXT';
-static const Chunk::type TYPE_REGN = 'REGN';
-static const Chunk::type TYPE_STOP = 'STOP';
-static const Chunk::type TYPE_MAP_ = 'MAP ';
-static const Chunk::type TYPE_DATA = 'DATA';
-static const Chunk::type TYPE_ETRS = 'ETRS';
-
-} // End of namespace Scumm
-
-#endif

Modified: scummvm/trunk/engines/scumm/smush/imuse_channel.cpp
===================================================================
--- scummvm/trunk/engines/scumm/smush/imuse_channel.cpp	2006-10-28 00:18:13 UTC (rev 24542)
+++ scummvm/trunk/engines/scumm/smush/imuse_channel.cpp	2006-10-28 00:45:58 UTC (rev 24543)
@@ -27,16 +27,12 @@
 #include "scumm/util.h"
 #include "scumm/smush/channel.h"
 #include "scumm/smush/chunk.h"
-#include "scumm/smush/chunk_type.h"
 
 namespace Scumm {
 
 ImuseChannel::ImuseChannel(int32 track) : SmushChannel(track) {
 }
 
-ImuseChannel::~ImuseChannel() {
-}
-
 bool ImuseChannel::isTerminated() const {
 	return (_dataSize <= 0 && _sbuffer == 0);
 }
@@ -66,7 +62,7 @@
 		assert(size > 8);
 		Chunk::type imus_type = b.getDword(); imus_type = SWAP_BYTES_32(imus_type);
 		uint32 imus_size = b.getDword(); imus_size = SWAP_BYTES_32(imus_size);
-		if (imus_type != TYPE_iMUS)
+		if (imus_type != MKID_BE('iMUS'))
 			error("Invalid Chunk for imuse_channel");
 		size -= 8;
 		_tbufferSize = size;
@@ -136,15 +132,15 @@
 	while (!map.eof()) {
 		Chunk *sub = map.subBlock();
 		switch (sub->getType()) {
-		case TYPE_FRMT:
+		case MKID_BE('FRMT'):
 			handleFormat(*sub);
 			break;
-		case TYPE_TEXT:
+		case MKID_BE('TEXT'):
 			break;
-		case TYPE_REGN:
+		case MKID_BE('REGN'):
 			handleRegion(*sub);
 			break;
-		case TYPE_STOP:
+		case MKID_BE('STOP'):
 			handleStop(*sub);
 			break;
 		default:
@@ -179,7 +175,7 @@
 		}
 	}
 
-	// FIXME: Code duplication! See decode12BitsSample() in scumm/imuse_digi.cpp
+	// FIXME: Code duplication! See decode12BitsSample() in imuse_digi/dimuse_codecs.cpp
 
 	int loop_size = _sbufferSize / 3;
 	int new_size = loop_size * 4;
@@ -209,14 +205,14 @@
 		uint32 size = READ_BE_UINT32(_tbuffer + offset + 4);
 		uint32 available_size = _tbufferSize - offset;
 		switch (type) {
-		case TYPE_MAP_:
+		case MKID_BE('MAP '):
 			_inData = false;
 			if (available_size >= (size + 8)) {
 				MemoryChunk c((byte *)_tbuffer + offset);
 				handleMap(c);
 			}
 			break;
-		case TYPE_DATA:
+		case MKID_BE('DATA'):
 			_inData = true;
 			_dataSize = size;
 			offset += 8;

Modified: scummvm/trunk/engines/scumm/smush/saud_channel.cpp
===================================================================
--- scummvm/trunk/engines/scumm/smush/saud_channel.cpp	2006-10-28 00:18:13 UTC (rev 24542)
+++ scummvm/trunk/engines/scumm/smush/saud_channel.cpp	2006-10-28 00:45:58 UTC (rev 24543)
@@ -26,10 +26,20 @@
 #include "scumm/util.h"
 #include "scumm/smush/channel.h"
 #include "scumm/smush/chunk.h"
-#include "scumm/smush/chunk_type.h"
 
 namespace Scumm {
 
+SaudChannel::SaudChannel(int32 track) : SmushChannel(track),
+	_nbframes(0),
+	_markReached(false),
+	_index(0),
+	_keepSize(false) {
+}
+
+bool SaudChannel::isTerminated() const {
+	return (_markReached && _dataSize == 0 && _sbuffer == 0);
+}
+
 void SaudChannel::handleStrk(Chunk &b) {
 	int32 size = b.getSize();
 	if (size != 14 && size != 10) {
@@ -54,7 +64,7 @@
 		uint32 available_size = _tbufferSize - offset;
 
 		switch (type) {
-		case TYPE_STRK:
+		case MKID_BE('STRK'):
 			_inData = false;
 			if (available_size >= (size + 8)) {
 				MemoryChunk c((byte *)_tbuffer + offset);
@@ -62,7 +72,7 @@
 			} else
 				return false;
 			break;
-		case TYPE_SMRK:
+		case MKID_BE('SMRK'):
 			_inData = false;
 			if (available_size >= (size + 8)) {
 				MemoryChunk c((byte *)_tbuffer + offset);
@@ -70,7 +80,7 @@
 			} else
 				return false;
 			break;
-		case TYPE_SHDR:
+		case MKID_BE('SHDR'):
 			_inData = false;
 			if (available_size >= (size + 8)) {
 				MemoryChunk c((byte *)_tbuffer + offset);
@@ -78,7 +88,7 @@
 			} else
 				return false;
 			break;
-		case TYPE_SDAT:
+		case MKID_BE('SDAT'):
 			_inData = true;
 			_dataSize = size;
 			offset += 8;
@@ -92,25 +102,6 @@
 	return false;
 }
 
-SaudChannel::SaudChannel(int32 track) : SmushChannel(track),
-	_nbframes(0),
-	_markReached(false),
-	_index(0),
-	_keepSize(false) {
-}
-
-SaudChannel::~SaudChannel() {
-	_dataSize = 0;
-	_tbufferSize = 0;
-	_sbufferSize = 0;
-	_markReached = true;
-	_sbuffer = 0;
-}
-
-bool SaudChannel::isTerminated() const {
-	return (_markReached && _dataSize == 0 && _sbuffer == 0);
-}
-
 bool SaudChannel::setParameters(int32 nb, int32 flags, int32 volume, int32 pan, int32 index) {
 	_nbframes = nb;
 	_flags = flags; // bit 7 == IS_VOICE, bit 6 == IS_BACKGROUND_MUSIC, other ??
@@ -146,7 +137,7 @@
 		saud_type = SWAP_BYTES_32(saud_type);
 		uint32 saud_size = b.getDword();
 		saud_size = SWAP_BYTES_32(saud_size);
-		if (saud_type != TYPE_SAUD)
+		if (saud_type != MKID_BE('SAUD'))
 			error("Invalid Chunk for SaudChannel : %X", saud_type);
 		size -= 8;
 		_dataSize = -2;

Modified: scummvm/trunk/engines/scumm/smush/smush_player.cpp
===================================================================
--- scummvm/trunk/engines/scumm/smush/smush_player.cpp	2006-10-28 00:18:13 UTC (rev 24542)
+++ scummvm/trunk/engines/scumm/smush/smush_player.cpp	2006-10-28 00:45:58 UTC (rev 24543)
@@ -40,7 +40,6 @@
 #include "scumm/sound.h"
 #include "scumm/util.h"
 #include "scumm/smush/channel.h"
-#include "scumm/smush/chunk_type.h"
 #include "scumm/smush/chunk.h"
 #include "scumm/smush/smush_font.h"
 #include "scumm/smush/smush_mixer.h"
@@ -62,7 +61,7 @@
 
 namespace Scumm {
 
-const int MAX_STRINGS = 200;
+static const int MAX_STRINGS = 200;
 
 class StringResource {
 private:
@@ -200,7 +199,7 @@
 		assert(length > ETRS_HEADER_LENGTH);
 		Chunk::type type = READ_BE_UINT32(filebuffer);
 
-		if (type != TYPE_ETRS) {
+		if (type != MKID_BE('ETRS')) {
 			delete [] filebuffer;
 			return getStrings(vm, file, false);
 		}
@@ -390,7 +389,7 @@
 }
 
 void SmushPlayer::handleSoundFrame(Chunk &b) {
-	checkBlock(b, TYPE_PSAD);
+	checkBlock(b, MKID_BE('PSAD'));
 	debugC(DEBUG_SMUSH, "SmushPlayer::handleSoundFrame()");
 
 	int32 track_id = b.getWord();
@@ -408,13 +407,13 @@
 
 void SmushPlayer::handleStore(Chunk &b) {
 	debugC(DEBUG_SMUSH, "SmushPlayer::handleStore()");
-	checkBlock(b, TYPE_STOR, 4);
+	checkBlock(b, MKID_BE('STOR'), 4);
 	_storeFrame = true;
 }
 
 void SmushPlayer::handleFetch(Chunk &b) {
 	debugC(DEBUG_SMUSH, "SmushPlayer::handleFetch()");
-	checkBlock(b, TYPE_FTCH, 6);
+	checkBlock(b, MKID_BE('FTCH'), 6);
 
 	if (_frameBuffer != NULL) {
 		memcpy(_dst, _frameBuffer, _width * _height);
@@ -422,7 +421,7 @@
 }
 
 void SmushPlayer::handleIACT(Chunk &b) {
-	checkBlock(b, TYPE_IACT, 8);
+	checkBlock(b, MKID_BE('IACT'), 8);
 	debugC(DEBUG_SMUSH, "SmushPlayer::IACT()");
 
 	int code = b.getWord();
@@ -558,7 +557,7 @@
 
 	const char *str;
 	char *string = NULL, *string2 = NULL;
-	if (b.getType() == TYPE_TEXT) {
+	if (b.getType() == MKID_BE('TEXT')) {
 		string = (char *)malloc(b.getSize() - 16);
 		str = string;
 		b.read(string, b.getSize() - 16);
@@ -743,7 +742,7 @@
 }
 
 void SmushPlayer::handleDeltaPalette(Chunk &b) {
-	checkBlock(b, TYPE_XPAL);
+	checkBlock(b, MKID_BE('XPAL'));
 	debugC(DEBUG_SMUSH, "SmushPlayer::handleDeltaPalette()");
 
 	if (b.getSize() == 0x300 * 3 + 4) {
@@ -772,7 +771,7 @@
 }
 
 void SmushPlayer::handleNewPalette(Chunk &b) {
-	checkBlock(b, TYPE_NPAL, 0x300);
+	checkBlock(b, MKID_BE('NPAL'), 0x300);
 	debugC(DEBUG_SMUSH, "SmushPlayer::handleNewPalette()");
 
 	if (_skipPalette)
@@ -864,7 +863,7 @@
 #endif
 
 void SmushPlayer::handleFrameObject(Chunk &b) {
-	checkBlock(b, TYPE_FOBJ, 14);
+	checkBlock(b, MKID_BE('FOBJ'), 14);
 	if (_skipNext) {
 		_skipNext = false;
 		return;
@@ -937,7 +936,7 @@
 }
 
 void SmushPlayer::handleFrame(Chunk &b) {
-	checkBlock(b, TYPE_FRME);
+	checkBlock(b, MKID_BE('FRME'));
 	debugC(DEBUG_SMUSH, "SmushPlayer::handleFrame(%d)", _frame);
 	_skipNext = false;
 
@@ -948,40 +947,40 @@
 	while (!b.eof()) {
 		Chunk *sub = b.subBlock();
 		switch (sub->getType()) {
-		case TYPE_NPAL:
+		case MKID_BE('NPAL'):
 			handleNewPalette(*sub);
 			break;
-		case TYPE_FOBJ:
+		case MKID_BE('FOBJ'):
 			handleFrameObject(*sub);
 			break;
 #ifdef USE_ZLIB
-		case TYPE_ZFOB:
+		case MKID_BE('ZFOB'):
 			handleZlibFrameObject(*sub);
 			break;
 #endif
-		case TYPE_PSAD:
+		case MKID_BE('PSAD'):
 			if (!_compressedFileMode)
 				handleSoundFrame(*sub);
 			break;
-		case TYPE_TRES:
+		case MKID_BE('TRES'):
 			handleTextResource(*sub);
 			break;
-		case TYPE_XPAL:
+		case MKID_BE('XPAL'):
 			handleDeltaPalette(*sub);
 			break;
-		case TYPE_IACT:
+		case MKID_BE('IACT'):
 			handleIACT(*sub);
 			break;
-		case TYPE_STOR:
+		case MKID_BE('STOR'):
 			handleStore(*sub);
 			break;
-		case TYPE_FTCH:
+		case MKID_BE('FTCH'):
 			handleFetch(*sub);
 			break;
-		case TYPE_SKIP:
+		case MKID_BE('SKIP'):
 			_vm->_insane->procSKIP(*sub);
 			break;
-		case TYPE_TEXT:
+		case MKID_BE('TEXT'):
 			handleTextResource(*sub);
 			break;
 		default:
@@ -1015,7 +1014,7 @@
 }
 
 void SmushPlayer::handleAnimHeader(Chunk &b) {
-	checkBlock(b, TYPE_AHDR, 0x300 + 6);
+	checkBlock(b, MKID_BE('AHDR'), 0x300 + 6);
 	debugC(DEBUG_SMUSH, "SmushPlayer::handleAnimHeader()");
 
 	_version = b.getWord();
@@ -1091,7 +1090,7 @@
 				assert(_seekPos > 8);
 				// In this case we need to get palette and number of frames
 				sub = _base->subBlock();
-				checkBlock(*sub, TYPE_AHDR);
+				checkBlock(*sub, MKID_BE('AHDR'));
 				handleAnimHeader(*sub);
 				delete sub;
 
@@ -1123,10 +1122,10 @@
 	sub = _base->subBlock();
 
 	switch (sub->getType()) {
-	case TYPE_AHDR: // FT INSANE may seek file to the beginning
+	case MKID_BE('AHDR'): // FT INSANE may seek file to the beginning
 		handleAnimHeader(*sub);
 		break;
-	case TYPE_FRME:
+	case MKID_BE('FRME'):
 		handleFrame(*sub);
 		break;
 	default:


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