[Scummvm-git-logs] scummvm master -> 40444b0aeb11da5ccde497866bffdc80e18392b8

csnover csnover at users.noreply.github.com
Sun Oct 9 18:24:08 CEST 2016


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:
8c555200d9 SCI32: Change storage type of int16 arrays to hold reg_ts instead
40444b0aeb SCI32: Clarify some identifiers


Commit: 8c555200d94470e554fb08324490dfb733952368
    https://github.com/scummvm/scummvm/commit/8c555200d94470e554fb08324490dfb733952368
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-10-09T11:21:13-05:00

Commit Message:
SCI32: Change storage type of int16 arrays to hold reg_ts instead

Memory references and integers in SSCI are both 16-bit numbers,
so game scripts frequently (incorrectly) use an IntArray instead
of an IDArray for holding references. Since references in ScummVM
are 32-bit reg_ts, IntArray entries must be large enough to hold
reg_ts in order to be compatible with game scripts that store
references in integer arrays.

The alternative solution is to find and patch all incorrect use of
IntArray across all games. This is possible, but a bit risky from
a save game stability perspective, since incorrect IntArray usage
is sometimes not apparent until well after the array is
instantiated (like GK1's global interview array).

This change invalidates existing SCI32 save games.

Changed paths:
    engines/sci/console.cpp
    engines/sci/engine/kevent.cpp
    engines/sci/engine/kfile.cpp
    engines/sci/engine/kpathing.cpp
    engines/sci/engine/savegame.cpp
    engines/sci/engine/script_patches.cpp
    engines/sci/engine/segment.cpp
    engines/sci/engine/segment.h
    engines/sci/graphics/transitions32.cpp



diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 34109ff..39fa95a 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -2812,7 +2812,7 @@ bool Console::cmdViewReference(int argc, const char **argv) {
 							arrayType = "byte";
 							break;
 						case kArrayTypeInt16:
-							arrayType = "int16";
+							arrayType = "int16 (as reg_t)";
 							break;
 						case kArrayTypeString:
 							arrayType = "string";
@@ -2823,24 +2823,16 @@ bool Console::cmdViewReference(int argc, const char **argv) {
 					}
 					debugPrintf("SCI32 %s array (%u entries):\n", arrayType, array->size());
 					switch (array->getType()) {
-					case kArrayTypeID:
+					case kArrayTypeInt16:
+					case kArrayTypeID: {
 						hexDumpReg((const reg_t *)array->getRawData(), array->size(), 4, 0, true);
 						break;
+					}
 					case kArrayTypeByte:
 					case kArrayTypeString: {
 						Common::hexdump((const byte *)array->getRawData(), array->size(), 16, 0);
 						break;
 					}
-					case kArrayTypeInt16: {
-						const int16 *data = (const int16 *)array->getRawData();
-						for (int i = 0; i < array->size(); ++i) {
-							debugN("% 6d ", *data++);
-							if ((i % 8) == 0) {
-								debugN("\n");
-							}
-						}
-						break;
-					}
 					default:
 						break;
 					}
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index c4aa4c5..a006306 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -383,10 +383,10 @@ reg_t kSetHotRectangles(EngineState *s, int argc, reg_t *argv) {
 	rects.resize(numRects);
 
 	for (int16 i = 0; i < numRects; ++i) {
-		rects[i].left   = hotRects.int16At(i * 4);
-		rects[i].top    = hotRects.int16At(i * 4 + 1);
-		rects[i].right  = hotRects.int16At(i * 4 + 2) + 1;
-		rects[i].bottom = hotRects.int16At(i * 4 + 3) + 1;
+		rects[i].left   = hotRects.getAsInt16(i * 4);
+		rects[i].top    = hotRects.getAsInt16(i * 4 + 1);
+		rects[i].right  = hotRects.getAsInt16(i * 4 + 2) + 1;
+		rects[i].bottom = hotRects.getAsInt16(i * 4 + 3) + 1;
 	}
 
 	g_sci->getEventManager()->setHotRectanglesActive(true);
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 386c4bc..6aad256 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -1327,11 +1327,11 @@ reg_t kGetSaveFiles32(EngineState *s, int argc, reg_t *argv) {
 		const SavegameDesc &save = saves[i];
 		char *target = &descriptions.charAt(SCI_MAX_SAVENAME_LENGTH * i);
 		Common::strlcpy(target, save.name, SCI_MAX_SAVENAME_LENGTH);
-		saveIds.int16At(i) = save.id - kSaveIdShift;
+		saveIds.setFromInt16(i, save.id - kSaveIdShift);
 	}
 
 	descriptions.charAt(SCI_MAX_SAVENAME_LENGTH * saves.size()) = '\0';
-	saveIds.int16At(saves.size()) = 0;
+	saveIds.setFromInt16(saves.size(), 0);
 
 	return make_reg(0, saves.size());
 }
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp
index 667f77f..937b1cf 100644
--- a/engines/sci/engine/kpathing.cpp
+++ b/engines/sci/engine/kpathing.cpp
@@ -285,13 +285,6 @@ struct PathfindingState {
 static Common::Point readPoint(SegmentRef list_r, int offset) {
 	Common::Point point;
 
-#ifdef ENABLE_SCI32
-	if (getSciVersion() >= SCI_VERSION_2) {
-		point.x = READ_UINT16(list_r.raw + offset * POLY_POINT_SIZE + 0);
-		point.y = READ_UINT16(list_r.raw + offset * POLY_POINT_SIZE + 2);
-	} else
-#endif
-
 	if (list_r.isRaw) {	// dynmem blocks are raw
 		point.x = (int16)READ_SCIENDIAN_UINT16(list_r.raw + offset * POLY_POINT_SIZE);
 		point.y = (int16)READ_SCIENDIAN_UINT16(list_r.raw + offset * POLY_POINT_SIZE + 2);
@@ -303,12 +296,6 @@ static Common::Point readPoint(SegmentRef list_r, int offset) {
 }
 
 static void writePoint(SegmentRef ref, int offset, const Common::Point &point) {
-#ifdef ENABLE_SCI32
-	if (getSciVersion() >= SCI_VERSION_2) {
-		WRITE_UINT16(ref.raw + offset * POLY_POINT_SIZE + 0, point.x);
-		WRITE_UINT16(ref.raw + offset * POLY_POINT_SIZE + 2, point.y);
-	} else
-#endif
 	if (ref.isRaw) {	// dynmem blocks are raw
 		WRITE_SCIENDIAN_UINT16(ref.raw + offset * POLY_POINT_SIZE, point.x);
 		WRITE_SCIENDIAN_UINT16(ref.raw + offset * POLY_POINT_SIZE + 2, point.y);
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index f01e2a6..2e4da46 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -685,20 +685,16 @@ void SciArray::saveLoadWithSerializer(Common::Serializer &s) {
 	}
 
 	switch (_type) {
-	case kArrayTypeByte:
-	case kArrayTypeString:
-		s.syncBytes((byte *)_data, savedSize);
-		break;
 	case kArrayTypeInt16:
-		for (int i = 0; i < savedSize; ++i) {
-			s.syncAsUint16LE(((int16 *)_data)[i]);
-		}
-		break;
 	case kArrayTypeID:
 		for (int i = 0; i < savedSize; ++i) {
 			syncWithSerializer(s, ((reg_t *)_data)[i]);
 		}
 		break;
+	case kArrayTypeByte:
+	case kArrayTypeString:
+		s.syncBytes((byte *)_data, savedSize);
+		break;
 	default:
 		error("Attempt to sync invalid SciArray type %d", _type);
 	}
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 4773646..f2f290f 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -995,32 +995,8 @@ static const uint16 gk1PatchDay10GabrielDressUp[] = {
 	PATCH_END
 };
 
-// GK1 initializes the global interrogation array with an int16 array, which
-// happens to work in SSCI because object references are int16s, but in ScummVM
-// object references are reg_ts, so this array needs to be created as an IDArray
-// instead
-static const uint16 gk1SignatureInterrogationArray1[] = {
-	0x38, SIG_SELECTOR16(new), // pushi new
-	0x78,                      // push1
-	SIG_MAGICDWORD,
-	0x39, 0x0f,                // pushi 15
-	0x51, 0x0a,                // class IntArray
-	SIG_END
-};
-
-static const uint16 gk1PatchInterrogationArray1[] = {
-	PATCH_ADDTOOFFSET(+3),  // pushi new
-	PATCH_ADDTOOFFSET(+1),  // push1
-	PATCH_ADDTOOFFSET(+2),  // pushi 15
-	0x51, 0x0b,             // class IDArray
-	PATCH_END
-};
-
 //          script, description,                                      signature                         patch
 static const SciScriptPatcherEntry gk1Signatures[] = {
-	{  true,    10, "fix interrogation array type 1/3",            1, gk1SignatureInterrogationArray1,  gk1PatchInterrogationArray1 },
-	{  true,    50, "fix interrogation array type 2/3",            1, gk1SignatureInterrogationArray1,  gk1PatchInterrogationArray1 },
-	{  true,    93, "fix interrogation array type 3/3",            1, gk1SignatureInterrogationArray1,  gk1PatchInterrogationArray1 },
 	{  true,    51, "interrogation bug",                           1, gk1SignatureInterrogationBug,     gk1PatchInterrogationBug },
 	{  true,   212, "day 5 drum book dialogue error",              1, gk1SignatureDay5DrumBookDialogue, gk1PatchDay5DrumBookDialogue },
 	{  true,   212, "day 5 phone freeze",                          1, gk1SignatureDay5PhoneFreeze,      gk1PatchDay5PhoneFreeze },
@@ -4560,30 +4536,10 @@ static const SciScriptPatcherEntry sq5Signatures[] = {
 #pragma mark -
 #pragma mark Space Quest 6
 
-// When pressing number buttons on the Holocabana controls, View objects are
-// put in an int16 array. This happens to work in SSCI, but ScummVM requires a
-// proper IDArray because reg_t is larger than 16 bits.
-static const uint16 sq6HoloIntArraySignature[] = {
-	0x38, SIG_SELECTOR16(new), // pushi new
-	0x76,                      // push0
-	0x51, 0x0b,                // class IntArray
-	SIG_MAGICDWORD,
-	0x4a, SIG_UINT16(0x04),    // send 4
-	0xa3, 0x06,                // sal local[6]
-	SIG_END
-};
-
-static const uint16 sq6HoloIntArrayPatch[] = {
-	PATCH_ADDTOOFFSET(+4),      // pushi new; push0
-	0x51, 0x0c,                 // class IDArray
-	PATCH_END
-};
-
 //          script, description,                                      signature                        patch
 static const SciScriptPatcherEntry sq6Signatures[] = {
 	{  true,    15, "invalid array construction",                  1, sci21IntArraySignature,          sci21IntArrayPatch },
 	{  true,    22, "invalid array construction",                  1, sci21IntArraySignature,          sci21IntArrayPatch },
-	{  true,   400, "invalid array type",                          1, sq6HoloIntArraySignature,        sq6HoloIntArrayPatch },
 	{  true,   460, "invalid array construction",                  1, sci21IntArraySignature,          sci21IntArrayPatch },
 	{  true,   510, "invalid array construction",                  1, sci21IntArraySignature,          sci21IntArrayPatch },
 	{  true, 64990, "increase number of save games",               1, sci2NumSavesSignature1,          sci2NumSavesPatch1 },
@@ -4595,30 +4551,8 @@ static const SciScriptPatcherEntry sq6Signatures[] = {
 #pragma mark -
 #pragma mark Torins Passage
 
-// Torin initializes the inventory with an int16 array, which happens to work
-// in SSCI because object references are int16s, but in ScummVM object
-// references are reg_ts, so this array needs to be created as an IDArray
-// instead
-static const uint16 torinInventItemSlotsSignature[] = {
-	0x38, SIG_SELECTOR16(new), // pushi new
-	0x78,                      // push1
-	SIG_MAGICDWORD,
-	0x67, 0x2e,                // pTos $2e (invSlotsTot)
-	0x51, 0x0b,                // class IntArray
-	SIG_END
-};
-
-static const uint16 torinInventItemSlotsPatch[] = {
-	PATCH_ADDTOOFFSET(+3),  // pushi new
-	PATCH_ADDTOOFFSET(+1),  // push1
-	PATCH_ADDTOOFFSET(+2),  // pTos $2e (invSlotsTot)
-	0x51, 0x0c,             // class IDArray
-	PATCH_END
-};
-
 //          script, description,                                      signature                         patch
 static const SciScriptPatcherEntry torinSignatures[] = {
-	{  true, 64895, "fix inventory array type",                    1, torinInventItemSlotsSignature,    torinInventItemSlotsPatch },
 	{  true, 64990, "increase number of save games",               1, sci2NumSavesSignature1,           sci2NumSavesPatch1 },
 	{  true, 64990, "increase number of save games",               1, sci2NumSavesSignature2,           sci2NumSavesPatch2 },
 	SCI_SIGNATUREENTRY_TERMINATOR
diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp
index 11331f0..32f1614 100644
--- a/engines/sci/engine/segment.cpp
+++ b/engines/sci/engine/segment.cpp
@@ -253,10 +253,10 @@ SegmentRef ArrayTable::dereference(reg_t pointer) {
 	SegmentRef ret;
 
 	SciArray &array = at(pointer.getOffset());
-	const bool isRaw = array.getType() != kArrayTypeID;
+	const bool isRaw = array.getType() == kArrayTypeByte || array.getType() == kArrayTypeString;
 
 	ret.isRaw = isRaw;
-	ret.maxSize = isRaw ? array.byteSize() : array.size();
+	ret.maxSize = array.byteSize();
 	if (isRaw) {
 		ret.raw = (byte *)array.getRawData();
 	} else {
diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h
index 6ecfbc7..e62b4fa 100644
--- a/engines/sci/engine/segment.h
+++ b/engines/sci/engine/segment.h
@@ -475,15 +475,13 @@ public:
 	/**
 	 * Sets the type of this array. The type of the array may only be set once.
 	 */
-	void setType(SciArrayType type) {
+	void setType(const SciArrayType type) {
 		assert(_type == kArrayTypeInvalid);
 		switch(type) {
+		case kArrayTypeInt16:
 		case kArrayTypeID:
 			_elementSize = sizeof(reg_t);
 			break;
-		case kArrayTypeInt16:
-			_elementSize = sizeof(int16);
-			break;
 		case kArrayTypeString:
 			_elementSize = sizeof(char);
 			break;
@@ -551,12 +549,11 @@ public:
 
 		switch(_type) {
 		case kArrayTypeInt16:
-			return make_reg(0, ((int16 *)_data)[index]);
+		case kArrayTypeID:
+			return ((reg_t *)_data)[index];
 		case kArrayTypeByte:
 		case kArrayTypeString:
 			return make_reg(0, ((byte *)_data)[index]);
-		case kArrayTypeID:
-			return ((reg_t *)_data)[index];
 		default:
 			error("Invalid array type %d", _type);
 		}
@@ -574,26 +571,23 @@ public:
 
 		switch(_type) {
 		case kArrayTypeInt16:
-			((int16 *)_data)[index] = value.toSint16();
+		case kArrayTypeID:
+			((reg_t *)_data)[index] = value;
 			break;
 		case kArrayTypeByte:
 		case kArrayTypeString:
 			((byte *)_data)[index] = value.toSint16();
 			break;
-		case kArrayTypeID:
-			((reg_t *)_data)[index] = value;
-			break;
 		default:
 			error("Invalid array type %d", _type);
 		}
 	}
 
 	/**
-	 * Returns a reference to the byte at the given index. Only valid for
-	 * string and byte arrays.
+	 * Gets the value at the given index as an int16.
 	 */
-	byte &byteAt(const uint16 index) {
-		assert(_type == kArrayTypeString || _type == kArrayTypeByte);
+	int16 getAsInt16(const uint16 index) {
+		assert(_type == kArrayTypeInt16);
 
 		if (getSciVersion() >= SCI_VERSION_3) {
 			resize(index);
@@ -601,14 +595,31 @@ public:
 			assert(index < _size);
 		}
 
-		return ((byte *)_data)[index];
+		const reg_t value = ((reg_t *)_data)[index];
+		assert(value.isNumber());
+		return value.toSint16();
 	}
 
 	/**
-	 * Returns a reference to the char at the given index. Only valid for
+	 * Sets the value at the given index from an int16.
+	 */
+	void setFromInt16(const uint16 index, const int16 value) {
+		assert(_type == kArrayTypeInt16);
+
+		if (getSciVersion() >= SCI_VERSION_3) {
+			resize(index + 1);
+		} else {
+			assert(index < _size);
+		}
+
+		((reg_t *)_data)[index] = make_reg(0, value);
+	}
+
+	/**
+	 * Returns a reference to the byte at the given index. Only valid for
 	 * string and byte arrays.
 	 */
-	char &charAt(const uint16 index) {
+	byte &byteAt(const uint16 index) {
 		assert(_type == kArrayTypeString || _type == kArrayTypeByte);
 
 		if (getSciVersion() >= SCI_VERSION_3) {
@@ -617,15 +628,15 @@ public:
 			assert(index < _size);
 		}
 
-		return ((char *)_data)[index];
+		return ((byte *)_data)[index];
 	}
 
 	/**
-	 * Returns a reference to the int16 at the given index. Only valid for int16
-	 * arrays.
+	 * Returns a reference to the char at the given index. Only valid for
+	 * string and byte arrays.
 	 */
-	int16 &int16At(const uint16 index) {
-		assert(_type == kArrayTypeInt16);
+	char &charAt(const uint16 index) {
+		assert(_type == kArrayTypeString || _type == kArrayTypeByte);
 
 		if (getSciVersion() >= SCI_VERSION_3) {
 			resize(index);
@@ -633,15 +644,15 @@ public:
 			assert(index < _size);
 		}
 
-		return ((int16 *)_data)[index];
+		return ((char *)_data)[index];
 	}
 
 	/**
 	 * Returns a reference to the reg_t at the given index. Only valid for ID
-	 * arrays.
+	 * and int16 arrays.
 	 */
 	reg_t &IDAt(const uint16 index) {
-		assert(_type == kArrayTypeID);
+		assert(_type == kArrayTypeID || _type == kArrayTypeInt16);
 
 		if (getSciVersion() >= SCI_VERSION_3) {
 			resize(index);
@@ -660,18 +671,7 @@ public:
 		resize(index + count);
 
 		switch (_type) {
-		case kArrayTypeInt16: {
-			const reg_t *source = values;
-			int16 *target = (int16 *)_data + index;
-			while (count--) {
-				if (!source->isNumber()) {
-					error("Non-number %04x:%04x sent to int16 array", PRINT_REG(*source));
-				}
-				*target++ = source->toSint16();
-				++source;
-			}
-			break;
-		}
+		case kArrayTypeInt16:
 		case kArrayTypeID: {
 			const reg_t *source = values;
 			reg_t *target = (reg_t *)_data + index;
@@ -714,14 +714,7 @@ public:
 		resize(index + count);
 
 		switch (_type) {
-		case kArrayTypeInt16: {
-			const int16 fillValue = value.toSint16();
-			int16 *target = (int16 *)_data + index;
-			while (count--) {
-				*target++ = fillValue;
-			}
-			break;
-		}
+		case kArrayTypeInt16:
 		case kArrayTypeID: {
 			reg_t *target = (reg_t *)_data + index;
 			while (count--) {
@@ -1129,8 +1122,9 @@ public:
 		const int length = getWidth() * getHeight();
 		uint8 *pixel = getPixels();
 		for (int i = 0; i < length; ++i) {
-			uint8 color = clut.int16At(*pixel);
-			*pixel++ = color;
+			const int16 color = clut.getAsInt16(*pixel);
+			assert(color >= 0 && color <= 255);
+			*pixel++ = (uint8)color;
 		}
 	}
 };
diff --git a/engines/sci/graphics/transitions32.cpp b/engines/sci/graphics/transitions32.cpp
index bffbd54..ee230f5 100644
--- a/engines/sci/graphics/transitions32.cpp
+++ b/engines/sci/graphics/transitions32.cpp
@@ -280,7 +280,7 @@ void GfxTransitions32::kernelSetShowStyle(const uint16 argc, const reg_t planeOb
 				if (rangeCount > 0) {
 					entry->fadeColorRanges = new uint16[rangeCount];
 					for (size_t i = 0; i < rangeCount; ++i) {
-						entry->fadeColorRanges[i] = table.int16At(i);
+						entry->fadeColorRanges[i] = table.getAsInt16(i);
 					}
 				}
 			}


Commit: 40444b0aeb11da5ccde497866bffdc80e18392b8
    https://github.com/scummvm/scummvm/commit/40444b0aeb11da5ccde497866bffdc80e18392b8
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-10-09T11:21:46-05:00

Commit Message:
SCI32: Clarify some identifiers

transparentColor -> skipColor
displace -> origin
scaledWidth -> xResolution
scaledHeight -> yResolution

Changed paths:
    engines/sci/engine/kernel.h
    engines/sci/engine/kernel_tables.h
    engines/sci/engine/kgraphics32.cpp
    engines/sci/engine/seg_manager.cpp
    engines/sci/engine/seg_manager.h
    engines/sci/engine/segment.h
    engines/sci/graphics/celobj32.cpp
    engines/sci/graphics/celobj32.h
    engines/sci/graphics/controls32.cpp
    engines/sci/graphics/cursor32.cpp
    engines/sci/graphics/frameout.cpp
    engines/sci/graphics/screen_item32.cpp
    engines/sci/graphics/text32.cpp
    engines/sci/graphics/text32.h
    engines/sci/video/robot_decoder.cpp



diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index 05e15da..cce9a22 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -563,7 +563,7 @@ reg_t kBitmapDrawText(EngineState *s, int argc, reg_t *argv);
 reg_t kBitmapDrawColor(EngineState *s, int argc, reg_t *argv);
 reg_t kBitmapDrawBitmap(EngineState *s, int argc, reg_t *argv);
 reg_t kBitmapInvert(EngineState *s, int argc, reg_t *argv);
-reg_t kBitmapSetDisplace(EngineState *s, int argc, reg_t *argv);
+reg_t kBitmapSetOrigin(EngineState *s, int argc, reg_t *argv);
 reg_t kBitmapCreateFromView(EngineState *s, int argc, reg_t *argv);
 reg_t kBitmapCopyPixels(EngineState *s, int argc, reg_t *argv);
 reg_t kBitmapClone(EngineState *s, int argc, reg_t *argv);
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index 6b31569..0f1210e 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -391,7 +391,7 @@ static const SciKernelMapSubEntry kBitmap_subops[] = {
 	{ SIG_SINCE_SCI21,     5, MAP_CALL(BitmapDrawColor),           "riiiii",               NULL },
 	{ SIG_SINCE_SCI21,     6, MAP_CALL(BitmapDrawBitmap),          "rr(i)(i)(i)",          NULL },
 	{ SIG_SINCE_SCI21,     7, MAP_CALL(BitmapInvert),              "riiiiii",              NULL },
-	{ SIG_SINCE_SCI21MID,  8, MAP_CALL(BitmapSetDisplace),         "rii",                  NULL },
+	{ SIG_SINCE_SCI21MID,  8, MAP_CALL(BitmapSetOrigin),           "rii",                  NULL },
 	{ SIG_SINCE_SCI21MID,  9, MAP_CALL(BitmapCreateFromView),      "iii(i)(i)(i)([r0])",   NULL },
 	{ SIG_SINCE_SCI21MID, 10, MAP_CALL(BitmapCopyPixels),          "rr",                   NULL },
 	{ SIG_SINCE_SCI21MID, 11, MAP_CALL(BitmapClone),               "r",                    NULL },
diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp
index b8dc3e4..e5b8da4 100644
--- a/engines/sci/engine/kgraphics32.cpp
+++ b/engines/sci/engine/kgraphics32.cpp
@@ -75,14 +75,14 @@ reg_t kBaseSetter32(EngineState *s, int argc, reg_t *argv) {
 	CelObjView celObj(viewId, loopNo, celNo);
 
 	const int16 scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth;
-	const Ratio scaleX(scriptWidth, celObj._scaledWidth);
+	const Ratio scaleX(scriptWidth, celObj._xResolution);
 
 	int16 brLeft;
 
 	if (celObj._mirrorX) {
-		brLeft = x - ((celObj._width - celObj._displace.x) * scaleX).toInt();
+		brLeft = x - ((celObj._width - celObj._origin.x) * scaleX).toInt();
 	} else {
-		brLeft = x - (celObj._displace.x * scaleX).toInt();
+		brLeft = x - (celObj._origin.x * scaleX).toInt();
 	}
 
 	const int16 brRight = brLeft + (celObj._width * scaleX).toInt() - 1;
@@ -427,7 +427,7 @@ reg_t kCelHigh32(EngineState *s, int argc, reg_t *argv) {
 	int16 loopNo = argv[1].toSint16();
 	int16 celNo = argv[2].toSint16();
 	CelObjView celObj(resourceId, loopNo, celNo);
-	return make_reg(0, mulru(celObj._height, Ratio(g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight, celObj._scaledHeight)));
+	return make_reg(0, mulru(celObj._height, Ratio(g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight, celObj._yResolution)));
 }
 
 reg_t kCelWide32(EngineState *s, int argc, reg_t *argv) {
@@ -435,7 +435,7 @@ reg_t kCelWide32(EngineState *s, int argc, reg_t *argv) {
 	int16 loopNo = argv[1].toSint16();
 	int16 celNo = argv[2].toSint16();
 	CelObjView celObj(resourceId, loopNo, celNo);
-	return make_reg(0, mulru(celObj._width, Ratio(g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth, celObj._scaledWidth)));
+	return make_reg(0, mulru(celObj._width, Ratio(g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth, celObj._xResolution)));
 }
 
 reg_t kCelInfo(EngineState *s, int argc, reg_t *argv) {
@@ -448,10 +448,10 @@ reg_t kCelInfo(EngineState *s, int argc, reg_t *argv) {
 
 	switch (argv[0].toUint16()) {
 	case 0:
-		result = view._displace.x;
+		result = view._origin.x;
 		break;
 	case 1:
-		result = view._displace.y;
+		result = view._origin.y;
 		break;
 	case 2:
 	case 3:
@@ -616,13 +616,13 @@ reg_t kSetFontHeight(EngineState *s, int argc, reg_t *argv) {
 	// of setting the fontHeight on the font manager, in
 	// which case we could just get the font directly ourselves.
 	g_sci->_gfxText32->setFont(argv[0].toUint16());
-	g_sci->_gfxText32->_scaledHeight = (g_sci->_gfxText32->_font->getHeight() * g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight + g_sci->_gfxText32->_scaledHeight - 1) / g_sci->_gfxText32->_scaledHeight;
-	return make_reg(0, g_sci->_gfxText32->_scaledHeight);
+	g_sci->_gfxText32->_yResolution = (g_sci->_gfxText32->_font->getHeight() * g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight + g_sci->_gfxText32->_yResolution - 1) / g_sci->_gfxText32->_yResolution;
+	return make_reg(0, g_sci->_gfxText32->_yResolution);
 }
 
 reg_t kSetFontRes(EngineState *s, int argc, reg_t *argv) {
-	g_sci->_gfxText32->_scaledWidth = argv[0].toUint16();
-	g_sci->_gfxText32->_scaledHeight = argv[1].toUint16();
+	g_sci->_gfxText32->_xResolution = argv[0].toUint16();
+	g_sci->_gfxText32->_yResolution = argv[1].toUint16();
 	return s->r_acc;
 }
 
@@ -637,12 +637,12 @@ reg_t kBitmapCreate(EngineState *s, int argc, reg_t *argv) {
 	int16 height = argv[1].toSint16();
 	int16 skipColor = argv[2].toSint16();
 	int16 backColor = argv[3].toSint16();
-	int16 scaledWidth = argc > 4 ? argv[4].toSint16() : g_sci->_gfxText32->_scaledWidth;
-	int16 scaledHeight = argc > 5 ? argv[5].toSint16() : g_sci->_gfxText32->_scaledHeight;
+	int16 xResolution = argc > 4 ? argv[4].toSint16() : g_sci->_gfxText32->_xResolution;
+	int16 yResolution = argc > 5 ? argv[5].toSint16() : g_sci->_gfxText32->_yResolution;
 	bool useRemap = argc > 6 ? argv[6].toSint16() : false;
 
 	reg_t bitmapId;
-	SciBitmap &bitmap = *s->_segMan->allocateBitmap(&bitmapId, width, height, skipColor, 0, 0, scaledWidth, scaledHeight, 0, useRemap, true);
+	SciBitmap &bitmap = *s->_segMan->allocateBitmap(&bitmapId, width, height, skipColor, 0, 0, xResolution, yResolution, 0, useRemap, true);
 	memset(bitmap.getPixels(), backColor, width * height);
 	return bitmapId;
 }
@@ -676,12 +676,12 @@ reg_t kBitmapDrawView(EngineState *s, int argc, reg_t *argv) {
 	const int16 alignY = argc > 8 ? argv[8].toSint16() : -1;
 
 	Common::Point position(
-		x == -1 ? bitmap.getDisplace().x : x,
-		y == -1 ? bitmap.getDisplace().y : y
+		x == -1 ? bitmap.getOrigin().x : x,
+		y == -1 ? bitmap.getOrigin().y : y
 	);
 
-	position.x -= alignX == -1 ? view._displace.x : alignX;
-	position.y -= alignY == -1 ? view._displace.y : alignY;
+	position.x -= alignX == -1 ? view._origin.x : alignX;
+	position.y -= alignY == -1 ? view._origin.y : alignY;
 
 	Common::Rect drawRect(
 		position.x,
@@ -756,20 +756,20 @@ reg_t kBitmapInvert(EngineState *s, int argc, reg_t *argv) {
 	return kStubNull(s, argc + 1, argv - 1);
 }
 
-reg_t kBitmapSetDisplace(EngineState *s, int argc, reg_t *argv) {
+reg_t kBitmapSetOrigin(EngineState *s, int argc, reg_t *argv) {
 	SciBitmap &bitmap = *s->_segMan->lookupBitmap(argv[0]);
-	bitmap.setDisplace(Common::Point(argv[1].toSint16(), argv[2].toSint16()));
+	bitmap.setOrigin(Common::Point(argv[1].toSint16(), argv[2].toSint16()));
 	return s->r_acc;
 }
 
 reg_t kBitmapCreateFromView(EngineState *s, int argc, reg_t *argv) {
 	CelObjView view(argv[0].toUint16(), argv[1].toSint16(), argv[2].toSint16());
-	const uint8 skipColor = argc > 3 && argv[3].toSint16() != -1 ? argv[3].toSint16() : view._transparentColor;
-	const uint8 backColor = argc > 4 && argv[4].toSint16() != -1 ? argv[4].toSint16() : view._transparentColor;
+	const uint8 skipColor = argc > 3 && argv[3].toSint16() != -1 ? argv[3].toSint16() : view._skipColor;
+	const uint8 backColor = argc > 4 && argv[4].toSint16() != -1 ? argv[4].toSint16() : view._skipColor;
 	const bool useRemap = argc > 5 ? (bool)argv[5].toSint16() : false;
 
 	reg_t bitmapId;
-	SciBitmap &bitmap = *s->_segMan->allocateBitmap(&bitmapId, view._width, view._height, skipColor, 0, 0, view._scaledWidth, view._scaledHeight, 0, useRemap, true);
+	SciBitmap &bitmap = *s->_segMan->allocateBitmap(&bitmapId, view._width, view._height, skipColor, 0, 0, view._xResolution, view._yResolution, 0, useRemap, true);
 	Buffer &buffer = bitmap.getBuffer();
 
 	const Common::Rect viewRect(view._width, view._height);
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index ced3830..83e7495 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -913,7 +913,7 @@ bool SegManager::isArray(reg_t addr) const {
 #pragma mark -
 #pragma mark Bitmaps
 
-SciBitmap *SegManager::allocateBitmap(reg_t *addr, const int16 width, const int16 height, const uint8 skipColor, const int16 displaceX, const int16 displaceY, const int16 scaledWidth, const int16 scaledHeight, const uint32 paletteSize, const bool remap, const bool gc) {
+SciBitmap *SegManager::allocateBitmap(reg_t *addr, const int16 width, const int16 height, const uint8 skipColor, const int16 originX, const int16 originY, const int16 xResolution, const int16 yResolution, const uint32 paletteSize, const bool remap, const bool gc) {
 	BitmapTable *table;
 	int offset;
 
@@ -928,7 +928,7 @@ SciBitmap *SegManager::allocateBitmap(reg_t *addr, const int16 width, const int1
 	*addr = make_reg(_bitmapSegId, offset);
 	SciBitmap &bitmap = table->at(offset);
 
-	bitmap.create(width, height, skipColor, displaceX, displaceY, scaledWidth, scaledHeight, paletteSize, remap, gc);
+	bitmap.create(width, height, skipColor, originX, originY, xResolution, yResolution, paletteSize, remap, gc);
 
 	return &bitmap;
 }
diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h
index 60d0ee5..c409744 100644
--- a/engines/sci/engine/seg_manager.h
+++ b/engines/sci/engine/seg_manager.h
@@ -438,7 +438,7 @@ public:
 	void freeArray(reg_t addr);
 	bool isArray(reg_t addr) const;
 
-	SciBitmap *allocateBitmap(reg_t *addr, const int16 width, const int16 height, const uint8 skipColor = kDefaultSkipColor, const int16 displaceX = 0, const int16 displaceY = 0, const int16 scaledWidth = kLowResX, const int16 scaledHeight = kLowResY, const uint32 paletteSize = 0, const bool remap = false, const bool gc = true);
+	SciBitmap *allocateBitmap(reg_t *addr, const int16 width, const int16 height, const uint8 skipColor = kDefaultSkipColor, const int16 originX = 0, const int16 originY = 0, const int16 xResolution = kLowResX, const int16 yResolution = kLowResY, const uint32 paletteSize = 0, const bool remap = false, const bool gc = true);
 	SciBitmap *lookupBitmap(reg_t addr);
 	void freeBitmap(reg_t addr);
 #endif
diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h
index e62b4fa..361c1cb 100644
--- a/engines/sci/engine/segment.h
+++ b/engines/sci/engine/segment.h
@@ -963,7 +963,7 @@ public:
 	/**
 	 * Allocates and initialises a new bitmap.
 	 */
-	inline void create(const int16 width, const int16 height, const uint8 skipColor, const int16 displaceX, const int16 displaceY, const int16 scaledWidth, const int16 scaledHeight, const uint32 paletteSize, const bool remap, const bool gc) {
+	inline void create(const int16 width, const int16 height, const uint8 skipColor, const int16 originX, const int16 originY, const int16 xResolution, const int16 yResolution, const uint32 paletteSize, const bool remap, const bool gc) {
 
 		_dataSize = getBitmapSize(width, height) + paletteSize;
 		_data = (byte *)realloc(_data, _dataSize);
@@ -973,7 +973,7 @@ public:
 
 		setWidth(width);
 		setHeight(height);
-		setDisplace(Common::Point(displaceX, displaceY));
+		setOrigin(Common::Point(originX, originY));
 		setSkipColor(skipColor);
 		_data[9] = 0;
 		WRITE_SCI11ENDIAN_UINT16(_data + 10, 0);
@@ -984,8 +984,8 @@ public:
 		setDataOffset(bitmapHeaderSize);
 		setUncompressedDataOffset(bitmapHeaderSize);
 		setControlOffset(0);
-		setScaledWidth(scaledWidth);
-		setScaledHeight(scaledHeight);
+		setXResolution(xResolution);
+		setYResolution(yResolution);
 
 		_buffer = Buffer(getWidth(), getHeight(), getPixels());
 	}
@@ -1017,16 +1017,16 @@ public:
 	BITMAP_PROPERTY(16, Width, 0);
 	BITMAP_PROPERTY(16, Height, 2);
 
-	inline Common::Point getDisplace() const {
+	inline Common::Point getOrigin() const {
 		return Common::Point(
 			(int16)READ_SCI11ENDIAN_UINT16(_data + 4),
 			(int16)READ_SCI11ENDIAN_UINT16(_data + 6)
 		);
 	}
 
-	inline void setDisplace(const Common::Point &displace) {
-		WRITE_SCI11ENDIAN_UINT16(_data + 4, (uint16)displace.x);
-		WRITE_SCI11ENDIAN_UINT16(_data + 6, (uint16)displace.y);
+	inline void setOrigin(const Common::Point &origin) {
+		WRITE_SCI11ENDIAN_UINT16(_data + 4, (uint16)origin.x);
+		WRITE_SCI11ENDIAN_UINT16(_data + 6, (uint16)origin.y);
 	}
 
 	inline uint8 getSkipColor() const {
@@ -1075,7 +1075,7 @@ public:
 	// NOTE: This property always seems to be zero
 	BITMAP_PROPERTY(32, ControlOffset, 32);
 
-	inline uint16 getScaledWidth() const {
+	inline uint16 getXResolution() const {
 		if (getDataOffset() >= 40) {
 			return READ_SCI11ENDIAN_UINT16(_data + 36);
 		}
@@ -1084,13 +1084,13 @@ public:
 		return 320;
 	}
 
-	inline void setScaledWidth(uint16 scaledWidth) {
+	inline void setXResolution(uint16 xResolution) {
 		if (getDataOffset() >= 40) {
-			WRITE_SCI11ENDIAN_UINT16(_data + 36, scaledWidth);
+			WRITE_SCI11ENDIAN_UINT16(_data + 36, xResolution);
 		}
 	}
 
-	inline uint16 getScaledHeight() const {
+	inline uint16 getYResolution() const {
 		if (getDataOffset() >= 40) {
 			return READ_SCI11ENDIAN_UINT16(_data + 38);
 		}
@@ -1099,9 +1099,9 @@ public:
 		return 200;
 	}
 
-	inline void setScaledHeight(uint16 scaledHeight) {
+	inline void setYResolution(uint16 yResolution) {
 		if (getDataOffset() >= 40) {
-			WRITE_SCI11ENDIAN_UINT16(_data + 38, scaledHeight);
+			WRITE_SCI11ENDIAN_UINT16(_data + 38, yResolution);
 		}
 	}
 
diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp
index f538bf6..430500c 100644
--- a/engines/sci/graphics/celobj32.cpp
+++ b/engines/sci/graphics/celobj32.cpp
@@ -287,7 +287,7 @@ private:
 	uint32 _uncompressedDataOffset;
 	int16 _y;
 	const int16 _sourceHeight;
-	const uint8 _transparentColor;
+	const uint8 _skipColor;
 	const int16 _maxWidth;
 
 public:
@@ -295,7 +295,7 @@ public:
 	_resource(celObj.getResPointer()),
 	_y(-1),
 	_sourceHeight(celObj._height),
-	_transparentColor(celObj._transparentColor),
+	_skipColor(celObj._skipColor),
 	_maxWidth(maxWidth) {
 		assert(maxWidth <= celObj._width);
 
@@ -326,7 +326,7 @@ public:
 
 					// Fill with skip color
 					if (controlByte & 0x40) {
-						memset(_buffer + i, _transparentColor, length);
+						memset(_buffer + i, _skipColor, length);
 					// Next value is fill color
 					} else {
 						memset(_buffer + i, *literal, length);
@@ -665,7 +665,7 @@ void CelObj::render(Buffer &target, const Common::Rect &targetRect, const Common
 
 	MAPPER mapper;
 	SCALER scaler(*this, targetRect.left - scaledPosition.x + targetRect.width(), scaledPosition);
-	RENDERER<MAPPER, SCALER, false> renderer(mapper, scaler, _transparentColor);
+	RENDERER<MAPPER, SCALER, false> renderer(mapper, scaler, _skipColor);
 	renderer.draw(target, targetRect, scaledPosition);
 }
 
@@ -675,10 +675,10 @@ void CelObj::render(Buffer &target, const Common::Rect &targetRect, const Common
 	MAPPER mapper;
 	SCALER scaler(*this, targetRect, scaledPosition, scaleX, scaleY);
 	if (_drawBlackLines) {
-		RENDERER<MAPPER, SCALER, true> renderer(mapper, scaler, _transparentColor);
+		RENDERER<MAPPER, SCALER, true> renderer(mapper, scaler, _skipColor);
 		renderer.draw(target, targetRect, scaledPosition);
 	} else {
-		RENDERER<MAPPER, SCALER, false> renderer(mapper, scaler, _transparentColor);
+		RENDERER<MAPPER, SCALER, false> renderer(mapper, scaler, _skipColor);
 		renderer.draw(target, targetRect, scaledPosition);
 	}
 }
@@ -891,20 +891,20 @@ CelObjView::CelObjView(const GuiResourceId viewId, const int16 loopNo, const int
 
 	const byte *const data = resource->data;
 
-	_scaledWidth = READ_SCI11ENDIAN_UINT16(data + 14);
-	_scaledHeight = READ_SCI11ENDIAN_UINT16(data + 16);
+	_xResolution = READ_SCI11ENDIAN_UINT16(data + 14);
+	_yResolution = READ_SCI11ENDIAN_UINT16(data + 16);
 
-	if (_scaledWidth == 0 && _scaledHeight == 0) {
+	if (_xResolution == 0 && _yResolution == 0) {
 		byte sizeFlag = data[5];
 		if (sizeFlag == 0) {
-			_scaledWidth = kLowResX;
-			_scaledHeight = kLowResY;
+			_xResolution = kLowResX;
+			_yResolution = kLowResY;
 		} else if (sizeFlag == 1) {
-			_scaledWidth = 640;
-			_scaledHeight = 480;
+			_xResolution = 640;
+			_yResolution = 480;
 		} else if (sizeFlag == 2) {
-			_scaledWidth = 640;
-			_scaledHeight = 400;
+			_xResolution = 640;
+			_yResolution = 400;
 		}
 	}
 
@@ -958,9 +958,9 @@ CelObjView::CelObjView(const GuiResourceId viewId, const int16 loopNo, const int
 
 	_width = READ_SCI11ENDIAN_UINT16(celHeader);
 	_height = READ_SCI11ENDIAN_UINT16(celHeader + 2);
-	_displace.x = _width / 2 - (int16)READ_SCI11ENDIAN_UINT16(celHeader + 4);
-	_displace.y = _height - (int16)READ_SCI11ENDIAN_UINT16(celHeader + 6) - 1;
-	_transparentColor = celHeader[8];
+	_origin.x = _width / 2 - (int16)READ_SCI11ENDIAN_UINT16(celHeader + 4);
+	_origin.y = _height - (int16)READ_SCI11ENDIAN_UINT16(celHeader + 6) - 1;
+	_skipColor = celHeader[8];
 	_compressionType = (CelCompressionType)celHeader[9];
 
 	if (_compressionType != kCelCompressionNone && _compressionType != kCelCompressionRLE) {
@@ -989,7 +989,7 @@ bool CelObjView::analyzeUncompressedForRemap() const {
 		if (
 			pixel >= g_sci->_gfxRemap32->getStartColor() &&
 			pixel <= g_sci->_gfxRemap32->getEndColor() &&
-			pixel != _transparentColor
+			pixel != _skipColor
 		) {
 			return true;
 		}
@@ -1006,7 +1006,7 @@ bool CelObjView::analyzeForRemap() const {
 			if (
 				pixel >= g_sci->_gfxRemap32->getStartColor() &&
 				pixel <= g_sci->_gfxRemap32->getEndColor() &&
-				pixel != _transparentColor
+				pixel != _skipColor
 			) {
 				return true;
 			}
@@ -1080,9 +1080,9 @@ CelObjPic::CelObjPic(const GuiResourceId picId, const int16 celNo) {
 
 	_width = READ_SCI11ENDIAN_UINT16(celHeader);
 	_height = READ_SCI11ENDIAN_UINT16(celHeader + 2);
-	_displace.x = (int16)READ_SCI11ENDIAN_UINT16(celHeader + 4);
-	_displace.y = (int16)READ_SCI11ENDIAN_UINT16(celHeader + 6);
-	_transparentColor = celHeader[8];
+	_origin.x = (int16)READ_SCI11ENDIAN_UINT16(celHeader + 4);
+	_origin.y = (int16)READ_SCI11ENDIAN_UINT16(celHeader + 6);
+	_skipColor = celHeader[8];
 	_compressionType = (CelCompressionType)celHeader[9];
 	_priority = READ_SCI11ENDIAN_UINT16(celHeader + 36);
 	_relativePosition.x = (int16)READ_SCI11ENDIAN_UINT16(celHeader + 38);
@@ -1092,17 +1092,17 @@ CelObjPic::CelObjPic(const GuiResourceId picId, const int16 celNo) {
 	const uint16 sizeFlag2 = READ_SCI11ENDIAN_UINT16(data + 12);
 
 	if (sizeFlag2) {
-		_scaledWidth = sizeFlag1;
-		_scaledHeight = sizeFlag2;
+		_xResolution = sizeFlag1;
+		_yResolution = sizeFlag2;
 	} else if (sizeFlag1 == 0) {
-		_scaledWidth = kLowResX;
-		_scaledHeight = kLowResY;
+		_xResolution = kLowResX;
+		_yResolution = kLowResY;
 	} else if (sizeFlag1 == 1) {
-		_scaledWidth = 640;
-		_scaledHeight = 480;
+		_xResolution = 640;
+		_yResolution = 480;
 	} else if (sizeFlag1 == 2) {
-		_scaledWidth = 640;
-		_scaledHeight = 400;
+		_xResolution = 640;
+		_yResolution = 400;
 	}
 
 	if (celHeader[10] & 128) {
@@ -1127,7 +1127,7 @@ bool CelObjPic::analyzeUncompressedForSkip() const {
 	const byte *const pixels = resource + READ_SCI11ENDIAN_UINT32(resource + _celHeaderOffset + 24);
 	for (int i = 0; i < _width * _height; ++i) {
 		uint8 pixel = pixels[i];
-		if (pixel == _transparentColor) {
+		if (pixel == _skipColor) {
 			return true;
 		}
 	}
@@ -1173,10 +1173,10 @@ CelObjMem::CelObjMem(const reg_t bitmapObject) {
 
 	_width = bitmap->getWidth();
 	_height = bitmap->getHeight();
-	_displace = bitmap->getDisplace();
-	_transparentColor = bitmap->getSkipColor();
-	_scaledWidth = bitmap->getScaledWidth();
-	_scaledHeight = bitmap->getScaledHeight();
+	_origin = bitmap->getOrigin();
+	_skipColor = bitmap->getSkipColor();
+	_xResolution = bitmap->getXResolution();
+	_yResolution = bitmap->getYResolution();
 	_hunkPaletteOffset = bitmap->getHunkPaletteOffset();
 	_remap = bitmap->getRemap();
 }
@@ -1195,10 +1195,10 @@ byte *CelObjMem::getResPointer() const {
 CelObjColor::CelObjColor(const uint8 color, const int16 width, const int16 height) {
 	_info.type = kCelTypeColor;
 	_info.color = color;
-	_displace.x = 0;
-	_displace.y = 0;
-	_scaledWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth;
-	_scaledHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight;
+	_origin.x = 0;
+	_origin.y = 0;
+	_xResolution = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth;
+	_yResolution = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight;
 	_hunkPaletteOffset = 0;
 	_mirrorX = false;
 	_remap = false;
diff --git a/engines/sci/graphics/celobj32.h b/engines/sci/graphics/celobj32.h
index c30529f..03d950a 100644
--- a/engines/sci/graphics/celobj32.h
+++ b/engines/sci/graphics/celobj32.h
@@ -286,7 +286,7 @@ public:
 	/**
 	 * TODO: Documentation
 	 */
-	Common::Point _displace;
+	Common::Point _origin;
 
 	/**
 	 * The dimensions of the original coordinate system for
@@ -301,21 +301,21 @@ public:
 	 * scriptWidth/Height but seems to typically be changed
 	 * to more closely match the native screen resolution.
 	 */
-	uint16 _scaledWidth, _scaledHeight;
+	uint16 _xResolution, _yResolution;
 
 	/**
 	 * The skip (transparent) color for the cel. When
 	 * compositing, any pixels matching this color will not
 	 * be copied to the buffer.
 	 */
-	uint8 _transparentColor;
+	uint8 _skipColor;
 
 	/**
 	 * Whether or not this cel has any transparent regions.
 	 * This is used for optimised drawing of non-transparent
 	 * cels.
 	 */
-	bool _transparent; // TODO: probably "skip"?
+	bool _transparent;
 
 	/**
 	 * The compression type for the pixel data for this cel.
diff --git a/engines/sci/graphics/controls32.cpp b/engines/sci/graphics/controls32.cpp
index 89997d3..4ec534f 100644
--- a/engines/sci/graphics/controls32.cpp
+++ b/engines/sci/graphics/controls32.cpp
@@ -400,7 +400,7 @@ ScrollWindow::ScrollWindow(SegManager *segMan, const Common::Rect &gameRect, con
 	const uint16 scriptHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight;
 
 	Common::Rect bitmapRect(gameRect);
-	mulinc(bitmapRect, Ratio(_gfxText32._scaledWidth, scriptWidth), Ratio(_gfxText32._scaledHeight, scriptHeight));
+	mulinc(bitmapRect, Ratio(_gfxText32._xResolution, scriptWidth), Ratio(_gfxText32._yResolution, scriptHeight));
 
 	_textRect.left = 2;
 	_textRect.top = 2;
diff --git a/engines/sci/graphics/cursor32.cpp b/engines/sci/graphics/cursor32.cpp
index 7889d61..2f2611c 100644
--- a/engines/sci/graphics/cursor32.cpp
+++ b/engines/sci/graphics/cursor32.cpp
@@ -182,7 +182,7 @@ void GfxCursor32::setView(const GuiResourceId viewId, const int16 loopNo, const
 	if (_macCursorRemap.empty() && viewId != -1) {
 		CelObjView view(viewId, loopNo, celNo);
 
-		_hotSpot = view._displace;
+		_hotSpot = view._origin;
 		_width = view._width;
 		_height = view._height;
 
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index c5c06c6..9451841 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -1344,7 +1344,7 @@ bool GfxFrameout::isOnMe(const ScreenItem &screenItem, const Plane &plane, const
 		scaledPosition.x -= screenItem._scaledPosition.x;
 		scaledPosition.y -= screenItem._scaledPosition.y;
 
-		mulru(scaledPosition, Ratio(celObj._scaledWidth, _currentBuffer.screenWidth), Ratio(celObj._scaledHeight, _currentBuffer.screenHeight));
+		mulru(scaledPosition, Ratio(celObj._xResolution, _currentBuffer.screenWidth), Ratio(celObj._yResolution, _currentBuffer.screenHeight));
 
 		if (screenItem._scale.signal != kScaleSignalNone && screenItem._scale.x && screenItem._scale.y) {
 			scaledPosition.x = scaledPosition.x * 128 / screenItem._scale.x;
@@ -1352,7 +1352,7 @@ bool GfxFrameout::isOnMe(const ScreenItem &screenItem, const Plane &plane, const
 		}
 
 		uint8 pixel = celObj.readPixel(scaledPosition.x, scaledPosition.y, mirrorX);
-		return pixel != celObj._transparentColor;
+		return pixel != celObj._skipColor;
 	}
 
 	return true;
diff --git a/engines/sci/graphics/screen_item32.cpp b/engines/sci/graphics/screen_item32.cpp
index 0956ef7..9b0d390 100644
--- a/engines/sci/graphics/screen_item32.cpp
+++ b/engines/sci/graphics/screen_item32.cpp
@@ -275,18 +275,18 @@ void ScreenItem::calcRects(const Plane &plane) {
 	if (scaleX.getNumerator() && scaleY.getNumerator()) {
 		_screenItemRect = _insetRect;
 
-		const Ratio celToScreenX(screenWidth, celObj._scaledWidth);
-		const Ratio celToScreenY(screenHeight, celObj._scaledHeight);
+		const Ratio celToScreenX(screenWidth, celObj._xResolution);
+		const Ratio celToScreenY(screenHeight, celObj._yResolution);
 
 		// Cel may use a coordinate system that is not the same size as the
 		// script coordinate system (usually this means high-resolution
 		// pictures with low-resolution scripts)
-		if (celObj._scaledWidth != kLowResX || celObj._scaledHeight != kLowResY) {
+		if (celObj._xResolution != kLowResX || celObj._yResolution != kLowResY) {
 			// high resolution coordinates
 
 			if (_useInsetRect) {
-				const Ratio scriptToCelX(celObj._scaledWidth, scriptWidth);
-				const Ratio scriptToCelY(celObj._scaledHeight, scriptHeight);
+				const Ratio scriptToCelX(celObj._xResolution, scriptWidth);
+				const Ratio scriptToCelY(celObj._yResolution, scriptHeight);
 				mulru(_screenItemRect, scriptToCelX, scriptToCelY, 0);
 
 				if (_screenItemRect.intersects(celRect)) {
@@ -296,11 +296,11 @@ void ScreenItem::calcRects(const Plane &plane) {
 				}
 			}
 
-			int displaceX = celObj._displace.x;
-			int displaceY = celObj._displace.y;
+			int originX = celObj._origin.x;
+			int originY = celObj._origin.y;
 
 			if (_mirrorX != celObj._mirrorX && _celInfo.type != kCelTypePic) {
-				displaceX = celObj._width - celObj._displace.x - 1;
+				originX = celObj._width - celObj._origin.x - 1;
 			}
 
 			if (!scaleX.isOne() || !scaleY.isOne()) {
@@ -328,13 +328,13 @@ void ScreenItem::calcRects(const Plane &plane) {
 					}
 				}
 
-				displaceX = (displaceX * scaleX).toInt();
-				displaceY = (displaceY * scaleY).toInt();
+				originX = (originX * scaleX).toInt();
+				originY = (originY * scaleY).toInt();
 			}
 
 			mulinc(_screenItemRect, celToScreenX, celToScreenY);
-			displaceX = (displaceX * celToScreenX).toInt();
-			displaceY = (displaceY * celToScreenY).toInt();
+			originX = (originX * celToScreenX).toInt();
+			originY = (originY * celToScreenY).toInt();
 
 			const Ratio scriptToScreenX = Ratio(screenWidth, scriptWidth);
 			const Ratio scriptToScreenY = Ratio(screenHeight, scriptHeight);
@@ -343,8 +343,8 @@ void ScreenItem::calcRects(const Plane &plane) {
 				_scaledPosition.x = _position.x;
 				_scaledPosition.y = _position.y;
 			} else {
-				_scaledPosition.x = (_position.x * scriptToScreenX).toInt() - displaceX;
-				_scaledPosition.y = (_position.y * scriptToScreenY).toInt() - displaceY;
+				_scaledPosition.x = (_position.x * scriptToScreenX).toInt() - originX;
+				_scaledPosition.y = (_position.y * scriptToScreenY).toInt() - originY;
 			}
 
 			_screenItemRect.translate(_scaledPosition.x, _scaledPosition.y);
@@ -362,7 +362,7 @@ void ScreenItem::calcRects(const Plane &plane) {
 				if (celObjPic == nullptr) {
 					error("Expected a CelObjPic");
 				}
-				temp.translate((celObjPic->_relativePosition.x * scriptToScreenX).toInt() - displaceX, 0);
+				temp.translate((celObjPic->_relativePosition.x * scriptToScreenX).toInt() - originX, 0);
 
 				// TODO: This is weird.
 				int deltaX = plane._planeRect.width() - temp.right - 1 - temp.left;
@@ -380,9 +380,9 @@ void ScreenItem::calcRects(const Plane &plane) {
 		} else {
 			// low resolution coordinates
 
-			int displaceX = celObj._displace.x;
+			int originX = celObj._origin.x;
 			if (_mirrorX != celObj._mirrorX && _celInfo.type != kCelTypePic) {
-				displaceX = celObj._width - celObj._displace.x - 1;
+				originX = celObj._width - celObj._origin.x - 1;
 			}
 
 			if (!scaleX.isOne() || !scaleY.isOne()) {
@@ -394,8 +394,8 @@ void ScreenItem::calcRects(const Plane &plane) {
 				_screenItemRect.bottom -= 1;
 			}
 
-			_scaledPosition.x = _position.x - (displaceX * scaleX).toInt();
-			_scaledPosition.y = _position.y - (celObj._displace.y * scaleY).toInt();
+			_scaledPosition.x = _position.x - (originX * scaleX).toInt();
+			_scaledPosition.y = _position.y - (celObj._origin.y * scaleY).toInt();
 			_screenItemRect.translate(_scaledPosition.x, _scaledPosition.y);
 
 			if (_mirrorX != celObj._mirrorX && _celInfo.type == kCelTypePic) {
@@ -410,7 +410,7 @@ void ScreenItem::calcRects(const Plane &plane) {
 				if (celObjPic == nullptr) {
 					error("Expected a CelObjPic");
 				}
-				temp.translate(celObjPic->_relativePosition.x - (displaceX * scaleX).toInt(), celObjPic->_relativePosition.y - (celObj._displace.y * scaleY).toInt());
+				temp.translate(celObjPic->_relativePosition.x - (originX * scaleX).toInt(), celObjPic->_relativePosition.y - (celObj._origin.y * scaleY).toInt());
 
 				// TODO: This is weird.
 				int deltaX = plane._gameRect.width() - temp.right - 1 - temp.left;
@@ -423,7 +423,7 @@ void ScreenItem::calcRects(const Plane &plane) {
 			_scaledPosition.y += plane._gameRect.top;
 			_screenItemRect.translate(plane._gameRect.left, plane._gameRect.top);
 
-			if (celObj._scaledWidth != screenWidth || celObj._scaledHeight != screenHeight) {
+			if (celObj._xResolution != screenWidth || celObj._yResolution != screenHeight) {
 				mulru(_scaledPosition, celToScreenX, celToScreenY);
 				mulru(_screenItemRect, celToScreenX, celToScreenY, 1);
 			}
@@ -517,11 +517,11 @@ void ScreenItem::printDebugInfo(Console *con) const {
 		_celInfo.color
 	);
 	if (_celObj != nullptr) {
-		con->debugPrintf("    width %d, height %d, scaledWidth %d, scaledHeight %d\n",
+		con->debugPrintf("    width %d, height %d, x-resolution %d, y-resolution %d\n",
 			_celObj->_width,
 			_celObj->_height,
-			_celObj->_scaledWidth,
-			_celObj->_scaledHeight
+			_celObj->_xResolution,
+			_celObj->_yResolution
 		);
 	}
 }
@@ -603,19 +603,19 @@ Common::Rect ScreenItem::getNowSeenRect(const Plane &plane) const {
 		return Common::Rect();
 	}
 
-	int16 displaceX = celObj._displace.x;
-	int16 displaceY = celObj._displace.y;
+	int16 originX = celObj._origin.x;
+	int16 originY = celObj._origin.y;
 
 	if (_mirrorX != celObj._mirrorX && _celInfo.type != kCelTypePic) {
-		displaceX = celObj._width - displaceX - 1;
+		originX = celObj._width - originX - 1;
 	}
 
-	if (celObj._scaledWidth != kLowResX || celObj._scaledHeight != kLowResY) {
+	if (celObj._xResolution != kLowResX || celObj._yResolution != kLowResY) {
 		// high resolution coordinates
 
 		if (_useInsetRect) {
-			Ratio scriptToCelX(celObj._scaledWidth, scriptWidth);
-			Ratio scriptToCelY(celObj._scaledHeight, scriptHeight);
+			Ratio scriptToCelX(celObj._xResolution, scriptWidth);
+			Ratio scriptToCelY(celObj._yResolution, scriptHeight);
 			mulru(nsRect, scriptToCelX, scriptToCelY, 0);
 
 			if (nsRect.intersects(celObjRect)) {
@@ -656,14 +656,14 @@ Common::Rect ScreenItem::getNowSeenRect(const Plane &plane) const {
 			}
 		}
 
-		Ratio celToScriptX(scriptWidth, celObj._scaledWidth);
-		Ratio celToScriptY(scriptHeight, celObj._scaledHeight);
+		Ratio celToScriptX(scriptWidth, celObj._xResolution);
+		Ratio celToScriptY(scriptHeight, celObj._yResolution);
 
-		displaceX = (displaceX * scaleX * celToScriptX).toInt();
-		displaceY = (displaceY * scaleY * celToScriptY).toInt();
+		originX = (originX * scaleX * celToScriptX).toInt();
+		originY = (originY * scaleY * celToScriptY).toInt();
 
 		mulinc(nsRect, celToScriptX, celToScriptY);
-		nsRect.translate(_position.x - displaceX, _position.y - displaceY);
+		nsRect.translate(_position.x - originX, _position.y - originY);
 	} else {
 		// low resolution coordinates
 
@@ -676,9 +676,9 @@ Common::Rect ScreenItem::getNowSeenRect(const Plane &plane) const {
 			nsRect.bottom -= 1;
 		}
 
-		displaceX = (displaceX * scaleX).toInt();
-		displaceY = (displaceY * scaleY).toInt();
-		nsRect.translate(_position.x - displaceX, _position.y - displaceY);
+		originX = (originX * scaleX).toInt();
+		originY = (originY * scaleY).toInt();
+		nsRect.translate(_position.x - originX, _position.y - originY);
 
 		if (_mirrorX != celObj._mirrorX && _celInfo.type != kCelTypePic) {
 			nsRect.translate(plane._gameRect.width() - nsRect.width(), 0);
diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp
index 254c7d9..d142ff7 100644
--- a/engines/sci/graphics/text32.cpp
+++ b/engines/sci/graphics/text32.cpp
@@ -39,8 +39,8 @@
 namespace Sci {
 
 int16 GfxText32::_defaultFontId = 0;
-int16 GfxText32::_scaledWidth = 0;
-int16 GfxText32::_scaledHeight = 0;
+int16 GfxText32::_xResolution = 0;
+int16 GfxText32::_yResolution = 0;
 
 GfxText32::GfxText32(SegManager *segMan, GfxCache *fonts) :
 	_segMan(segMan),
@@ -52,10 +52,10 @@ GfxText32::GfxText32(SegManager *segMan, GfxCache *fonts) :
 		_fontId = _defaultFontId;
 		_font = _cache->getFont(_defaultFontId);
 
-		if (_scaledWidth == 0) {
+		if (_xResolution == 0) {
 			// initialize the statics
-			_scaledWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth;
-			_scaledHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight;
+			_xResolution = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth;
+			_yResolution = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight;
 		}
 	}
 
@@ -78,8 +78,8 @@ reg_t GfxText32::createFontBitmap(int16 width, int16 height, const Common::Rect
 		int16 scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth;
 		int16 scriptHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight;
 
-		Ratio scaleX(_scaledWidth, scriptWidth);
-		Ratio scaleY(_scaledHeight, scriptHeight);
+		Ratio scaleX(_xResolution, scriptWidth);
+		Ratio scaleY(_yResolution, scriptHeight);
 
 		_width = (_width * scaleX).toInt();
 		_height = (_height * scaleY).toInt();
@@ -96,7 +96,7 @@ reg_t GfxText32::createFontBitmap(int16 width, int16 height, const Common::Rect
 		_textRect = Common::Rect();
 	}
 
-	_segMan->allocateBitmap(&_bitmap, _width, _height, _skipColor, 0, 0, _scaledWidth, _scaledHeight, 0, false, gc);
+	_segMan->allocateBitmap(&_bitmap, _width, _height, _skipColor, 0, 0, _xResolution, _yResolution, 0, false, gc);
 
 	erase(bitmapRect, false);
 
@@ -120,12 +120,12 @@ reg_t GfxText32::createFontBitmap(const CelInfo32 &celInfo, const Common::Rect &
 	int16 scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth;
 	int16 scriptHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight;
 
-	mulinc(_textRect, Ratio(_scaledWidth, scriptWidth), Ratio(_scaledHeight, scriptHeight));
+	mulinc(_textRect, Ratio(_xResolution, scriptWidth), Ratio(_yResolution, scriptHeight));
 
 	CelObjView view(celInfo.resourceId, celInfo.loopNo, celInfo.celNo);
-	_skipColor = view._transparentColor;
-	_width = view._width * _scaledWidth / view._scaledWidth;
-	_height = view._height * _scaledHeight / view._scaledHeight;
+	_skipColor = view._skipColor;
+	_width = view._width * _xResolution / view._xResolution;
+	_height = view._height * _yResolution / view._yResolution;
 
 	Common::Rect bitmapRect(_width, _height);
 	if (_textRect.intersects(bitmapRect)) {
@@ -134,7 +134,7 @@ reg_t GfxText32::createFontBitmap(const CelInfo32 &celInfo, const Common::Rect &
 		_textRect = Common::Rect();
 	}
 
-	SciBitmap &bitmap = *_segMan->allocateBitmap(&_bitmap, _width, _height, _skipColor, 0, 0, _scaledWidth, _scaledHeight, 0, false, gc);
+	SciBitmap &bitmap = *_segMan->allocateBitmap(&_bitmap, _width, _height, _skipColor, 0, 0, _xResolution, _yResolution, 0, false, gc);
 
 	// NOTE: The engine filled the bitmap pixels with 11 here, which is silly
 	// because then it just erased the bitmap using the skip color. So we don't
@@ -144,7 +144,7 @@ reg_t GfxText32::createFontBitmap(const CelInfo32 &celInfo, const Common::Rect &
 	erase(bitmapRect, false);
 	_backColor = backColor;
 
-	view.draw(bitmap.getBuffer(), bitmapRect, Common::Point(0, 0), false, Ratio(_scaledWidth, view._scaledWidth), Ratio(_scaledHeight, view._scaledHeight));
+	view.draw(bitmap.getBuffer(), bitmapRect, Common::Point(0, 0), false, Ratio(_xResolution, view._xResolution), Ratio(_yResolution, view._yResolution));
 
 	if (_backColor != skipColor && _foreColor != skipColor) {
 		erase(_textRect, false);
@@ -332,7 +332,7 @@ void GfxText32::drawText(const uint index, uint length) {
 void GfxText32::invertRect(const reg_t bitmapId, int16 bitmapStride, const Common::Rect &rect, const uint8 foreColor, const uint8 backColor, const bool doScaling) {
 	Common::Rect targetRect = rect;
 	if (doScaling) {
-		bitmapStride = bitmapStride * _scaledWidth / g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth;
+		bitmapStride = bitmapStride * _xResolution / g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth;
 		targetRect = scaleRect(rect);
 	}
 
@@ -557,13 +557,13 @@ Common::Rect GfxText32::getTextSize(const Common::String &text, int16 maxWidth,
 	int16 scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth;
 	int16 scriptHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight;
 
-	maxWidth = maxWidth * _scaledWidth / scriptWidth;
+	maxWidth = maxWidth * _xResolution / scriptWidth;
 
 	_text = text;
 
 	if (maxWidth >= 0) {
 		if (maxWidth == 0) {
-			maxWidth = _scaledWidth * 3 / 5;
+			maxWidth = _xResolution * 3 / 5;
 		}
 
 		result.right = maxWidth;
@@ -606,8 +606,8 @@ Common::Rect GfxText32::getTextSize(const Common::String &text, int16 maxWidth,
 	if (doScaling) {
 		// NOTE: The original engine code also scaled top/left but these are
 		// always zero so there is no reason to do that.
-		result.right = ((result.right - 1) * scriptWidth + _scaledWidth - 1) / _scaledWidth + 1;
-		result.bottom = ((result.bottom - 1) * scriptHeight + _scaledHeight - 1) / _scaledHeight + 1;
+		result.right = ((result.right - 1) * scriptWidth + _xResolution - 1) / _xResolution + 1;
+		result.bottom = ((result.bottom - 1) * scriptHeight + _yResolution - 1) / _yResolution + 1;
 	}
 
 	return result;
@@ -630,7 +630,7 @@ int16 GfxText32::getTextCount(const Common::String &text, const uint index, cons
 
 	Common::Rect scaledRect(textRect);
 	if (doScaling) {
-		mulinc(scaledRect, Ratio(_scaledWidth, scriptWidth), Ratio(_scaledHeight, scriptHeight));
+		mulinc(scaledRect, Ratio(_xResolution, scriptWidth), Ratio(_yResolution, scriptHeight));
 	}
 
 	Common::String oldText = _text;
diff --git a/engines/sci/graphics/text32.h b/engines/sci/graphics/text32.h
index 44bd48a..c4521a4 100644
--- a/engines/sci/graphics/text32.h
+++ b/engines/sci/graphics/text32.h
@@ -151,8 +151,8 @@ private:
 		Common::Rect scaledRect(rect);
 		int16 scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth;
 		int16 scriptHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight;
-		Ratio scaleX(_scaledWidth, scriptWidth);
-		Ratio scaleY(_scaledHeight, scriptHeight);
+		Ratio scaleX(_xResolution, scriptWidth);
+		Ratio scaleY(_yResolution, scriptHeight);
 		mulinc(scaledRect, scaleX, scaleY);
 		return scaledRect;
 	}
@@ -169,13 +169,13 @@ public:
 	 * The size of the x-dimension of the coordinate system
 	 * used by the text renderer. Static since it was global in SSCI.
 	 */
-	static int16 _scaledWidth;
+	static int16 _xResolution;
 
 	/**
 	 * The size of the y-dimension of the coordinate system
 	 * used by the text renderer. Static since it was global in SSCI.
 	 */
-	static int16 _scaledHeight;
+	static int16 _yResolution;
 
 	/**
 	 * The currently active font resource used to write text
@@ -199,12 +199,12 @@ public:
 
 	inline int scaleUpWidth(int value) const {
 		const int scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth;
-		return (value * scriptWidth + _scaledWidth - 1) / _scaledWidth;
+		return (value * scriptWidth + _xResolution - 1) / _xResolution;
 	}
 
 	inline int scaleUpHeight(int value) const {
 		const int scriptHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight;
-		return (value * scriptHeight + _scaledHeight - 1) / _scaledHeight;
+		return (value * scriptHeight + _yResolution - 1) / _yResolution;
 	}
 
 	/**
diff --git a/engines/sci/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp
index 0426dd0..446b986 100644
--- a/engines/sci/video/robot_decoder.cpp
+++ b/engines/sci/video/robot_decoder.cpp
@@ -703,7 +703,7 @@ void RobotDecoder::showFrame(const uint16 frameNo, const uint16 newX, const uint
 					const int16 lowResX = (scaledX * screenToLowResX).toInt();
 					const int16 lowResY = (scaledY2 * screenToLowResY).toInt();
 
-					bitmap.setDisplace(Common::Point(
+					bitmap.setOrigin(Common::Point(
 						(scaledX - (lowResX * lowResToScreenX).toInt()) * -1,
 						(lowResY * lowResToScreenY).toInt() - scaledY1
 					));
@@ -713,7 +713,7 @@ void RobotDecoder::showFrame(const uint16 frameNo, const uint16 newX, const uint
 				} else {
 					const int16 scaledX = _originalScreenItemX[i] + _position.x;
 					const int16 scaledY = _originalScreenItemY[i] + _position.y + bitmap.getHeight() - 1;
-					bitmap.setDisplace(Common::Point(0, bitmap.getHeight() - 1));
+					bitmap.setOrigin(Common::Point(0, bitmap.getHeight() - 1));
 					_screenItemX[i] = scaledX;
 					_screenItemY[i] = scaledY;
 				}
@@ -1461,7 +1461,7 @@ uint32 RobotDecoder::createCel5(const byte *rawVideoData, const int16 screenItem
 	const int16 screenWidth = g_sci->_gfxFrameout->getCurrentBuffer().screenWidth;
 	const int16 screenHeight = g_sci->_gfxFrameout->getCurrentBuffer().screenHeight;
 
-	Common::Point displace;
+	Common::Point origin;
 	if (scriptWidth == kLowResX && scriptHeight == kLowResY) {
 		const Ratio lowResToScreenX(screenWidth, kLowResX);
 		const Ratio lowResToScreenY(screenHeight, kLowResY);
@@ -1475,22 +1475,22 @@ uint32 RobotDecoder::createCel5(const byte *rawVideoData, const int16 screenItem
 		const int16 lowResX = (scaledX * screenToLowResX).toInt();
 		const int16 lowResY = (scaledY2 * screenToLowResY).toInt();
 
-		displace.x = (scaledX - (lowResX * lowResToScreenX).toInt()) * -1;
-		displace.y = (lowResY * lowResToScreenY).toInt() - scaledY1;
+		origin.x = (scaledX - (lowResX * lowResToScreenX).toInt()) * -1;
+		origin.y = (lowResY * lowResToScreenY).toInt() - scaledY1;
 		_screenItemX[screenItemIndex] = lowResX;
 		_screenItemY[screenItemIndex] = lowResY;
 
-		debugC(kDebugLevelVideo, "Low resolution position c: %d %d l: %d/%d %d/%d d: %d %d s: %d/%d %d/%d x: %d y: %d", celPosition.x, celPosition.y, lowResX, scriptWidth, lowResY, scriptHeight, displace.x, displace.y, scaledX, screenWidth, scaledY2, screenHeight, scaledX - displace.x, scaledY2 - displace.y);
+		debugC(kDebugLevelVideo, "Low resolution position c: %d %d l: %d/%d %d/%d d: %d %d s: %d/%d %d/%d x: %d y: %d", celPosition.x, celPosition.y, lowResX, scriptWidth, lowResY, scriptHeight, origin.x, origin.y, scaledX, screenWidth, scaledY2, screenHeight, scaledX - origin.x, scaledY2 - origin.y);
 	} else {
 		const int16 highResX = celPosition.x + _position.x;
 		const int16 highResY = celPosition.y + _position.y + celHeight - 1;
 
-		displace.x = 0;
-		displace.y = celHeight - 1;
+		origin.x = 0;
+		origin.y = celHeight - 1;
 		_screenItemX[screenItemIndex] = highResX;
 		_screenItemY[screenItemIndex] = highResY;
 
-		debugC(kDebugLevelVideo, "High resolution position c: %d %d s: %d %d d: %d %d", celPosition.x, celPosition.y, highResX, highResY, displace.x, displace.y);
+		debugC(kDebugLevelVideo, "High resolution position c: %d %d s: %d %d d: %d %d", celPosition.x, celPosition.y, highResX, highResY, origin.x, origin.y);
 	}
 
 	_originalScreenItemX[screenItemIndex] = celPosition.x;
@@ -1500,9 +1500,9 @@ uint32 RobotDecoder::createCel5(const byte *rawVideoData, const int16 screenItem
 
 	SciBitmap &bitmap = *_segMan->lookupBitmap(_celHandles[screenItemIndex].bitmapId);
 	assert(bitmap.getWidth() == celWidth && bitmap.getHeight() == celHeight);
-	assert(bitmap.getScaledWidth() == _xResolution && bitmap.getScaledHeight() == _yResolution);
+	assert(bitmap.getXResolution() == _xResolution && bitmap.getYResolution() == _yResolution);
 	assert(bitmap.getHunkPaletteOffset() == (uint32)bitmap.getWidth() * bitmap.getHeight() + SciBitmap::getBitmapHeaderSize());
-	bitmap.setDisplace(displace);
+	bitmap.setOrigin(origin);
 
 	byte *targetBuffer = nullptr;
 	if (_verticalScaleFactor == 100) {





More information about the Scummvm-git-logs mailing list