[Scummvm-cvs-logs] SF.net SVN: scummvm: [26145] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Thu Mar 15 22:56:21 CET 2007


Revision: 26145
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26145&view=rev
Author:   peres001
Date:     2007-03-15 14:56:21 -0700 (Thu, 15 Mar 2007)

Log Message:
-----------
moved remaining background related functions to disk.cpp, and changed Gfx accordingly

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/callables.cpp
    scummvm/trunk/engines/parallaction/disk.cpp
    scummvm/trunk/engines/parallaction/disk.h
    scummvm/trunk/engines/parallaction/graphics.cpp
    scummvm/trunk/engines/parallaction/graphics.h
    scummvm/trunk/engines/parallaction/location.cpp
    scummvm/trunk/engines/parallaction/menu.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp

Modified: scummvm/trunk/engines/parallaction/callables.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/callables.cpp	2007-03-15 21:49:27 UTC (rev 26144)
+++ scummvm/trunk/engines/parallaction/callables.cpp	2007-03-15 21:56:21 UTC (rev 26145)
@@ -220,7 +220,7 @@
 	byte pal0[PALETTE_SIZE], pal1[PALETTE_SIZE];
 
 	for (uint16 i = 0; i <= PALETTE_COLORS; i++) {
-		pal0[i] = _palette[i];
+		pal0[i] = _vm->_gfx->_palette[i];
 		pal0[i*3+1] = 0;
 		pal0[i*3+2] = 0;
 	}
@@ -234,7 +234,7 @@
 		_vm->_gfx->setPalette(pal1);
 	}
 
-	_vm->_gfx->setPalette(_palette);
+	_vm->_gfx->setPalette(_vm->_gfx->_palette);
 
 	return;
 }
@@ -282,7 +282,7 @@
 	cleanInventory();
 	refreshInventory(_vm->_characterName);
 
-	_vm->_gfx->palUnk0(_palette);
+	_vm->_gfx->palUnk0(_vm->_gfx->_palette);
 
 	if (gameCompleted) {
 		_vm->_gfx->setFont("slide");

Modified: scummvm/trunk/engines/parallaction/disk.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk.cpp	2007-03-15 21:49:27 UTC (rev 26144)
+++ scummvm/trunk/engines/parallaction/disk.cpp	2007-03-15 21:56:21 UTC (rev 26145)
@@ -388,13 +388,45 @@
 	return;
 }
 
+void Disk::parseDepths(Common::SeekableReadStream &stream) {
+	_vm->_gfx->_bgLayers[0] = stream.readByte();
+	_vm->_gfx->_bgLayers[1] = stream.readByte();
+	_vm->_gfx->_bgLayers[2] = stream.readByte();
+	_vm->_gfx->_bgLayers[3] = stream.readByte();
+}
+
+
+void Disk::parseBackground(Common::SeekableReadStream &stream) {
+
+	stream.read(_vm->_gfx->_palette, PALETTE_SIZE);
+
+	parseDepths(stream);
+
+	for (uint32 _si = 0; _si < 6; _si++) {
+		_vm->_gfx->_palettefx[_si]._timer = stream.readUint16BE();
+		_vm->_gfx->_palettefx[_si]._step = stream.readUint16BE();
+		_vm->_gfx->_palettefx[_si]._flags = stream.readUint16BE();
+		_vm->_gfx->_palettefx[_si]._first = stream.readByte();
+		_vm->_gfx->_palettefx[_si]._last = stream.readByte();
+	}
+
+#if 0
+	uint16 v147;
+	for (v147 = 0; v147 < PALETTE_SIZE; v147++) {
+		byte _al = _vm->_gfx->_palette[v147];
+		_vm->_gfx->_palette[PALETTE_SIZE+v147] = _al / 2;
+	}
+#endif
+
+}
+
 void Disk::loadBackground(const char *filename) {
 //	printf("Gfx::loadBackground(%s)\n", filename);
 
 	if (!_archive.openArchivedFile(filename))
 		errorFileNotFound(filename);
 
-	_vm->_gfx->parseBackground(_archive);
+	parseBackground(_archive);
 
 	byte *bg = (byte*)calloc(1, SCREEN_WIDTH*SCREEN_HEIGHT);
 	byte *mask = (byte*)calloc(1, SCREENMASK_WIDTH*SCREEN_HEIGHT);
@@ -440,7 +472,7 @@
 	byte *maskBuf = (byte*)calloc(1, SCREENMASK_WIDTH*SCREEN_HEIGHT);
 	byte *pathBuf = (byte*)calloc(1, SCREENPATH_WIDTH*SCREEN_HEIGHT);
 
-	_vm->_gfx->parseDepths(_archive);
+	parseDepths(_archive);
 
 	_archive.read(pathBuf, SCREENPATH_WIDTH*SCREEN_HEIGHT);
 	_archive.read(maskBuf, SCREENMASK_WIDTH*SCREEN_HEIGHT);

Modified: scummvm/trunk/engines/parallaction/disk.h
===================================================================
--- scummvm/trunk/engines/parallaction/disk.h	2007-03-15 21:49:27 UTC (rev 26144)
+++ scummvm/trunk/engines/parallaction/disk.h	2007-03-15 21:56:21 UTC (rev 26145)
@@ -86,6 +86,8 @@
 	void loadExternalStaticCnv(const char *filename, StaticCnv *cnv);
 	void loadBackground(const char *filename);
 	void loadMaskAndPath(const char *name);
+	void parseDepths(Common::SeekableReadStream &stream);
+	void parseBackground(Common::SeekableReadStream &stream);
 
 protected:
 	Archive		  _archive;

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2007-03-15 21:49:27 UTC (rev 26144)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2007-03-15 21:56:21 UTC (rev 26145)
@@ -34,7 +34,6 @@
 namespace Parallaction {
 
 
-uint16	_bgLayers[4];
 
 //
 //	proportional font glyphs width
@@ -57,16 +56,6 @@
 
 #define PALETTE_BACKUP	PALETTE_SIZE
 
-PaletteFxRange		_palettefx[6];
-byte				_palette[PALETTE_SIZE] = {
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
 byte _black_palette[PALETTE_SIZE] = {
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -874,38 +863,8 @@
 	return;
 }
 
-void Gfx::parseDepths(Common::SeekableReadStream &stream) {
-	_bgLayers[0] = stream.readByte();
-	_bgLayers[1] = stream.readByte();
-	_bgLayers[2] = stream.readByte();
-	_bgLayers[3] = stream.readByte();
-}
 
 
-void Gfx::parseBackground(Common::SeekableReadStream &stream) {
-
-	stream.read(_palette, PALETTE_SIZE);
-
-	parseDepths(stream);
-
-	for (uint32 _si = 0; _si < 6; _si++) {
-		_palettefx[_si]._timer = stream.readUint16BE();
-		_palettefx[_si]._step = stream.readUint16BE();
-		_palettefx[_si]._flags = stream.readUint16BE();
-		_palettefx[_si]._first = stream.readByte();
-		_palettefx[_si]._last = stream.readByte();
-	}
-
-#if 0
-	uint16 v147;
-	for (v147 = 0; v147 < PALETTE_SIZE; v147++) {
-		byte _al = _palette[v147];
-		_palette[PALETTE_SIZE+v147] = _al / 2;
-	}
-#endif
-
-}
-
 void Gfx::setBackground(byte *background) {
 	memcpy(_buffers[kBitBack], background, SCREEN_WIDTH*SCREEN_HEIGHT);
 	copyScreen(kBitBack, kBit2);

Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h	2007-03-15 21:49:27 UTC (rev 26144)
+++ scummvm/trunk/engines/parallaction/graphics.h	2007-03-15 21:56:21 UTC (rev 26145)
@@ -97,8 +97,6 @@
 	// location
 	void setBackground(byte *background);
 	void setMask(byte *mask);
-	void parseDepths(Common::SeekableReadStream &stream);
-	void parseBackground(Common::SeekableReadStream &stream);
 	int16 queryMask(int16 v);
 	void intGrottaHackMask();
 	void restoreBackground(const Common::Rect& r);
@@ -139,6 +137,10 @@
 	static Point		_labelPosition[2];
 	static bool 		_proportionalFont;
 
+	uint16				_bgLayers[4];
+	PaletteFxRange		_palettefx[6];
+	byte				_palette[PALETTE_SIZE];
+
 protected:
 	Parallaction*		_vm;
 

Modified: scummvm/trunk/engines/parallaction/location.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/location.cpp	2007-03-15 21:49:27 UTC (rev 26144)
+++ scummvm/trunk/engines/parallaction/location.cpp	2007-03-15 21:56:21 UTC (rev 26145)
@@ -282,7 +282,7 @@
 void Parallaction::showSlide(const char *name) {
 
 	_disk->loadSlide(name);
-	_gfx->palUnk0(_palette);
+	_gfx->palUnk0(_vm->_gfx->_palette);
 	_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
 
 	debugC(1, kDebugLocation, "changeLocation: new background set");
@@ -418,7 +418,7 @@
 	runJobs();
 	_gfx->swapBuffers();
 
-	_gfx->palUnk0(_palette);
+	_gfx->palUnk0(_vm->_gfx->_palette);
 	if (_location._aCommands) {
 		runCommands(_location._aCommands);
 		debugC(1, kDebugLocation, "changeLocation: location acommands run");

Modified: scummvm/trunk/engines/parallaction/menu.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/menu.cpp	2007-03-15 21:49:27 UTC (rev 26144)
+++ scummvm/trunk/engines/parallaction/menu.cpp	2007-03-15 21:56:21 UTC (rev 26145)
@@ -106,19 +106,19 @@
 	_vm->_gfx->setFont("slide");
 
 	_vm->_disk->loadSlide("intro");
-	_vm->_gfx->palUnk0(_palette);
+	_vm->_gfx->palUnk0(_vm->_gfx->_palette);
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
 
 	g_system->delayMillis(2000);
 
 	_vm->_disk->loadSlide("minintro");
-	_vm->_gfx->palUnk0(_palette);
+	_vm->_gfx->palUnk0(_vm->_gfx->_palette);
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
 
 	g_system->delayMillis(2000);
 
 	_vm->_disk->loadSlide("lingua");
-	_vm->_gfx->palUnk0(_palette);
+	_vm->_gfx->palUnk0(_vm->_gfx->_palette);
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
 
 	_vm->_gfx->displayString(60, 30, "SELECT LANGUAGE");
@@ -130,7 +130,7 @@
 	_vm->_disk->setLanguage(_language);
 
 	_vm->_disk->loadSlide("restore");
-	_vm->_gfx->palUnk0(_palette);
+	_vm->_gfx->palUnk0(_vm->_gfx->_palette);
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
 
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2);
@@ -147,7 +147,7 @@
 	const char **v14 = introMsg3;
 
 	_vm->_disk->loadScenery("test", NULL);
-	_vm->_gfx->palUnk0(_palette);
+	_vm->_gfx->palUnk0(_vm->_gfx->_palette);
 	_vm->_gfx->swapBuffers();
 
 	uint16 _ax = (SCREEN_WIDTH - _vm->_gfx->getStringWidth(v14[0])) / 2;
@@ -294,7 +294,7 @@
 
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);	//
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2);		//
-	_vm->_gfx->palUnk0(_palette);
+	_vm->_gfx->palUnk0(_vm->_gfx->_palette);
 
 	while (askPassword == true) {
 

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2007-03-15 21:49:27 UTC (rev 26144)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2007-03-15 21:56:21 UTC (rev 26145)
@@ -458,7 +458,7 @@
 		if ((_engineFlags & kEnginePauseJobs) == 0 || (_engineFlags & kEngineInventory)) {
 			_gfx->swapBuffers();
 			byte palette[PALETTE_SIZE];
-			memcpy(palette, _palette, sizeof(palette));
+			memcpy(palette, _vm->_gfx->_palette, sizeof(palette));
 			_gfx->animatePalette(palette);
 			_gfx->setPalette(palette);
 		}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list