[Scummvm-git-logs] scummvm master -> eafa56daf0e159592a9476b803c12ec17da17eb1

sev- sev at scummvm.org
Sat Feb 11 23:21:27 CET 2017


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

Summary:
8b043bc731 DIRECTOR: Lingo: Simplfy movie presense check in 'go to movie'
eafa56daf0 JANITORIAL: Formatting fixes


Commit: 8b043bc7316b27c1d44d9e68111335346134cbeb
    https://github.com/scummvm/scummvm/commit/8b043bc7316b27c1d44d9e68111335346134cbeb
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-02-11T23:23:56+01:00

Commit Message:
DIRECTOR: Lingo: Simplfy movie presense check in 'go to movie'

Changed paths:
    engines/director/lingo/lingo-funcs.cpp


diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp
index 4bd8590..95a7506 100644
--- a/engines/director/lingo/lingo-funcs.cpp
+++ b/engines/director/lingo/lingo-funcs.cpp
@@ -180,19 +180,23 @@ void Lingo::func_goto(Datum &frame, Datum &movie) {
 	if (movie.type != VOID) {
 		movie.toString();
 
-		Common::File file;
-
-		if (!file.open(*movie.u.s)) {
-			if (_vm->getPlatform() == Common::kPlatformMacintosh) {
-				Common::MacResManager resMan;
-				if (!resMan.open(*movie.u.s)) {
-					warning("Movie %s does not exist", movie.u.s->c_str());
-					return;
-				}
-			} else {
-				warning("Movie %s does not exist", movie.u.s->c_str());
-				return;
+		bool fileExists = false;
+
+		if (_vm->getPlatform() == Common::kPlatformMacintosh) {
+			Common::MacResManager resMan;
+			if (resMan.open(*movie.u.s)) {
+				fileExists = true;
 			}
+		} else {
+			Common::File file;
+			if (file.open(*movie.u.s)) {
+				fileExists = true;
+			}
+		}
+
+		if (!fileExists) {
+			warning("Movie %s does not exist", movie.u.s->c_str());
+			return;
 		}
 
 		_vm->_nextMovie = *movie.u.s;


Commit: eafa56daf0e159592a9476b803c12ec17da17eb1
    https://github.com/scummvm/scummvm/commit/eafa56daf0e159592a9476b803c12ec17da17eb1
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-02-11T23:23:56+01:00

Commit Message:
JANITORIAL: Formatting fixes

Changed paths:
    engines/director/archive.cpp
    engines/director/cast.cpp
    engines/director/frame.cpp
    engines/director/images.cpp
    engines/director/lingo/lingo-codegen.cpp
    engines/director/lingo/lingo-funcs.cpp
    engines/director/score.cpp


diff --git a/engines/director/archive.cpp b/engines/director/archive.cpp
index 496f47c..c9b6cc1 100644
--- a/engines/director/archive.cpp
+++ b/engines/director/archive.cpp
@@ -411,7 +411,7 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
 			keyRes = &resources[resources.size() - 1];
 		else if (tag == MKTAG('C', 'A', 'S', '*'))
 			casRes = &resources[resources.size() - 1];
-		//or the children of
+		// or the children of
 		else if (tag == MKTAG('S', 'T', 'X', 'T') ||
 				 tag == MKTAG('B', 'I', 'T', 'D') ||
 				 tag == MKTAG('D', 'I', 'B', ' '))
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 453ca08..8b1e57c 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -118,13 +118,13 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
 		gutterSize = static_cast<SizeType>(stream.readByte());
 		boxShadow = static_cast<SizeType>(stream.readByte());
 		textType = static_cast<TextType>(stream.readByte());
-		textAlign = static_cast<TextAlignType>(stream.readSint16()); //this is because 'right' is -1? or should that be 255?
+		textAlign = static_cast<TextAlignType>(stream.readSint16()); // this is because 'right' is -1? or should that be 255?
 		stream.readUint16();
 		stream.readUint16();
 		stream.readUint16();
 		stream.readUint16();
 
-		fontId = 1; //this is in STXT
+		fontId = 1; // this is in STXT
 
 		initialRect = Score::readRect(stream);
 		stream.readUint16();
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index f6a16e6..3dcfd57 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -304,7 +304,7 @@ void Frame::readPaletteInfo(Common::SeekableSubReadStreamEndian &stream) {
 	_palette->flags = stream.readByte();
 	_palette->speed = stream.readByte();
 	_palette->frameCount = stream.readUint16();
-	stream.skip(8); //unknown
+	stream.skip(8); // unknown
 }
 
 void Frame::readSprite(Common::SeekableSubReadStreamEndian &stream, uint16 offset, uint16 size) {
@@ -552,7 +552,7 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) {
 					castType = kCastBitmap;
 					break;
 				case 0x02:
-				case 0x0c: //this is actually a mouse-over shape? I don't think it's a real button.
+				case 0x0c: // this is actually a mouse-over shape? I don't think it's a real button.
 					castType = kCastShape;
 					break;
 				case 0x07:
diff --git a/engines/director/images.cpp b/engines/director/images.cpp
index 7d5e089..53e91ac 100644
--- a/engines/director/images.cpp
+++ b/engines/director/images.cpp
@@ -301,7 +301,7 @@ bool BITDDecoderV4::loadStream(Common::SeekableReadStream &stream) {
 	}
 
 	int offset = 0;
-	if (_surface->w < (pixels.size() / _surface->h)) 
+	if (_surface->w < (pixels.size() / _surface->h))
 		offset = (pixels.size() / _surface->h) - _surface->w;
 
 	if (pixels.size() > 0) {
@@ -316,7 +316,7 @@ bool BITDDecoderV4::loadStream(Common::SeekableReadStream &stream) {
 				}
 
 				case 8:
-					//this calculation is wrong.. need a demo with colours.
+					// this calculation is wrong.. need a demo with colours.
 					*((byte *)_surface->getBasePtr(x, y)) = 0xff - pixels[(y * _surface->w) + x + (y * offset)];
 					x++;
 					break;
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp
index 9550167..0d771ec 100644
--- a/engines/director/lingo/lingo-codegen.cpp
+++ b/engines/director/lingo/lingo-codegen.cpp
@@ -229,8 +229,8 @@ void Lingo::define(Common::String &name, int start, int nargs, Common::String *p
 			_handlers[ENTITY_INDEX(_eventHandlerTypeIds[name.c_str()], _currentEntityId)] = sym;
 		}
 	} else {
-		//we don't want to be here. The getHandler call should have used the EntityId and the result
-		//should have been unique!
+		// we don't want to be here. The getHandler call should have used the EntityId and the result
+		// should have been unique!
 		warning("Redefining handler '%s'", name.c_str());
 		delete sym->u.defn;
 	}
diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp
index 95a7506..7056d9a 100644
--- a/engines/director/lingo/lingo-funcs.cpp
+++ b/engines/director/lingo/lingo-funcs.cpp
@@ -258,11 +258,11 @@ void Lingo::func_gotoprevious() {
 
 void Lingo::func_cursor(int c) {
 	if (_cursorOnStack) {
-		//pop cursor
+		// pop cursor
 		_vm->getMacWindowManager()->popCursor();
 	}
 
-	//and then push cursor.
+	// and then push cursor.
 	switch (c) {
 	case 0:
 	case -1:
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index fbb89e4..9cc108d 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -420,7 +420,7 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
 			ci->type = castStrings[4];
 
 			if (!ci->script.empty()) {
-				//the script type here could be wrong!
+				// the script type here could be wrong!
 				if (ConfMan.getBool("dump_scripts"))
 					dumpScript(ci->script.c_str(), kCastScript, id);
 
@@ -649,12 +649,12 @@ int Score::getCurrentLabelNumber() {
 }
 
 void Score::gotoNext() {
-	//we can just try to use the current frame and get the next label
+	// we can just try to use the current frame and get the next label
 	_currentFrame = getNextLabelNumber(_currentFrame);
 }
 
 void Score::gotoPrevious() {
-	//we actually need the frame of the label prior to the most recent label.
+	// we actually need the frame of the label prior to the most recent label.
 	_currentFrame = getPreviousLabelNumber(getCurrentLabelNumber());
 }
 





More information about the Scummvm-git-logs mailing list