aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/parallaction/disk_br.cpp44
-rw-r--r--engines/parallaction/parallaction.h2
-rw-r--r--engines/parallaction/parallaction_br.cpp43
3 files changed, 46 insertions, 43 deletions
diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp
index dbdd308ad4..3d8ee015d7 100644
--- a/engines/parallaction/disk_br.cpp
+++ b/engines/parallaction/disk_br.cpp
@@ -98,6 +98,21 @@ void genSlidePath(char *path, const char* name) {
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,37 +121,24 @@ Graphics::Surface* DosDisk_br::loadStatic(const char* name) {
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);
-
- return surf;
-}
-
-Cnv* DosDisk_br::loadFrames(const char* name) {
- debugC(5, kDebugDisk, "DosDisk_br::loadFrames");
- return 0;
-}
+ info->bg.create(info->width, info->height, 1);
+ stream.read(info->bg.pixels, info->width * info->height);
-
-
-// there are no Slide resources in Big Red Adventure
-BackgroundInfo* DosDisk_br::loadSlide(const char *name) {
- debugC(5, kDebugDisk, "DosDisk_br::loadSlide");
-
- return 0;
+ return info;
}
BackgroundInfo* DosDisk_br::loadScenery(const char *name, const char *mask, const char* path) {
diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h
index 72c7e8d68b..21cfb3984f 100644
--- a/engines/parallaction/parallaction.h
+++ b/engines/parallaction/parallaction.h
@@ -569,6 +569,8 @@ private:
void initResources();
void initGame();
+ void splash(const char *name);
+
static const Callable _dosCallables[6];
void _c_blufade(void*);
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp
index fbf424c41e..0455b50381 100644
--- a/engines/parallaction/parallaction_br.cpp
+++ b/engines/parallaction/parallaction_br.cpp
@@ -72,39 +72,38 @@ int Parallaction_br::go() {
return 0;
}
-void Parallaction_br::initGame() {
+void Parallaction_br::splash(const char *name) {
+
+ BackgroundInfo *info;
+
+ _gfx->clearScreen(Gfx::kBitFront);
- Graphics::Surface* surf = _disk->loadStatic("dyna");
- _gfx->setPalette(_gfx->_palette);
- _gfx->flatBlitCnv(surf, (640 - surf->w) >> 1, (400 - surf->h) >> 1, 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