[Scummvm-cvs-logs] scummvm master -> 1af04e937b010b4fcd2e6e5fafd1b0839a21fb93

urukgit urukgit at users.noreply.github.com
Wed Feb 5 10:52:18 CET 2014


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
89386900bb AVALANCHE: Add ghostDrawGlerk().
2ca5143155 AVALANCHE: Remove unnecessary checks from picture creatings.
f26bbefb2d AVALANCHE: Make constants really const.
acb70b645a AVALANCHE: Implement GhostRoom::wait().
1af04e937b AVALANCHE: Hide/reveal the mouse cursor in GhostRoom::run().


Commit: 89386900bb4b633356da05cd22aac7e4009a28c1
    https://github.com/scummvm/scummvm/commit/89386900bb4b633356da05cd22aac7e4009a28c1
Author: uruk (koppirnyo at gmail.com)
Date: 2014-02-05T01:51:31-08:00

Commit Message:
AVALANCHE: Add ghostDrawGlerk().

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 1a06ebc..dd08eac 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -527,6 +527,32 @@ void GraphicManager::ghostDrawGhost(byte ghostArr[2][66][26], uint16 destX, uint
 	ghostPic.free();
 }
 
+void GraphicManager::ghostDrawGlerk(byte glerkArr[4][35][9], uint16 destX, uint16 destY) {
+	// Constants from the original code.
+	uint16 height = 35;
+	uint16 width = 9 * 8;
+
+	Graphics::Surface glerkPic;
+	glerkPic.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
+
+	for (int y = 0; y < height; y++) {
+		for (int plane = 0; plane < 4; plane++) {
+			for (uint16 x = 0; x < width / 8; x++) {
+				byte pixel = glerkArr[plane][y][x];
+				for (int bit = 0; bit < 8; bit++) {
+					byte pixelBit = (pixel >> bit) & 1;
+					if (pixelBit != 0)
+						*(byte *)glerkPic.getBasePtr(x * 8 + 7 - bit, y) += (pixelBit << plane);
+				}
+			}
+		}
+	}
+
+	drawPicture(_surface, glerkPic, destX, destY);
+
+	glerkPic.free();
+}
+
 /**
  *	With the use of the second argument, it replaces get_meg_aargh as well.
  * @remarks	Originally called 'get_me' and was located in Ghostroom.
@@ -538,7 +564,7 @@ Graphics::Surface GraphicManager::ghostLoadPicture(Common::File &file, Common::P
 	coord.y = cb._y;
 	
 	Graphics::Surface picture = loadPictureGraphic(file);
-
+	
 	int bytesPerRow = (picture.w / 8);
 	if ((picture.w % 8) > 0)
 		bytesPerRow += 1;
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 791e04a..485da1f 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -93,6 +93,7 @@ public:
 
 	// Ghostroom's functions:
 	void ghostDrawGhost(byte ghostArr[2][66][26], uint16 destX, uint16 destY); // Very similar to loadPictureSign(). TODO: Unify the two later if possible.
+	void ghostDrawGlerk(byte glerkArr[4][35][9], uint16 destX, uint16 destY); // Very similar to ghostDrawGhost(), but not enough to unify the two.
 	Graphics::Surface ghostLoadPicture(Common::File &file, Common::Point &coord);
 	void ghostDrawPicture(const Graphics::Surface &picture, uint16 destX, uint16 destY);
 	void ghostDrawBackgroundItems(Common::File &file);


Commit: 2ca5143155d472f0140ed27d4ec15e4d08655a01
    https://github.com/scummvm/scummvm/commit/2ca5143155d472f0140ed27d4ec15e4d08655a01
Author: uruk (koppirnyo at gmail.com)
Date: 2014-02-05T01:51:32-08:00

Commit Message:
AVALANCHE: Remove unnecessary checks from picture creatings.

Changed paths:
    engines/avalanche/graphics.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index dd08eac..2a4a29c 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -515,8 +515,7 @@ void GraphicManager::ghostDrawGhost(byte ghostArr[2][66][26], uint16 destX, uint
 				byte pixel = ghostArr[kPlaneToUse[plane]][y][x];
 				for (int bit = 0; bit < 8; bit++) {
 					byte pixelBit = (pixel >> bit) & 1;
-					if (pixelBit != 0)
-						*(byte *)ghostPic.getBasePtr(x * 8 + 7 - bit, y) += (pixelBit << plane);
+					*(byte *)ghostPic.getBasePtr(x * 8 + 7 - bit, y) += (pixelBit << plane);
 				}
 			}
 		}
@@ -541,8 +540,7 @@ void GraphicManager::ghostDrawGlerk(byte glerkArr[4][35][9], uint16 destX, uint1
 				byte pixel = glerkArr[plane][y][x];
 				for (int bit = 0; bit < 8; bit++) {
 					byte pixelBit = (pixel >> bit) & 1;
-					if (pixelBit != 0)
-						*(byte *)glerkPic.getBasePtr(x * 8 + 7 - bit, y) += (pixelBit << plane);
+					*(byte *)glerkPic.getBasePtr(x * 8 + 7 - bit, y) += (pixelBit << plane);
 				}
 			}
 		}
@@ -640,8 +638,7 @@ Graphics::Surface GraphicManager::loadPictureGraphic(Common::File &file) {
 				byte pixel = file.readByte();
 				for (int bit = 0; bit < 8; bit++) {
 					byte pixelBit = (pixel >> bit) & 1;
-					if (pixelBit != 0)
-						*(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane);
+					*(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane);
 				}
 			}
 		}
@@ -689,8 +686,7 @@ Graphics::Surface GraphicManager::loadPictureSign(Common::File &file, int xl, in
 				byte pixel = file.readByte();
 				for (int bit = 0; bit < 8; bit++) {
 					byte pixelBit = (pixel >> bit) & 1;
-					if (pixelBit != 0)
-						*(byte *)picture.getBasePtr(xx + 7 - bit, yy) += (pixelBit << plane);
+					*(byte *)picture.getBasePtr(xx + 7 - bit, yy) += (pixelBit << plane);
 				}
 			}
 		}


Commit: f26bbefb2de1ad4051026248c2b6a894793a6a6e
    https://github.com/scummvm/scummvm/commit/f26bbefb2de1ad4051026248c2b6a894793a6a6e
Author: uruk (koppirnyo at gmail.com)
Date: 2014-02-05T01:51:32-08:00

Commit Message:
AVALANCHE: Make constants really const.

Changed paths:
    engines/avalanche/graphics.cpp



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 2a4a29c..8bc32d8 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -503,8 +503,8 @@ void GraphicManager::nimFree() {
 void GraphicManager::ghostDrawGhost(byte ghostArr[2][66][26], uint16 destX, uint16 destY) {
 	const byte kPlaneToUse[4] = { 0, 0, 0, 1 };
 	// Constants from the original code.
-	uint16 height = 66;
-	uint16 width = 26 * 8;
+	const uint16 height = 66;
+	const uint16 width = 26 * 8;
 
 	Graphics::Surface ghostPic;
 	ghostPic.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
@@ -528,8 +528,8 @@ void GraphicManager::ghostDrawGhost(byte ghostArr[2][66][26], uint16 destX, uint
 
 void GraphicManager::ghostDrawGlerk(byte glerkArr[4][35][9], uint16 destX, uint16 destY) {
 	// Constants from the original code.
-	uint16 height = 35;
-	uint16 width = 9 * 8;
+	const uint16 height = 35;
+	const uint16 width = 9 * 8;
 
 	Graphics::Surface glerkPic;
 	glerkPic.create(width, height, Graphics::PixelFormat::createFormatCLUT8());


Commit: acb70b645ad5ea23d914d533712d05ff22c66754
    https://github.com/scummvm/scummvm/commit/acb70b645ad5ea23d914d533712d05ff22c66754
Author: uruk (koppirnyo at gmail.com)
Date: 2014-02-05T01:51:33-08:00

Commit Message:
AVALANCHE: Implement GhostRoom::wait().

Changed paths:
    engines/avalanche/ghostroom.cpp



diff --git a/engines/avalanche/ghostroom.cpp b/engines/avalanche/ghostroom.cpp
index 95b5476..be2175c 100644
--- a/engines/avalanche/ghostroom.cpp
+++ b/engines/avalanche/ghostroom.cpp
@@ -68,7 +68,13 @@ GhostRoom::~GhostRoom() {
 }
 
 void GhostRoom::wait(uint16 howLong) {
-	warning("STUB: wait()");
+	for (int i = 0; i < howLong; i++) {
+		Common::Event event;
+		_vm->getEvent(event);
+		if (event.type == Common::EVENT_KEYDOWN)
+			_vm->_sound->playNote(6177, 1);
+		_vm->_system->delayMillis(1);
+	}
 }
 
 void GhostRoom::doBat() {


Commit: 1af04e937b010b4fcd2e6e5fafd1b0839a21fb93
    https://github.com/scummvm/scummvm/commit/1af04e937b010b4fcd2e6e5fafd1b0839a21fb93
Author: uruk (koppirnyo at gmail.com)
Date: 2014-02-05T01:51:34-08:00

Commit Message:
AVALANCHE: Hide/reveal the mouse cursor in GhostRoom::run().

Changed paths:
    engines/avalanche/ghostroom.cpp



diff --git a/engines/avalanche/ghostroom.cpp b/engines/avalanche/ghostroom.cpp
index be2175c..cbb36fb 100644
--- a/engines/avalanche/ghostroom.cpp
+++ b/engines/avalanche/ghostroom.cpp
@@ -161,6 +161,7 @@ void GhostRoom::loadPictures() {
 }
 
 void GhostRoom::run() {
+	CursorMan.showMouse(false);
 	_vm->_graphics->saveScreen();
 	_vm->fadeOut();
 	_vm->fadeIn();
@@ -169,6 +170,8 @@ void GhostRoom::run() {
 	loadPictures();
 	
 	warning("STUB: run()");
+
+	CursorMan.showMouse(true);
 }
 
 } // End of namespace Avalanche






More information about the Scummvm-git-logs mailing list