[Scummvm-cvs-logs] scummvm master -> 3eb2c05faf3b0b29f076c0809043781047920d5e

urukgit urukgit at users.noreply.github.com
Tue Feb 4 18:52:09 CET 2014


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

Summary:
a0e28107d3 AVALANCHE: Some renaming connected to Ghostroom.
81992bf616 AVALANCHE: Some renaming in Background.
3eb2c05faf AVALANCHE: Rename/move/implement plainGrab().


Commit: a0e28107d38004c03403177c4e3d962c80c66aa2
    https://github.com/scummvm/scummvm/commit/a0e28107d38004c03403177c4e3d962c80c66aa2
Author: uruk (koppirnyo at gmail.com)
Date: 2014-02-04T03:06:11-08:00

Commit Message:
AVALANCHE: Some renaming connected to Ghostroom.

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



diff --git a/engines/avalanche/enums.h b/engines/avalanche/enums.h
index 2b5db67..cadcae5 100644
--- a/engines/avalanche/enums.h
+++ b/engines/avalanche/enums.h
@@ -29,6 +29,10 @@
 #define AVALANCHE_ENUMS_H
 
 namespace Avalanche {
+
+
+enum Flavour { kFlavourEga, kFlavourBgi, kFlavourNatural, kFlavourTwo, kFlavourOne };
+
 enum Color {
 	kColorBlack = 0,       kColorBlue,      kColorGreen,     kColorCyan,         kColorRed,
 	kColorMagenta = 5,     kColorBrown,     kColorLightgray, kColorDarkgray,     kColorLightblue,
diff --git a/engines/avalanche/ghostroom.cpp b/engines/avalanche/ghostroom.cpp
index 752da65..345d2a4 100644
--- a/engines/avalanche/ghostroom.cpp
+++ b/engines/avalanche/ghostroom.cpp
@@ -74,13 +74,13 @@ void GhostRoom::bigGreenEyes(byte how) {
 	warning("STUB: bigGreenEyes()");
 }
 
-ChunkBlockType GhostRoom::readChunkBlock(Common::File &file) {
-	ChunkBlockType cb;
-	cb._flavour = (FlavourType)file.readByte();
+ChunkBlock GhostRoom::readChunkBlock(Common::File &file) {
+	ChunkBlock cb;
+	cb._flavour = (Flavour)file.readByte();
 	cb._x = file.readSint16LE();
 	cb._y = file.readSint16LE();
-	cb._xl = file.readSint16LE();
-	cb._yl = file.readSint16LE();
+	cb._width = file.readSint16LE();
+	cb._height = file.readSint16LE();
 	cb._size = file.readSint32LE();
 	return cb;
 }
@@ -105,10 +105,10 @@ void GhostRoom::run() {
 
 	// Reading in the pictures of the ghost.
 	for (int i = 0; i < 5; i++) {
-		ChunkBlockType cb = readChunkBlock(_file);
+		ChunkBlock cb = readChunkBlock(_file);
 		for (int j = 0; j < 2; j++)
-			for (uint16 y = 0; y <= cb._yl; y++)
-				_file.read(_ghost[i][j][y], cb._xl / 8);
+			for (uint16 y = 0; y <= cb._height; y++)
+				_file.read(_ghost[i][j][y], cb._width / 8);
 	}
 
 	// Load some smaller pictures.
diff --git a/engines/avalanche/ghostroom.h b/engines/avalanche/ghostroom.h
index 0693ecf..9a2a544 100644
--- a/engines/avalanche/ghostroom.h
+++ b/engines/avalanche/ghostroom.h
@@ -34,12 +34,10 @@
 namespace Avalanche {
 class AvalancheEngine;
 
-enum FlavourType { ch_EGA, ch_BGI, ch_Natural, ch_Two, ch_One };
-
-struct ChunkBlockType {
-	FlavourType _flavour;
+struct ChunkBlock {
+	Flavour _flavour;
 	int16 _x, _y;
-	int16 _xl, _yl;
+	int16 _width, _height;
 	int32 _size;
 };
 
@@ -49,7 +47,7 @@ public:
 	~GhostRoom();
 
 	void run();
-	ChunkBlockType readChunkBlock(Common::File &file);
+	ChunkBlock readChunkBlock(Common::File &file);
 
 private:
 	AvalancheEngine *_vm;
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index a11773a..cc65196 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -531,7 +531,7 @@ void GraphicManager::ghostDrawGhost(byte ghostArr[2][66][26], uint16 destX, uint
  * @remarks	Originally called 'get_me' and was located in Ghostroom.
  */
 Graphics::Surface GraphicManager::ghostLoadPicture(Common::File &file) {
-	ChunkBlockType cb = _vm->_ghostroom->readChunkBlock(file);
+	ChunkBlock cb = _vm->_ghostroom->readChunkBlock(file);
 	
 	Graphics::Surface picture = loadPictureGraphic(file);
 
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index ed5a47b..2978468 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -38,7 +38,7 @@ namespace Avalanche {
 class AvalancheEngine;
 class AnimationType;
 struct SpriteType;
-struct ChunkBlockType;
+struct ChunkBlock;
 
 typedef byte FontType[256][16];
 typedef byte ManiType[2049];


Commit: 81992bf6169b20762236894e58188e28decf6e2e
    https://github.com/scummvm/scummvm/commit/81992bf6169b20762236894e58188e28decf6e2e
Author: uruk (koppirnyo at gmail.com)
Date: 2014-02-04T03:07:05-08:00

Commit Message:
AVALANCHE: Some renaming in Background.

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



diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index 5d168a2..f49d103 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -279,24 +279,24 @@ void Background::load(byte number) {
 		sprite._type = (PictureType)(f.readByte());
 		sprite._x = f.readSint16LE();
 		sprite._y = f.readSint16LE();
-		sprite._xl = f.readSint16LE();
-		sprite._yl = f.readSint16LE();
+		sprite._width = f.readSint16LE();
+		sprite._height = f.readSint16LE();
 		sprite._size = f.readSint32LE();
 		bool natural = f.readByte();
 		bool memorize = f.readByte();
 
 		if (memorize) {
 			_sprites[i]._x = sprite._x;
-			_sprites[i]._xl = sprite._xl;
+			_sprites[i]._width = sprite._width;
 			_sprites[i]._y = sprite._y;
-			_sprites[i]._yl = sprite._yl;
+			_sprites[i]._height = sprite._height;
 			_sprites[i]._type = sprite._type;
 
 			if (natural)
 				_vm->_graphics->getNaturalPicture(_sprites[i]);
 			else {
 				_sprites[i]._size = sprite._size;
-				_sprites[i]._picture = _vm->_graphics->loadPictureRaw(f, _sprites[i]._xl * 8, _sprites[i]._yl + 1);
+				_sprites[i]._picture = _vm->_graphics->loadPictureRaw(f, _sprites[i]._width * 8, _sprites[i]._height + 1);
 			}
 		} else
 			_sprites[i]._x = kOnDisk;
@@ -335,11 +335,11 @@ void Background::draw(int16 destX, int16 destY, byte sprId) {
 		sprite._type = (PictureType)(f.readByte());
 		sprite._x = f.readSint16LE();
 		sprite._y = f.readSint16LE();
-		sprite._xl = f.readSint16LE();
-		sprite._yl = f.readSint16LE();
+		sprite._width = f.readSint16LE();
+		sprite._height = f.readSint16LE();
 		sprite._size = f.readSint32LE();
 		f.skip(2); // Natural and Memorize are used in Load()
-		sprite._picture = _vm->_graphics->loadPictureRaw(f, sprite._xl * 8, sprite._yl + 1);
+		sprite._picture = _vm->_graphics->loadPictureRaw(f, sprite._width * 8, sprite._height + 1);
 
 		if (destX < 0) {
 			destX = sprite._x * 8;
diff --git a/engines/avalanche/background.h b/engines/avalanche/background.h
index 34d7a9a..67020c8 100644
--- a/engines/avalanche/background.h
+++ b/engines/avalanche/background.h
@@ -40,7 +40,7 @@ enum PictureType {kEga, kBgi, kNaturalImage};
 struct SpriteType {
 	PictureType _type;
 	int16 _x, _y;
-	int16 _xl, _yl;
+	int16 _width, _height;
 	int32 _size;
 	Graphics::Surface _picture;
 };
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index cc65196..b98ca4b 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -850,10 +850,10 @@ void GraphicManager::showScroll() {
 
 void GraphicManager::getNaturalPicture(SpriteType &sprite) {
 	sprite._type = kNaturalImage; // We simply read from the screen and later, in drawSprite() we draw it right back.
-	sprite._size = sprite._xl * 8 * sprite._yl + 1;
-	sprite._picture.create(sprite._xl * 8, sprite._yl + 1, Graphics::PixelFormat::createFormatCLUT8());
-	for (uint16 y = 0; y < sprite._yl + 1; y++) {
-		for (uint16 x = 0; x < sprite._xl * 8; x++)
+	sprite._size = sprite._width * 8 * sprite._height + 1;
+	sprite._picture.create(sprite._width * 8, sprite._height + 1, Graphics::PixelFormat::createFormatCLUT8());
+	for (uint16 y = 0; y < sprite._height + 1; y++) {
+		for (uint16 x = 0; x < sprite._width * 8; x++)
 			*(byte *)sprite._picture.getBasePtr(x, y) = *(byte *)_vm->_graphics->_surface.getBasePtr(sprite._x * 8 + x, sprite._y + y);
 	}
 }


Commit: 3eb2c05faf3b0b29f076c0809043781047920d5e
    https://github.com/scummvm/scummvm/commit/3eb2c05faf3b0b29f076c0809043781047920d5e
Author: uruk (koppirnyo at gmail.com)
Date: 2014-02-04T09:51:13-08:00

Commit Message:
AVALANCHE: Rename/move/implement plainGrab().

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



diff --git a/engines/avalanche/ghostroom.cpp b/engines/avalanche/ghostroom.cpp
index 345d2a4..0012010 100644
--- a/engines/avalanche/ghostroom.cpp
+++ b/engines/avalanche/ghostroom.cpp
@@ -58,10 +58,6 @@ GhostRoom::~GhostRoom() {
 	_exclamation.free();
 }
 
-void GhostRoom::plainGrab() {
-	warning("STUB: plainGrab()");
-}
-
 void GhostRoom::wait(uint16 howLong) {
 	warning("STUB: wait()");
 }
@@ -92,7 +88,7 @@ void GhostRoom::run() {
 	_vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 640, 200), kColorBlack);
 
 	if (!_file.open("spooky.avd"))
-		error("AVALANCHE: Trip: File not found: spooky.avd");
+		error("AVALANCHE: GhostRoom: File not found: spooky.avd");
 
 	_file.seek(44);
 
@@ -116,6 +112,8 @@ void GhostRoom::run() {
 		_eyes[i] = _vm->_graphics->ghostLoadPicture(_file);
 	_exclamation = _vm->_graphics->ghostLoadPicture(_file);
 
+	_vm->_graphics->ghostDrawBackgroundItems(_file);
+
 	warning("STUB: run()");
 }
 
diff --git a/engines/avalanche/ghostroom.h b/engines/avalanche/ghostroom.h
index 9a2a544..9c048f5 100644
--- a/engines/avalanche/ghostroom.h
+++ b/engines/avalanche/ghostroom.h
@@ -80,7 +80,6 @@ private:
 	byte _greldetCount;
 	bool _redGreldet;
 
-	void plainGrab();
 	void wait(uint16 howLong);
 	void doBat();
 	void bigGreenEyes(byte how);
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index b98ca4b..a3e3718 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -552,6 +552,47 @@ void GraphicManager::ghostDrawPicture(const Graphics::Surface &picture, uint16 d
 }
 
 /**
+ * Loads and puts 3 images (in this order: cobweb, Mark's signature, open door) into the background at the beginning of the ghostroom scene.
+ * @remarks	Originally called 'plain_grab' and was located in Ghostroom. It was originally called 3 times. I unified these in one function, used a for cycle.
+ */
+void GraphicManager::ghostDrawBackgroundItems(Common::File &file) {
+	for (int num = 0; num < 3; num++) {
+		ChunkBlock cb = _vm->_ghostroom->readChunkBlock(file);
+
+		int width = cb._width;
+		int height = cb._height + 1;
+
+		Graphics::Surface picture;
+		picture.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
+
+		// Load the picture according to it's type.
+		switch (cb._flavour) {
+		case kFlavourOne: // There is only one plane.
+			for (uint16 y = 0; y < height; y++) {
+				for (uint16 x = 0; x < width; x += 8) {
+					byte pixel = file.readByte();
+					for (int i = 0; i < 8; i++) {
+						byte pixelBit = (pixel >> i) & 1;
+						*(byte *)picture.getBasePtr(x + 7 - i, y) = (pixelBit << 3);
+					}
+				}
+			}
+			break;
+		case kFlavourEga:
+			picture = loadPictureRaw(file, width, height);
+			break;
+		default:
+			break;
+		}
+
+		drawPicture(_surface, picture, cb._x, cb._y);
+
+		picture.free();
+	}
+	refreshScreen();
+}
+
+/**
  * This function mimics Pascal's getimage().
  */
 Graphics::Surface GraphicManager::loadPictureGraphic(Common::File &file) {
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 2978468..525616d 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -95,6 +95,7 @@ public:
 	void ghostDrawGhost(byte ghostArr[2][66][26], uint16 destX, uint16 destY); // Very similar to loadPictureSign(). TODO: Unify the two later if possible.
 	Graphics::Surface ghostLoadPicture(Common::File &file);
 	void ghostDrawPicture(const Graphics::Surface &picture, uint16 destX, uint16 destY);
+	void ghostDrawBackgroundItems(Common::File &file);
 
 	void clearAlso();
 	void clearTextBar();






More information about the Scummvm-git-logs mailing list