[Scummvm-cvs-logs] scummvm master -> cd085b1ae889dfa12d1b525810b218342c61a7a6

bluegr md5 at scummvm.org
Sun Apr 10 16:33:03 CEST 2011


This automated email contains information about 7 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d2d6c9e2ba MOHAWK: Silenced an MSVC waning about an uninitialized var (false positive)
3fde0306a4 TINSEL: Removed the useless LookAtBuffers() function
69ec4fbf1b TINSEL: Removed the dummy ForceEntireRedraw() function
b31f39e6c6 TINSEL: Changed cdFlags to be non-static and constant
d1c4b56223 TINSEL: Cleanup - removed obsolete defines
c89f2276d1 TINSEL: Merged NewName() inside DoSave() in order to remove a static var
cd085b1ae8 TINSEL: Removed some unused global static variables


Commit: d2d6c9e2ba934a600ad6061328cac982fa5e3f64
    https://github.com/scummvm/scummvm/commit/d2d6c9e2ba934a600ad6061328cac982fa5e3f64
Author: md5 (md5 at scummvm.org)
Date: 2011-04-10T04:27:45-07:00

Commit Message:
MOHAWK: Silenced an MSVC waning about an uninitialized var (false positive)

Changed paths:
    engines/mohawk/livingbooks_code.cpp



diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp
index 86adfd6..756d881 100644
--- a/engines/mohawk/livingbooks_code.cpp
+++ b/engines/mohawk/livingbooks_code.cpp
@@ -317,7 +317,7 @@ void LBCode::parseComparisons() {
 		error("comparison didn't get enough values");
 	LBValue val2 = _stack.pop();
 	LBValue val1 = _stack.pop();
-	bool result;
+	bool result = false;
 	// FIXME: should work for non-integers!!
 	switch (comparison) {
 	case kTokenEquals:


Commit: 3fde0306a44e1649d8922d59ea209a74736df8f2
    https://github.com/scummvm/scummvm/commit/3fde0306a44e1649d8922d59ea209a74736df8f2
Author: md5 (md5 at scummvm.org)
Date: 2011-04-10T04:27:46-07:00

Commit Message:
TINSEL: Removed the useless LookAtBuffers() function

Changed paths:
    engines/tinsel/bmv.cpp
    engines/tinsel/bmv.h



diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp
index 3f56288..a459f2c 100644
--- a/engines/tinsel/bmv.cpp
+++ b/engines/tinsel/bmv.cpp
@@ -1046,21 +1046,6 @@ void BMVPlayer::CopyMovieToScreen() {
 }
 
 /**
- * LookAtBuffers
- */
-void BMVPlayer::LookAtBuffers() {
-	// FIXME: What's the point of this function???
-	// Maybe to ensure the relevant data is loaded into cache by the CPU?
-	static int junk;	// FIXME: Avoid non-const global vars
-	int i;
-
-	if (bigBuffer) {
-		for (i = 0; i < NUM_SLOTS; i++)
-			junk += bigBuffer[i*SLOT_SIZE];
-	}
-}
-
-/**
  * Handles playback of any active movie. Called from the foreground 24 times a second.
  */
 void BMVPlayer::FettleBMV() {
@@ -1078,8 +1063,6 @@ void BMVPlayer::FettleBMV() {
 		return;
 	}
 
-	LookAtBuffers();
-
 	if (!stream.isOpen()) {
 		int i;
 
diff --git a/engines/tinsel/bmv.h b/engines/tinsel/bmv.h
index 2644504..99a43e0 100644
--- a/engines/tinsel/bmv.h
+++ b/engines/tinsel/bmv.h
@@ -151,7 +151,6 @@ private:
 	bool MaintainBuffer();
 	bool DoBMVFrame();
 	bool DoSoundFrame();
-	void LookAtBuffers();
 };
 
 


Commit: 69ec4fbf1be753f67c8de06fc9efc58786a255c3
    https://github.com/scummvm/scummvm/commit/69ec4fbf1be753f67c8de06fc9efc58786a255c3
Author: md5 (md5 at scummvm.org)
Date: 2011-04-10T04:27:47-07:00

Commit Message:
TINSEL: Removed the dummy ForceEntireRedraw() function

Changed paths:
    engines/tinsel/background.cpp
    engines/tinsel/background.h
    engines/tinsel/bmv.cpp



diff --git a/engines/tinsel/background.cpp b/engines/tinsel/background.cpp
index 560216a..f895ecd 100644
--- a/engines/tinsel/background.cpp
+++ b/engines/tinsel/background.cpp
@@ -39,9 +39,6 @@ namespace Tinsel {
 // current background
 const BACKGND *pCurBgnd = NULL;
 
-// FIXME: Not yet used
-static bool bEntireRedraw;
-
 /**
  * Called to initialise a background.
  * @param pBgnd			Pointer to data struct for current background
@@ -257,9 +254,4 @@ void DrawBackgnd() {
 	ResetClipRect();
 }
 
-void ForceEntireRedraw() {
-	bEntireRedraw = true;
-}
-
-
 } // End of namespace Tinsel
diff --git a/engines/tinsel/background.h b/engines/tinsel/background.h
index 81b4904..d0b27e6 100644
--- a/engines/tinsel/background.h
+++ b/engines/tinsel/background.h
@@ -110,8 +110,6 @@ OBJECT *GetBgObject();
 
 SCNHANDLE BgPal();
 
-void ForceEntireRedraw();
-
 int BgWidth();
 
 int BgHeight();
diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp
index a459f2c..b5b84ce 100644
--- a/engines/tinsel/bmv.cpp
+++ b/engines/tinsel/bmv.cpp
@@ -1025,7 +1025,6 @@ bool BMVPlayer::DoSoundFrame() {
 void BMVPlayer::CopyMovieToScreen() {
 	// Not if not up and running yet!
 	if (!screenBuffer || (currentFrame == 0)) {
-		ForceEntireRedraw();
 		DrawBackgnd();
 		return;
 	}


Commit: b31f39e6c6f97d8e05814ee9a14737580f96b94e
    https://github.com/scummvm/scummvm/commit/b31f39e6c6f97d8e05814ee9a14737580f96b94e
Author: md5 (md5 at scummvm.org)
Date: 2011-04-10T04:27:48-07:00

Commit Message:
TINSEL: Changed cdFlags to be non-static and constant

Changed paths:
    engines/tinsel/drives.cpp



diff --git a/engines/tinsel/drives.cpp b/engines/tinsel/drives.cpp
index 6e30caf..e6f5f1e 100644
--- a/engines/tinsel/drives.cpp
+++ b/engines/tinsel/drives.cpp
@@ -38,7 +38,6 @@ namespace Tinsel {
 // FIXME: Avoid non-const global vars
 
 char currentCD = '1';
-static uint32 cdFlags[] = { fCd1, fCd2, fCd3, fCd4, fCd5, fCd6, fCd7, fCd8 };
 
 static bool bChangingCD = false;
 static char nextCD = '\0';
@@ -75,6 +74,8 @@ int GetCurrentCD() {
 	return (currentCD - '1' + 1);
 }
 
+const uint32 cdFlags[] = { fCd1, fCd2, fCd3, fCd4, fCd5, fCd6, fCd7, fCd8 };
+
 void SetCD(int flags) {
 	if (flags & cdFlags[currentCD - '1'])
 		return;


Commit: d1c4b56223e0d586a4f5a9b21bbf7420bb194da7
    https://github.com/scummvm/scummvm/commit/d1c4b56223e0d586a4f5a9b21bbf7420bb194da7
Author: md5 (md5 at scummvm.org)
Date: 2011-04-10T04:27:49-07:00

Commit Message:
TINSEL: Cleanup - removed obsolete defines

Changed paths:
    engines/tinsel/dw.h



diff --git a/engines/tinsel/dw.h b/engines/tinsel/dw.h
index 8bd7ca1..aed4c50 100644
--- a/engines/tinsel/dw.h
+++ b/engines/tinsel/dw.h
@@ -42,8 +42,6 @@ typedef int HPOLYGON;
 #define	LF_CHAR			'\x0a'		// line feed
 
 // file names
-#define	SAMPLE_FILE		"english.smp"	// all samples
-#define	SAMPLE_INDEX		"english.idx"	// sample index filename
 #define	MIDI_FILE		"midi.dat"	// all MIDI sequences
 #define	INDEX_FILENAME		"index"		// name of index file
 #define PSX_INDEX_FILENAME	"index.dat" // name of index file in psx version


Commit: c89f2276d1b52a99f08861c5acd86fedb349c718
    https://github.com/scummvm/scummvm/commit/c89f2276d1b52a99f08861c5acd86fedb349c718
Author: md5 (md5 at scummvm.org)
Date: 2011-04-10T04:27:50-07:00

Commit Message:
TINSEL: Merged NewName() inside DoSave() in order to remove a static var

Changed paths:
    engines/tinsel/saveload.cpp



diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp
index c965666..3182593 100644
--- a/engines/tinsel/saveload.cpp
+++ b/engines/tinsel/saveload.cpp
@@ -77,9 +77,6 @@ SRSTATE SRstate = SR_IDLE;
 // in DOS_DW.C
 extern void syncSCdata(Common::Serializer &s);
 
-// in DOS_MAIN.C
-//char HardDriveLetter();
-
 // in PCODE.C
 extern void syncGlobInfo(Common::Serializer &s);
 
@@ -283,32 +280,6 @@ static void syncSavedData(Common::Serializer &s, SAVED_DATA &sd) {
 	}
 }
 
-
-/**
- * Called when saving a game to a new file.
- * Generates a new, unique, filename.
- */
-static char *NewName() {
-	static char result[FNAMELEN];	// FIXME: Avoid non-const global vars
-	int	i;
-	int	ano = 1;	// Allocated number
-
-	while (1) {
-		Common::String fname = _vm->getSavegameFilename(ano);
-		strcpy(result, fname.c_str());
-
-		for (i = 0; i < numSfiles; i++)
-			if (!strcmp(savedFiles[i].name, result))
-				break;
-
-		if (i == numSfiles)
-			break;
-		ano++;
-	}
-
-	return result;
-}
-
 /**
  * Compare two TimeDate structs to see which one was earlier.
  * Returns 0 if they are equal, a negative value if a is lower / first, and
@@ -498,19 +469,37 @@ static bool DoRestore() {
  */
 static void DoSave() {
 	Common::OutSaveFile *f;
-	const char *fname;
+	char tmpName[FNAMELEN];
 
 	// Next getList() must do its stuff again
 	NeedLoad = true;
 
-	if (SaveSceneName == NULL)
-		SaveSceneName = NewName();
+	if (SaveSceneName == NULL) {
+		// Generate a new unique save name	
+		int	i;
+		int	ano = 1;	// Allocated number
+
+		while (1) {
+			Common::String fname = _vm->getSavegameFilename(ano);
+			strcpy(tmpName, fname.c_str());
+
+			for (i = 0; i < numSfiles; i++)
+				if (!strcmp(savedFiles[i].name, tmpName))
+					break;
+
+			if (i == numSfiles)
+				break;
+			ano++;
+		}
+
+		SaveSceneName = tmpName;
+	}
+
+
 	if (SaveSceneDesc[0] == 0)
 		SaveSceneDesc = "unnamed";
 
-	fname = SaveSceneName;
-
-	f = _vm->getSaveFileMan()->openForSaving(fname);
+	f = _vm->getSaveFileMan()->openForSaving(SaveSceneName);
 	Common::Serializer s(0, f);
 
 	if (f == NULL)
@@ -537,12 +526,14 @@ static void DoSave() {
 
 	f->finalize();
 	delete f;
+	SaveSceneName = NULL;	// Invalidate save name
 	return;
 
 save_failure:
 	if (f) {
 		delete f;
-		_vm->getSaveFileMan()->removeSavefile(fname);
+		_vm->getSaveFileMan()->removeSavefile(SaveSceneName);
+		SaveSceneName = NULL;	// Invalidate save name
 	}
 	GUI::MessageDialog dialog("Failed to save game state to file.");
 	dialog.runModal();


Commit: cd085b1ae889dfa12d1b525810b218342c61a7a6
    https://github.com/scummvm/scummvm/commit/cd085b1ae889dfa12d1b525810b218342c61a7a6
Author: md5 (md5 at scummvm.org)
Date: 2011-04-10T07:27:48-07:00

Commit Message:
TINSEL: Removed some unused global static variables

Changed paths:
    engines/tinsel/handle.cpp
    engines/tinsel/music.cpp
    engines/tinsel/scene.cpp



diff --git a/engines/tinsel/handle.cpp b/engines/tinsel/handle.cpp
index a48fd2c..f2db42b 100644
--- a/engines/tinsel/handle.cpp
+++ b/engines/tinsel/handle.cpp
@@ -65,8 +65,6 @@ enum {
 	fLoaded		= 0x20000000L	///< set when file data has been loaded
 };
 #define	FSIZE_MASK	0x00FFFFFFL	///< mask to isolate the filesize
-#define	MALLOC_MASK	0xFF000000L	///< mask to isolate the memory allocation flags
-//#define	HANDLEMASK		0xFF800000L	///< get handle of address
 
 //----------------- LOCAL GLOBAL DATA --------------------
 
@@ -80,7 +78,6 @@ static uint numHandles = 0;
 
 static uint32 cdPlayHandle = (uint32)-1;
 
-static int	cdPlayFileNum, cdPlaySceneNum;
 static SCNHANDLE cdBaseHandle = 0, cdTopHandle = 0;
 static Common::File *cdGraphStream = 0;
 
@@ -235,7 +232,7 @@ void LoadCDGraphData(MEMHANDLE *pH) {
 	// clear the loading flag
 //	pH->filesize &= ~fLoading;
 
-	if (bytes != ((cdTopHandle-cdBaseHandle) & OFFSETMASK))
+	if (bytes != ((cdTopHandle - cdBaseHandle) & OFFSETMASK))
 		// file is corrupt
 		error(FILE_READ_ERROR, "CD play file");
 }
@@ -248,7 +245,7 @@ void LoadCDGraphData(MEMHANDLE *pH) {
  * @param next			Handle of end of range + 1
  */
 void LoadExtraGraphData(SCNHANDLE start, SCNHANDLE next) {
-	if (cdPlayFileNum == cdPlaySceneNum && start == cdBaseHandle)
+	if (start == cdBaseHandle)
 		return;
 
 	OpenCDGraphFile();
@@ -264,7 +261,6 @@ void LoadExtraGraphData(SCNHANDLE start, SCNHANDLE next) {
 }
 
 void SetCdPlaySceneDetails(int fileNum, const char *fileName) {
-	cdPlaySceneNum = fileNum;
 	strcpy(szCdPlayFile, fileName);
 }
 
diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp
index ea5d88c..dd5ca27 100644
--- a/engines/tinsel/music.cpp
+++ b/engines/tinsel/music.cpp
@@ -65,10 +65,6 @@ struct SOUND_BUFFER {
 
 // FIXME: Avoid non-const global vars
 
-// get set when music driver is installed
-//static MDI_DRIVER *mDriver;
-//static HSEQUENCE mSeqHandle;
-
 // MIDI buffer
 static SOUND_BUFFER midiBuffer = { 0, 0 };
 
@@ -152,8 +148,6 @@ bool PlayMidiSequence(uint32 dwFileOffset, bool bLoop) {
 
 	// the index and length of the last tune loaded
 	static uint32 dwLastMidiIndex = 0;	// FIXME: Avoid non-const global vars
-	//static uint32 dwLastSeqLen;
-
 	uint32 dwSeqLen = 0;	// length of the sequence
 
 	// Support for external music from the music enhancement project
diff --git a/engines/tinsel/scene.cpp b/engines/tinsel/scene.cpp
index 8f0f477..67e0ea9 100644
--- a/engines/tinsel/scene.cpp
+++ b/engines/tinsel/scene.cpp
@@ -112,15 +112,11 @@ struct ENTRANCE_STRUC {
 static bool ShowPosition = false;	// Set when showpos() has been called
 #endif
 
-SCNHANDLE newestScene = 0;
-
 int sceneCtr = 0;
 static int initialMyEscape;
 
 static SCNHANDLE SceneHandle = 0;	// Current scene handle - stored in case of Save_Scene()
 
-static bool bWatchingOut = false;
-
 SCENE_STRUC tempStruc;
 
 struct TP_INIT {
@@ -180,9 +176,6 @@ static void SceneTinselProcess(CORO_PARAM, const void *param) {
 		_ctx->myEscape);
 	CORO_INVOKE_1(Interpret, _ctx->pic);
 
-	if (_ctx->pInit->event == CLOSEDOWN || _ctx->pInit->event == LEAVE_T2)
-		bWatchingOut = false;
-
 	CORO_END_CODE;
 }
 
@@ -193,9 +186,6 @@ static void SceneTinselProcess(CORO_PARAM, const void *param) {
 void SendSceneTinselProcess(TINSEL_EVENT event) {
 	SCENE_STRUC	*ss;
 
-	if (event == CLOSEDOWN || event == LEAVE_T2)
-		bWatchingOut = true;
-
 	if (SceneHandle != (SCNHANDLE)NULL) {
 		ss = (SCENE_STRUC *) FindChunk(SceneHandle, CHUNK_SCENE);
 
@@ -206,11 +196,8 @@ void SendSceneTinselProcess(TINSEL_EVENT event) {
 			init.hTinselCode = ss->hSceneScript;
 
 			g_scheduler->createProcess(PID_TCODE, SceneTinselProcess, &init, sizeof(init));
-		} else if (event == CLOSEDOWN)
-			bWatchingOut = false;
+		}
 	}
-	else if (event == CLOSEDOWN)
-		bWatchingOut = false;
 }
 
 
@@ -249,9 +236,6 @@ static void LoadScene(SCNHANDLE scene, int entry) {
 	assert(ss != NULL);
 
 	if (TinselV2) {
-		// Handle to scene description
-		newestScene = FROM_LE_32(ss->hSceneDesc);
-
 		// Music stuff
 		char *cptr = (char *)FindChunk(scene, CHUNK_MUSIC_FILENAME);
 		assert(cptr);






More information about the Scummvm-git-logs mailing list