diff options
| author | Martin Kiewitz | 2014-12-25 00:31:17 +0100 | 
|---|---|---|
| committer | Martin Kiewitz | 2014-12-25 00:31:17 +0100 | 
| commit | 381b7592a49e5d022159b5684dbba32eceaa6657 (patch) | |
| tree | ee961754b87e773172091f19183de151e172b69e | |
| parent | fa2d8d927b353162ac9ee434b4611e03b22246e8 (diff) | |
| download | scummvm-rg350-381b7592a49e5d022159b5684dbba32eceaa6657.tar.gz scummvm-rg350-381b7592a49e5d022159b5684dbba32eceaa6657.tar.bz2 scummvm-rg350-381b7592a49e5d022159b5684dbba32eceaa6657.zip  | |
SCI: actor file format, add debug code kPortrait
| -rw-r--r-- | engines/sci/graphics/portrait.cpp | 51 | 
1 files changed, 44 insertions, 7 deletions
diff --git a/engines/sci/graphics/portrait.cpp b/engines/sci/graphics/portrait.cpp index 668de616fb..959c0f6817 100644 --- a/engines/sci/graphics/portrait.cpp +++ b/engines/sci/graphics/portrait.cpp @@ -57,13 +57,39 @@ void Portrait::init() {  	// 4 bytes paletteSize (base 1)  	//  -> 17 bytes  	// paletteSize bytes paletteData -	// 14 bytes bitmap header -	//  -> 4 bytes unknown -	//  -> 2 bytes height -	//  -> 2 bytes width -	//  -> 6 bytes unknown -	// height * width bitmap data -	// another animation count times bitmap header and data +	// +	// bitmap-data follows, total of [animation count] +	//   14 bytes bitmap header +	//    -> 4 bytes unknown +	//    -> 2 bytes height +	//    -> 2 bytes width +	//    -> 6 bytes unknown +	//   height * width bitmap data +	// +	// 4 bytes offset table size (may be larger than the actual known entries?!) +	//   14 bytes all zeroes (dummy entry?!) +	// +	//   14 bytes for each entry +	//    -> 2 bytes displace X +	//    -> 2 bytes displace Y +	//    -> 2 bytes height (again) +	//    -> 2 bytes width (again) +	//    -> 6 bytes unknown (normally 01 00 00 00 00 00 for delta bitmaps, 00 00 00 00 00 00 for first bitmap) +	//   random data may be used as filler +	// +	// 4 bytes lip sync id table size (is [lip sync id count] * 4, should be 0x2E0 for all actors) +	//   4 bytes per lip sync id +	//    -> 1 byte length of ID +	//    -> 3 bytes actual ID +	// +	// 4 bytes lip sync id data table size (seems to be the same for all actors, always 0x220 in size) +	//   1 byte animation number or 0xFF as terminator +	//   1 byte delay, if last byte was not terminator +	//   one array for every lip sync id +	// +	// 4 bytes appended, seem to be random +	//   9E11120E for alex +	//   9E9E9E9E for vizier  	int32 fileSize = 0;  	Common::SeekableReadStream *file =  		SearchMan.createReadStreamForMember("actors/" + _resourceName + ".bin"); @@ -202,6 +228,7 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint  	if (raveResource->size < 4000) {  		memcpy(debugPrint, raveResource->data, raveResource->size);  		debugPrint[raveResource->size] = 0; // set terminating NUL +		debug("kPortrait: using actor %s", _resourceName.c_str());  		debug("kPortrait (noun %d, verb %d, cond %d, seq %d)", noun, verb, cond, seq);  		debug("kPortrait: %s", debugPrint);  	} @@ -273,6 +300,10 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint  			raveLipSyncData = NULL;  		} +#ifdef DEBUG_PORTRAIT +		debug("kPortrait: %d: %x", raveTicks, raveID); +#endif +  		timerPosition += raveTicks;  		// Wait till syncTime passed, then show specific animation bitmap @@ -294,6 +325,9 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint  			//  Tick = 0xFF is the terminator for the data  			timerPositionWithin = timerPosition;  			raveLipSyncTicks = *raveLipSyncData++; +#ifdef DEBUG_PORTRAIT +			debug("kPortrait: waiting %d", raveLipSyncTicks); +#endif  			while ( (raveLipSyncData < _lipSyncDataOffsetTableEnd) && (raveLipSyncTicks != 0xFF) ) {  				timerPositionWithin += raveLipSyncTicks; @@ -308,6 +342,9 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint  				} while ((curPosition != -1) && (curPosition < timerPositionWithin) && (!userAbort));  				raveLipSyncBitmapNr = *raveLipSyncData++; +#ifdef DEBUG_PORTRAIT +				debug("kPortrait: showing bitmap %d", raveLipSyncBitmapNr); +#endif  				// bitmap nr within sync data is base 1, we need base 0  				raveLipSyncBitmapNr--;  | 
