[Scummvm-cvs-logs] SF.net SVN: scummvm:[39395] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sat Mar 14 16:34:28 CET 2009


Revision: 39395
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39395&view=rev
Author:   peres001
Date:     2009-03-14 15:34:28 +0000 (Sat, 14 Mar 2009)

Log Message:
-----------
Fixed building on 64-bit architectures.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parser_ns.cpp
    scummvm/trunk/engines/parallaction/sound.h
    scummvm/trunk/engines/parallaction/sound_ns.cpp

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2009-03-14 15:09:31 UTC (rev 39394)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2009-03-14 15:34:28 UTC (rev 39395)
@@ -142,7 +142,7 @@
 
 void Parallaction::pauseEngineIntern(bool pause) {
 	if (_soundMan) {
-		_soundMan->execute(SC_PAUSE, (SoundManCommandParameter)pause);
+		_soundMan->execute(SC_PAUSE, pause);
 	}
 }
 
@@ -635,10 +635,10 @@
 		break;
 
 	case kZoneHear:
-		_soundMan->execute(SC_SETSFXCHANNEL, (SoundManCommandParameter)z->u.hear->_channel);
-		_soundMan->execute(SC_SETSFXLOOPING, (SoundManCommandParameter)((z->_flags & kFlagsLooping) == kFlagsLooping));
-		_soundMan->execute(SC_SETSFXVOLUME, (SoundManCommandParameter)60);
-		_soundMan->execute(SC_PLAYSFX, (SoundManCommandParameter)z->u.hear->_name);		
+		_soundMan->execute(SC_SETSFXCHANNEL, z->u.hear->_channel);
+		_soundMan->execute(SC_SETSFXLOOPING, ((z->_flags & kFlagsLooping) == kFlagsLooping));
+		_soundMan->execute(SC_SETSFXVOLUME, 60);
+		_soundMan->execute(SC_PLAYSFX, z->u.hear->_name);		
 		break;
 
 	case kZoneSpeak:
@@ -984,10 +984,10 @@
 }
 
 void Parallaction::beep() {
-	_soundMan->execute(SC_SETSFXCHANNEL, (SoundManCommandParameter)3);	
-	_soundMan->execute(SC_SETSFXVOLUME, (SoundManCommandParameter)127);	
-	_soundMan->execute(SC_SETSFXLOOPING, (SoundManCommandParameter)false);	
-	_soundMan->execute(SC_PLAYSFX,  (SoundManCommandParameter)"beep");
+	_soundMan->execute(SC_SETSFXCHANNEL, 3);	
+	_soundMan->execute(SC_SETSFXVOLUME, 127);	
+	_soundMan->execute(SC_SETSFXLOOPING, 0);	
+	_soundMan->execute(SC_PLAYSFX, "beep");
 }
 
 void Parallaction::scheduleLocationSwitch(const char *location) {

Modified: scummvm/trunk/engines/parallaction/parser_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parser_ns.cpp	2009-03-14 15:09:31 UTC (rev 39394)
+++ scummvm/trunk/engines/parallaction/parser_ns.cpp	2009-03-14 15:34:28 UTC (rev 39395)
@@ -1089,7 +1089,7 @@
 	debugC(7, kDebugParser, "LOCATION_PARSER(music) ");
 
 	if (_vm->getPlatform() == Common::kPlatformAmiga)
-		_vm->_soundMan->execute(SC_SETMUSICFILE, (SoundManCommandParameter)_tokens[1]);
+		_vm->_soundMan->execute(SC_SETMUSICFILE, _tokens[1]);
 }
 
 void LocationParser_ns::parse(Script *script) {

Modified: scummvm/trunk/engines/parallaction/sound.h
===================================================================
--- scummvm/trunk/engines/parallaction/sound.h	2009-03-14 15:09:31 UTC (rev 39394)
+++ scummvm/trunk/engines/parallaction/sound.h	2009-03-14 15:34:28 UTC (rev 39395)
@@ -43,11 +43,9 @@
 class Parallaction_ns;
 class MidiPlayer;
 
-typedef void* SoundManCommandParameter;
-
 class SoundManImpl {
 public:
-	virtual void execute(int command, SoundManCommandParameter parm) = 0;
+	virtual void execute(int command, const char *parm = 0) = 0;
 	virtual ~SoundManImpl() { }
 };
 
@@ -56,7 +54,15 @@
 public:
 	SoundMan(SoundManImpl *impl) : _impl(impl) { }
 	virtual ~SoundMan() { delete _impl; }
-	void execute(int command, SoundManCommandParameter parm = 0) {
+	void execute(int command, bool parm) {
+		execute(command, parm ? "1" : "0");
+	}
+	void execute(int command, int32 parm) {
+		char n[12];
+		sprintf(n, "%i", parm);
+		execute(command, n);
+	}
+	void execute(int command, const char *parm = 0) {
 		if (_impl) {
 			_impl->execute(command, parm);
 		}
@@ -111,7 +117,7 @@
 	virtual void playCharacterMusic(const char *character) = 0;
 	virtual void playLocationMusic(const char *location) = 0;
 	virtual void pause(bool p) { }
-	virtual void execute(int command, SoundManCommandParameter parm = 0);
+	virtual void execute(int command, const char *parm);
 
 	void setMusicVolume(int value);
 };
@@ -168,7 +174,7 @@
 
 class DummySoundMan : public SoundManImpl {
 public:	
-	void execute(int command, SoundManCommandParameter parm) { }
+	void execute(int command, const char *parm) { }
 };
 
 } // namespace Parallaction

Modified: scummvm/trunk/engines/parallaction/sound_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/sound_ns.cpp	2009-03-14 15:09:31 UTC (rev 39394)
+++ scummvm/trunk/engines/parallaction/sound_ns.cpp	2009-03-14 15:34:28 UTC (rev 39395)
@@ -477,42 +477,45 @@
 	strcpy(_musicFile, filename);
 }
 
-void SoundMan_ns::execute(int command, SoundManCommandParameter parm) {
+void SoundMan_ns::execute(int command, const char *parm = 0) {
+	uint32 n = strtoul(parm, 0, 10);
+	bool b = (n == 1) ? true : false;
+	
 	switch (command) {
 	case SC_PLAYMUSIC:
-		if (_musicType == MUSIC_CHARACTER) playCharacterMusic((const char*)parm);
-		else if (_musicType == MUSIC_LOCATION) playLocationMusic((const char*)parm);
+		if (_musicType == MUSIC_CHARACTER) playCharacterMusic(parm);
+		else if (_musicType == MUSIC_LOCATION) playLocationMusic(parm);
 		else playMusic();
 		break;
 	case SC_STOPMUSIC:
 		stopMusic();
 		break;
 	case SC_SETMUSICTYPE:
-		_musicType = (int)parm;			
+		_musicType = n;			
 		break;
 	case SC_SETMUSICFILE:
-		setMusicFile((const char*)parm);
+		setMusicFile(parm);
 		break;
 	
 	case SC_PLAYSFX:
-		playSfx((const char*)parm, _sfxChannel, _sfxLooping, _sfxVolume);
+		playSfx(parm, _sfxChannel, _sfxLooping, _sfxVolume);
 		break;	
 	case SC_STOPSFX:
-		stopSfx((int)parm);
+		stopSfx(n);
 		break;
 	
 	case SC_SETSFXCHANNEL:
-		_sfxChannel = (uint)parm;
+		_sfxChannel = n;
 		break;
 	case SC_SETSFXLOOPING:
-		_sfxLooping = (bool)parm;
+		_sfxLooping = b;
 		break;
 	case SC_SETSFXVOLUME:
-		_sfxVolume = (int)parm;
+		_sfxVolume = n;
 		break;
 	
 	case SC_PAUSE:
-		pause((bool)parm);
+		pause(b);
 		break;
 	}
 }


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