[Scummvm-cvs-logs] CVS: scummvm/scumm charset.cpp,2.68,2.69 debugger.cpp,1.97,1.98 dialogs.cpp,1.83,1.84 gfx.cpp,2.230,2.231 imuse.cpp,2.110,2.111 imuse_digi.cpp,1.53,1.54 imuse_internal.h,2.32,2.33 imuse_player.cpp,2.37,2.38 intern.h,2.116,2.117 midiparser_eup.cpp,1.10,1.11 nut_renderer.cpp,1.35,1.36 object.cpp,1.146,1.147 player_mod.h,2.8,2.9 player_v1.cpp,1.14,1.15 player_v2.cpp,2.40,2.41 player_v2.h,2.21,2.22 player_v2a.cpp,2.13,2.14 player_v2a.h,2.6,2.7 player_v3a.cpp,1.15,1.16 player_v3a.h,1.14,1.15 resource.cpp,1.171,1.172 script_v2.cpp,2.209,2.210 scummvm.cpp,2.470,2.471 sound.cpp,1.268,1.269 string.cpp,1.164,1.165

Pawel Kolodziejski aquadran at users.sourceforge.net
Sat Nov 8 14:00:13 CET 2003


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

Modified Files:
	charset.cpp debugger.cpp dialogs.cpp gfx.cpp imuse.cpp 
	imuse_digi.cpp imuse_internal.h imuse_player.cpp intern.h 
	midiparser_eup.cpp nut_renderer.cpp object.cpp player_mod.h 
	player_v1.cpp player_v2.cpp player_v2.h player_v2a.cpp 
	player_v2a.h player_v3a.cpp player_v3a.h resource.cpp 
	script_v2.cpp scummvm.cpp sound.cpp string.cpp 
Log Message:
cleanup whitespaces

Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.68
retrieving revision 2.69
diff -u -d -r2.68 -r2.69
--- charset.cpp	17 Oct 2003 15:35:45 -0000	2.68
+++ charset.cpp	8 Nov 2003 21:59:32 -0000	2.69
@@ -1014,7 +1014,7 @@
 		return;
 
 	_vm->_charsetColorMap[1] = _color;
-	
+
 	if (is2byte) {
 		_dropShadow = true;
 		charPtr = g_scumm->get2byteCharPtr(chr);

Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debugger.cpp,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -d -r1.97 -r1.98
--- debugger.cpp	2 Nov 2003 02:18:14 -0000	1.97
+++ debugger.cpp	8 Nov 2003 21:59:32 -0000	1.98
@@ -474,7 +474,7 @@
 	} else if (!strcmp(argv[2], "name")) {
 		DebugPrintf("Name of object %d: %s\n", obj, _vm->getObjOrActorName(obj));
 	} else {
-		  DebugPrintf("Unknown object command '%s'\nUse <pickup | state> as command\n", argv[2]);
+		DebugPrintf("Unknown object command '%s'\nUse <pickup | state> as command\n", argv[2]);
 	}
 
 	return true;
@@ -605,8 +605,7 @@
 static int gfxPrimitivesCompareInt(const void *a, const void *b);
 
 
-static void hlineColor(ScummEngine *scumm, int x1, int x2, int y, byte color)
-{
+static void hlineColor(ScummEngine *scumm, int x1, int x2, int y, byte color) {
 	VirtScreen *vs = &scumm->virtscr[0];
 	byte *ptr;
 
@@ -634,13 +633,11 @@
 	}
 }
 
-static int gfxPrimitivesCompareInt(const void *a, const void *b)
-{
+static int gfxPrimitivesCompareInt(const void *a, const void *b) {
 	return (*(const int *)a) - (*(const int *)b);
 }
 
-static void fillQuad(ScummEngine *scumm, int16 vx[4], int16 vy[4], int color)
-{
+static void fillQuad(ScummEngine *scumm, int16 vx[4], int16 vy[4], int color) {
 	const int N = 4;
 	int i;
 	int y;

Index: dialogs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.cpp,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- dialogs.cpp	5 Nov 2003 14:35:35 -0000	1.83
+++ dialogs.cpp	8 Nov 2003 21:59:32 -0000	1.84
@@ -246,7 +246,6 @@
 	}
 }
 
-
 Common::StringList generateSavegameList(ScummEngine *scumm, bool saveMode) {
 	// Get savegame names
 	Common::StringList l;
@@ -273,15 +272,15 @@
 enum {
 	kRowHeight = 18,
 	kBigButtonWidth = 90,
-	kMainMenuWidth 	= (kBigButtonWidth + 2*8),
-	kMainMenuHeight 	= 7*kRowHeight + 3*5 + 7 + 5
+	kMainMenuWidth 	= (kBigButtonWidth + 2 * 8),
+	kMainMenuHeight 	= 7 * kRowHeight + 3 * 5 + 7 + 5
 };
 
 #define addBigButton(label, cmd, hotkey) \
 	new ButtonWidget(this, x, y, kBigButtonWidth, 16, label, cmd, hotkey); y += kRowHeight
 
 MainMenuDialog::MainMenuDialog(ScummEngine *scumm)
-	: ScummDialog(scumm, (320 - kMainMenuWidth)/2, (200 - kMainMenuHeight)/2, kMainMenuWidth, kMainMenuHeight) {
+	: ScummDialog(scumm, (320 - kMainMenuWidth) / 2, (200 - kMainMenuHeight)/2, kMainMenuWidth, kMainMenuHeight) {
 	int y = 7;
 
 	const int x = (_w - kBigButtonWidth) / 2;
@@ -418,13 +417,13 @@
 	// Add the buttons
 	//
 #ifdef _WIN32_WCE
-	addButton(_w-kButtonWidth-8, _h-24 - kButtonHeight - 4, "OK", kOKCmd, 'O');
-	addButton(_w-2*kButtonWidth-12, _h-24 - kButtonHeight - 4, "Cancel", kCancelCmd, 'C');
+	addButton(_w - kButtonWidth - 8, _h - 24 - kButtonHeight - 4, "OK", kOKCmd, 'O');
+	addButton(_w - 2 * kButtonWidth - 12, _h - 24 - kButtonHeight - 4, "Cancel", kCancelCmd, 'C');
 
-	addButton(kButtonWidth+12, _h-24, "Keys", kKeysCmd, 'K');
+	addButton(kButtonWidth+12, _h - 24, "Keys", kKeysCmd, 'K');
 #else
-	addButton(_w-kButtonWidth-8, _h-24, "OK", kOKCmd, 'O');
-	addButton(_w-2*kButtonWidth-12, _h-24, "Cancel", kCancelCmd, 'C');
+	addButton(_w - kButtonWidth-8, _h - 24, "OK", kOKCmd, 'O');
+	addButton(_w - 2 * kButtonWidth-12, _h - 24, "Cancel", kCancelCmd, 'C');
 #endif
 
 	//
@@ -433,7 +432,7 @@
 	int yoffset = 8;
 
 	_masterVolumeSlider = new SliderWidget(this, 5, yoffset, 185, 12, "Master volume: ", 100, kMasterVolumeChanged);
-	_masterVolumeLabel = new StaticTextWidget(this, 200, yoffset+2, 24, 16, "100%", kTextAlignLeft);
+	_masterVolumeLabel = new StaticTextWidget(this, 200, yoffset + 2, 24, 16, "100%", kTextAlignLeft);
 	_masterVolumeSlider->setMinValue(0); _masterVolumeSlider->setMaxValue(255);
 	_masterVolumeLabel->setFlags(WIDGET_CLEARBG);
 	yoffset += 16;
@@ -445,7 +444,7 @@
 	yoffset += 16;
 
 	_sfxVolumeSlider = new SliderWidget(this, 5, yoffset, 185, 12, "SFX volume: ", 100, kSfxVolumeChanged);
-	_sfxVolumeLabel  = new StaticTextWidget(this, 200, yoffset+2, 24, 16, "100%", kTextAlignLeft);
+	_sfxVolumeLabel  = new StaticTextWidget(this, 200, yoffset + 2, 24, 16, "100%", kTextAlignLeft);
 	_sfxVolumeSlider->setMinValue(0); _sfxVolumeSlider->setMaxValue(255);
 	_sfxVolumeLabel->setFlags(WIDGET_CLEARBG);
 	yoffset += 16;
@@ -641,7 +640,7 @@
 	_x = (_scumm->_screenWidth - width) >> 1;
 	_w = width;
 
-	new StaticTextWidget(this, 4, 4, _w-8, _h, message, kTextAlignCenter);
+	new StaticTextWidget(this, 4, 4, _w - 8, _h, message, kTextAlignCenter);
 }
 
 #pragma mark -

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.230
retrieving revision 2.231
diff -u -d -r2.230 -r2.231
--- gfx.cpp	7 Nov 2003 02:11:41 -0000	2.230
+++ gfx.cpp	8 Nov 2003 21:59:32 -0000	2.231
@@ -802,7 +802,7 @@
 		gdi._C64ObjectMode = false;
 	}
 	gdi.drawBitmap(getResourceAddress(rtRoom, _roomResource) + _IM00_offs,
-	               &virtscr[0], s, 0, _roomWidth, virtscr[0].height, s, num, 0, _roomStrips);
+					&virtscr[0], s, 0, _roomWidth, virtscr[0].height, s, num, 0, _roomStrips);
 }
 
 void ScummEngine::restoreCharsetBg() {
@@ -910,7 +910,7 @@
  * and objects, used throughout all SCUMM versions.
  */
 void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int width, const int height,
-                     int stripnr, int numstrip, byte flag, StripTable *table) {
+					int stripnr, int numstrip, byte flag, StripTable *table) {
 	assert(ptr);
 	assert(height > 0);
 	byte *backbuff_ptr, *bgbak_ptr;
@@ -1304,10 +1304,10 @@
 	for (x = 0 ; x < width; x++) {
 
 		if ((x % 8) == 0) {
-			assert(x/8 < 160);
-			table->run[x/8] = run;
-			table->color[x/8] = color;
-			table->offsets[x/8] = src - bitmapStart;
+			assert(x / 8 < 160);
+			table->run[x / 8] = run;
+			table->color[x / 8] = color;
+			table->offsets[x / 8] = src - bitmapStart;
 		}
 
 		for (y = 0; y < height; y++) {
@@ -1761,12 +1761,12 @@
 	}
 }
 
-#define READ_BIT (cl--, bit = bits&1, bits>>=1,bit)
-#define FILL_BITS do {				\
-		if (cl <= 8) {			\
-			bits |= (*src++ << cl);	\
-			cl += 8;		\
-		}				\
+#define READ_BIT (cl--, bit = bits & 1, bits >>= 1, bit)
+#define FILL_BITS do {              \
+		if (cl <= 8) {              \
+			bits |= (*src++ << cl); \
+			cl += 8;                \
+		}                           \
 	} while (0)
 
 void Gdi::unkDecodeA(byte *dst, const byte *src, int height) {
@@ -2829,7 +2829,7 @@
 			if (_proc_special_palette) {
 				doCycleIndirectPalette(_proc_special_palette, cycl->start, cycl->end, !(cycl->flags & 2));
 			}
-			
+
 			if (_shadowPalette) {
 				if (_version >= 7) {
 					for (j = 0; j < NUM_SHADOW_PALETTE; j++)
@@ -2864,7 +2864,7 @@
 	string3 = getStringAddress(string_id + 2);
 	if (!string1 || !string2 || !string3) {
 		warning("palManipulateInit(%d,%d,%d,%d): Cannot obtain string resources %d, %d and %d",
-		        start, end, string_id, time, string_id, string_id + 1, string_id + 2);
+				start, end, string_id, time, string_id, string_id + 1, string_id + 2);
 		return;
 	}
 
@@ -2875,7 +2875,7 @@
 	_palManipStart = start;
 	_palManipEnd = end;
 	_palManipCounter = 0;
-	
+
 	if (!_palManipPalette)
 		_palManipPalette = (byte *)calloc(0x300, 1);
 	if (!_palManipIntermediatePal)
@@ -3509,7 +3509,7 @@
 
 void ScummEngine::updateCursor() {
 	_system->set_mouse_cursor(_grabbedCursor, _cursor.width, _cursor.height,
-	                          _cursor.hotspotX, _cursor.hotspotY);
+							_cursor.hotspotX, _cursor.hotspotY);
 }
 
 void ScummEngine::animateCursor() {

Index: imuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
retrieving revision 2.110
retrieving revision 2.111
diff -u -d -r2.110 -r2.111
--- imuse.cpp	17 Oct 2003 17:38:18 -0000	2.110
+++ imuse.cpp	8 Nov 2003 21:59:32 -0000	2.111
@@ -63,8 +63,7 @@
 _master_volume(0),
 _music_volume(0),
 _trigger_count(0),
-_snm_trigger_index(0)
-{
+_snm_trigger_index(0) {
 	memset(_channel_volume,0,sizeof(_channel_volume));
 	memset(_channel_volume_eff,0,sizeof(_channel_volume_eff));
 	memset(_volchan_table,0,sizeof(_volchan_table));
@@ -229,7 +228,7 @@
 		debug(2, "IMuseInternal::startSound(): Couldn't find sound %d!", sound);
 		return false;
 	}
-	
+
 	// Check which MIDI driver this track should use.
 	// If it's NULL, it ain't something we can play.
 	MidiDriver *driver = getBestMidiDriver(sound);
@@ -461,8 +460,7 @@
 
 	for (i = 0; i < ARRAYSIZE (_deferredCommands); ++i) {
 		if (_deferredCommands[i].time_left && _deferredCommands[i].a == 8 &&
-		    _deferredCommands[i].b == sound)
-		{
+			_deferredCommands[i].b == sound) {
 			return 2;
 		}
 	}
@@ -942,9 +940,7 @@
 	int i;
 	ImTrigger *trig = _snm_triggers;
 	for (i = ARRAYSIZE(_snm_triggers); i; --i, ++trig) {
-		if ((sound == -1 || trig->sound == sound) &&
-		    trig->id && (id == -1 || trig->id == id))
-		{
+		if ((sound == -1 || trig->sound == sound) && trig->id && (id == -1 || trig->id == id)) {
 			trig->sound = trig->id = 0;
 			++count;
 		}
@@ -957,8 +953,7 @@
 	int count = 0;
 	int i;
 	for (i = 0; i < 16; ++i) {
-		if (_snm_triggers [i].sound == sound)
-		{
+		if (_snm_triggers [i].sound == sound) {
 			_snm_triggers [i].sound = _snm_triggers [i].id = 0;
 			doCommand (8, _snm_triggers[i].command);
 			++count;
@@ -1660,8 +1655,7 @@
 	// so we'll do the scaling ourselves.
 	if (_player->_se->isNativeMT32())
 		bend = bend * _pitchbend_factor / 12;
-	_mc->pitchBend(clamp(bend + (_detune_eff * 64 / 12) +
-					(_transpose_eff * 8192 / 12), -8192, 8191));
+	_mc->pitchBend(clamp(bend + (_detune_eff * 64 / 12) + (_transpose_eff * 8192 / 12), -8192, 8191));
 }
 
 void Part::programChange(byte value) {
@@ -1709,9 +1703,8 @@
 		hipart = NULL;
 		for (i = 32, part = _parts; i; i--, part++) {
 			if (part->_player && part->_player->getMidiDriver() == midi &&
-			    !part->_percussion && part->_on &&
-				!part->_mc && part->_pri_eff >= hipri)
-			{
+						!part->_percussion && part->_on &&
+						!part->_mc && part->_pri_eff >= hipri) {
 				hipri = part->_pri_eff;
 				hipart = part;
 			}

Index: imuse_digi.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- imuse_digi.cpp	17 Oct 2003 16:39:32 -0000	1.53
+++ imuse_digi.cpp	8 Nov 2003 21:59:32 -0000	1.54
@@ -783,7 +783,7 @@
 				int8	pan = _channel[l]._volumeRight - _channel[l]._volume;
 				if (_channel[l]._mixerChannel == 0) {
 					_scumm->_mixer->newStream(&_channel[l]._mixerChannel, buf, mixer_size,
-					                           _channel[l]._freq, _channel[l]._mixerFlags, 100000, _channel[l]._volume, pan);
+											_channel[l]._freq, _channel[l]._mixerFlags, 100000, _channel[l]._volume, pan);
 				} else {
 					_scumm->_mixer->appendStream(_channel[l]._mixerChannel, buf, mixer_size);
 					_scumm->_mixer->setChannelVolume(_channel[l]._mixerChannel, _channel[l]._volume);

Index: imuse_internal.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_internal.h,v
retrieving revision 2.32
retrieving revision 2.33
diff -u -d -r2.32 -r2.33
--- imuse_internal.h	17 Oct 2003 16:46:06 -0000	2.32
+++ imuse_internal.h	8 Nov 2003 21:59:32 -0000	2.33
@@ -222,42 +222,42 @@
 	Player();
 	virtual ~Player();
 
-	int    addParameterFader(int param, int target, int time);
-	void   clear();
-	void   clearLoop();
-	void   fixAfterLoad();
+	int	 addParameterFader(int param, int target, int time);
+	void clear();
+	void clearLoop();
+	void fixAfterLoad();
 	Part * getActivePart(uint8 part);
-	uint   getBeatIndex();
-	int8   getDetune() const { return _detune; }
-	byte   getEffectiveVolume() const { return _vol_eff; }
-	int    getID() const { return _id; }
+	uint getBeatIndex();
+	int8 getDetune() const { return _detune; }
+	byte getEffectiveVolume() const { return _vol_eff; }
+	int getID() const { return _id; }
 	MidiDriver *getMidiDriver() const { return _midi; }
-	int    getParam(int param, byte chan);
-	int8   getPan() const { return _pan; }
+	int getParam(int param, byte chan);
+	int8 getPan() const { return _pan; }
 	Part * getPart(uint8 part);
-	byte   getPriority() const { return _priority; }
-	uint   getTicksPerBeat() const { return TICKS_PER_BEAT; }
-	int8   getTranspose() const { return _transpose; }
-	byte   getVolume() const { return _volume; }
-	bool   isActive() const { return _active; }
-	bool   isFadingOut() const;
-	bool   isGM() const { return _isGM; }
-	bool   isMT32() const { return _isMT32; }
-	bool   jump(uint track, uint beat, uint tick);
-	void   onTimer();
-	void   removePart(Part *part);
-	int    scan(uint totrack, uint tobeat, uint totick);
-	int    save_or_load(Serializer *ser);
-	int    setHook(byte cls, byte value, byte chan) { return _hook.set(cls, value, chan); }
-	void   setDetune(int detune);
-	bool   setLoop(uint count, uint tobeat, uint totick, uint frombeat, uint fromtick);
-	void   setPan(int pan);
-	void   setPriority(int pri);
-	void   setSpeed(byte speed);
-	int    setTranspose(byte relative, int b);
-	int    setVolume(byte vol);
-	bool   startSound(int sound, MidiDriver *midi, bool passThrough);
-	int    getMusicTimer() const;
+	byte getPriority() const { return _priority; }
+	uint getTicksPerBeat() const { return TICKS_PER_BEAT; }
+	int8 getTranspose() const { return _transpose; }
+	byte getVolume() const { return _volume; }
+	bool isActive() const { return _active; }
+	bool isFadingOut() const;
+	bool isGM() const { return _isGM; }
+	bool isMT32() const { return _isMT32; }
+	bool jump(uint track, uint beat, uint tick);
+	void onTimer();
+	void removePart(Part *part);
+	int scan(uint totrack, uint tobeat, uint totick);
+	int save_or_load(Serializer *ser);
+	int setHook(byte cls, byte value, byte chan) { return _hook.set(cls, value, chan); }
+	void setDetune(int detune);
+	bool setLoop(uint count, uint tobeat, uint totick, uint frombeat, uint fromtick);
+	void setPan(int pan);
+	void setPriority(int pri);
+	void setSpeed(byte speed);
+	int setTranspose(byte relative, int b);
+	int setVolume(byte vol);
+	bool startSound(int sound, MidiDriver *midi, bool passThrough);
+	int getMusicTimer() const;
 
 public:
 	// MidiDriver interface

Index: imuse_player.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_player.cpp,v
retrieving revision 2.37
retrieving revision 2.38
diff -u -d -r2.37 -r2.38
--- imuse_player.cpp	5 Oct 2003 15:36:00 -0000	2.37
+++ imuse_player.cpp	8 Nov 2003 21:59:32 -0000	2.38
@@ -58,30 +58,30 @@
 //////////////////////////////////////////////////
 
 Player::Player() :
-_midi(0),
-_parser(0),
-_parts(0),
-_active(false),
-_scanning(false),
-_id(0),
-_priority(0),
-_volume(0),
-_pan(0),
-_transpose(0),
-_detune(0),
-_vol_eff(0),
-_track_index(0),
-_loop_to_beat(0),
-_loop_from_beat(0),
-_loop_counter(0),
-_loop_to_tick(0),
-_loop_from_tick(0),
-_speed(128),
-_isMT32(false),
-_isGM(false),
-_se(0),
-_vol_chan(0)
-{ }
+	_midi(0),
+	_parser(0),
+	_parts(0),
+	_active(false),
+	_scanning(false),
+	_id(0),
+	_priority(0),
+	_volume(0),
+	_pan(0),
+	_transpose(0),
+	_detune(0),
+	_vol_eff(0),
+	_track_index(0),
+	_loop_to_beat(0),
+	_loop_from_beat(0),
+	_loop_counter(0),
+	_loop_to_tick(0),
+	_loop_from_tick(0),
+	_speed(128),
+	_isMT32(false),
+	_isGM(false),
+	_se(0),
+	_vol_chan(0){
+}
 
 Player::~Player() {
 	if (_parser) {
@@ -101,7 +101,7 @@
 			warning("Player::startSound(): Couldn't find start of sound %d!", sound);
 			return false;
 	}
-	
+
 	_isMT32 = _se->isMT32(sound);
 	_isGM = _se->isGM(sound);
 
@@ -142,8 +142,7 @@
 	int i;
 	for (i = 0; i < ARRAYSIZE(_parameterFaders); ++i) {
 		if (_parameterFaders[i].param == ParameterFader::pfVolume &&
-		    _parameterFaders[i].end == 0)
-		{
+						_parameterFaders[i].end == 0) {
 			return true;
 		}
 	}
@@ -1217,7 +1216,7 @@
 
 	ser->saveLoadEntries(this, playerEntries);
 	ser->saveLoadArrayOf(_parameterFaders, ARRAYSIZE(_parameterFaders),
-		                  sizeof(ParameterFader), parameterFaderEntries);
+						sizeof(ParameterFader), parameterFaderEntries);
 	return 0;
 }
 

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.116
retrieving revision 2.117
diff -u -d -r2.116 -r2.117
--- intern.h	28 Oct 2003 17:07:23 -0000	2.116
+++ intern.h	8 Nov 2003 21:59:32 -0000	2.117
@@ -325,8 +325,7 @@
 	File _hFileTable[17];
 	
 public:
-	ScummEngine_v6(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine(detector, syst, gs)
-	{
+	ScummEngine_v6(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine(detector, syst, gs) {
 		VAR_VIDEONAME = 0xFF;
 
 		VAR_TIMEDATE_YEAR = 0xFF;

Index: midiparser_eup.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/midiparser_eup.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- midiparser_eup.cpp	7 Oct 2003 15:15:26 -0000	1.10
+++ midiparser_eup.cpp	8 Nov 2003 21:59:32 -0000	1.11
@@ -72,13 +72,13 @@
 	// fits-all" sound until we actually support the
 	// FM synthesis capabilities of FM Towns.
 	for (; _presend < 12; ++_presend) {
-		if (_instr_to_channel[_presend>>1] >= 16)
+		if (_instr_to_channel[_presend >> 1] >= 16)
 			continue;
 		info.start = pos;
 		info.delta = 0;
 		if (_presend & 1) {
-			byte *data = &_instruments[_presend>>1][0];
-			data[1] = _instr_to_channel[_presend>>1];
+			byte *data = &_instruments[_presend >> 1][0];
+			data[1] = _instr_to_channel[_presend >> 1];
 			info.event = 0xF0;
 			info.ext.data = data;
 			info.length = 48;

Index: nut_renderer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/nut_renderer.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- nut_renderer.cpp	17 Oct 2003 19:20:00 -0000	1.35
+++ nut_renderer.cpp	8 Nov 2003 21:59:32 -0000	1.36
@@ -118,7 +118,7 @@
 	if (_loaded) {
 		warning("NutRenderer::loadFont() Font already loaded, ok, loading...");
 	}
-	
+
 	File file;
 	file.open(filename, directory);
 	if (file.isOpen() == false) {
@@ -142,7 +142,7 @@
 		free(dataSrc);
 		return false;
 	}
-	
+
 	_nbChars = READ_LE_UINT16(dataSrc + 10);
 	uint32 offset = READ_BE_UINT32(dataSrc + 4) + 8;
 	int32 decoded_length;
@@ -304,7 +304,7 @@
 
 	byte maskmask;
 	int maskpos;
-	
+
 	for (int ty = 0; ty < height; ty++) {
 		maskmask = revBitMask[x & 7];
 		maskpos = 0;
@@ -342,7 +342,7 @@
 
 	byte maskmask;
 	int maskpos;
-	
+
 	for (int ty = 0; ty < height; ty++) {
 		maskmask = revBitMask[x & 7];
 		maskpos = 0;

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -d -r1.146 -r1.147
--- object.cpp	29 Oct 2003 13:16:12 -0000	1.146
+++ object.cpp	8 Nov 2003 21:59:32 -0000	1.147
@@ -1399,7 +1399,7 @@
 }
 
 void ScummEngine::enqueueObject(int objectNumber, int objectX, int objectY, int objectWidth,
-                          int objectHeight, int scaleX, int scaleY, int image, int mode) {
+								int objectHeight, int scaleX, int scaleY, int image, int mode) {
 	BlastObject *eo;
 	ObjectData *od;
 

Index: player_mod.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_mod.h,v
retrieving revision 2.8
retrieving revision 2.9
diff -u -d -r2.8 -r2.9
--- player_mod.h	3 Oct 2003 23:32:34 -0000	2.8
+++ player_mod.h	8 Nov 2003 21:59:32 -0000	2.9
@@ -55,8 +55,7 @@
 		MOD_MAXCHANS = 16
 	};
 
-	struct soundChan
-	{
+	struct soundChan {
 		int id;
 		uint8 vol;
 		int8 pan;

Index: player_v1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v1.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- player_v1.cpp	5 Oct 2003 17:32:38 -0000	1.14
+++ player_v1.cpp	8 Nov 2003 21:59:32 -0000	1.15
@@ -133,7 +133,7 @@
  parse_again:
 	_chunk_type = READ_LE_UINT16(_next_chunk);
 	debug(6, "parseSpeakerChunk: sound %d, offset %4x, chunk %x", 
-		  _current_nr, _next_chunk - _current_data, _chunk_type);
+			_current_nr, _next_chunk - _current_data, _chunk_type);
 
 	_next_chunk += 2;
 	switch (_chunk_type) {
@@ -170,7 +170,7 @@
 		_channels[0].freq = _start;
 		_next_chunk += 10;
 		debug(6, "chunk 1: mplex %d, freq %d -> %d step %d  x %d", 
-			  _mplex, _start, _end, _delta, _repeat_ctr);
+				_mplex, _start, _end, _delta, _repeat_ctr);
 		break;
 	case 2:
 		_start = READ_LE_UINT16(_next_chunk);
@@ -180,7 +180,7 @@
 		_next_chunk += 6;
 		_forced_level = -1;
 		debug(6, "chunk 2: %d -> %d step %d", 
-			  _start, _end, _delta);
+				_start, _end, _delta);
 		break;
 	case 3:
 		_start = READ_LE_UINT16(_next_chunk);
@@ -190,7 +190,7 @@
 		_next_chunk += 6;
 		_forced_level = -1;
 		debug(6, "chunk 3: %d -> %d step %d", 
-			  _start, _end, _delta);
+				_start, _end, _delta);
 		break;
 	}
 }
@@ -209,7 +209,7 @@
 			_next_chunk += 2;
 		}
 		debug(7, "nextSpeakerCmd: chunk %d, offset %4x: notelen %d", 
-			  _chunk_type, _next_chunk - 2 - _current_data, _time_left);
+				_chunk_type, _next_chunk - 2 - _current_data, _time_left);
 
 		if (_time_left == 0) {
 			parseSpeakerChunk();
@@ -262,7 +262,7 @@
 	set_mplex(3000);
 	_forced_level = 0;
 
- parse_again:
+parse_again:
 
 	_chunk_type = READ_LE_UINT16(_next_chunk);
 	debug(6, "parsePCjrChunk: sound %d, offset %4x, chunk %x", 
@@ -539,7 +539,7 @@
 	} else {
 		squareGenerator(0, _channels[0].freq, 0, 0, data, len);
 		debug(9, "speaker: %8x: freq %d %.1f", _tick_len,
-			  _channels[0].freq, 1193000.0/_channels[0].freq);
+				_channels[0].freq, 1193000.0 / _channels[0].freq);
 	}
 	lowPassFilter(data, len);
 }
@@ -588,7 +588,7 @@
 			hasdata = true;
 			squareGenerator(i, freq, vol, 0, data, len);
 			debug(9, "channel[%d]: %8x: freq %d %.1f ; volume %d", 
-				  i, _tick_len, freq, 111860.0/freq,  vol);
+				  i, _tick_len, freq, 111860.0 / freq,  vol);
 		} else {
 			int noiseFB = (freq & 4) ? FB_WNOISE : FB_PNOISE;
 			int n = (freq & 3);
@@ -597,7 +597,7 @@
 			hasdata = true;
 			squareGenerator(i, freq, vol, noiseFB, data, len);
 			debug(9, "channel[%d]: %x: noise freq %d %.1f ; volume %d", 
-				  i, _tick_len, freq, 111860.0/freq,  vol);
+				  i, _tick_len, freq, 111860.0 / freq,  vol);
 		}
 	}
 

Index: player_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v2.cpp,v
retrieving revision 2.40
retrieving revision 2.41
diff -u -d -r2.40 -r2.41
--- player_v2.cpp	9 Oct 2003 14:17:05 -0000	2.40
+++ player_v2.cpp	8 Nov 2003 21:59:32 -0000	2.41
@@ -447,7 +447,7 @@
 
 		_channels[i].d.music_script_nr = nr;
 		if (data) {
-			_channels[i].d.next_cmd = READ_LE_UINT16(data+offset+2*i);
+			_channels[i].d.next_cmd = READ_LE_UINT16(data + offset + 2 * i);
 			if (_channels[i].d.next_cmd)
 				_channels[i].d.time_left = 1;
 		}
@@ -521,8 +521,8 @@
 	}
 	
 	if (nr != _current_nr
-	    && restartable
-	    && (!_next_nr
+		&& restartable
+		&& (!_next_nr
 		|| nprio <= prio)) {
 
 		_next_nr = nr;
@@ -590,15 +590,15 @@
 			case 0xf8: // set hull curve
 				debug(7, "channels[%d]: hull curve %2d", 
 				channel - _channels, *script_ptr);
-				channel->d.hull_curve = hull_offsets[*script_ptr/2];
+				channel->d.hull_curve = hull_offsets[*script_ptr / 2];
 				script_ptr++;
 				break;
 
 			case 0xf9: // set freqmod curve
 				debug(7, "channels[%d]: freqmod curve %2d", 
 				channel - _channels, *script_ptr);
-				channel->d.freqmod_table = freqmod_offsets[*script_ptr/4];
-				channel->d.freqmod_modulo = freqmod_lengths[*script_ptr/4];
+				channel->d.freqmod_table = freqmod_offsets[*script_ptr / 4];
+				channel->d.freqmod_modulo = freqmod_lengths[*script_ptr / 4];
 				script_ptr++;
 				break;
 
@@ -658,16 +658,16 @@
 				offset = READ_LE_UINT16 (script_ptr);
 				script_ptr += 2;
 				debug(7, "loop if %d to %d", opcode, offset);
-				if (!channel->array[opcode/2] || --channel->array[opcode/2])
+				if (!channel->array[opcode / 2] || --channel->array[opcode/2])
 					script_ptr += offset;
 				break;
 
 			case 0xff: // set parameter
 				opcode = *script_ptr++;
 				value = READ_LE_UINT16 (script_ptr);
-				channel->array[opcode/2] = value;
+				channel->array[opcode / 2] = value;
 				debug(7, "channels[%d]: set param %2d = %5d", 
-					  channel - &_channels[0], opcode, value);
+						channel - &_channels[0], opcode, value);
 				script_ptr += 2;
 				if (opcode == 14) {
 				    /* tempo var */
@@ -708,11 +708,11 @@
 
 
 				debug(8, "channels[%d]: @%04x note: %3d+%d len: %2d hull: %d mod: %d/%d/%d %s", 
-				      dest_channel - channel, script_ptr ? script_ptr - _current_data - 2 : 0,
-				      note, (signed short) dest_channel->d.transpose, channel->d.time_left,
-				      dest_channel->d.hull_curve, dest_channel->d.freqmod_table,
-				      dest_channel->d.freqmod_incr,dest_channel->d.freqmod_multiplier,
-				      is_last_note ? "last":"");
+						dest_channel - channel, script_ptr ? script_ptr - _current_data - 2 : 0,
+						note, (signed short) dest_channel->d.transpose, channel->d.time_left,
+						dest_channel->d.hull_curve, dest_channel->d.freqmod_table,
+						dest_channel->d.freqmod_incr,dest_channel->d.freqmod_multiplier,
+						is_last_note ? "last":"");
 
 
 				uint16 myfreq;
@@ -775,10 +775,10 @@
 		+ channel->d.base_freq;
 
 	debug(9, "Freq: %d/%d, %d/%d/%d*%d %d",
-	      channel->d.base_freq, (int16)channel->d.freq_delta,
-	      channel->d.freqmod_table, channel->d.freqmod_offset,
-	      channel->d.freqmod_incr, channel->d.freqmod_multiplier,
-	      channel->d.freq);
+			channel->d.base_freq, (int16)channel->d.freq_delta,
+			channel->d.freqmod_table, channel->d.freqmod_offset,
+			channel->d.freqmod_incr, channel->d.freqmod_multiplier,
+			channel->d.freq);
 
 	if (channel->d.note_length && !--channel->d.note_length) {
 		channel->d.hull_offset  = 16;
@@ -791,15 +791,15 @@
 
 #if 0
 	debug(9, "channels[%d]: freq %d hull %d/%d/%d", 
-	      channel - &_channels[0], channel->d.freq,
-	      channel->d.hull_curve, channel->d.hull_offset,
-	      channel->d.hull_counter);
+			channel - &_channels[0], channel->d.freq,
+			channel->d.hull_curve, channel->d.hull_offset,
+			channel->d.hull_counter);
 #endif
 
 	if (channel->d.hull_counter && !--channel->d.hull_counter) {
 		for (;;) {
 			const int16 *hull_ptr = hulls
-			+ channel->d.hull_curve + channel->d.hull_offset/2;
+			+ channel->d.hull_curve + channel->d.hull_offset / 2;
 			if (hull_ptr[1] == -1) {
 				channel->d.volume = hull_ptr[0];
 				if (hull_ptr[0] == 0)
@@ -854,14 +854,14 @@
 void Player_V2::lowPassFilter(int16 *sample, uint len) {
 	for (uint i = 0; i < len; i++) {
 		_level = (int) (_level * _decay
-				+ sample[0] * (0x10000-_decay)) >> 16;
+				+ sample[0] * (0x10000 - _decay)) >> 16;
 		sample[0] = sample[1] = _level;
 		sample += 2;
 	}
 }
 
 void Player_V2::squareGenerator(int channel, int freq, int vol,
-                                int noiseFeedback, int16 *sample, uint len) {
+								int noiseFeedback, int16 *sample, uint len) {
 	int period = _update_step * freq;
 	long nsample;
 	if (period == 0)
@@ -896,8 +896,8 @@
 			duration -= _timer_count[channel];
 		
 		nsample = *sample + 
-			(((signed long) (duration - (1 << (FIXP_SHIFT-1)))
-			  * (signed long) _volumetable[vol]) >> FIXP_SHIFT);
+			(((signed long) (duration - (1 << (FIXP_SHIFT - 1)))
+				* (signed long) _volumetable[vol]) >> FIXP_SHIFT);
 		/* overflow: clip value */
 		if (nsample > 0x7fff)
 			nsample = 0x7fff;
@@ -914,8 +914,8 @@
 	int winning_channel = -1;
 	for (int i = 0; i < 4; i++) {
 		if (winning_channel == -1
-		    && _channels[i].d.volume
-		    && _channels[i].d.time_left) {
+			&& _channels[i].d.volume
+			&& _channels[i].d.time_left) {
 			winning_channel = i;
 		}
 	}
@@ -943,8 +943,8 @@
 		if (_channels[i].d.volume && _channels[i].d.time_left) {
 			for (j = 0; j < i; j++) {
 				if (_channels[j].d.volume
-				    && _channels[j].d.time_left
-				    && freq == (_channels[j].d.freq >> 6)) {
+					&& _channels[j].d.time_left
+					&& freq == (_channels[j].d.freq >> 6)) {
 					/* HACK: this channel is playing at
 					 * the same frequency as another.
 					 * Synchronize it to the same phase to
@@ -978,7 +978,7 @@
 		}
 #if 0
 		debug(9, "channel[%d]: freq %d %.1f ; volume %d", 
-		      i, freq, 111860.0/freq,  vol);
+				i, freq, 111860.0 / freq,  vol);
 #endif
 	}
 

Index: player_v2.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v2.h,v
retrieving revision 2.21
retrieving revision 2.22
diff -u -d -r2.21 -r2.22
--- player_v2.h	5 Oct 2003 17:32:38 -0000	2.21
+++ player_v2.h	8 Nov 2003 21:59:32 -0000	2.22
@@ -140,8 +140,8 @@
 
 	void lowPassFilter(int16 *data, uint len);
 	void squareGenerator(int channel, int freq, int vol,
-	                     int noiseFeedback, int16 *sample, uint len);
-    
+						int noiseFeedback, int16 *sample, uint len);
+
 private:
 	static void premix_proc(void *param, int16 *buf, uint len);
 	void do_mix(int16 *buf, uint len);

Index: player_v2a.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v2a.cpp,v
retrieving revision 2.13
retrieving revision 2.14
diff -u -d -r2.13 -r2.14
--- player_v2a.cpp	9 Oct 2003 15:03:01 -0000	2.13
+++ player_v2a.cpp	8 Nov 2003 21:59:32 -0000	2.14
@@ -732,7 +732,7 @@
 		_id = id;
 		_data = (char *)malloc(READ_LE_UINT16(data));
 		memcpy(_data, data, READ_LE_UINT16(data));
-		
+
 		_loopnum = 1;
 		_step = 2;
 		_curfreq = _freq1;
@@ -752,7 +752,7 @@
 		}
 		if (_curfreq >= _freq2)
 			return true;
-		const char steps[8] = {0,2,2,3,4,8,15,2};
+		const char steps[8] = {0, 2, 2, 3, 4, 8, 15, 2};
 		_curfreq = _freq1;
 		_step = steps[++_loopnum];
 		if (_loopnum == 7) {
@@ -818,10 +818,10 @@
 	}
 	virtual bool update() {
 		assert(_id);
-		updatefreq(_freq1,_step1,0x00AA,0x00FA);
-		updatefreq(_freq2,_step2,0x019A,0x03B6);
-		updatefreq(_freq3,_step3,0x00AA,0x00FA);
-		updatefreq(_freq4,_step4,0x019A,0x03B6);
+		updatefreq(_freq1, _step1, 0x00AA, 0x00FA);
+		updatefreq(_freq2, _step2, 0x019A, 0x03B6);
+		updatefreq(_freq3, _step3, 0x00AA, 0x00FA);
+		updatefreq(_freq4, _step4, 0x019A, 0x03B6);
 		_mod->setChannelFreq(_id | 0x000, BASE_FREQUENCY / _freq1);
 		_mod->setChannelFreq(_id | 0x100, BASE_FREQUENCY / _freq2);
 		_mod->setChannelFreq(_id | 0x200, BASE_FREQUENCY / _freq3);
@@ -986,8 +986,9 @@
 	int _ticks;
 };
 
-#define CRCToSound(CRC, SOUND)	\
-	if (crc == CRC) return new SOUND
+#define CRCToSound(CRC, SOUND)  \
+	if (crc == CRC)             \
+		return new SOUND
 
 static V2A_Sound *findSound (unsigned long crc) {
 	CRCToSound(0x8FAB08C4, V2A_Sound_SingleLooped(0x006C,0x2B58,0x016E,0x3F));	// Maniac 17
@@ -1165,7 +1166,7 @@
 	assert(_scumm);
 	byte *data = _scumm->getResourceAddress(rtSound, nr);
 	assert(data);
-	uint32 crc = GetCRC(data + 0x0A,READ_BE_UINT16(data + 0x08));
+	uint32 crc = GetCRC(data + 0x0A, READ_BE_UINT16(data + 0x08));
 	V2A_Sound *snd = findSound(crc);
 	if (snd == NULL) {
 		warning("player_v2a - sound %i not recognized yet (crc %08X)",nr,crc);

Index: player_v2a.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v2a.h,v
retrieving revision 2.6
retrieving revision 2.7
diff -u -d -r2.6 -r2.7
--- player_v2a.h	5 Oct 2003 17:32:38 -0000	2.6
+++ player_v2a.h	8 Nov 2003 21:59:32 -0000	2.7
@@ -55,8 +55,7 @@
 		V2A_MAXSLOTS = 8
 	};
 
-	struct soundSlot
-	{
+	struct soundSlot {
 		int id;
 		V2A_Sound *sound;
 	};

Index: player_v3a.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v3a.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- player_v3a.cpp	3 Oct 2003 23:32:34 -0000	1.15
+++ player_v3a.cpp	8 Nov 2003 21:59:32 -0000	1.16
@@ -28,10 +28,10 @@
 namespace Scumm {
 
 static const uint16 note_freqs[4][12] = {
-	{0x06B0,0x0650,0x05F4,0x05A0,0x054C,0x0500,0x04B8,0x0474,0x0434,0x03F8,0x03C0,0x0388},
-	{0x0358,0x0328,0x02FA,0x02D0,0x02A6,0x0280,0x025C,0x023A,0x021A,0x01FC,0x01E0,0x01C4},
-	{0x01AC,0x0194,0x017D,0x0168,0x0153,0x0140,0x012E,0x011D,0x010D,0x00FE,0x00F0,0x00E2},
-	{0x00D6,0x00CA,0x00BE,0x00B4,0x00A9,0x00A0,0x0097,0x008E,0x0086,0x007F,0x00F0,0x00E2}
+	{0x06B0, 0x0650, 0x05F4, 0x05A0, 0x054C, 0x0500, 0x04B8, 0x0474, 0x0434, 0x03F8, 0x03C0, 0x0388},
+	{0x0358, 0x0328, 0x02FA, 0x02D0, 0x02A6, 0x0280, 0x025C, 0x023A, 0x021A, 0x01FC, 0x01E0, 0x01C4},
+	{0x01AC, 0x0194, 0x017D, 0x0168, 0x0153, 0x0140, 0x012E, 0x011D, 0x010D, 0x00FE, 0x00F0, 0x00E2},
+	{0x00D6, 0x00CA, 0x00BE, 0x00B4, 0x00A9, 0x00A0, 0x0097, 0x008E, 0x0086, 0x007F, 0x00F0, 0x00E2}
 };
 
 Player_V3A::Player_V3A(ScummEngine *scumm) {
@@ -206,7 +206,7 @@
 		_wavetable[i] = NULL;
 		_isinit = true;
 	}
-	
+
 	if (getSoundStatus(nr))
 		stopSound(nr);	// if a sound is playing, restart it
 	

Index: player_v3a.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v3a.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- player_v3a.h	5 Oct 2003 17:32:38 -0000	1.14
+++ player_v3a.h	8 Nov 2003 21:59:32 -0000	1.15
@@ -55,21 +55,18 @@
 		V3A_MAXSFX = 8
 	};
 
-	struct musChan
-	{
+	struct musChan {
 		int id;
 		int dur;
 	};
 
-	struct sfxChan
-	{
+	struct sfxChan {
 		int id;
 		int dur;
 		// SFX will eventually have pitch bends
 	};
 
-	struct instData
-	{
+	struct instData {
 		char *_idat[6];
 		uint16 _ilen[6];
 		char *_ldat[6];

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -d -r1.171 -r1.172
--- resource.cpp	7 Nov 2003 02:11:41 -0000	1.171
+++ resource.cpp	8 Nov 2003 21:59:32 -0000	1.172
@@ -1297,78 +1297,76 @@
 			if (instr[i*16 + 13])
 				warning("Sound %d instrument %d uses percussion", idx, i);
 
-			debug(4, "Sound %d: instrument %d on channel %d.", 
-				  idx, i, ch);
-			
-			memcpy(ptr, ADLIB_INSTR_MIDI_HACK, 
-				   sizeof(ADLIB_INSTR_MIDI_HACK));
+			debug(4, "Sound %d: instrument %d on channel %d.", idx, i, ch);
+
+			memcpy(ptr, ADLIB_INSTR_MIDI_HACK, sizeof(ADLIB_INSTR_MIDI_HACK));
 
 			ptr[5]  += ch;
 			ptr[28] += ch;
 			ptr[92] += ch;
-			
+
 			/* flags_1 */
 			ptr[30 + 0] = (instr[i * 16 + 3] >> 4) & 0xf;
 			ptr[30 + 1] = instr[i * 16 + 3] & 0xf;
-			
+
 			/* oplvl_1 */
 			ptr[30 + 2] = (instr[i * 16 + 4] >> 4) & 0xf;
 			ptr[30 + 3] = instr[i * 16 + 4] & 0xf;
-			
+
 			/* atdec_1 */
 			ptr[30 + 4] = ((~instr[i * 16 + 5]) >> 4) & 0xf;
 			ptr[30 + 5] = (~instr[i * 16 + 5]) & 0xf;
-			
+
 			/* sustrel_1 */
 			ptr[30 + 6] = ((~instr[i * 16 + 6]) >> 4) & 0xf;
 			ptr[30 + 7] = (~instr[i * 16 + 6]) & 0xf;
-			
+
 			/* waveform_1 */
 			ptr[30 + 8] = (instr[i * 16 + 7] >> 4) & 0xf;
 			ptr[30 + 9] = instr[i * 16 + 7] & 0xf;
-			
+
 			/* flags_2 */
 			ptr[30 + 10] = (instr[i * 16 + 8] >> 4) & 0xf;
 			ptr[30 + 11] = instr[i * 16 + 8] & 0xf;
-			
+
 			/* oplvl_2 */
 			ptr[30 + 12] = (instr[i * 16 + 9] >> 4) & 0xf;
 			ptr[30 + 13] = instr[i * 16 + 9] & 0xf;
-			
+
 			/* atdec_2 */
 			ptr[30 + 14] = ((~instr[i * 16 + 10]) >> 4) & 0xf;
 			ptr[30 + 15] = (~instr[i * 16 + 10]) & 0xf;
-			
+
 			/* sustrel_2 */
 			ptr[30 + 16] = ((~instr[i * 16 + 11]) >> 4) & 0xf;
 			ptr[30 + 17] = (~instr[i * 16 + 11]) & 0xf;
-			
+
 			/* waveform_2 */
 			ptr[30 + 18] = (instr[i * 16 + 12] >> 4) & 0xf;
 			ptr[30 + 19] = instr[i * 16 + 12] & 0xf;
-			
+
 			/* feedback */
 			ptr[30 + 20] = (instr[i * 16 + 2] >> 4) & 0xf;
 			ptr[30 + 21] = instr[i * 16 + 2] & 0xf;
 			ptr += sizeof(ADLIB_INSTR_MIDI_HACK);
 		}
-		
+
 		// There is a constant delay of ppqn/3 before the music starts.
 		if (ppqn / 3 >= 128)
 			*ptr++ = (ppqn / 3 >> 7) | 0x80;
 		*ptr++ = ppqn / 3 & 0x7f;
-		
+
 		// Now copy the actual music data 
 		memcpy(ptr, track, size);
 		ptr += size;
-		
+
 		if (!play_once) {
 			// The song is meant to be looped. We achieve this by inserting just
 			// before the song end a jump to the song start. More precisely we abuse
 			// a S&M sysex, "maybe_jump" to achieve this effect. We could also
 			// use a set_loop sysex, but it's a bit longer, a little more complicated,
 			// and has no advantage either.
-			
+
 			// First, find the track end
 			byte *end = ptr;
 			ptr -= size;
@@ -1377,7 +1375,7 @@
 					break;
 			}
 			assert(ptr < end);
-			
+
 			// Now insert the jump. The jump offset is measured in ticks.
 			// We have ppqn/3 ticks before the first note.
 
@@ -1399,16 +1397,16 @@
 		 * tracks.
 		 */
 		ptr = writeMIDIHeader(ptr, "ASFX", ppqn, total_size);
-	
+
 		byte current_instr[3][14];
 		int  current_note[3];
 		int track_time[3];
 		byte *track_data[3];
-	
+
 		int track_ctr = 0;
 		byte chunk_type = 0;
 		int delay, delay2, olddelay;
-	
+
 		// Write a tempo change Meta event
 		// 473 / 4 Hz, convert to micro seconds.
 		dw = 1000000 * ppqn * 4 / 473;
@@ -1416,7 +1414,7 @@
 		*ptr++ = (byte)((dw >> 16) & 0xFF);
 		*ptr++ = (byte)((dw >> 8) & 0xFF);
 		*ptr++ = (byte)(dw & 0xFF);
-	
+
 		for (i = 0; i < 3; i++) {
 			track_time[i] = -1;
 			current_note[i] = -1;
@@ -1445,7 +1443,7 @@
 				break;
 			src_ptr++;
 		}
-		
+
 		int curtime = 0;
 		for (;;) {
 			int mintime = -1;
@@ -1459,11 +1457,10 @@
 			}
 			if (mintime < 0)
 				break;
-	
+
 			src_ptr = track_data[ch];
 			chunk_type = *src_ptr;
-	
-	
+
 			if (current_note[ch] >= 0) {
 				delay = mintime - curtime;
 				curtime = mintime;
@@ -1473,71 +1470,70 @@
 				*ptr++ = 0;
 				current_note[ch] = -1;
 			}
-			
-	
+
 			switch (chunk_type) {
 			case 1:
 				/* Instrument definition */
-				memcpy(current_instr[ch], src_ptr+1, 14);
+				memcpy(current_instr[ch], src_ptr + 1, 14);
 				src_ptr += 15;
 				break;
-	
+
 			case 2:
 				/* tone/parammodulation */
 				memcpy(ptr, ADLIB_INSTR_MIDI_HACK, 
 					   sizeof(ADLIB_INSTR_MIDI_HACK));
-				
+
 				ptr[5]  += ch;
 				ptr[28] += ch;
 				ptr[92] += ch;
-	
+
 				/* flags_1 */
 				ptr[30 + 0] = (current_instr[ch][3] >> 4) & 0xf;
 				ptr[30 + 1] = current_instr[ch][3] & 0xf;
-				
+
 				/* oplvl_1 */
 				ptr[30 + 2] = (current_instr[ch][4] >> 4) & 0xf;
 				ptr[30 + 3] = current_instr[ch][4] & 0xf;
-				
+
 				/* atdec_1 */
 				ptr[30 + 4] = ((~current_instr[ch][5]) >> 4) & 0xf;
 				ptr[30 + 5] = (~current_instr[ch][5]) & 0xf;
-				
+
 				/* sustrel_1 */
 				ptr[30 + 6] = ((~current_instr[ch][6]) >> 4) & 0xf;
 				ptr[30 + 7] = (~current_instr[ch][6]) & 0xf;
-					
+
 				/* waveform_1 */
 				ptr[30 + 8] = (current_instr[ch][7] >> 4) & 0xf;
 				ptr[30 + 9] = current_instr[ch][7] & 0xf;
-					
+
 				/* flags_2 */
 				ptr[30 + 10] = (current_instr[ch][8] >> 4) & 0xf;
 				ptr[30 + 11] = current_instr[ch][8] & 0xf;
-				
+
 				/* oplvl_2 */
 				ptr[30 + 12] = ((current_instr[ch][9]) >> 4) & 0xf;
 				ptr[30 + 13] = (current_instr[ch][9]) & 0xf;
-				
+
 				/* atdec_2 */
 				ptr[30 + 14] = ((~current_instr[ch][10]) >> 4) & 0xf;
 				ptr[30 + 15] = (~current_instr[ch][10]) & 0xf;
-				
+
 				/* sustrel_2 */
 				ptr[30 + 16] = ((~current_instr[ch][11]) >> 4) & 0xf;
 				ptr[30 + 17] = (~current_instr[ch][11]) & 0xf;
-				
+
 				/* waveform_2 */
 				ptr[30 + 18] = (current_instr[ch][12] >> 4) & 0xf;
 				ptr[30 + 19] = current_instr[ch][12] & 0xf;
-				
+
 				/* feedback */
 				ptr[30 + 20] = (current_instr[ch][2] >> 4) & 0xf;
 				ptr[30 + 21] = current_instr[ch][2] & 0xf;
-	
+
 				delay = mintime - curtime;
 				curtime = mintime;
-	
+
 				{
 					delay = convert_extraflags(ptr + 30 + 22, src_ptr + 1);
 					delay2 = convert_extraflags(ptr + 30 + 40, src_ptr + 6);
@@ -1547,17 +1543,17 @@
 					if (delay == -1)
 						delay = 0;
 				}
-								
+
 				/* duration */
 				ptr[30 + 58] = 0; // ((delay * 17 / 63) >> 4) & 0xf;
 				ptr[30 + 59] = 0; // (delay * 17 / 63) & 0xf;
-					
+
 				ptr += sizeof(ADLIB_INSTR_MIDI_HACK);
-	
+
 				olddelay = mintime - curtime;
 				curtime = mintime;
 				ptr = writeVLQ(ptr, olddelay);
-	
+
 				{
 					int freq = ((current_instr[ch][1] & 3) << 8)
 						| current_instr[ch][0];
@@ -1580,22 +1576,22 @@
 						note = 1;
 					else if (note > 127)
 						note = 127;
-					
+
 					// Insert a note on event 
 					*ptr++ = 0x90 + ch; // key on channel
 					*ptr++ = note;
 					*ptr++ = 63;
 					current_note[ch] = note;
-					track_time[ch] = curtime + delay;				
+					track_time[ch] = curtime + delay;
 				}
 				src_ptr += 11;
 				break;
-				
+
 			case 0x80:
 				track_time[ch] = -1;
 				src_ptr ++;
 				break;
-				
+
 			default:
 				track_time[ch] = -1;
 			}
@@ -1645,10 +1641,9 @@
 	} else {
 		total_size = size = _fileHandle.readUint32LE();
 		tag = _fileHandle.readUint16LE();
-		debug(4, "  tag='%c%c', size=%d",
-		      (char) (tag & 0xff),
-		      (char) ((tag >> 8) & 0xff), size);
-		
+		debug(4, "  tag='%c%c', size=%d", (char) (tag & 0xff),
+				(char) ((tag >> 8) & 0xff), size);
+
 		if (tag == 0x4F52) { // RO
 			ro_offs = _fileHandle.pos();
 			ro_size = size;
@@ -1657,11 +1652,10 @@
 			while (pos < total_size) {
 				size = _fileHandle.readUint32LE();
 				tag = _fileHandle.readUint16LE();
-				debug(4, "  tag='%c%c', size=%d",
-				      (char) (tag & 0xff),
-				      (char) ((tag >> 8) & 0xff), size);
+				debug(4, "  tag='%c%c', size=%d", (char) (tag & 0xff),
+						(char) ((tag >> 8) & 0xff), size);
 				pos += size;
-			
+
 				// MI1 and Indy3 uses one or more nested SO resources, which contains AD and WA
 				// resources.
 				if ((tag == 0x4441) && !(ad_offs)) { // AD
@@ -1725,7 +1719,6 @@
 	return 0;
 }
 
-
 int ScummEngine::getResourceRoomNr(int type, int idx) {
 	if (type == rtRoom)
 		return idx;
@@ -1888,16 +1881,12 @@
 	if (!validateResource("Locking", type, i))
 		return;
 	res.flags[type][i] |= RF_LOCK;
-
-//  debug(1, "locking %d,%d", type, i);
 }
 
 void ScummEngine::unlock(int type, int i) {
 	if (!validateResource("Unlocking", type, i))
 		return;
 	res.flags[type][i] &= ~RF_LOCK;
-
-//  debug(1, "unlocking %d,%d", type, i);
 }
 
 bool ScummEngine::isResourceInUse(int type, int i) const {
@@ -1939,8 +1928,6 @@
 	byte best_counter;
 	int best_type, best_res = 0;
 	uint32 oldAllocatedSize;
-
-//  return;
 
 	if (_expire_counter != 0xFF) {
 		_expire_counter = 0xFF;

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.209
retrieving revision 2.210
diff -u -d -r2.209 -r2.210
--- script_v2.cpp	29 Oct 2003 10:24:03 -0000	2.209
+++ script_v2.cpp	8 Nov 2003 21:59:32 -0000	2.210
@@ -421,7 +421,7 @@
 		if (_demoMode && _actorToPrintStrFor == 0xFF)
 			_string[textSlot].color = 1;
 		else if (_actorToPrintStrFor != 0xFF) 
-			_string[textSlot].color =  v1_mm_actor_speech_color[_actorToPrintStrFor];
+			_string[textSlot].color = v1_mm_actor_speech_color[_actorToPrintStrFor];
 	}
 
 	_messagePtr = buffer;
@@ -674,7 +674,7 @@
 		_string[0].color = arg;
 		return;
 	}
-	
+
 	a = derefActor(act, "actorSet");
 
 	switch (_opcode) {
@@ -801,7 +801,7 @@
 		_verbs[slot].curmode = state;
 
 		break;
-	
+
 	default: {	// New Verb
 		int x = fetchScriptByte() << 3;
 		int y = fetchScriptByte() << 3;
@@ -888,7 +888,7 @@
 	st->objectB = getVarOrDirectWord(0x20);
 	st->preposition = (st->objectB != 0);
 	st->freezeCount = 0;
-	
+
 	// Execute or print the sentence
 	_opcode = fetchScriptByte();
 	switch(_opcode) {
@@ -908,7 +908,7 @@
 				VAR(VAR_ACTIVE_VERB) = st->verb;
 				VAR(VAR_ACTIVE_OBJECT1) = st->objectA;	
 				VAR(VAR_ACTIVE_OBJECT2) = st->objectB;
-				
+
 				isBackgroundScript = false;
 				isSpecialVerb = false;
 			} else {
@@ -926,7 +926,7 @@
 			int slot = -1;
 			ScriptSlot *ss;
 			int i;
-		
+
 			ss = vm.slot;
 			for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) {
 				if (st->objectA == ss->number &&
@@ -944,7 +944,7 @@
 	case 2:
 		// Print the sentence
 		_sentenceNum--;
-		
+
 		VAR(VAR_SENTENCE_VERB) = st->verb;
 		VAR(VAR_SENTENCE_OBJECT1) = st->objectA;
 		VAR(VAR_SENTENCE_OBJECT2) = st->objectB;
@@ -960,7 +960,7 @@
 	Common::Rect sentenceline;
 	static char sentence[256];
 	const byte *temp;
-	int slot = getVerbSlot(VAR(VAR_SENTENCE_VERB),0);
+	int slot = getVerbSlot(VAR(VAR_SENTENCE_VERB), 0);
 
 	if (!(_userState & 32))
 		return;
@@ -983,7 +983,7 @@
 			if (_verbs[slot].prep == 0xFF) {
 				byte *ptr = getOBCDFromObject(VAR(VAR_SENTENCE_OBJECT1));
 				assert(ptr);
-				VAR(VAR_SENTENCE_PREPOSITION) = (*(ptr+12) >> 5);
+				VAR(VAR_SENTENCE_PREPOSITION) = (*(ptr + 12) >> 5);
 			} else
 				VAR(VAR_SENTENCE_PREPOSITION) = _verbs[slot].prep;
 		}
@@ -1360,16 +1360,16 @@
 	vm.cutSceneData[1] = (int16)VAR(VAR_CURSORSTATE);
 	vm.cutSceneData[2] = _currentRoom;
 	vm.cutSceneData[3] = camera._mode;
-	
+
 	VAR(VAR_CURSORSTATE) = 200;
-	
+
 	// FIXME allows quotes script (173) to start during introudction of
 	// demo mode of V1 Maniac Mansion. setUserState was halting script
 	// 173 before it started.
 	if (!(_gameId == GID_MANIAC && _version == 1 && _demoMode))
 	// Hide inventory, freeze scripts, hide cursor
 	setUserState(15);
-	
+
 	_sentenceNum = 0;
 	stopScript(SENTENCE_SCRIPT);
 	resetSentence();
@@ -1496,7 +1496,7 @@
 	if (cmd & 0xFF) {
 		VAR(VAR_CURSORSTATE) = cmd & 0xFF;
 	}
-	
+
 	setUserState(state);
 }
 

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.470
retrieving revision 2.471
diff -u -d -r2.470 -r2.471
--- scummvm.cpp	7 Nov 2003 02:11:41 -0000	2.470
+++ scummvm.cpp	8 Nov 2003 21:59:32 -0000	2.471
@@ -82,7 +82,7 @@
 	byte id, version;
 	int midi; // MidiDriverType values
 	uint32 features;
-	
+
 	GameSettings toGameSettings() const {
 		GameSettings dummy = { gameName, description, midi, features, 0 };
 		return dummy;
@@ -663,9 +663,8 @@
 	if (!_mixer->bindToSystem(syst)) {
 		warning("Sound mixer initialization failed");
 		if (_midiDriver == MD_ADLIB ||
-		    _midiDriver == MD_PCSPK ||
-		    _midiDriver == MD_PCJR)
-		{
+				_midiDriver == MD_PCSPK ||
+				_midiDriver == MD_PCJR)	{
 			_midiDriver = MD_NULL;
 			warning("MIDI driver depends on sound mixer, switching to null MIDI driver");
 		}
@@ -792,9 +791,9 @@
 
 ScummEngine::~ScummEngine() {
 	_mixer->stopAll();
-	
+
 	delete [] _actors;
-	
+
 	delete _2byteFontPtr;
 	delete _charset;
 	delete _pauseDialog;

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.268
retrieving revision 1.269
diff -u -d -r1.268 -r1.269
--- sound.cpp	17 Oct 2003 16:39:32 -0000	1.268
+++ sound.cpp	8 Nov 2003 21:59:32 -0000	1.269
@@ -487,12 +487,12 @@
 				}
 			}
 		}
-		
+
 		if (finished && _scumm->_talkDelay == 0) {
 			_scumm->stopTalk();
 		}
 	}
-		
+
 	if (_sfxMode & 1) {
 		if (isSfxFinished()) {
 			_sfxMode &= ~1;
@@ -615,7 +615,7 @@
 
 	if (sound == _currentCDSound)
 		return pollCD();
-	
+
 	if (_scumm->_features & GF_HUMONGOUS) {
 		if (sound == -2) {
 			return isSfxFinished();
@@ -626,7 +626,7 @@
 			return _scumm->_imuse->getSoundStatus(sound);
 		}
 	}
-	
+
 	if (isSoundInQueue(sound))
 		return 1;
 
@@ -1632,7 +1632,7 @@
 		// FIXME: Using _size here is a problem if offset (or equivalently
 		// startFrame) is non-zero.
 		mad_timer_set(&durationTime, (_size * 8) / _mad_header.bitrate,
-		              (_size * 8) % _mad_header.bitrate, _mad_header.bitrate);
+					(_size * 8) % _mad_header.bitrate, _mad_header.bitrate);
 	} else {
 		mad_timer_set(&durationTime, duration / 75, duration % 75, 75);
 	}
@@ -1680,8 +1680,7 @@
 	ov_time_seek(&_ov_file, startFrame / 75.0);
 #endif
 	return mixer->playVorbis(handle, &_ov_file,
-				 duration * ov_info(&_ov_file, -1)->rate / 75,
-				 true);
+							duration * ov_info(&_ov_file, -1)->rate / 75, true);
 }
 
 VorbisTrackInfo::~VorbisTrackInfo() {

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.164
retrieving revision 1.165
diff -u -d -r1.164 -r1.165
--- string.cpp	2 Nov 2003 02:18:16 -0000	1.164
+++ string.cpp	8 Nov 2003 21:59:32 -0000	1.165
@@ -592,8 +592,7 @@
 	_msgPtrToAdd += sprintf((char *)_msgPtrToAdd, "%d", num);
 }
 
-void ScummEngine::addVerbToStack(int var)
-{
+void ScummEngine::addVerbToStack(int var) {
 	int num, k;
 
 	num = readVar(var);
@@ -611,8 +610,7 @@
 	}
 }
 
-void ScummEngine::addNameToStack(int var)
-{
+void ScummEngine::addNameToStack(int var) {
 	int num;
 	const byte *ptr = 0;
 
@@ -725,8 +723,8 @@
 			if (c != 0 && c != 0xFF) {
 				_charset->_left = _charset->_nextLeft;
 				_charset->_top = _charset->_nextTop;
- 				if (c >= 0x80 && _CJKMode)
- 					c += *buf++ * 256;
+				if (c >= 0x80 && _CJKMode)
+					c += *buf++ * 256;
 				_charset->printChar(c);
 				_charset->_nextLeft = _charset->_left;
 				_charset->_nextTop = _charset->_top;





More information about the Scummvm-git-logs mailing list