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

csnover csnover at users.noreply.github.com
Thu Mar 17 16:43:34 CET 2016


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:
7f4149d491 SCI32: Enable redrawAllCount in palMorphFrameOut
35fde1bbcf SCI32: Update unimplemented TODO to reflect the correct operation type
8748fd7eec SCI32: Clarify game engine version comments for split-version games
17ec528c9a SCI32: Temporarily remove dead SCI2.1early transitions code
804e132476 SCI32: Remove outdated note about state of frameout code
a292123cda SCI32: Code documentation improvements


Commit: 7f4149d49131164846375d4a5119019995939ca7
    https://github.com/scummvm/scummvm/commit/7f4149d49131164846375d4a5119019995939ca7
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-03-17T10:43:07-05:00

Commit Message:
SCI32: Enable redrawAllCount in palMorphFrameOut

Changed paths:
    engines/sci/graphics/frameout.cpp



diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 30e59c2..1be0cbd 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -888,8 +888,7 @@ void GfxFrameout::palMorphFrameOut(const int8 *styleRanges, const ShowStyleEntry
 	_frameNowVisible = true;
 
 	for (PlaneList::iterator plane = _planes.begin(); plane != _planes.end(); ++plane) {
-// TODO:
-//		plane->updateRedrawAllCount();
+		(*plane)->_redrawAllCount = getScreenCount();
 	}
 
 	if (g_sci->_gfxRemap32->getRemapCount() > 0 && _remapOccurred) {


Commit: 35fde1bbcfd68aec649782ed37a3887137fce614
    https://github.com/scummvm/scummvm/commit/35fde1bbcfd68aec649782ed37a3887137fce614
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-03-17T10:43:07-05:00

Commit Message:
SCI32: Update unimplemented TODO to reflect the correct operation type

Changed paths:
    engines/sci/graphics/frameout.cpp



diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 1be0cbd..b5bae4a 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -1966,8 +1966,8 @@ void GfxFrameout::kernelFrameOut(const bool shouldShowBits) {
 		_palMorphIsOn = false;
 	} else {
 // TODO: Window scroll
-//		if (g_ScrollWindow) {
-//			doScroll();
+//		if (g_PlaneScroll) {
+//			processScrolls();
 //		}
 
 		frameOut(shouldShowBits);


Commit: 8748fd7eecebbb702e20325c217c6b2fc9f1b863
    https://github.com/scummvm/scummvm/commit/8748fd7eecebbb702e20325c217c6b2fc9f1b863
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-03-17T10:43:07-05:00

Commit Message:
SCI32: Clarify game engine version comments for split-version games

Changed paths:
    engines/sci/sci.h



diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index 2474db8..80f0b33 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -206,8 +206,8 @@ enum SciVersion {
 	SCI_VERSION_1_LATE, // Dr. Brain 1, EcoQuest 1, Longbow, PQ3, SQ1, LSL5, KQ5 CD
 	SCI_VERSION_1_1, // Dr. Brain 2, EcoQuest 1 CD, EcoQuest 2, KQ6, QFG3, SQ4CD, XMAS 1992 and many more
 	SCI_VERSION_2, // GK1, PQ4 floppy, QFG4 floppy
-	SCI_VERSION_2_1_EARLY, // GK2 demo, KQ7, LSL6 hires, PQ4, QFG4 floppy
-	SCI_VERSION_2_1_MIDDLE, // GK2, KQ7, MUMG Deluxe, Phantasmagoria 1, PQ4CD, PQ:SWAT, QFG4CD, Shivers 1, SQ6, Torin
+	SCI_VERSION_2_1_EARLY, // GK2 demo, KQ7 1.4/1.51DOS, LSL6 hires, PQ4CD, QFG4 floppy
+	SCI_VERSION_2_1_MIDDLE, // GK2, KQ7 1.51Win/2.0, MUMG Deluxe, Phantasmagoria 1, PQ:SWAT, QFG4CD, Shivers 1, SQ6, Torin
 	SCI_VERSION_2_1_LATE, // demos of LSL7, Lighthouse, RAMA
 	SCI_VERSION_3 // LSL7, Lighthouse, RAMA, Phantasmagoria 2
 };


Commit: 17ec528c9aa1616171b857277169eae48e7fcb77
    https://github.com/scummvm/scummvm/commit/17ec528c9aa1616171b857277169eae48e7fcb77
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-03-17T10:43:07-05:00

Commit Message:
SCI32: Temporarily remove dead SCI2.1early transitions code

This code sneaked in with the graphics engine rewrite, but is not
ready yet to be used. It will return shortly, once it is enabled
and working.

Changed paths:
    engines/sci/graphics/frameout.cpp
    engines/sci/graphics/frameout.h



diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index b5bae4a..b4cce96 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -880,7 +880,7 @@ void GfxFrameout::palMorphFrameOut(const int8 *styleRanges, const ShowStyleEntry
 	if (showStyle && showStyle->type != kShowStyleUnknown) {
 // TODO: SCI2.1mid transition effects
 //		processEffects();
-		warning("Transition not implemented!");
+		warning("Transition %d not implemented!", showStyle->type);
 	} else {
 		showBits();
 	}
@@ -1070,44 +1070,7 @@ inline ShowStyleEntry *GfxFrameout::deleteShowStyleInternal(ShowStyleEntry *cons
 		lastEntry->next = showStyle->next;
 	}
 
-	// NOTE: Differences from SCI2/2.1early engine:
-	// 1. Memory of ShowStyle-owned objects was freed before ShowStyle was
-	//    removed from the linked list, but since this operation is position
-	//    independent, it has been moved after removal from the list for
-	//    consistency with SCI2.1mid+
-	// 2. In SCI2, `screenItems` was a pointer to an array of pointers, so
-	//    extra deletes were performed here; we use an owned container object
-	//    instead, which is automatically freed when ShowStyle is freed
-#if 0
-	if (getSciVersion() < SCI_VERSION_2_1_MIDDLE) {
-		uint8 type = showStyle->type;
-
-		if (type >= 1 && type <= 10) {
-			ScreenItemList &styleItems = showStyle->screenItems;
-			for (ScreenItemList::iterator it = styleItems.begin(); it != styleItems.end(); ++it) {
-				if (active) {
-					// TODO: _screen->deleteScreenItem(showStyle->plane, *it->id);
-					_screenItems.remove(*it);
-				}
-				delete *it;
-			}
-		} else if (type == 11 || type == 12) {
-			if (!showStyle->bitmapMemId.isNull()) {
-				_segMan->freeHunkEntry(showStyle->bitmapMemId);
-			}
-			if (showStyle->bitmapScreenItem != nullptr) {
-				// TODO: _screen->deleteScreenItem(showStyle->plane, showStyle->bitmapScreenItem->id);
-				_screenItems.remove(showStyle->bitmapScreenItem);
-				delete showStyle->bitmapScreenItem;
-			}
-		}
-	} else {
-#endif
-		delete[] showStyle->fadeColorRanges;
-#if 0
-	}
-#endif
-
+	delete[] showStyle->fadeColorRanges;
 	delete showStyle;
 
 	// TODO: Verify that this is the correct entry to return
@@ -1162,20 +1125,12 @@ void GfxFrameout::kernelSetShowStyle(const uint16 argc, const reg_t planeObj, co
 		error("Plane %04x:%04x is not present in active planes list", PRINT_REG(planeObj));
 	}
 
-	// TODO: This is Plane.gameRect in SCI engine, not planeRect. Engine uses
-	// Plane::ConvGameRectToPlaneRect to convert from gameRect to planeRect.
-	// Also this never gets used by SQ6 so it is not clear what it does yet
-	//	Common::Rect gameRect = plane.planeRect;
-
 	bool createNewEntry = true;
 	ShowStyleEntry *entry = findShowStyleForPlane(planeObj);
 	if (entry != nullptr) {
+		// TODO: SCI2.1early has different criteria for show style reuse
 		bool useExisting = true;
 
-		if (getSciVersion() < SCI_VERSION_2_1_MIDDLE) {
-			useExisting = plane->_planeRect.width() == entry->width && plane->_planeRect.height() == entry->height;
-		}
-
 		if (useExisting) {
 			useExisting = entry->divisions == (hasDivisions ? divisions : _defaultDivisions[type]) && entry->unknownC == _defaultUnknownC[type];
 		}
@@ -1204,39 +1159,28 @@ void GfxFrameout::kernelSetShowStyle(const uint16 argc, const reg_t planeObj, co
 			entry->divisions = hasDivisions ? divisions : _defaultDivisions[type];
 			entry->plane = planeObj;
 
-#if 0
-			if (getSciVersion() < SCI_VERSION_2_1_MIDDLE) {
-				entry->bitmapMemId = NULL_REG;
-				entry->screenItems.empty();
-				entry->width = plane->_planeRect.width();
-				entry->height = plane->_planeRect.height();
-			} else {
-#endif
-				entry->fadeColorRanges = nullptr;
-				if (hasFadeArray) {
-					// NOTE: SCI2.1mid engine does no check to verify that an array is
-					// successfully retrieved, and SegMan will cause a fatal error
-					// if we try to use a memory segment that is not an array
-					SciArray<reg_t> *table = _segMan->lookupArray(pFadeArray);
-
-					uint32 rangeCount = table->getSize();
-					entry->fadeColorRangesCount = rangeCount;
-
-					// NOTE: SCI engine code always allocates memory even if the range
-					// table has no entries, but this does not really make sense, so
-					// we avoid the allocation call in this case
-					if (rangeCount > 0) {
-						entry->fadeColorRanges = new uint16[rangeCount];
-						for (size_t i = 0; i < rangeCount; ++i) {
-							entry->fadeColorRanges[i] = table->getValue(i).toUint16();
-						}
+			entry->fadeColorRanges = nullptr;
+			if (hasFadeArray) {
+				// NOTE: SCI2.1mid engine does no check to verify that an array is
+				// successfully retrieved, and SegMan will cause a fatal error
+				// if we try to use a memory segment that is not an array
+				SciArray<reg_t> *table = _segMan->lookupArray(pFadeArray);
+
+				uint32 rangeCount = table->getSize();
+				entry->fadeColorRangesCount = rangeCount;
+
+				// NOTE: SCI engine code always allocates memory even if the range
+				// table has no entries, but this does not really make sense, so
+				// we avoid the allocation call in this case
+				if (rangeCount > 0) {
+					entry->fadeColorRanges = new uint16[rangeCount];
+					for (size_t i = 0; i < rangeCount; ++i) {
+						entry->fadeColorRanges[i] = table->getValue(i).toUint16();
 					}
-				} else {
-					entry->fadeColorRangesCount = 0;
 				}
-#if 0
+			} else {
+				entry->fadeColorRangesCount = 0;
 			}
-#endif
 		}
 
 		// NOTE: The original engine had no nullptr check and would just crash
@@ -1253,9 +1197,6 @@ void GfxFrameout::kernelSetShowStyle(const uint16 argc, const reg_t planeObj, co
 		entry->delay = (seconds * 60 + entry->divisions - 1) / entry->divisions;
 
 		if (entry->delay == 0) {
-#if 0
-			if (getSciVersion() >= SCI_VERSION_2_1_MIDDLE && entry->fadeColorRanges != nullptr) {
-#endif
 			if (entry->fadeColorRanges != nullptr) {
 				delete[] entry->fadeColorRanges;
 			}
@@ -1269,235 +1210,13 @@ void GfxFrameout::kernelSetShowStyle(const uint16 argc, const reg_t planeObj, co
 		}
 
 		if (createNewEntry) {
-			// TODO: Implement SCI3, which may or may not actually have
-			// the same transitions as SCI2/SCI2.1early, but implemented
-			// differently
-#if 0
-			if (getSciVersion() < SCI_VERSION_2_1_MIDDLE) {
-				switch (entry->type) {
-					case kShowStyleHShutterIn:
-					case kShowStyleHShutterOut:
-						prepareShowStyleWipe(entry, priority, 2, true);
-						break;
-
-					case kShowStyleVShutterIn:
-					case kShowStyleVShutterOut:
-						prepareShowStyleWipe(entry, priority, 2, false);
-						break;
-
-					case kShowStyleHWipe1:
-					case kShowStyleHWipe2:
-						prepareShowStyleWipe(entry, priority, 1, true);
-						break;
-
-					case kShowStyleVWipe1:
-					case kShowStyleVWipe2:
-						prepareShowStyleWipe(entry, priority, 1, false);
-						break;
-
-					case kShowStyleIrisIn:
-					case kShowStyleIrisOut:
-						prepareShowStyleIris(entry, priority);
-						break;
-
-					case kShowStyle11:
-					case kShowStyle12:
-						prepareShowStylePixels(entry, priority, plane->planeRect);
-						break;
-
-					default:
-						break;
-				}
-			}
-#endif
-
+			// TODO: Implement SCI2.1early and SCI3
 			entry->next = _showStyles;
 			_showStyles = entry;
 		}
 	}
 }
 
-#if 0
-void addFrameoutEntryInternal(ShowStyleEntry *const showStyle, const int16 priority, const CelInfo32 &celInfo, const Common::Rect &rect) {
-	ScreenItem *screenItem = new ScreenItem;
-	screenItem->plane = showStyle->plane;
-	screenItem->celInfo = celInfo;
-	screenItem->celRect = rect;
-	screenItem->isInList = true;
-	screenItem->priority = priority;
-	screenItem->visible = true;
-	showStyle->screenItems.push_back(screenItem);
-}
-
-void GfxFrameout::prepareShowStyleWipe(ShowStyleEntry *const showStyle, const int16 priority, const int16 edgeCount, const bool horizontal) {
-	assert(edgeCount == 1 || edgeCount == 2);
-
-	const int numScreenItems = showStyle->divisions * edgeCount;
-	const int extra = edgeCount > 1 ? 1 : 0;
-
-	showStyle->edgeCount = edgeCount;
-	showStyle->screenItems.reserve(numScreenItems);
-
-	CelInfo32 celInfo;
-	celInfo.bitmap = NULL_REG;
-	celInfo.type = kCelObjTypeView;
-	celInfo.color = showStyle->color;
-
-	for (int i = 0; i < numScreenItems; ++i) {
-		Common::Rect rect;
-
-		if (horizontal) {
-			rect.top = 0;
-			rect.bottom = showStyle->height - 1;
-			rect.left = (showStyle->width * i) / (showStyle->divisions * edgeCount);
-			rect.right = ((i + 1) * (showStyle->width + extra)) / (showStyle->divisions * edgeCount) - 1;
-		} else {
-			rect.left = 0;
-			rect.right = showStyle->width - 1;
-			rect.top = (showStyle->height * i) / (showStyle->divisions * edgeCount);
-			rect.bottom = ((i + 1) * (showStyle->height + extra)) / (showStyle->divisions * edgeCount) - 1;
-		}
-
-		addFrameoutEntryInternal(showStyle, priority, celInfo, rect);
-
-		if (edgeCount == 2) {
-			if (horizontal) {
-				int temp = rect.left;
-				rect.left = showStyle->width - rect.right - 1;
-				rect.right = showStyle->width - temp - 1;
-			} else {
-				int temp = rect.top;
-				rect.top = showStyle->height - rect.bottom - 1;
-				rect.bottom = showStyle->height - temp - 1;
-			}
-
-			addFrameoutEntryInternal(showStyle, priority, celInfo, rect);
-		}
-	}
-}
-
-void GfxFrameout::prepareShowStyleIris(ShowStyleEntry *const showStyle, const int16 priority) {
-	const int edgeCount = 4;
-	const int numScreenItems = showStyle->divisions * edgeCount;
-
-	showStyle->edgeCount = edgeCount;
-	showStyle->screenItems.reserve(numScreenItems);
-
-	CelInfo32 celInfo;
-	celInfo.bitmap = NULL_REG;
-	celInfo.type = kCelObjTypeView;
-	celInfo.color = showStyle->color;
-
-	for (int i = 0; i < numScreenItems; ++i) {
-		Common::Rect rect;
-
-		rect.right = showStyle->width - ((showStyle->width * i) / (showStyle->divisions * 2)) - 1;
-		rect.left = (showStyle->width * i) / (showStyle->divisions * 2);
-		rect.top = (showStyle->height * i) / (showStyle->divisions * 2);
-		rect.bottom = ((i + 1) * (showStyle->height + 1)) / (showStyle->divisions * 2) - 1;
-
-		addFrameoutEntryInternal(showStyle, priority, celInfo, rect);
-
-		{
-			int temp = rect.top;
-			rect.top = showStyle->height - rect.bottom - 1;
-			rect.bottom = showStyle->height - temp - 1;
-		}
-
-		addFrameoutEntryInternal(showStyle, priority, celInfo, rect);
-
-		rect.top = ((i + 1) * (showStyle->height + 1)) / (showStyle->divisions * 2);
-		rect.right = ((i + 1) * (showStyle->width + 1)) / (showStyle->divisions * 2) - 1;
-		rect.bottom = ((i + 1) * (showStyle->height + 1)) / (showStyle->divisions * 2) - 1;
-
-		addFrameoutEntryInternal(showStyle, priority, celInfo, rect);
-
-		{
-			int temp = rect.left;
-			rect.left = showStyle->width - rect.right - 1;
-			rect.right = showStyle->width - temp - 1;
-		}
-
-		addFrameoutEntryInternal(showStyle, priority, celInfo, rect);
-	}
-}
-
-void GfxFrameout::prepareShowStylePixels(ShowStyleEntry *const showStyle, const int16 priority, const Common::Rect planeGameRect) {
-	const int bitmapSize = showStyle->width * showStyle->height;
-
-	// TODO: Verify that memory type 0x200 (what GK1 engine uses)
-	// is Hunk type
-	reg_t bitmapMemId = _segMan->allocateHunkEntry("ShowStylePixels()", bitmapSize + sizeof(GfxBitmapHeader));
-	showStyle->bitmapMemId = bitmapMemId;
-
-	// TODO: SCI2 GK1 uses a Bitmap constructor function to
-	// do this work
-	byte *bitmap = _segMan->getHunkPointer(bitmapMemId);
-	GfxBitmapHeader *header = (GfxBitmapHeader *)bitmap;
-	byte *bitmapData = bitmap + sizeof(GfxBitmapHeader);
-
-	// TODO: These are defaults from the Bitmap constructor in
-	// GK1, not specific values set by this function.
-	// TODO: This probably should not even be using a struct at
-	// all since this information is machine endian dependent
-	// and will be reversed for Mac versions or when running
-	// ScummVM on big-endian systems. GK1 used packed structs
-	// everywhere so this probably worked better there too.
-	header->field_18 = 36;
-	header->field_1c = 36;
-	memset(header, 0, sizeof(GfxBitmapHeader));
-
-	header->width = showStyle->width;
-	header->height = showStyle->height;
-	header->field_8 = 250;
-	header->size = bitmapSize;
-
-	// TODO: Scaled dimensions in bitmap headers was not added
-	// until SCI2.1mid. It is not clear what the right thing to
-	// do here is.
-	if (getSciVersion() >= SCI_VERSION_2_1_MIDDLE) {
-		header->scaledWidth = _currentBuffer.scriptWidth;
-		header->scaledHeight = _currentBuffer.scriptHeight;
-	}
-
-	Common::Rect copyRect;
-	// TODO: planeGameRect is supposedly in script coordinates,
-	// which are usually 320x200. If bitsSaveDisplayScreen is
-	// in native resolution then seemingly this function will
-	// not work properly since we will be not copy enough bits,
-	// or from the correct location.
-	copyRect.left = planeGameRect.left;
-	copyRect.top = planeGameRect.top;
-	copyRect.right = planeGameRect.left + showStyle->width;
-	copyRect.bottom = planeGameRect.top + showStyle->height;
-	_screen->bitsSaveDisplayScreen(copyRect, bitmapData);
-
-	CelInfo32 celInfo;
-	celInfo.bitmap = bitmapMemId;
-	celInfo.type = kCelObjTypeMem;
-
-	ScreenItem *screenItem = new ScreenItem;
-
-	screenItem->position.x = 0;
-	screenItem->position.y = 0;
-
-	showStyle->bitmapScreenItem = screenItem;
-	screenItem->priority = priority;
-
-	// TODO: Have not seen/identified this particular flag yet in
-	// SCI2.1mid (SQ6) engine; maybe (1) a duplicate of `created`,
-	// or (2) does not exist any more, or (3) one of the other
-	// still-unidentified fields. Probably need to look at the
-	// GK1 source for its use in drawing algorithms to determine
-	// if/how this correlates to ScreenItem members in the
-	// SCI2.1mid engine.
-//	screenItem->isInList = true;
-
-	Plane *plane = _planes.findByObject(showStyle.plane);
-	plane->_screenItemList.add(screenItem);
-}
-#endif
-
 // NOTE: Different version of SCI engine support different show styles
 // SCI2 implements 0, 1/3/5/7/9, 2/4/6/8/10, 11, 12, 13, 14
 // SCI2.1 implements 0, 1/2/3/4/5/6/7/8/9/10/11/12/15, 13, 14
@@ -1539,53 +1258,15 @@ void GfxFrameout::processShowStyles() {
 					case kShowStyleWipeLeft:
 					case kShowStyleWipeUp:
 					case kShowStyleIrisOut:
-#if 0
-						if (getSciVersion() >= SCI_VERSION_2_1_MIDDLE) {
-#endif
-							retval = processShowStyleMorph(showStyle);
-#if 0
-						} else {
-							retval = processShowStyleWipe(-1, showStyle);
-						}
-#endif
-						break;
 					case kShowStyleHShutterIn:
 					case kShowStyleVShutterIn:
 					case kShowStyleWipeRight:
 					case kShowStyleWipeDown:
 					case kShowStyleIrisIn:
-#if 0
-						if (getSciVersion() >= SCI_VERSION_2_1_MIDDLE) {
-#endif
-							retval = processShowStyleMorph(showStyle);
-#if 0
-						} else {
-							retval = processShowStyleWipe(1, showStyle);
-						}
-#endif
-						break;
 					case kShowStyle11:
-#if 0
-						if (getSciVersion() >= SCI_VERSION_2_1_MIDDLE) {
-#endif
-							retval = processShowStyleMorph(showStyle);
-#if 0
-						} else {
-							retval = processShowStyle11(showStyle);
-						}
-#endif
-						break;
 					case kShowStyle12:
 					case kShowStyleUnknown: {
-#if 0
-						if (getSciVersion() >= SCI_VERSION_2_1_MIDDLE) {
-#endif
-							retval = processShowStyleMorph(showStyle);
-#if 0
-						} else {
-							retval = processShowStyle12(showStyle);
-						}
-#endif
+						retval = processShowStyleMorph(showStyle);
 						break;
 					}
 					case kShowStyleFadeOut: {
@@ -1679,285 +1360,6 @@ bool GfxFrameout::processShowStyleFade(const int direction, ShowStyleEntry *cons
 	return false;
 }
 
-// TODO: Rect sizes are wrong, rects in SCI are inclusive of bottom/right but
-// in ScummVM are exclusive so extra ±1 operations here are wrong
-#if 0
-bool GfxFrameout::processShowStyleWipe(const ShowStyleEntry *const style) {
-	const int16 divisions = style->divisions;
-	Common::Rect rect(divisions, divisions);
-
-	const Plane *const plane = _visibleScreen->planeList->findByObject(style->plane);
-
-	const int16 planeLeft = plane->field_4C.left;
-	const int16 planeTop = plane->field_4C.top;
-	const int16 planeRight = plane->field_4C.right;
-	const int16 planeBottom = plane->field_4C.bottom;
-	const int16 planeWidth = planeRight - planeLeft + 1;
-	const int16 planeHeight = planeBottom - planeTop + 1;
-
-	const int16 divisionWidth = planeWidth / divisions - 1;
-	int16 shutterDivisionWidth = planeWidth / (2 * divisions);
-	if (shutterDivisionWidth >= 0) {
-		const int16 heightPerDivision = planeHeight / divisions;
-		int16 shutterMiddleX = divisions * shutterDivisionWidth;
-		for (int16 x = divisionWidth - shutterDivisionWidth; x <= divisionWidth; ++x) {
-			int16 divisionTop = 0;
-			for (int16 y = 0; y < heightPerDivision; ++y, divisionTop += divisions) {
-				rect.top = planeTop + divisionTop;
-				rect.bottom = rect.top + divisions - 1;
-				rect.left = planeLeft + shutterMiddleX;
-				rect.right = rect.left + divisions - 1;
-				//				_screen->rectList.clear();
-				//				_screen->rectList.add(rect);
-				//				showBits();
-			}
-			// number of divisions does not divide evenly into plane height,
-			// draw the remainder
-			if (planeHeight % divisions) {
-				rect.top = planeTop + divisionTop;
-				rect.bottom = rect.top + planeHeight % divisions - 1;
-				rect.left = planeLeft + shutterMiddleX;
-				rect.right = rect.left + divisions - 1;
-				//				_screen->rectList.clear();
-				//				_screen->rectList.add(rect);
-				//				showBits();
-			}
-
-			divisionTop = 0;
-			for (int16 y = 0; y < heightPerDivision; ++y, divisionTop += divisions) {
-				rect.top = planeTop + divisionTop;
-				rect.bottom = rect.top + divisions - 1;
-				rect.left = planeLeft + divisions * x;
-				rect.right = rect.left + divisions - 1;
-				//				_screen->rectList.clear();
-				//				_screen->rectList.add(rect);
-				//				showBits();
-			}
-			if (planeHeight % divisions) {
-				rect.top = planeTop + divisionTop;
-				rect.bottom = rect.top + planeHeight % divisions - 1;
-				rect.left = planeLeft + divisions * x;
-				rect.right = rect.left + divisions - 1;
-				//				_screen->rectList.clear();
-				//				_screen->rectList.add(rect);
-				//				showBits();
-			}
-
-			shutterMiddleX -= divisions;
-			--shutterDivisionWidth;
-		}
-	}
-
-	if (planeWidth % divisions) {
-		const int16 roundedPlaneWidth = divisions * divisionWidth;
-		int16 divisionTop = 0;
-		for (int16 y = 0; y < planeHeight / divisions; ++y, divisionTop += divisions) {
-			rect.top = planeTop + divisionTop;
-			rect.bottom = rect.top + divisions - 1;
-			rect.left = planeLeft + roundedPlaneWidth;
-			rect.right = rect.left + planeWidth % divisions + divisions - 1;
-			//			_screen->rectList.clear();
-			//			_screen->rectList.add(rect);
-			//			showBits();
-		}
-		if (planeHeight % divisions) {
-			rect.top = planeTop + divisionTop;
-			rect.bottom = rect.top + planeHeight % divisions - 1;
-			rect.left = planeLeft + roundedPlaneWidth;
-			rect.right = rect.left + planeWidth % divisions + divisions - 1;
-			//			_screen->rectList.clear();
-			//			_screen->rectList.add(rect);
-			//			showBits();
-		}
-	}
-
-	rect.right = planeRight;
-	rect.left = planeLeft;
-	rect.top = planeTop;
-	rect.bottom = planeBottom;
-	//	_screen->rectList.clear();
-	//	_screen->rectList.add(rect);
-	//	showBits();
-}
-#endif
-#if 0
-bool GfxFrameout::processShowStyleWipe(const int direction, ShowStyleEntry *const showStyle) {
-	if (showStyle->currentStep < showStyle->divisions) {
-		int index;
-		if (direction <= 0) {
-			index = showStyle->divisions - showStyle->currentStep - 1;
-		} else {
-			index = showStyle->currentStep;
-		}
-
-		index *= showStyle->edgeCount;
-
-		if (showStyle->edgeCount > 0) {
-			for (int i = 0; i < showStyle->edgeCount; ++i) {
-				if (showStyle->fadeUp) {
-					ScreenItem *screenItem = showStyle->screenItems[index + i];
-					if (screenItem != nullptr) {
-						// TODO: _screen->deleteScreenItem(screenItem);
-						_screenItems.remove(screenItem);
-
-						delete screenItem;
-						showStyle->screenItems[index + i] = nullptr;
-					}
-				} else {
-					ScreenItem *screenItem = showStyle->screenItems[index + i];
-					// TODO: _screen->addScreenItem(screenItem);
-					_screenItems.push_back(screenItem);
-				}
-			}
-
-			++showStyle->currentStep;
-			showStyle->nextTick += showStyle->delay;
-		}
-	}
-
-	if (showStyle->currentStep >= showStyle->divisions) {
-		if (showStyle->fadeUp) {
-			showStyle->processed = true;
-		}
-
-		return true;
-	}
-
-	return false;
-}
-
-void fillRect(byte *data, const Common::Rect &rect, const int16 color, const int16 stride) {
-
-}
-
-bool GfxFrameout::processShowStyle11(ShowStyleEntry *const showStyle) {
-	int divisions = showStyle->divisions * showStyle->divisions;
-
-	byte *bitmapData = _segMan->getHunkPointer(showStyle->bitmapMemId) + sizeof(GfxBitmapHeader);
-
-	int ebx;
-
-	if (showStyle->currentStep == 0) {
-		int ctr = 0;
-		int bloot = divisions;
-		do {
-			bloot >>= 1;
-			++ctr;
-		} while (bloot != 1);
-
-		showStyle->dissolveSeed = _dissolveSequenceSeeds[ctr];
-		ebx = 800;
-		showStyle->unknown3A = 800;
-		showStyle->dissolveInitial = 800;
-	} else {
-		int ebx = showStyle->unknown3A;
-		do {
-			int eax = ebx >> 1;
-			if (ebx & 1) {
-				ebx = showStyle->dissolveSeed ^ eax;
-			} else {
-				ebx = eax;
-			}
-		} while (ebx >= divisions);
-
-		if (ebx == showStyle->dissolveInitial) {
-			ebx = 0;
-		}
-	}
-
-	Common::Rect rect;
-
-	rect.left = (showStyle->width + showStyle->divisions - 1) / showStyle->divisions;
-	rect.top = (showStyle->height + showStyle->divisions - 1) / showStyle->divisions;
-
-	if (showStyle->currentStep <= showStyle->divisions) {
-		int ebp = 0;
-		do {
-			int ecx = ebx % showStyle->divisions;
-
-			Common::Rect drawRect;
-			drawRect.left = rect.left * ecx;
-			drawRect.right = drawRect.left + rect.left - 1;
-			drawRect.top = rect.top * ebx;
-			drawRect.bottom = rect.top * ebx + rect.top - 1;
-
-			bool doit;
-			if (drawRect.right >= 0 && drawRect.bottom >= 0 && drawRect.left <= rect.right && drawRect.top <= rect.bottom) {
-				doit = true;
-			} else {
-				doit = false;
-			}
-
-			if (doit) {
-				if (drawRect.left < 0) {
-					drawRect.left = 0;
-				}
-
-				if (drawRect.top < 0) {
-					drawRect.top = 0;
-				}
-
-				if (drawRect.right > rect.right) {
-					drawRect.right = rect.right;
-				}
-
-				if (drawRect.bottom > rect.bottom) {
-					drawRect.bottom = rect.bottom;
-				}
-			} else {
-				drawRect.right = 0;
-				drawRect.bottom = 0;
-				drawRect.left = 0;
-				drawRect.top = 0;
-			}
-
-			fillRect(bitmapData, drawRect, showStyle->color, showStyle->width);
-
-			int eax = ebx;
-			do {
-				eax >>= 1;
-				if (ebx & 1) {
-					ebx = showStyle->dissolveSeed;
-					ebx ^= eax;
-				} else {
-					ebx = eax;
-				}
-			} while (ebx >= divisions);
-
-			if (showStyle->currentStep != showStyle->divisions) {
-				ebp++;
-			} else {
-				drawRect.left = 0;
-				drawRect.top = 0;
-				drawRect.right = showStyle->width - 1;
-				drawRect.bottom = showStyle->height - 1;
-				fillRect(bitmapData, drawRect, showStyle->color, showStyle->width);
-			}
-
-		} while (ebp <= showStyle->divisions);
-
-		showStyle->unknown3A = ebx;
-		++showStyle->currentStep;
-		showStyle->nextTick += showStyle->delay;
-		// _screen->updateScreenItem(showStyle->bitmapScreenItem);
-	}
-
-	if (showStyle->currentStep >= showStyle->divisions) {
-		if (showStyle->fadeUp) {
-			showStyle->processed = true;
-		}
-
-		return true;
-	}
-
-	return false;
-}
-
-bool GfxFrameout::processShowStyle12(ShowStyleEntry *const showStyle) {
-	return true;
-}
-#endif
-
 void GfxFrameout::kernelFrameOut(const bool shouldShowBits) {
 	if (_showStyles != nullptr) {
 		processShowStyles();
diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h
index 7cc1adf..8ed95a0 100644
--- a/engines/sci/graphics/frameout.h
+++ b/engines/sci/graphics/frameout.h
@@ -130,64 +130,6 @@ struct ShowStyleEntry {
 	bool processed;
 
 	//
-	// Engine-specific properties for SCI2 through 2.1early
-	//
-
-	// TODO: Could union this stuff to save literally
-	// several bytes of memory.
-
-	/**
-	 * The width of the plane. Used to determine the correct
-	 * size of screen items for wipes.
-	 */
-	int width;
-
-	/**
-	 * The height of the plane. Used to determine the correct
-	 * size of screen items for wipes.
-	 */
-	int height;
-
-	/**
-	 * The number of edges that a transition operates on.
-	 * Slide wipe: 1 edge
-	 * Reveal wipe: 2 edges
-	 * Iris wipe: 4 edges
-	 */
-	// TODO: I have no idea why SCI engine stores this instead
-	// of a screenItems count
-	int edgeCount;
-
-	/**
-	 * Used by transition types 1 through 10.
-	 * One screen item per division per edge.
-	 */
-	ScreenItemList screenItems;
-
-	/**
-	 * Used by transition types 11 and 12. A copy of the
-	 * visible frame buffer.
-	 */
-	// TODO: This is a reg_t in SCI engine; not sure if
-	// we can avoid allocation through SegMan or not.
-	reg_t bitmapMemId;
-
-	/**
-	 * Used by transition types 11 and 12. A screen item
-	 * used to display the associated bitmap data.
-	 */
-	ScreenItem *bitmapScreenItem;
-
-	/**
-	 * A number used to pick pixels to dissolve by types
-	 * 11 and 12.
-	 */
-	int dissolveSeed;
-	int unknown3A;
-	// max?
-	int dissolveInitial;
-
-	//
 	// Engine specific properties for SCI2.1mid through SCI3
 	//
 
@@ -326,9 +268,6 @@ private:
 	bool processShowStyleNone(ShowStyleEntry *showStyle);
 	bool processShowStyleMorph(ShowStyleEntry *showStyle);
 	bool processShowStyleFade(const int direction, ShowStyleEntry *showStyle);
-#if 0
-	bool processShowStyleWipe(const int direction, ShowStyleEntry *const showStyle);
-#endif
 
 public:
 	// NOTE: This signature is taken from SCI3 Phantasmagoria 2


Commit: 804e1324762daeab2b211b1969fcb80562b24be7
    https://github.com/scummvm/scummvm/commit/804e1324762daeab2b211b1969fcb80562b24be7
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-03-17T10:43:08-05:00

Commit Message:
SCI32: Remove outdated note about state of frameout code

This code is engine-accurate now, not based on guesswork.

Changed paths:
    engines/sci/graphics/frameout.cpp



diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index b4cce96..82a33e4 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -56,8 +56,6 @@
 
 namespace Sci {
 
-// TODO/FIXME: This is partially guesswork
-
 static int dissolveSequences[2][20] = {
 	/* SCI2.1early- */ { 3, 6, 12, 20, 48, 96, 184, 272, 576, 1280, 3232, 6912, 13568, 24576, 46080 },
 	/* SCI2.1mid+ */ { 0, 0, 3, 6, 12, 20, 48, 96, 184, 272, 576, 1280, 3232, 6912, 13568, 24576, 46080, 73728, 132096, 466944 }


Commit: a292123cdac7cf1cda8171e9249a6fdd4142202e
    https://github.com/scummvm/scummvm/commit/a292123cdac7cf1cda8171e9249a6fdd4142202e
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-03-17T10:43:08-05:00

Commit Message:
SCI32: Code documentation improvements

Changed paths:
    engines/sci/graphics/plane32.h



diff --git a/engines/sci/graphics/plane32.h b/engines/sci/graphics/plane32.h
index 4262966..770a6fa 100644
--- a/engines/sci/graphics/plane32.h
+++ b/engines/sci/graphics/plane32.h
@@ -166,7 +166,7 @@ public:
 	 * another plane and cleared when draw list calculation
 	 * occurs.
 	 */
-	int _priorityChanged; // ?
+	int _priorityChanged;
 
 	/**
 	 * A handle to the VM object corresponding to this
@@ -182,7 +182,12 @@ public:
 	int16 _priority;
 
 	/**
-	 * TODO: Document
+	 * Whether or not all screen items in this plane should
+	 * be redrawn on the next frameout, instead of just
+	 * the screen items marked as updated. This is set when
+	 * visual changes to the plane itself are made that
+	 * affect the rendering of the entire plane, and cleared
+	 * once those changes are rendered by `redrawAll`.
 	 */
 	int _redrawAllCount;
 






More information about the Scummvm-git-logs mailing list