diff options
author | Travis Howell | 2008-07-28 07:20:55 +0000 |
---|---|---|
committer | Travis Howell | 2008-07-28 07:20:55 +0000 |
commit | 533dbfd756f744234fdc2942472a61b542530193 (patch) | |
tree | 9cb90750113fc61488d55783e2c8567d40590b4d /engines | |
parent | 258f1e8fe630e4323c93c03bbf993307ef652fb5 (diff) | |
download | scummvm-rg350-533dbfd756f744234fdc2942472a61b542530193.tar.gz scummvm-rg350-533dbfd756f744234fdc2942472a61b542530193.tar.bz2 scummvm-rg350-533dbfd756f744234fdc2942472a61b542530193.zip |
Add basic support for running Amiga and PC demos of BRA.
svn-id: r33357
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/detection.cpp | 36 | ||||
-rw-r--r-- | engines/parallaction/disk.h | 10 | ||||
-rw-r--r-- | engines/parallaction/disk_br.cpp | 37 | ||||
-rw-r--r-- | engines/parallaction/gfxbase.cpp | 4 | ||||
-rw-r--r-- | engines/parallaction/parallaction_br.cpp | 18 |
5 files changed, 100 insertions, 5 deletions
diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index 8841b9ca40..0476b01454 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -154,7 +154,23 @@ static const PARALLACTIONGameDescription gameDescriptions[] = { Common::ADGF_NO_FLAGS }, GType_BRA, - GF_LANG_EN | GF_LANG_FR | GF_LANG_DE | GF_LANG_IT | GF_LANG_MULT + GF_LANG_EN | GF_LANG_FR | GF_LANG_DE | GF_LANG_IT | GF_LANG_MULT, + }, + + { + { + "bra", + "Demo", + { + { "russia.fnt", 0, "0dd55251d2886d6783718df2b184bf97", 10649 }, + { NULL, 0, NULL, 0} + }, + Common::UNK_LANG, + Common::kPlatformPC, + Common::ADGF_DEMO + }, + GType_BRA, + GF_LANG_EN | GF_DEMO, }, // TODO: Base the detection of Amiga BRA on actual data file, not executable file. @@ -171,9 +187,25 @@ static const PARALLACTIONGameDescription gameDescriptions[] = { Common::ADGF_NO_FLAGS }, GType_BRA, - GF_LANG_EN | GF_LANG_FR | GF_LANG_DE | GF_LANG_IT | GF_LANG_MULT + GF_LANG_EN | GF_LANG_FR | GF_LANG_DE | GF_LANG_IT | GF_LANG_MULT, }, + // TODO: Base the detection of Amiga BRA demo on actual data file, not executable file. + { + { + "bra", + "Demo", + { + { "bigred", 0, "b62a7b589fb5e9071f021227640893bf", 97004 }, + { NULL, 0, NULL, 0} + }, + Common::UNK_LANG, + Common::kPlatformAmiga, + Common::ADGF_DEMO + }, + GType_BRA, + GF_LANG_EN | GF_DEMO, + }, { AD_TABLE_END_MARKER, 0, 0 } }; diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h index a2a4086a51..ee393afd6a 100644 --- a/engines/parallaction/disk.h +++ b/engines/parallaction/disk.h @@ -250,6 +250,16 @@ public: Common::ReadStream* loadSound(const char* name); }; +class DosDemo_br : public DosDisk_br { + +public: + DosDemo_br(Parallaction *vm); + virtual ~DosDemo_br(); + + Common::String selectArchive(const Common::String& name); + +}; + class AmigaDisk_br : public DosDisk_br { protected: diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp index 8f2fabf926..1f77c338c0 100644 --- a/engines/parallaction/disk_br.cpp +++ b/engines/parallaction/disk_br.cpp @@ -443,6 +443,43 @@ Common::ReadStream* DosDisk_br::loadSound(const char* name) { +DosDemo_br::DosDemo_br(Parallaction *vm) : DosDisk_br(vm) { + +} + + +DosDemo_br::~DosDemo_br() { + +} + +Common::String DosDemo_br::selectArchive(const Common::String& name) { + debugC(5, kDebugDisk, "DosDemo_br::selectArchive"); + + Common::String oldPath; + if (_partDir.exists()) { + oldPath = _partDir.getDisplayName(); + } + + _partDir = _baseDir; + + _aniDir = _partDir.getChild("ani"); + _bkgDir = _partDir.getChild("bkg"); + _mscDir = _partDir.getChild("msc"); + _mskDir = _partDir.getChild("msk"); + _pthDir = _partDir.getChild("pth"); + _rasDir = _partDir.getChild("ras"); + _scrDir = _partDir.getChild("scripts"); + _sfxDir = _partDir.getChild("sfx"); + _talDir = _partDir.getChild("tal"); + + return oldPath; +} + + + + + + AmigaDisk_br::AmigaDisk_br(Parallaction *vm) : DosDisk_br(vm) { _fntDir = _baseDir.getChild("fonts"); diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp index e8250ac8fd..c9892ce2f3 100644 --- a/engines/parallaction/gfxbase.cpp +++ b/engines/parallaction/gfxbase.cpp @@ -204,6 +204,10 @@ void Gfx::drawGfxObjects(Graphics::Surface &surf) { void Gfx::drawText(Font *font, Graphics::Surface* surf, uint16 x, uint16 y, const char *text, byte color) { + // TODO: Add support for difference in font data + if (_vm->getGameType() == GType_BRA && _vm->getPlatform() == Common::kPlatformPC && (_vm->getFeatures() & GF_DEMO)) + return; + byte *dst = (byte*)surf->getBasePtr(x, y); font->setColor(color); font->drawString(dst, surf->w, text); diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index 18b697fdae..6482329c5e 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -56,7 +56,11 @@ int Parallaction_br::init() { if (getGameType() == GType_BRA) { if (getPlatform() == Common::kPlatformPC) { - _disk = new DosDisk_br(this); + if (getFeatures() & GF_DEMO) { + _disk = new DosDemo_br(this); + } else { + _disk = new DosDisk_br(this); + } _disk->setLanguage(2); // NOTE: language is now hardcoded to English. Original used command-line parameters. _soundMan = new DummySoundMan(this); } else { @@ -109,7 +113,11 @@ void Parallaction_br::callFunction(uint index, void* parm) { int Parallaction_br::go() { - startGui(); + if (getFeatures() & GF_DEMO) { + startPart(1); + } else { + startGui(); + } while ((_engineFlags & kEngineQuit) == 0) { @@ -200,7 +208,11 @@ void Parallaction_br::startPart(uint part) { initPart(); - strcpy(_location._name, partFirstLocation[_part]); + if (getFeatures() & GF_DEMO) { + strcpy(_location._name, "camalb"); + } else { + strcpy(_location._name, partFirstLocation[_part]); + } parseLocation("common"); changeLocation(_location._name); |