[Scummvm-git-logs] scummvm master -> 9cb608c70f4435339b3a820f9ce321b5784d0e0d

sev- sev at scummvm.org
Fri Mar 17 20:19:31 CET 2017


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

Summary:
7074c98e91 DIRECTOR: Improved debug output for resource loading
2dc77ededa DIRECTOR: More loading process debug info
444d193a36 DIRECTOR: Fix num to cast id for cast A11
0c91568753 DIRECTOR: More debug output for frame loading
595ea902bf DIRECTOR: The maximum cast num is H88, 512, not 513
9cb608c70f DIRECTOR: Lingo: Improved debug on event handling


Commit: 7074c98e915402e59313331543b1ab5ca8c1bbc4
    https://github.com/scummvm/scummvm/commit/7074c98e915402e59313331543b1ab5ca8c1bbc4
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-03-17T08:20:11Z

Commit Message:
DIRECTOR: Improved debug output for resource loading

Changed paths:
    engines/director/resource.cpp
    engines/director/score.cpp


diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index 62363bf..10e7d93 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -200,7 +200,7 @@ void DirectorEngine::loadMac(const Common::String movie) {
 void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
 	Archive *shardcst = createArchive();
 
-	debug(0, "Loading Shared cast '%s'", filename.c_str());
+	debug(0, "****** Loading Shared cast '%s'", filename.c_str());
 
 	_sharedDIB = new Common::HashMap<int, Common::SeekableSubReadStreamEndian *>;
 	_sharedSTXT = new Common::HashMap<int, Common::SeekableSubReadStreamEndian *>;
@@ -229,12 +229,16 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
 
 	Common::Array<uint16> cast = shardcst->getResourceIDList(MKTAG('C','A','S','t'));
 	if (cast.size() > 0) {
+		debug(0, "****** Loading %d CASt resources", cast.size());
+
 		for (Common::Array<uint16>::iterator iterator = cast.begin(); iterator != cast.end(); ++iterator)
 			_sharedScore->loadCastData(*shardcst->getResource(MKTAG('C','A','S','t'), *iterator), *iterator, NULL);
 	}
 
 	Common::Array<uint16> vwci = shardcst->getResourceIDList(MKTAG('V', 'W', 'C', 'I'));
 	if (vwci.size() > 0) {
+		debug(0, "****** Loading %d CastInfo resources", vwci.size());
+
 		for (Common::Array<uint16>::iterator iterator = vwci.begin(); iterator != vwci.end(); ++iterator)
 			_sharedScore->loadCastInfo(*shardcst->getResource(MKTAG('V', 'W', 'C', 'I'), *iterator), *iterator);
 	}
@@ -243,7 +247,7 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
 
 	Common::Array<uint16> dib = shardcst->getResourceIDList(MKTAG('D','I','B',' '));
 	if (dib.size() != 0) {
-		debugC(3, kDebugLoading, "Loading %d DIBs", dib.size());
+		debugC(3, kDebugLoading, "****** Loading %d DIBs", dib.size());
 
 		for (Common::Array<uint16>::iterator iterator = dib.begin(); iterator != dib.end(); ++iterator) {
 			debugC(3, kDebugLoading, "Shared DIB %d", *iterator);
@@ -253,7 +257,7 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
 
 	Common::Array<uint16> stxt = shardcst->getResourceIDList(MKTAG('S','T','X','T'));
 	if (stxt.size() != 0) {
-		debugC(3, kDebugLoading, "Loading %d STXTs", stxt.size());
+		debugC(3, kDebugLoading, "****** Loading %d STXTs", stxt.size());
 
 		for (Common::Array<uint16>::iterator iterator = stxt.begin(); iterator != stxt.end(); ++iterator) {
 			debugC(3, kDebugLoading, "Shared STXT %d", *iterator);
@@ -263,7 +267,7 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
 
 	Common::Array<uint16> bmp = shardcst->getResourceIDList(MKTAG('B','I','T','D'));
 	if (bmp.size() != 0) {
-		debugC(3, kDebugLoading, "Loading %d BITDs", bmp.size());
+		debugC(3, kDebugLoading, "****** Loading %d BITDs", bmp.size());
 		for (Common::Array<uint16>::iterator iterator = bmp.begin(); iterator != bmp.end(); ++iterator) {
 			debugC(3, kDebugLoading, "Shared BITD %d (%s)", *iterator, numToCastNum(*iterator - 1024));
 			_sharedBMP->setVal(*iterator, shardcst->getResource(MKTAG('B','I','T','D'), *iterator));
@@ -272,7 +276,7 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
 
 	Common::Array<uint16> sound = shardcst->getResourceIDList(MKTAG('S','N','D',' '));
 	if (sound.size() != 0) {
-		debugC(3, kDebugLoading, "Loading %d SNDs", sound.size());
+		debugC(3, kDebugLoading, "****** Loading %d SNDs", sound.size());
 		for (Common::Array<uint16>::iterator iterator = sound.begin(); iterator != sound.end(); ++iterator) {
 			debugC(3, kDebugLoading, "Shared SND  %d", *iterator);
 			_sharedSound->setVal(*iterator, shardcst->getResource(MKTAG('S','N','D',' '), *iterator));
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 14ab831..61bfd09 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -183,6 +183,8 @@ void Score::loadArchive() {
 }
 
 void Score::loadSpriteImages(bool isSharedCast) {
+	debugC(1, kDebugLoading, "****** Preloading sprite images");
+
 	Common::HashMap<int, BitmapCast *>::iterator bc;
 	for (bc = _loadedBitmaps->begin(); bc != _loadedBitmaps->end(); ++bc) {
 		if (bc->_value) {
@@ -277,6 +279,8 @@ void Score::loadPalette(Common::SeekableSubReadStreamEndian &stream) {
 }
 
 void Score::loadFrames(Common::SeekableSubReadStreamEndian &stream) {
+	debugC(1, kDebugLoading, "****** Loading frames");
+
 	uint32 size = stream.readUint32();
 	size -= 4;
 
@@ -334,7 +338,7 @@ void Score::loadFrames(Common::SeekableSubReadStreamEndian &stream) {
 		//Common::hexdump(channelData, ARRAYSIZE(channelData));
 		frame->readChannels(str);
 
-		debugC(3, kDebugLoading, "Frame %d actionId: %d", _frames.size() + 1, frame->_actionId);
+		debugC(3, kDebugLoading, "Frame %d actionId: %d", _frames.size(), frame->_actionId);
 
 		delete str;
 
@@ -343,6 +347,8 @@ void Score::loadFrames(Common::SeekableSubReadStreamEndian &stream) {
 }
 
 void Score::loadConfig(Common::SeekableSubReadStreamEndian &stream) {
+	debugC(1, kDebugLoading, "****** Loading Config");
+
 	/*uint16 unk1 = */ stream.readUint16();
 	/*ver1 = */ stream.readUint16();
 	_movieRect = Score::readRect(stream);
@@ -362,7 +368,7 @@ void Score::readVersion(uint32 rid) {
 }
 
 void Score::loadCastDataVWCR(Common::SeekableSubReadStreamEndian &stream) {
-	debugC(1, kDebugLoading, "Score::loadCastDataVWCR(). start: %d, end: %d", _castArrayStart, _castArrayEnd);
+	debugC(1, kDebugLoading, "****** Score::loadCastDataVWCR(). start: %d, end: %d", _castArrayStart, _castArrayEnd);
 
 	for (uint16 id = _castArrayStart; id <= _castArrayEnd; id++) {
 		byte size = stream.readByte();
@@ -638,6 +644,7 @@ void Score::loadLabels(Common::SeekableSubReadStreamEndian &stream) {
 
 	Common::SortedArray<Label *>::iterator j;
 
+	debugC(2, kDebugLoading, "****** Loading labels");
 	for (j = _labels->begin(); j != _labels->end(); ++j) {
 		debugC(2, kDebugLoading, "Frame %d, Label %s", (*j)->number, (*j)->name.c_str());
 	}


Commit: 2dc77ededa064aeacf36a677b2933f19e6f59f37
    https://github.com/scummvm/scummvm/commit/2dc77ededa064aeacf36a677b2933f19e6f59f37
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-03-17T08:36:25Z

Commit Message:
DIRECTOR: More loading process debug info

Changed paths:
    engines/director/score.cpp


diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 61bfd09..2797fe3 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -120,6 +120,7 @@ void Score::loadArchive() {
 	} else {
 		Common::SeekableSubReadStreamEndian *pal = _movieArchive->getResource(MKTAG('C', 'L', 'U', 'T'), clutList[0]);
 
+		debugC(2, kDebugLoading, "****** Loading Palette");
 		loadPalette(*pal);
 		g_system->getPaletteManager()->setPalette(_vm->getPalette(), 0, _vm->getPaletteColorCount());
 	}
@@ -155,12 +156,16 @@ void Score::loadArchive() {
 
 	Common::Array<uint16> vwci = _movieArchive->getResourceIDList(MKTAG('V', 'W', 'C', 'I'));
 	if (vwci.size() > 0) {
+		debugC(2, kDebugLoading, "****** Loading %d CastInfos", vwci.size());
+
 		for (Common::Array<uint16>::iterator iterator = vwci.begin(); iterator != vwci.end(); ++iterator)
 			loadCastInfo(*_movieArchive->getResource(MKTAG('V', 'W', 'C', 'I'), *iterator), *iterator);
 	}
 
 	Common::Array<uint16> cast = _movieArchive->getResourceIDList(MKTAG('C', 'A', 'S', 't'));
 	if (cast.size() > 0) {
+		debugC(2, kDebugLoading, "****** Loading %d CASt resources", cast.size());
+
 		for (Common::Array<uint16>::iterator iterator = cast.begin(); iterator != cast.end(); ++iterator) {
 			Common::SeekableSubReadStreamEndian *stream = _movieArchive->getResource(MKTAG('C', 'A', 'S', 't'), *iterator);
 			Resource res = _movieArchive->getResourceDetail(MKTAG('C', 'A', 'S', 't'), *iterator);
@@ -175,6 +180,8 @@ void Score::loadArchive() {
 	if (_vm->getVersion() <= 3) {
 		Common::Array<uint16> stxt = _movieArchive->getResourceIDList(MKTAG('S','T','X','T'));
 		if (stxt.size() > 0) {
+			debugC(2, kDebugLoading, "****** Loading %d STXT resources", stxt.size());
+
 			for (Common::Array<uint16>::iterator iterator = stxt.begin(); iterator != stxt.end(); ++iterator) {
 				loadScriptText(*_movieArchive->getResource(MKTAG('S','T','X','T'), *iterator));
 			}
@@ -382,18 +389,22 @@ void Score::loadCastDataVWCR(Common::SeekableSubReadStreamEndian &stream) {
 
 		switch (castType) {
 		case kCastBitmap:
+			debugC(3, kDebugLoading, "CastTypes id: %d BitmapCast", id);
 			_loadedBitmaps->setVal(id, new BitmapCast(stream));
 			_castTypes[id] = kCastBitmap;
 			break;
 		case kCastText:
+			debugC(3, kDebugLoading, "CastTypes id: %d TextCast", id);
 			_loadedText->setVal(id, new TextCast(stream));
 			_castTypes[id] = kCastText;
 			break;
 		case kCastShape:
+			debugC(3, kDebugLoading, "CastTypes id: %d ShapeCast", id);
 			_loadedShapes->setVal(id, new ShapeCast(stream));
 			_castTypes[id] = kCastShape;
 			break;
 		case kCastButton:
+			debugC(3, kDebugLoading, "CastTypes id: %d ButtonCast", id);
 			_loadedButtons->setVal(id, new ButtonCast(stream));
 			_castTypes[id] = kCastButton;
 			break;
@@ -655,6 +666,8 @@ int Score::compareLabels(const void *a, const void *b) {
 }
 
 void Score::loadActions(Common::SeekableSubReadStreamEndian &stream) {
+	debugC(2, kDebugLoading, "****** Loading Actions");
+
 	uint16 count = stream.readUint16() + 1;
 	uint16 offset = count * 4 + 2;
 
@@ -679,7 +692,7 @@ void Score::loadActions(Common::SeekableSubReadStreamEndian &stream) {
 			_actions[i + 1] += ch;
 		}
 
-		debugC(3, kDebugLoading, "id: %d nextId: %d subId: %d, code: %s", id, nextId, subId, _actions[id].c_str());
+		debugC(3, kDebugLoading, "Action id: %d nextId: %d subId: %d, code: %s", id, nextId, subId, _actions[id].c_str());
 
 		stream.seek(streamPos);
 
@@ -942,6 +955,8 @@ Common::String Score::getString(Common::String str) {
 }
 
 void Score::loadFileInfo(Common::SeekableSubReadStreamEndian &stream) {
+	debugC(2, kDebugLoading, "****** Loading FileInfo");
+
 	Common::Array<Common::String> fileInfoStrings = loadStrings(stream, _flags);
 	_script = fileInfoStrings[0];
 
@@ -971,6 +986,8 @@ Common::Array<Common::String> Score::loadStrings(Common::SeekableSubReadStreamEn
 
 	uint16 count = stream.readUint16() + 1;
 
+	debugC(3, kDebugLoading, "Strings: %d entries", count);
+
 	uint32 *entries = (uint32 *)calloc(count, sizeof(uint32));
 
 	for (uint i = 0; i < count; i++)
@@ -989,6 +1006,8 @@ Common::Array<Common::String> Score::loadStrings(Common::SeekableSubReadStreamEn
 				entryString += data[j];
 
 		strings.push_back(entryString);
+
+		debugC(4, kDebugLoading, "String %d:\n%s\n", i, entryString.c_str());
 	}
 
 	free(data);
@@ -1001,6 +1020,8 @@ void Score::loadFontMap(Common::SeekableSubReadStreamEndian &stream) {
 	if (stream.size() == 0)
 		return;
 
+	debugC(2, kDebugLoading, "****** Loading FontMap");
+
 	uint16 count = stream.readUint16();
 	uint32 offset = (count * 2) + 2;
 	uint16 currentRawPosition = offset;
@@ -1021,7 +1042,7 @@ void Score::loadFontMap(Common::SeekableSubReadStreamEndian &stream) {
 		_fontMap[id] = font;
 		_vm->_wm->_fontMan->registerFontMapping(id, font);
 
-		debug(3, "Fontmap. ID %d Font %s", id, font.c_str());
+		debugC(3, kDebugLoading, "Fontmap. ID %d Font %s", id, font.c_str());
 		currentRawPosition = stream.pos();
 		stream.seek(positionInfo);
 	}


Commit: 444d193a36b4f6c20aad1c1294fad638da85d593
    https://github.com/scummvm/scummvm/commit/444d193a36b4f6c20aad1c1294fad638da85d593
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-03-17T09:24:59Z

Commit Message:
DIRECTOR: Fix num to cast id for cast A11

Changed paths:
    engines/director/util.cpp


diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index ccde2b3..c53541e 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -48,7 +48,7 @@ char *numToCastNum(int num) {
 	res[3] = '\0';
 	num--;
 
-	if (num > 0 && num <= 512) {
+	if (num >= 0 && num <= 512) {
 		int c = num / 64;
 		res[0] = 'A' + c;
 		num -= 64 * c;


Commit: 0c915687538d84d1a27534bc75f917e5be394eef
    https://github.com/scummvm/scummvm/commit/0c915687538d84d1a27534bc75f917e5be394eef
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-03-17T09:25:33Z

Commit Message:
DIRECTOR: More debug output for frame loading

Changed paths:
    engines/director/frame.cpp
    engines/director/score.cpp


diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index cceecdd..92aa851 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -222,10 +222,14 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
 				sprite._unk3 = stream->readUint32();
 		}
 
-		debugC(kDebugLoading, 8, "%03d(%d)[%x,%x,%04x,%d/%d/%d/%d/%d] script:%d",
-			sprite._castId, sprite._enabled, sprite._x1, sprite._x2, sprite._flags,
-			sprite._startPoint.x, sprite._startPoint.y, sprite._width, sprite._height,
-			sprite._lineSize, sprite._scriptId);
+		if (sprite._castId) {
+			debugC(kDebugLoading, 4, "CH: %-3d castId: %03d(%s) (e:%d) [%x,%x, flags:%04x, %dx%d@%d,%d linesize: %d] script: %d",
+				i + 1, sprite._castId, numToCastNum(sprite._castId), sprite._enabled, sprite._x1, sprite._x2, sprite._flags,
+				sprite._width, sprite._height, sprite._startPoint.x, sprite._startPoint.y,
+				sprite._lineSize, sprite._scriptId);
+		} else {
+			debugC(kDebugLoading, 4, "CH: %-3d castId: 000", i + 1);
+		}
 	}
 }
 
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 2797fe3..472bd73 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -1007,7 +1007,7 @@ Common::Array<Common::String> Score::loadStrings(Common::SeekableSubReadStreamEn
 
 		strings.push_back(entryString);
 
-		debugC(4, kDebugLoading, "String %d:\n%s\n", i, entryString.c_str());
+		debugC(6, kDebugLoading, "String %d:\n%s\n", i, entryString.c_str());
 	}
 
 	free(data);


Commit: 595ea902bf08b988d8711adf1d5a4e7feb6e7bfd
    https://github.com/scummvm/scummvm/commit/595ea902bf08b988d8711adf1d5a4e7feb6e7bfd
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-03-17T09:28:33Z

Commit Message:
DIRECTOR: The maximum cast num is H88, 512, not 513

Changed paths:
    engines/director/util.cpp


diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index c53541e..dbd1cd3 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -48,7 +48,7 @@ char *numToCastNum(int num) {
 	res[3] = '\0';
 	num--;
 
-	if (num >= 0 && num <= 512) {
+	if (num >= 0 && num < 512) {
 		int c = num / 64;
 		res[0] = 'A' + c;
 		num -= 64 * c;


Commit: 9cb608c70f4435339b3a820f9ce321b5784d0e0d
    https://github.com/scummvm/scummvm/commit/9cb608c70f4435339b3a820f9ce321b5784d0e0d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-03-17T09:38:39Z

Commit Message:
DIRECTOR: Lingo: Improved debug on event handling

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


diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index f00d9a7..a51ff22 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -299,7 +299,7 @@ void Lingo::processEvent(LEvent event, ScriptType st, int entityId) {
 	if (entityId < 0)
 		return;
 
-	debugC(1, kDebugEvents, "Lingo::processEvent(%s, %s, %d)", _eventHandlerTypes[event], scriptType2str(st), entityId);
+	debugC(9, kDebugEvents, "Lingo::processEvent(%s, %s, %d)", _eventHandlerTypes[event], scriptType2str(st), entityId);
 
 	_currentEntityId = entityId;
 
@@ -307,8 +307,11 @@ void Lingo::processEvent(LEvent event, ScriptType st, int entityId) {
 		error("processEvent: Unknown event %d for entity %d", event, entityId);
 
 	if (_handlers.contains(ENTITY_INDEX(event, entityId))) {
+		debugC(1, kDebugEvents, "Lingo::processEvent(%s, %s, %d), _eventHandler", _eventHandlerTypes[event], scriptType2str(st), entityId);
 		call(_eventHandlerTypes[event], 0); // D4+ Events
 	} else if (_scripts[st].contains(entityId)) {
+		debugC(1, kDebugEvents, "Lingo::processEvent(%s, %s, %d), script", _eventHandlerTypes[event], scriptType2str(st), entityId);
+
 		executeScript(st, entityId); // D3 list of scripts.
 	} else {
 		debugC(3, kDebugLingoExec, "STUB: processEvent(%s) for %d", _eventHandlerTypes[event], entityId);





More information about the Scummvm-git-logs mailing list