[Scummvm-cvs-logs] SF.net SVN: scummvm: [28511] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Thu Aug 9 21:26:20 CEST 2007
Revision: 28511
http://scummvm.svn.sourceforge.net/scummvm/?rev=28511&view=rev
Author: peres001
Date: 2007-08-09 12:26:20 -0700 (Thu, 09 Aug 2007)
Log Message:
-----------
Added code to load and display splash screens for BRA. The game crashes afterwards.
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-09 19:24:51 UTC (rev 28510)
+++ scummvm/trunk/engines/parallaction/disk_br.cpp 2007-08-09 19:26:20 UTC (rev 28511)
@@ -92,10 +92,37 @@
return 0;
}
+void genSlidePath(char *path, const char* name) {
+ sprintf(path, "%s.bmp", name);
+}
Graphics::Surface* DosDisk_br::loadStatic(const char* name) {
debugC(5, kDebugDisk, "DosDisk_br::loadStatic");
- return 0;
+
+ char path[PATH_LEN];
+ genSlidePath(path, name);
+
+ Common::File stream;
+ if (!stream.open(path))
+ errorFileNotFound(path);
+
+ stream.skip(4);
+ uint width = stream.readUint32BE();
+ uint 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);
+ }
+
+ Graphics::Surface *surf = new Graphics::Surface;
+ surf->create(width, height, 1);
+ stream.read(surf->pixels, width*height);
+
+ return surf;
}
Cnv* DosDisk_br::loadFrames(const char* name) {
@@ -103,9 +130,12 @@
return 0;
}
+
+
// there are no Slide resources in Big Red Adventure
-void DosDisk_br::loadSlide(const char *filename) {
+void DosDisk_br::loadSlide(const char *name) {
debugC(5, kDebugDisk, "DosDisk_br::loadSlide");
+
return;
}
Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h 2007-08-09 19:24:51 UTC (rev 28510)
+++ scummvm/trunk/engines/parallaction/parallaction.h 2007-08-09 19:26:20 UTC (rev 28511)
@@ -543,6 +543,7 @@
~Parallaction_br() { }
int init();
+ int go();
public:
typedef void (Parallaction_br::*Callable)(void*);
@@ -554,6 +555,7 @@
private:
void initResources();
+ void initGame();
static const Callable _dosCallables[6];
Modified: scummvm/trunk/engines/parallaction/parallaction_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_br.cpp 2007-08-09 19:24:51 UTC (rev 28510)
+++ scummvm/trunk/engines/parallaction/parallaction_br.cpp 2007-08-09 19:26:20 UTC (rev 28511)
@@ -24,6 +24,8 @@
*/
#include "common/stdafx.h"
+#include "common/system.h"
+
#include "parallaction/parallaction.h"
#include "parallaction/sound.h"
@@ -63,4 +65,46 @@
(this->*_callables[index])(parm);
}
+int Parallaction_br::go() {
+
+ initGame();
+
+ return 0;
+}
+
+void Parallaction_br::initGame() {
+
+ Graphics::Surface* surf = _disk->loadStatic("dyna");
+ _gfx->setPalette(_gfx->_palette);
+ _gfx->flatBlitCnv(surf, (640 - surf->w) >> 1, (400 - surf->h) >> 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);
+ _gfx->updateScreen();
+ _system->delayMillis(30);
+ }
+ surf->free();
+ _gfx->clearScreen(Gfx::kBitFront);
+
+ 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);
+
+ 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);
+
+}
+
} // 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