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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sat Aug 11 16:18:01 CEST 2007


Revision: 28527
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28527&view=rev
Author:   peres001
Date:     2007-08-11 07:18:00 -0700 (Sat, 11 Aug 2007)

Log Message:
-----------
Since splash screen graphics will be called slides (like in Nippon Safes), loading code has been moved to loadSlide. Related code in engine has been refactored as well.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/disk_br.cpp
    scummvm/trunk/engines/parallaction/parallaction.h
    scummvm/trunk/engines/parallaction/parallaction_br.cpp

Modified: scummvm/trunk/engines/parallaction/disk_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk_br.cpp	2007-08-11 13:17:57 UTC (rev 28526)
+++ scummvm/trunk/engines/parallaction/disk_br.cpp	2007-08-11 14:18:00 UTC (rev 28527)
@@ -98,7 +98,22 @@
 
 Graphics::Surface* DosDisk_br::loadStatic(const char* name) {
 	debugC(5, kDebugDisk, "DosDisk_br::loadStatic");
+	return 0;
+}
 
+Cnv* DosDisk_br::loadFrames(const char* name) {
+	debugC(5, kDebugDisk, "DosDisk_br::loadFrames");
+	return 0;
+}
+
+// Slides in Nippon Safes are basically screen-sized pictures with valid
+// palette data used for menu and for location switches. Big Red Adventure
+// doesn't need slides in that sense, but it still has some special
+// graphics resources with palette data, so those will be named slides.
+//
+BackgroundInfo* DosDisk_br::loadSlide(const char *name) {
+	debugC(5, kDebugDisk, "DosDisk_br::loadSlide");
+
 	char path[PATH_LEN];
 	genSlidePath(path, name);
 
@@ -106,39 +121,26 @@
 	if (!stream.open(path))
 		errorFileNotFound(path);
 
+	BackgroundInfo* info = new BackgroundInfo;
+
 	stream.skip(4);
-	uint width = stream.readUint32BE();
-	uint height = stream.readUint32BE();
+	info->width = stream.readUint32BE();
+	info->height = stream.readUint32BE();
 	stream.skip(20);
 
 	byte rgb[768];
 	stream.read(rgb, 768);
 
 	for (uint i = 0; i < 256; i++) {
-		_vm->_gfx->_palette.setEntry(i, rgb[i] >> 2, rgb[i+256] >> 2, rgb[i+512] >> 2);
+		info->palette.setEntry(i, rgb[i] >> 2, rgb[i+256] >> 2, rgb[i+512] >> 2);
 	}
 
-	Graphics::Surface *surf = new Graphics::Surface;
-	surf->create(width, height, 1);
-	stream.read(surf->pixels, width*height);
+	info->bg.create(info->width, info->height, 1);
+	stream.read(info->bg.pixels, info->width * info->height);
 
-	return surf;
+	return info;
 }
 
-Cnv* DosDisk_br::loadFrames(const char* name) {
-	debugC(5, kDebugDisk, "DosDisk_br::loadFrames");
-	return 0;
-}
-
-
-
-//	there are no Slide resources in Big Red Adventure
-BackgroundInfo* DosDisk_br::loadSlide(const char *name) {
-	debugC(5, kDebugDisk, "DosDisk_br::loadSlide");
-
-	return 0;
-}
-
 BackgroundInfo* DosDisk_br::loadScenery(const char *name, const char *mask, const char* path) {
 	debugC(5, kDebugDisk, "DosDisk_br::loadScenery");
 	return 0;

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2007-08-11 13:17:57 UTC (rev 28526)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2007-08-11 14:18:00 UTC (rev 28527)
@@ -569,6 +569,8 @@
 	void 		initResources();
 	void 		initGame();
 
+	void splash(const char *name);
+
 	static const Callable _dosCallables[6];
 
 	void _c_blufade(void*);

Modified: scummvm/trunk/engines/parallaction/parallaction_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_br.cpp	2007-08-11 13:17:57 UTC (rev 28526)
+++ scummvm/trunk/engines/parallaction/parallaction_br.cpp	2007-08-11 14:18:00 UTC (rev 28527)
@@ -72,39 +72,38 @@
 	return 0;
 }
 
-void Parallaction_br::initGame() {
+void Parallaction_br::splash(const char *name) {
 
-	Graphics::Surface* surf = _disk->loadStatic("dyna");
-	_gfx->setPalette(_gfx->_palette);
-	_gfx->flatBlitCnv(surf, (640 - surf->w) >> 1, (400 - surf->h) >> 1, Gfx::kBitFront);
+	BackgroundInfo *info;
+
+	_gfx->clearScreen(Gfx::kBitFront);
+
+	info = _disk->loadSlide(name);
+	_gfx->setPalette(info->palette);
+	_gfx->flatBlitCnv(&info->bg, (640 - info->width) >> 1, (400 - info->height) >> 1, Gfx::kBitFront);
 	_gfx->updateScreen();
 	_system->delayMillis(600);
 
 	Palette pal;
 	for (uint i = 0; i < 64; i++) {
-		_gfx->_palette.fadeTo(pal, 1);
-		_gfx->setPalette(_gfx->_palette);
+		info->palette.fadeTo(pal, 1);
+		_gfx->setPalette(info->palette);
 		_gfx->updateScreen();
-		_system->delayMillis(30);
+		_system->delayMillis(20);
 	}
-	surf->free();
-	_gfx->clearScreen(Gfx::kBitFront);
+	info->bg.free();
 
-	surf = _disk->loadStatic("core");
-	_gfx->setPalette(_gfx->_palette);
-	_gfx->flatBlitCnv(surf, (640 - surf->w) >> 1, (400 - surf->h) >> 1, Gfx::kBitFront);
-	_gfx->updateScreen();
-	_system->delayMillis(2000);
+	delete info;
 
-	for (uint i = 0; i < 64; i++) {
-		_gfx->_palette.fadeTo(pal, 1);
-		_gfx->setPalette(_gfx->_palette);
-		_gfx->updateScreen();
-		_system->delayMillis(30);
-	}
-	surf->free();
-	_gfx->clearScreen(Gfx::kBitFront);
+	return;
+}
 
+void Parallaction_br::initGame() {
+
+	splash("dyna");
+	splash("core");
+
+	return;
 }
 
 } // namespace Parallaction


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