[Scummvm-git-logs] scummvm master -> 87cac81c5c850d135b68f8135c45fef7baf113d1

bluegr bluegr at gmail.com
Tue Mar 14 21:51:48 CET 2017


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:
7ccc55d53d CHEWY: Properly clip drawn text
87cac81c5c CHEWY: More work on room-specific animations. Some cleanup


Commit: 7ccc55d53d6394de39a8b2d35ba396482cf8eb56
    https://github.com/scummvm/scummvm/commit/7ccc55d53d6394de39a8b2d35ba396482cf8eb56
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2017-03-14T22:51:12+02:00

Commit Message:
CHEWY: Properly clip drawn text

Changed paths:
    engines/chewy/graphics.cpp


diff --git a/engines/chewy/graphics.cpp b/engines/chewy/graphics.cpp
index 9ff681a..2f7c28a 100644
--- a/engines/chewy/graphics.cpp
+++ b/engines/chewy/graphics.cpp
@@ -89,10 +89,12 @@ void Graphics::drawTransparent(uint16 x, uint16 y, byte *data, uint16 width, uin
 	::Graphics::Surface *screen = g_system->lockScreen();
 	for (uint curX = 0; curX < width; curX++) {
 		for (uint curY = 0; curY < height; curY++) {
-			byte *src = data + (curY * width) + curX;
-			byte *dst = (byte *)screen->getBasePtr(curX + x, curY + y);
-			if (*src != transparentColor)
-				*dst = *src;
+			if (curX + x < 320 && curY + y < 200) {
+				byte *src = data + (curY * width) + curX;
+				byte *dst = (byte *)screen->getBasePtr(curX + x, curY + y);
+				if (*src != transparentColor)
+					*dst = *src;
+			}
 		}
 	}
 	g_system->unlockScreen();


Commit: 87cac81c5c850d135b68f8135c45fef7baf113d1
    https://github.com/scummvm/scummvm/commit/87cac81c5c850d135b68f8135c45fef7baf113d1
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2017-03-14T22:51:13+02:00

Commit Message:
CHEWY: More work on room-specific animations. Some cleanup

Changed paths:
    engines/chewy/scene.cpp


diff --git a/engines/chewy/scene.cpp b/engines/chewy/scene.cpp
index 778cec1..22a6c05 100644
--- a/engines/chewy/scene.cpp
+++ b/engines/chewy/scene.cpp
@@ -40,9 +40,23 @@ namespace Chewy {
 
 // Animated details - scene animations
 struct AnimatedDetails {
-	uint16 x;
-	uint16 y;
-	// 66 bytes animated details - TODO
+	int16 x;
+	int16 y;
+	byte startFlag;     // 0: no animation
+	byte repeat;
+	int16 startSprite;
+	int16 endSprite;
+	int16 spriteCount;
+	uint16 delay;
+	uint16 delayCount;
+	uint16 reverse;     // 0: play normally, 1: play in reverse
+	uint16 timerStart;  // seconds until detail is started (0: no timer)
+	uint16 zIndex;
+	byte loadFlag;      // 0: load animation in memory immediately, 1: load animation in memory when it is played
+	byte zoom;
+	// 2 * 3 * 7 = 42 bytes sound data - TODO
+	byte showOneFrame;  // show a sprite, 0: none, 1: before animation, 2: after animation
+	byte currentFrame;
 };
 
 // Static details - scene sprites and props
@@ -50,7 +64,7 @@ struct StaticDetails {
 	int16 x;
 	int16 y;
 	int16 spriteNum;
-	uint16 z;
+	uint16 zIndex;
 	byte hide;
 	// 1 byte dummy
 };
@@ -102,8 +116,8 @@ void Scene::draw() {
 	// Background
 	_vm->_graphics->drawImage("episode1.tgp", _curScene);
 
-	// Static details
 	for (uint16 i = 0; i < MAX_DETAILS; i++) {
+		// Static details
 		StaticDetails s = _sceneInfo->staticDetails[i];
 		if (s.spriteNum >= 0 && s.x >= 0 && s.y >= 0 && !s.hide)
 			_vm->_graphics->drawSprite(Common::String::format("det%d.taf", _curScene), s.spriteNum, s.x, s.y);
@@ -112,7 +126,7 @@ void Scene::draw() {
 	// TODO: These are all hardcoded for now
 	_vm->_graphics->drawSprite("det1.taf", 0, 200, 100);
 	_vm->_graphics->loadFont("6x8.tff");
-	_vm->_graphics->drawText("This is a test", 200, 80);
+	//_vm->_graphics->drawText("This is a test", 200, 80);
 
 	_vm->_graphics->setDescSurface(Common::Point(-1, -1));
 }
@@ -120,13 +134,9 @@ void Scene::draw() {
 void Scene::updateMouse(Common::Point coords) {
 	_vm->_graphics->restoreDescSurface();
 
-	// Animated details
-	// TODO: handle these
-
 	// Static details
 	for (uint16 i = 0; i < MAX_HOTSPOTS; i++) {
 		//_vm->_graphics->drawRect(_sceneInfo->hotspot[i].rect, 0);	// debug
-
 		if (_sceneInfo->hotspot[i].rect.contains(coords) && _sceneInfo->hotspot[i].resource < kATSTextMax) {
 			if (coords.y >= 8) {
 				_vm->_graphics->setDescSurface(Common::Point(coords.x, coords.y - 8));
@@ -161,9 +171,23 @@ void Scene::loadSceneInfo() {
 
 	// Animated details
 	for (int i = 0; i < MAX_DETAILS; i++) {
-		_sceneInfo->animatedDetails[i].x = indexFile.readUint16LE();
-		_sceneInfo->animatedDetails[i].y = indexFile.readUint16LE();
-		indexFile.skip(66);	// animated details info - TODO: read these
+		_sceneInfo->animatedDetails[i].x = indexFile.readSint16LE();
+		_sceneInfo->animatedDetails[i].y = indexFile.readSint16LE();
+		_sceneInfo->animatedDetails[i].startFlag = indexFile.readByte();
+		_sceneInfo->animatedDetails[i].repeat = indexFile.readByte();
+		_sceneInfo->animatedDetails[i].startSprite = indexFile.readSint16LE();
+		_sceneInfo->animatedDetails[i].endSprite = indexFile.readSint16LE();
+		_sceneInfo->animatedDetails[i].spriteCount = indexFile.readSint16LE();
+		_sceneInfo->animatedDetails[i].delay = indexFile.readUint16LE();
+		_sceneInfo->animatedDetails[i].delayCount = indexFile.readUint16LE();
+		_sceneInfo->animatedDetails[i].reverse = indexFile.readUint16LE();
+		_sceneInfo->animatedDetails[i].timerStart = indexFile.readUint16LE();
+		_sceneInfo->animatedDetails[i].zIndex = indexFile.readUint16LE();
+		_sceneInfo->animatedDetails[i].loadFlag = indexFile.readByte();
+		_sceneInfo->animatedDetails[i].zoom = indexFile.readByte();
+		indexFile.skip(42);	// 2 * 3 * 7 = 42 bytes sound data - TODO
+		_sceneInfo->animatedDetails[i].showOneFrame = indexFile.readUint16LE();
+		_sceneInfo->animatedDetails[i].currentFrame = indexFile.readUint16LE();
 	}
 
 	// Static details
@@ -171,7 +195,7 @@ void Scene::loadSceneInfo() {
 		_sceneInfo->staticDetails[i].x = indexFile.readSint16LE();
 		_sceneInfo->staticDetails[i].y = indexFile.readSint16LE();
 		_sceneInfo->staticDetails[i].spriteNum = indexFile.readSint16LE();
-		_sceneInfo->staticDetails[i].z = indexFile.readUint16LE();
+		_sceneInfo->staticDetails[i].zIndex = indexFile.readUint16LE();
 		_sceneInfo->staticDetails[i].hide = indexFile.readByte();
 		indexFile.readByte();	// padding
 	}
@@ -189,18 +213,12 @@ void Scene::loadSceneInfo() {
 	// Hotspot descriptions
 	for (int i = 0; i < MAX_HOTSPOTS; i++) {
 		_sceneInfo->hotspot[i].resource = indexFile.readUint16LE() + 4;
-		
+		_sceneInfo->hotspot[i].desc = "";
+
 		if (_sceneInfo->hotspot[i].resource < kATSTextMax) {
 			TextEntry *entry = text->getText(_curScene + kADSTextMax, _sceneInfo->hotspot[i].resource);
 			if (entry)
 				_sceneInfo->hotspot[i].desc = entry->text;
-			else
-				_sceneInfo->hotspot[i].desc = Common::String::format("Hotspot %d", _sceneInfo->hotspot[i].resource);
-		} else {
-			// TODO: Handle these types of hotspot descriptions
-			_sceneInfo->hotspot[i].desc = "";
-			//warning("Hotspot %d has an invalid description resource (%d)", i, _sceneInfo->hotspot[i].resource);
-			//_sceneInfo->hotspot[i].desc = Common::String::format("Hotspot %d", _sceneInfo->hotspot[i].resource);
 		}
 	}
 





More information about the Scummvm-git-logs mailing list