Add basic support for Amiga version.

svn-id: r27411
This commit is contained in:
Travis Howell 2007-06-15 04:05:57 +00:00
parent 4f8f854ee6
commit 388b8689a6
4 changed files with 30 additions and 9 deletions

View File

@ -22,7 +22,9 @@
* $Id$
*
*/
#include "common/stdafx.h"
#include "common/endian.h"
#include "common/file.h"
#include "parallaction/disk.h"
@ -54,6 +56,7 @@ Archive::Archive() {
}
void Archive::open(const char *file) {
bool isSmallArchive;
debugC(3, kDebugDisk, "Archive::open(%s)", file);
if (_archive.isOpen())
@ -65,7 +68,11 @@ void Archive::open(const char *file) {
if (!_archive.open(path))
error("archive '%s' not found", path);
bool isSmallArchive = _archive.size() == SIZEOF_SMALL_ARCHIVE;
if (_vm->getFeatures() & GF_DEMO) {
isSmallArchive = _archive.size() == SIZEOF_SMALL_ARCHIVE;
} else {
isSmallArchive = (_archive.readUint32BE() != MKID_BE('NDOS'));
}
_numFiles = (isSmallArchive) ? SMALL_ARCHIVE_FILES_NUM : NORMAL_ARCHIVE_FILES_NUM;

View File

@ -808,7 +808,11 @@ Cnv* AmigaDisk::loadTalk(const char *name) {
Common::SeekableReadStream *s;
char path[PATH_LEN];
sprintf(path, "%s.talk", name);
if (_vm->getFeatures() & GF_DEMO)
sprintf(path, "%s.talk", name);
else
sprintf(path, "talk/%s.talk", name);
s = openArchivedFile(path, false);
if (s == NULL) {
s = openArchivedFile(name, true);
@ -824,7 +828,11 @@ Cnv* AmigaDisk::loadObjects(const char *name) {
debugC(1, kDebugDisk, "AmigaDisk::loadObjects");
char path[PATH_LEN];
sprintf(path, "%s.objs", name);
if (_vm->getFeatures() & GF_DEMO)
sprintf(path, "%s.objs", name);
else
sprintf(path, "objs/%s.objs", name);
Common::SeekableReadStream *s = openArchivedFile(path, true);
Cnv *cnv = makeCnv(*s);
@ -1103,6 +1111,9 @@ Table* AmigaDisk::loadTable(const char* name) {
dispose = true;
stream = s;
} else {
if (!(_vm->getFeatures() & GF_DEMO))
sprintf(path, "objs/%s.table", name);
if (!_resArchive.openArchivedFile(path))
errorFileNotFound(path);

View File

@ -105,7 +105,7 @@ Menu::~Menu() {
void Menu::start() {
_vm->_disk->selectArchive((_vm->getPlatform() == Common::kPlatformPC) ? "disk1" : "disk0");
_vm->_disk->selectArchive((_vm->getFeatures() & GF_DEMO) ? "disk0" : "disk1");
splash();

View File

@ -175,11 +175,11 @@ int Parallaction::init() {
_baseTime = 0;
if (getPlatform() == Common::kPlatformPC)
if (getPlatform() == Common::kPlatformPC) {
_disk = new DosDisk(this);
else {
} else {
_disk = new AmigaDisk(this);
_disk->selectArchive("disk0");
_disk->selectArchive((_vm->getFeatures() & GF_DEMO) ? "disk0" : "disk1");
}
_engineFlags = 0;
@ -753,10 +753,13 @@ void Parallaction::changeCharacter(const char *name) {
// character for sanity before memory is freed
freeCharacter();
_disk->selectArchive((_vm->getPlatform() == Common::kPlatformPC) ? "disk1" : "disk0");
_disk->selectArchive((_vm->getFeatures() & GF_DEMO) ? "disk0" : "disk1");
_vm->_char._ani._cnv = _disk->loadFrames(fullName);
if (!IS_DUMMY_CHARACTER(name)) {
if (_vm->getPlatform() == Common::kPlatformAmiga)
_disk->selectArchive("disk0");
_vm->_char._head = _disk->loadHead(baseName);
_vm->_char._talk = _disk->loadTalk(baseName);
_vm->_char._objs = _disk->loadObjects(baseName);
@ -765,7 +768,7 @@ void Parallaction::changeCharacter(const char *name) {
_soundMan->playCharacterMusic(name);
if ((getFeatures() & GF_DEMO) == 0)
if (!(getFeatures() & GF_DEMO))
parseLocation("common");
}
}