[Scummvm-cvs-logs] scummvm master -> 325a301a4feac17d8aa4bba80c6112116a1ceb1a

clone2727 clone2727 at gmail.com
Tue Feb 15 17:03:40 CET 2011


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:
ea67956768 VIDEO: Add some stubs for QuickTime edit list work
325a301a4f SCI: Fill in the remaining Mac-specific kPlatform subops


Commit: ea679567683c8e43255a0636e32ccf7c683c6997
    https://github.com/scummvm/scummvm/commit/ea679567683c8e43255a0636e32ccf7c683c6997
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2011-02-15T08:01:43-08:00

Commit Message:
VIDEO: Add some stubs for QuickTime edit list work

The edit lists are actually read in now. Minor cleanup of streams as well.

Changed paths:
    video/qt_decoder.cpp
    video/qt_decoder.h



diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp
index 6944fd5..a277d6b 100644
--- a/video/qt_decoder.cpp
+++ b/video/qt_decoder.cpp
@@ -820,19 +820,25 @@ int QuickTimeDecoder::readTKHD(MOVatom atom) {
 
 // edit list atom
 int QuickTimeDecoder::readELST(MOVatom atom) {
+	MOVStreamContext *st = _streams[_numStreams - 1];
+
 	_fd->readByte(); // version
 	_fd->readByte(); _fd->readByte(); _fd->readByte(); // flags
-	uint32 editCount = _streams[_numStreams - 1]->edit_count = _fd->readUint32BE();	 // entries
 
-	for (uint32 i = 0; i < editCount; i++){
-		_fd->readUint32BE(); // Track duration
-		_fd->readUint32BE(); // Media time
-		_fd->readUint32BE(); // Media rate
-	}
+	st->editCount = _fd->readUint32BE();
+	st->editList = new EditListEntry[st->editCount];
 
-	debug(0, "track[%i].edit_count = %i", _numStreams - 1, _streams[_numStreams - 1]->edit_count);
+	debug(2, "Track %d edit list count: %d", _numStreams - 1, st->editCount);
+
+	for (uint32 i = 0; i < st->editCount; i++){
+		st->editList[i].trackDuration = _fd->readUint32BE();
+		st->editList[i].mediaTime = _fd->readSint32BE();
+		st->editList[i].mediaRate = Common::Rational(_fd->readUint32BE(), 0x10000);
+		debugN(3, "\tDuration = %d, Media Time = %d, ", st->editList[i].trackDuration, st->editList[i].mediaTime);
+		st->editList[i].mediaRate.debugPrint(3, "Media Rate =");
+	}
 
-	if (editCount != 1)
+	if (st->editCount != 1)
 		warning("Multiple edit list entries. Things may go awry");
 
 	return 0;
@@ -863,7 +869,7 @@ int QuickTimeDecoder::readHDLR(MOVatom atom) {
 	else if (type == MKID_BE('soun'))
 		st->codec_type = CODEC_TYPE_AUDIO;
 
-	_fd->readUint32BE(); // component  manufacture
+	_fd->readUint32BE(); // component manufacture
 	_fd->readUint32BE(); // component flags
 	_fd->readUint32BE(); // component flags mask
 
@@ -1465,12 +1471,30 @@ QuickTimeDecoder::STSDEntry::~STSDEntry() {
 }
 
 QuickTimeDecoder::MOVStreamContext::MOVStreamContext() {
-	// FIXME: Setting all members to 0 via memset is a hack -- it works
-	// because the only non-POD member of MOVStreamContext is of type
-	// Common::Rational, and that luckily has no virtual methods nor
-	// does it keep internal pointers or anything like that. But watch
-	// out if you ever extend MOVStreamContext!
-	memset(this, 0, sizeof(MOVStreamContext));
+	chunk_count = 0;
+	chunk_offsets = 0;
+	stts_count = 0;
+	stts_data = 0;
+	sample_to_chunk_sz = 0;
+	sample_to_chunk = 0;
+	sample_size = 0;
+	sample_count = 0;
+	sample_sizes = 0;
+	keyframe_count = 0;
+	keyframes = 0;
+	time_scale = 0;
+	time_rate = 0;
+	width = 0;
+	height = 0;
+	codec_type = CODEC_TYPE_MOV_OTHER;
+	stsdEntryCount = 0;
+	stsdEntries = 0;
+	editCount = 0;
+	editList = 0;
+	extradata = 0;
+	nb_frames = 0;
+	duration = 0;
+	start_time = 0;
 }
 
 QuickTimeDecoder::MOVStreamContext::~MOVStreamContext() {
@@ -1480,6 +1504,7 @@ QuickTimeDecoder::MOVStreamContext::~MOVStreamContext() {
 	delete[] sample_sizes;
 	delete[] keyframes;
 	delete[] stsdEntries;
+	delete[] editList;
 	delete extradata;
 }
 
diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index 809c8a7..e876097 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -149,6 +149,12 @@ private:
 		uint32 id;
 	};
 
+	struct EditListEntry {
+		uint32 trackDuration;
+		int32 mediaTime;
+		Common::Rational mediaRate;
+	};
+
 	struct STSDEntry {
 		STSDEntry();
 		~STSDEntry();
@@ -183,7 +189,6 @@ private:
 		uint32 *chunk_offsets;
 		int stts_count;
 		MOVstts *stts_data;
-		int edit_count; /* number of 'edit' (elst atom) */
 		uint32 sample_to_chunk_sz;
 		MOVstsc *sample_to_chunk;
 		uint32 sample_size;
@@ -201,6 +206,9 @@ private:
 		uint32 stsdEntryCount;
 		STSDEntry *stsdEntries;
 
+		uint32 editCount;
+		EditListEntry *editList;
+
 		Common::SeekableReadStream *extradata;
 
 		uint32 nb_frames;


Commit: 325a301a4feac17d8aa4bba80c6112116a1ceb1a
    https://github.com/scummvm/scummvm/commit/325a301a4feac17d8aa4bba80c6112116a1ceb1a
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2011-02-15T08:02:01-08:00

Commit Message:
SCI: Fill in the remaining Mac-specific kPlatform subops

Changed paths:
    engines/sci/engine/kmisc.cpp



diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index 6e961f7..f95b1dd 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -362,20 +362,29 @@ reg_t kIconBar(EngineState *s, int argc, reg_t *argv) {
 		return NULL_REG;
 
 	switch (argv[0].toUint16()) {
-	case 0:
-		// Add the icons
+	case 0: // InitIconBar
 		for (int i = 0; i < argv[1].toUint16(); i++)
 			g_sci->_gfxMacIconBar->addIcon(argv[i + 2]);
 
 		g_sci->_gfxMacIconBar->drawIcons();
+
+		// TODO: Should return icon bar handle
+		// Said handle is then used by DisposeIconBar
+		break;
+	case 1: // DisposeIconBar
+		warning("kIconBar(Dispose)");
+		break;
+	case 2: // EnableIconBar (0xffff = all)
+		warning("kIconBar(Enable, %d)", argv[1].toUint16());
+		break;
+	case 3: // DisableIconBar (0xffff = all)
+		warning("kIconBar(Disable, %d)", argv[1].toUint16());
 		break;
-	case 2:
-	case 3:
-	case 4:
-		// TODO: Other calls seem to handle selecting/deselecting them
+	case 4: // SetIconBarIcon
+		warning("kIconBar(SetIcon, %d, %d)", argv[1].toUint16(), argv[2].toUint16());
 		break;
 	default:
-		warning("Unknown kIconBar subop %d", argv[0].toUint16());
+		error("Unknown kIconBar(%d)", argv[0].toUint16());
 	}
 
 	return NULL_REG;
@@ -389,23 +398,28 @@ reg_t kMacPlatform(EngineState *s, int argc, reg_t *argv) {
 
 	switch (argv[0].toUint16()) {
 	case 0:
-		// Set Mac cursor remap
-		g_sci->_gfxCursor->setMacCursorRemapList(argc - 1, argv + 1);
+		// Subop 0 has changed a few times
+		// In SCI1, its usage is still unknown
+		// In SCI1.1, it's NOP
+		// In SCI32, it's used for remapping cursor ID's
+		if (getSciVersion() >= SCI_VERSION_2_1) // Set Mac cursor remap
+			g_sci->_gfxCursor->setMacCursorRemapList(argc - 1, argv + 1);
+		else if (getSciVersion() != SCI_VERSION_1_1)
+			warning("Unknown SCI1 kMacPlatform(0) call");
 		break;
-	case 1:
-		// Unknown
-		break;
-	case 2:
-		// Unknown
-		break;
-	case 3:
-		// Unknown
-		break;
-	case 4:
-		// Handle icon bar code
+	case 4: // Handle icon bar code
 		return kIconBar(s, argc - 1, argv + 1);
+	case 7: // Unknown, but always return -1
+		return SIGNAL_REG;
+	case 1:	// Unknown, calls QuickDraw region functions (KQ5, QFG1VGA)
+	case 2: // Unknown, "UseNextWaitEvent" (Various)
+	case 3: // Unknown, "ProcessOpenDocuments" (Various)
+	case 5: // Unknown, plays a sound (KQ7)
+	case 6: // Unknown, menu-related (Unused?)
+		warning("Unhandled kMacPlatform(%d)", argv[0].toUint16());
+		break;
 	default:
-		warning("Unknown kMacPlatform subop %d", argv[0].toUint16());
+		error("Unknown kMacPlatform(%d)", argv[0].toUint16());
 	}
 
 	return s->r_acc;
@@ -455,7 +469,8 @@ reg_t kPlatform(EngineState *s, int argc, reg_t *argv) {
 		warning("STUB: kPlatform(CDCheck)");
 		break;
 	case kPlatformUnk0:
-		if (g_sci->getPlatform() == Common::kPlatformMacintosh && getSciVersion() >= SCI_VERSION_1_1 && argc > 1)
+		// For Mac versions, kPlatform(0) with other args has more functionality
+		if (g_sci->getPlatform() == Common::kPlatformMacintosh && argc > 1)
 			return kMacPlatform(s, argc - 1, argv + 1);
 		// Otherwise, fall through
 	case kPlatformGetPlatform:






More information about the Scummvm-git-logs mailing list