- Moved disk code for Nippon Safes in new file disk_ns.cpp, adding _ns suffix to classes and member functions.

- Added function stubs into new file disk_br.cpp for Big Red Adventure [IT STILL CRASHES!].
- Modified engine to create the proper Disk manager object.

svn-id: r28246
This commit is contained in:
Nicola Mettifogo 2007-07-27 19:02:19 +00:00
parent a32b81d126
commit 67869d2c10
7 changed files with 333 additions and 157 deletions

View File

@ -29,19 +29,8 @@
#include "parallaction/defs.h"
#include "common/file.h"
namespace Audio {
class AudioStream;
}
namespace Parallaction {
//------------------------------------------------------
// ARCHIVE MANAGEMENT
//------------------------------------------------------
#define MAX_ARCHIVE_ENTRIES 384
class Table;
class Parallaction;
class Gfx;
@ -51,63 +40,15 @@ class Font;
struct Cnv;
struct StaticCnv;
class Archive : public Common::SeekableReadStream {
protected:
bool _file;
uint32 _fileOffset;
uint32 _fileCursor;
uint32 _fileEndOffset;
Common::String _archiveName;
char _archiveDir[MAX_ARCHIVE_ENTRIES][32];
uint32 _archiveLenghts[MAX_ARCHIVE_ENTRIES];
uint32 _archiveOffsets[MAX_ARCHIVE_ENTRIES];
Common::File _archive;
uint32 _numFiles;
protected:
void resetArchivedFile();
public:
Archive();
void open(const char* file);
void close();
Common::String name() const;
bool openArchivedFile(const char *name);
void closeArchivedFile();
uint32 size() const;
uint32 pos() const;
bool eos() const;
void seek(int32 offs, int whence = SEEK_SET);
uint32 read(void *dataPtr, uint32 dataSize);
};
class Disk {
protected:
Archive _resArchive;
Archive _locArchive;
char _languageDir[3];
Parallaction *_vm;
protected:
void errorFileNotFound(const char *s);
public:
Disk(Parallaction *vm);
virtual ~Disk();
Disk() { }
virtual ~Disk() { }
Common::String selectArchive(const Common::String &name);
void setLanguage(uint16 language);
virtual Common::String selectArchive(const Common::String &name) = 0;
virtual void setLanguage(uint16 language) = 0;
virtual Script* loadLocation(const char *name) = 0;
virtual Script* loadScript(const char* name) = 0;
@ -125,7 +66,63 @@ public:
virtual Common::ReadStream* loadSound(const char* name) = 0;
};
class DosDisk : public Disk {
#define MAX_ARCHIVE_ENTRIES 384
class Archive : public Common::SeekableReadStream {
protected:
bool _file;
uint32 _fileOffset;
uint32 _fileCursor;
uint32 _fileEndOffset;
Common::String _archiveName;
char _archiveDir[MAX_ARCHIVE_ENTRIES][32];
uint32 _archiveLenghts[MAX_ARCHIVE_ENTRIES];
uint32 _archiveOffsets[MAX_ARCHIVE_ENTRIES];
Common::File _archive;
uint32 _numFiles;
protected:
void resetArchivedFile();
public:
Archive();
void open(const char* file);
void close();
Common::String name() const;
bool openArchivedFile(const char *name);
void closeArchivedFile();
uint32 size() const;
uint32 pos() const;
bool eos() const;
void seek(int32 offs, int whence = SEEK_SET);
uint32 read(void *dataPtr, uint32 dataSize);
};
class Disk_ns : public Disk {
protected:
Archive _resArchive;
Archive _locArchive;
char _languageDir[3];
Parallaction *_vm;
protected:
void errorFileNotFound(const char *s);
public:
Disk_ns(Parallaction *vm);
virtual ~Disk_ns();
Common::String selectArchive(const Common::String &name);
void setLanguage(uint16 language);
};
class DosDisk_ns : public Disk_ns {
private:
void unpackBackground(Common::ReadStream *stream, byte *screen, byte *mask, byte *path);
@ -142,8 +139,8 @@ protected:
Gfx *_gfx;
public:
DosDisk(Parallaction *vm);
virtual ~DosDisk();
DosDisk_ns(Parallaction *vm);
virtual ~DosDisk_ns();
Script* loadLocation(const char *name);
Script* loadScript(const char* name);
@ -161,7 +158,7 @@ public:
Common::ReadStream* loadSound(const char* name);
};
class AmigaDisk : public Disk {
class AmigaDisk_ns : public Disk_ns {
protected:
Cnv* makeCnv(Common::SeekableReadStream &stream);
@ -176,8 +173,8 @@ protected:
void loadBackground(const char *name);
public:
AmigaDisk(Parallaction *vm);
virtual ~AmigaDisk();
AmigaDisk_ns(Parallaction *vm);
virtual ~AmigaDisk_ns();
Script* loadLocation(const char *name);
Script* loadScript(const char* name);
@ -195,6 +192,41 @@ public:
Common::ReadStream* loadSound(const char* name);
};
// for the moment DosDisk_br subclasses Disk. When Amiga support will
// be taken into consideration, it might be useful to add another level
// like we did for Nippon Safes.
class DosDisk_br : public Disk {
protected:
Parallaction *_vm;
protected:
void errorFileNotFound(const char *s);
public:
DosDisk_br(Parallaction *vm);
virtual ~DosDisk_br();
Common::String selectArchive(const Common::String &name);
void setLanguage(uint16 language);
Script* loadLocation(const char *name);
Script* loadScript(const char* name);
Cnv* loadTalk(const char *name);
Cnv* loadObjects(const char *name);
StaticCnv* loadPointer();
StaticCnv* loadHead(const char* name);
Font* loadFont(const char* name);
StaticCnv* loadStatic(const char* name);
Cnv* loadFrames(const char* name);
void loadSlide(const char *filename);
void loadScenery(const char* background, const char* mask);
Table* loadTable(const char* name);
Common::ReadStream* loadMusic(const char* name);
Common::ReadStream* loadSound(const char* name);
};
} // namespace Parallaction

View File

@ -0,0 +1,134 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*
*/
#include "common/stdafx.h"
#include "parallaction/parallaction.h"
namespace Parallaction {
void DosDisk_br::errorFileNotFound(const char *s) {
error("File '%s' not found", s);
}
Common::String DosDisk_br::selectArchive(const Common::String& name) {
debugC(5, kDebugDisk, "DosDisk_br::selectArchive");
return "";
}
void DosDisk_br::setLanguage(uint16 language) {
debugC(5, kDebugDisk, "DosDisk_br::setLanguage");
return;
}
DosDisk_br::DosDisk_br(Parallaction* vm) : _vm(vm) {
}
DosDisk_br::~DosDisk_br() {
}
Cnv* DosDisk_br::loadTalk(const char *name) {
debugC(5, kDebugDisk, "DosDisk_br::loadTalk");
return 0;
}
Script* DosDisk_br::loadLocation(const char *name) {
debugC(5, kDebugDisk, "DosDisk_br::loadLocation");
return 0;
}
Script* DosDisk_br::loadScript(const char* name) {
debugC(5, kDebugDisk, "DosDisk_br::loadScript");
return 0;
}
// there are no Head resources in Big Red Adventure
StaticCnv* DosDisk_br::loadHead(const char* name) {
debugC(5, kDebugDisk, "DosDisk_br::loadHead");
return 0;
}
StaticCnv* DosDisk_br::loadPointer() {
debugC(5, kDebugDisk, "DosDisk_br::loadPointer");
return 0;
}
Font* DosDisk_br::loadFont(const char* name) {
debugC(5, kDebugDisk, "DosDisk_br::loadFont");
return 0;
}
Cnv* DosDisk_br::loadObjects(const char *name) {
debugC(5, kDebugDisk, "DosDisk_br::loadObjects");
return 0;
}
StaticCnv* 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;
}
// there are no Slide resources in Big Red Adventure
void DosDisk_br::loadSlide(const char *filename) {
debugC(5, kDebugDisk, "DosDisk_br::loadSlide");
return;
}
void DosDisk_br::loadScenery(const char *name, const char *mask) {
debugC(5, kDebugDisk, "DosDisk_br::loadScenery");
return;
}
Table* DosDisk_br::loadTable(const char* name) {
debugC(5, kDebugDisk, "DosDisk_br::loadTable");
return 0;
}
Common::ReadStream* DosDisk_br::loadMusic(const char* name) {
debugC(5, kDebugDisk, "DosDisk_br::loadMusic");
return 0;
}
Common::ReadStream* DosDisk_br::loadSound(const char* name) {
debugC(5, kDebugDisk, "DosDisk_br::loadSound");
return 0;
}
} // namespace Parallaction

View File

@ -32,6 +32,8 @@
namespace Audio {
class AudioStream;
AudioStream *make8SVXStream(Common::ReadStream &input);
}
@ -254,26 +256,26 @@ public:
Disk::Disk(Parallaction *vm) : _vm(vm) {
}
Disk::~Disk() {
}
void Disk::errorFileNotFound(const char *s) {
void Disk_ns::errorFileNotFound(const char *s) {
error("File '%s' not found", s);
}
Disk_ns::Disk_ns(Parallaction *vm) : _vm(vm) {
Common::String Disk::selectArchive(const Common::String& name) {
}
Disk_ns::~Disk_ns() {
}
Common::String Disk_ns::selectArchive(const Common::String& name) {
Common::String oldName = _resArchive.name();
_resArchive.open(name.c_str());
return oldName;
}
void Disk::setLanguage(uint16 language) {
void Disk_ns::setLanguage(uint16 language) {
debugC(1, kDebugDisk, "setLanguage(%i)", language);
switch (language) {
@ -309,18 +311,18 @@ void Disk::setLanguage(uint16 language) {
DosDisk::DosDisk(Parallaction* vm) : Disk(vm) {
DosDisk_ns::DosDisk_ns(Parallaction* vm) : Disk_ns(vm) {
}
DosDisk::~DosDisk() {
DosDisk_ns::~DosDisk_ns() {
}
//
// loads a cnv from an external file
//
Cnv* DosDisk::loadExternalCnv(const char *filename) {
Cnv* DosDisk_ns::loadExternalCnv(const char *filename) {
// printf("Gfx::loadExternalCnv(%s)...", filename);
char path[PATH_LEN];
@ -343,7 +345,7 @@ Cnv* DosDisk::loadExternalCnv(const char *filename) {
return new Cnv(numFrames, width, height, data);
}
StaticCnv *DosDisk::loadExternalStaticCnv(const char *filename) {
StaticCnv *DosDisk_ns::loadExternalStaticCnv(const char *filename) {
char path[PATH_LEN];
@ -368,7 +370,7 @@ StaticCnv *DosDisk::loadExternalStaticCnv(const char *filename) {
return cnv;
}
Cnv* DosDisk::loadCnv(const char *filename) {
Cnv* DosDisk_ns::loadCnv(const char *filename) {
// printf("Gfx::loadCnv(%s)\n", filename);
char path[PATH_LEN];
@ -393,7 +395,7 @@ Cnv* DosDisk::loadCnv(const char *filename) {
return new Cnv(numFrames, width, height, data);
}
Cnv* DosDisk::loadTalk(const char *name) {
Cnv* DosDisk_ns::loadTalk(const char *name) {
const char *ext = strstr(name, ".talk");
if (ext != NULL) {
@ -418,7 +420,7 @@ Cnv* DosDisk::loadTalk(const char *name) {
return loadExternalCnv(v20);
}
Script* DosDisk::loadLocation(const char *name) {
Script* DosDisk_ns::loadLocation(const char *name) {
char archivefile[PATH_LEN];
@ -435,11 +437,11 @@ Script* DosDisk::loadLocation(const char *name) {
strcat(archivefile, name);
strcat(archivefile, ".loc");
debugC(3, kDebugDisk, "DosDisk::loadLocation(%s): trying '%s'", name, archivefile);
debugC(3, kDebugDisk, "DosDisk_ns::loadLocation(%s): trying '%s'", name, archivefile);
if (!_locArchive.openArchivedFile(archivefile)) {
sprintf(archivefile, "%s%s.loc", _languageDir, name);
debugC(3, kDebugDisk, "DosDisk::loadLocation(%s): trying '%s'", name, archivefile);
debugC(3, kDebugDisk, "DosDisk_ns::loadLocation(%s): trying '%s'", name, archivefile);
if (!_locArchive.openArchivedFile(archivefile))
errorFileNotFound(name);
@ -448,7 +450,7 @@ Script* DosDisk::loadLocation(const char *name) {
return new Script(new DummyArchiveStream(_locArchive), true);
}
Script* DosDisk::loadScript(const char* name) {
Script* DosDisk_ns::loadScript(const char* name) {
char vC8[PATH_LEN];
@ -460,7 +462,7 @@ Script* DosDisk::loadScript(const char* name) {
return new Script(new DummyArchiveStream(_resArchive), true);
}
StaticCnv* DosDisk::loadHead(const char* name) {
StaticCnv* DosDisk_ns::loadHead(const char* name) {
char path[PATH_LEN];
@ -475,19 +477,19 @@ StaticCnv* DosDisk::loadHead(const char* name) {
}
StaticCnv* DosDisk::loadPointer() {
StaticCnv* DosDisk_ns::loadPointer() {
return loadExternalStaticCnv("pointer");
}
Font* DosDisk::loadFont(const char* name) {
Font* DosDisk_ns::loadFont(const char* name) {
char path[PATH_LEN];
sprintf(path, "%scnv", name);
return createFont(name, loadExternalCnv(path));
}
Cnv* DosDisk::loadObjects(const char *name) {
Cnv* DosDisk_ns::loadObjects(const char *name) {
if (IS_MINI_CHARACTER(name)) {
name += 4;
@ -499,7 +501,7 @@ Cnv* DosDisk::loadObjects(const char *name) {
}
StaticCnv* DosDisk::loadStatic(const char* name) {
StaticCnv* DosDisk_ns::loadStatic(const char* name) {
char path[PATH_LEN];
@ -525,7 +527,7 @@ StaticCnv* DosDisk::loadStatic(const char* name) {
return cnv;
}
Cnv* DosDisk::loadFrames(const char* name) {
Cnv* DosDisk_ns::loadFrames(const char* name) {
return loadCnv(name);
}
@ -537,7 +539,7 @@ Cnv* DosDisk::loadFrames(const char* name) {
// * mask data [bits 6-7] (z buffer)
// * path data [bit 8] (walkable areas)
//
void DosDisk::unpackBackground(Common::ReadStream *stream, byte *screen, byte *mask, byte *path) {
void DosDisk_ns::unpackBackground(Common::ReadStream *stream, byte *screen, byte *mask, byte *path) {
byte b;
uint32 i = 0;
@ -555,7 +557,7 @@ void DosDisk::unpackBackground(Common::ReadStream *stream, byte *screen, byte *m
}
void DosDisk::parseDepths(Common::SeekableReadStream &stream) {
void DosDisk_ns::parseDepths(Common::SeekableReadStream &stream) {
_vm->_gfx->_bgLayers[0] = stream.readByte();
_vm->_gfx->_bgLayers[1] = stream.readByte();
_vm->_gfx->_bgLayers[2] = stream.readByte();
@ -563,7 +565,7 @@ void DosDisk::parseDepths(Common::SeekableReadStream &stream) {
}
void DosDisk::parseBackground(Common::SeekableReadStream &stream) {
void DosDisk_ns::parseBackground(Common::SeekableReadStream &stream) {
stream.read(_vm->_gfx->_palette, BASE_PALETTE_SIZE);
_vm->_gfx->setPalette(_vm->_gfx->_palette);
@ -580,7 +582,7 @@ void DosDisk::parseBackground(Common::SeekableReadStream &stream) {
}
void DosDisk::loadBackground(const char *filename) {
void DosDisk_ns::loadBackground(const char *filename) {
if (!_resArchive.openArchivedFile(filename))
errorFileNotFound(filename);
@ -612,7 +614,7 @@ void DosDisk::loadBackground(const char *filename) {
// mask and path are normally combined (via OR) into the background picture itself
// read the comment on the top of this file for more
//
void DosDisk::loadMaskAndPath(const char *name) {
void DosDisk_ns::loadMaskAndPath(const char *name) {
char path[PATH_LEN];
sprintf(path, "%s.msk", name);
@ -633,13 +635,13 @@ void DosDisk::loadMaskAndPath(const char *name) {
return;
}
void DosDisk::loadSlide(const char *filename) {
void DosDisk_ns::loadSlide(const char *filename) {
char path[PATH_LEN];
sprintf(path, "%s.slide", filename);
loadBackground(path);
}
void DosDisk::loadScenery(const char *name, const char *mask) {
void DosDisk_ns::loadScenery(const char *name, const char *mask) {
char path[PATH_LEN];
sprintf(path, "%s.dyn", name);
loadBackground(path);
@ -651,7 +653,7 @@ void DosDisk::loadScenery(const char *name, const char *mask) {
}
Table* DosDisk::loadTable(const char* name) {
Table* DosDisk_ns::loadTable(const char* name) {
char path[PATH_LEN];
sprintf(path, "%s.tab", name);
@ -672,7 +674,7 @@ Table* DosDisk::loadTable(const char* name) {
return t;
}
Common::ReadStream* DosDisk::loadMusic(const char* name) {
Common::ReadStream* DosDisk_ns::loadMusic(const char* name) {
char path[PATH_LEN];
sprintf(path, "%s.mid", name);
@ -684,7 +686,7 @@ Common::ReadStream* DosDisk::loadMusic(const char* name) {
}
Common::ReadStream* DosDisk::loadSound(const char* name) {
Common::ReadStream* DosDisk_ns::loadSound(const char* name) {
return NULL;
}
@ -859,12 +861,12 @@ public:
AmigaDisk::AmigaDisk(Parallaction *vm) : Disk(vm) {
AmigaDisk_ns::AmigaDisk_ns(Parallaction *vm) : Disk_ns(vm) {
}
AmigaDisk::~AmigaDisk() {
AmigaDisk_ns::~AmigaDisk_ns() {
}
@ -874,7 +876,7 @@ AmigaDisk::~AmigaDisk() {
unpackFrame transforms images from 5-bitplanes format to
8-bit color-index mode
*/
void AmigaDisk::unpackFrame(byte *dst, byte *src, uint16 planeSize) {
void AmigaDisk_ns::unpackFrame(byte *dst, byte *src, uint16 planeSize) {
byte s0, s1, s2, s3, s4, mask, t0, t1, t2, t3, t4;
@ -902,7 +904,7 @@ void AmigaDisk::unpackFrame(byte *dst, byte *src, uint16 planeSize) {
/*
patchFrame applies DLTA data (dlta) to specified buffer (dst)
*/
void AmigaDisk::patchFrame(byte *dst, byte *dlta, uint16 bytesPerPlane, uint16 height) {
void AmigaDisk_ns::patchFrame(byte *dst, byte *dlta, uint16 bytesPerPlane, uint16 height) {
uint32 *dataIndex = (uint32*)dlta;
uint32 *ofslenIndex = (uint32*)dlta + 8;
@ -938,7 +940,7 @@ void AmigaDisk::patchFrame(byte *dst, byte *dlta, uint16 bytesPerPlane, uint16 h
}
// FIXME: no mask is loaded
void AmigaDisk::unpackBitmap(byte *dst, byte *src, uint16 numFrames, uint16 bytesPerPlane, uint16 height) {
void AmigaDisk_ns::unpackBitmap(byte *dst, byte *src, uint16 numFrames, uint16 bytesPerPlane, uint16 height) {
byte *baseFrame = src;
byte *tempBuffer = 0;
@ -972,7 +974,7 @@ void AmigaDisk::unpackBitmap(byte *dst, byte *src, uint16 numFrames, uint16 byte
}
StaticCnv* AmigaDisk::makeStaticCnv(Common::SeekableReadStream &stream) {
StaticCnv* AmigaDisk_ns::makeStaticCnv(Common::SeekableReadStream &stream) {
stream.skip(1);
uint16 width = stream.readByte();
@ -1002,7 +1004,7 @@ StaticCnv* AmigaDisk::makeStaticCnv(Common::SeekableReadStream &stream) {
return cnv;
}
Cnv* AmigaDisk::makeCnv(Common::SeekableReadStream &stream) {
Cnv* AmigaDisk_ns::makeCnv(Common::SeekableReadStream &stream) {
uint16 numFrames = stream.readByte();
uint16 width = stream.readByte();
@ -1027,8 +1029,8 @@ Cnv* AmigaDisk::makeCnv(Common::SeekableReadStream &stream) {
}
#undef NUM_PLANES
Script* AmigaDisk::loadLocation(const char *name) {
debugC(1, kDebugDisk, "AmigaDisk()::loadLocation '%s'", name);
Script* AmigaDisk_ns::loadLocation(const char *name) {
debugC(1, kDebugDisk, "AmigaDisk_ns()::loadLocation '%s'", name);
char path[PATH_LEN];
if (IS_MINI_CHARACTER(_vm->_characterName)) {
@ -1048,8 +1050,8 @@ Script* AmigaDisk::loadLocation(const char *name) {
return new Script(new PowerPackerStream(_locArchive), true);
}
Script* AmigaDisk::loadScript(const char* name) {
debugC(1, kDebugDisk, "AmigaDisk::loadScript '%s'", name);
Script* AmigaDisk_ns::loadScript(const char* name) {
debugC(1, kDebugDisk, "AmigaDisk_ns::loadScript '%s'", name);
char vC8[PATH_LEN];
@ -1061,8 +1063,8 @@ Script* AmigaDisk::loadScript(const char* name) {
return new Script(new DummyArchiveStream(_resArchive), true);
}
StaticCnv* AmigaDisk::loadPointer() {
debugC(1, kDebugDisk, "AmigaDisk::loadPointer");
StaticCnv* AmigaDisk_ns::loadPointer() {
debugC(1, kDebugDisk, "AmigaDisk_ns::loadPointer");
Common::File stream;
if (!stream.open("pointer"))
@ -1071,8 +1073,8 @@ StaticCnv* AmigaDisk::loadPointer() {
return makeStaticCnv(stream);
}
StaticCnv* AmigaDisk::loadStatic(const char* name) {
debugC(1, kDebugDisk, "AmigaDisk::loadStatic '%s'", name);
StaticCnv* AmigaDisk_ns::loadStatic(const char* name) {
debugC(1, kDebugDisk, "AmigaDisk_ns::loadStatic '%s'", name);
Common::SeekableReadStream *s = openArchivedFile(name, true);
StaticCnv *cnv = makeStaticCnv(*s);
@ -1082,8 +1084,8 @@ StaticCnv* AmigaDisk::loadStatic(const char* name) {
return cnv;
}
Common::SeekableReadStream *AmigaDisk::openArchivedFile(const char* name, bool errorOnFileNotFound) {
debugC(3, kDebugDisk, "AmigaDisk::openArchivedFile(%s)", name);
Common::SeekableReadStream *AmigaDisk_ns::openArchivedFile(const char* name, bool errorOnFileNotFound) {
debugC(3, kDebugDisk, "AmigaDisk_ns::openArchivedFile(%s)", name);
if (_resArchive.openArchivedFile(name)) {
return new DummyArchiveStream(_resArchive);
@ -1184,7 +1186,7 @@ public:
};
void AmigaDisk::loadBackground(const char *name) {
void AmigaDisk_ns::loadBackground(const char *name) {
Common::SeekableReadStream *s = openArchivedFile(name, true);
@ -1205,7 +1207,7 @@ void AmigaDisk::loadBackground(const char *name) {
}
void AmigaDisk::loadMask(const char *name) {
void AmigaDisk_ns::loadMask(const char *name) {
char path[PATH_LEN];
sprintf(path, "%s.mask", name);
@ -1241,7 +1243,7 @@ void AmigaDisk::loadMask(const char *name) {
return;
}
void AmigaDisk::loadPath(const char *name) {
void AmigaDisk_ns::loadPath(const char *name) {
char path[PATH_LEN];
sprintf(path, "%s.path", name);
@ -1263,8 +1265,8 @@ void AmigaDisk::loadPath(const char *name) {
return;
}
void AmigaDisk::loadScenery(const char* background, const char* mask) {
debugC(1, kDebugDisk, "AmigaDisk::loadScenery '%s', '%s'", background, mask);
void AmigaDisk_ns::loadScenery(const char* background, const char* mask) {
debugC(1, kDebugDisk, "AmigaDisk_ns::loadScenery '%s', '%s'", background, mask);
char path[PATH_LEN];
sprintf(path, "%s.bkgnd", background);
@ -1276,8 +1278,8 @@ void AmigaDisk::loadScenery(const char* background, const char* mask) {
return;
}
void AmigaDisk::loadSlide(const char *name) {
debugC(1, kDebugDisk, "AmigaDisk::loadSlide '%s'", name);
void AmigaDisk_ns::loadSlide(const char *name) {
debugC(1, kDebugDisk, "AmigaDisk_ns::loadSlide '%s'", name);
char path[PATH_LEN];
sprintf(path, "slides/%s", name);
@ -1290,8 +1292,8 @@ void AmigaDisk::loadSlide(const char *name) {
return;
}
Cnv* AmigaDisk::loadFrames(const char* name) {
debugC(1, kDebugDisk, "AmigaDisk::loadFrames '%s'", name);
Cnv* AmigaDisk_ns::loadFrames(const char* name) {
debugC(1, kDebugDisk, "AmigaDisk_ns::loadFrames '%s'", name);
Common::SeekableReadStream *s;
@ -1308,8 +1310,8 @@ Cnv* AmigaDisk::loadFrames(const char* name) {
return cnv;
}
StaticCnv* AmigaDisk::loadHead(const char* name) {
debugC(1, kDebugDisk, "AmigaDisk::loadHead '%s'", name);
StaticCnv* AmigaDisk_ns::loadHead(const char* name) {
debugC(1, kDebugDisk, "AmigaDisk_ns::loadHead '%s'", name);
char path[PATH_LEN];
sprintf(path, "%s.head", name);
@ -1323,8 +1325,8 @@ StaticCnv* AmigaDisk::loadHead(const char* name) {
}
Cnv* AmigaDisk::loadObjects(const char *name) {
debugC(1, kDebugDisk, "AmigaDisk::loadObjects");
Cnv* AmigaDisk_ns::loadObjects(const char *name) {
debugC(1, kDebugDisk, "AmigaDisk_ns::loadObjects");
char path[PATH_LEN];
if (_vm->getFeatures() & GF_DEMO)
@ -1341,8 +1343,8 @@ Cnv* AmigaDisk::loadObjects(const char *name) {
}
Cnv* AmigaDisk::loadTalk(const char *name) {
debugC(1, kDebugDisk, "AmigaDisk::loadTalk '%s'", name);
Cnv* AmigaDisk_ns::loadTalk(const char *name) {
debugC(1, kDebugDisk, "AmigaDisk_ns::loadTalk '%s'", name);
Common::SeekableReadStream *s;
@ -1363,8 +1365,8 @@ Cnv* AmigaDisk::loadTalk(const char *name) {
return cnv;
}
Table* AmigaDisk::loadTable(const char* name) {
debugC(1, kDebugDisk, "AmigaDisk::loadTable '%s'", name);
Table* AmigaDisk_ns::loadTable(const char* name) {
debugC(1, kDebugDisk, "AmigaDisk_ns::loadTable '%s'", name);
char path[PATH_LEN];
sprintf(path, "%s.table", name);
@ -1403,7 +1405,7 @@ Table* AmigaDisk::loadTable(const char* name) {
return t;
}
Font* AmigaDisk::loadFont(const char* name) {
Font* AmigaDisk_ns::loadFont(const char* name) {
debugC(1, kDebugDisk, "AmigaFullDisk::loadFont '%s'", name);
char path[PATH_LEN];
@ -1425,11 +1427,11 @@ Font* AmigaDisk::loadFont(const char* name) {
}
Common::ReadStream* AmigaDisk::loadMusic(const char* name) {
Common::ReadStream* AmigaDisk_ns::loadMusic(const char* name) {
return openArchivedFile(name);
}
Common::ReadStream* AmigaDisk::loadSound(const char* name) {
Common::ReadStream* AmigaDisk_ns::loadSound(const char* name) {
char path[PATH_LEN];
sprintf(path, "%s.snd", name);

View File

@ -408,7 +408,7 @@ void AmigaFont::drawString(byte *buffer, uint32 pitch, const char *s) {
}
Font *DosDisk::createFont(const char *name, Cnv* cnv) {
Font *DosDisk_ns::createFont(const char *name, Cnv* cnv) {
Font *f = 0;
if (!scumm_stricmp(name, "comic"))
@ -425,7 +425,7 @@ Font *DosDisk::createFont(const char *name, Cnv* cnv) {
return f;
}
Font *AmigaDisk::createFont(const char *name, Common::SeekableReadStream &stream) {
Font *AmigaDisk_ns::createFont(const char *name, Common::SeekableReadStream &stream) {
// TODO: implement AmigaLabelFont for labels
return new AmigaFont(stream);
}

View File

@ -7,7 +7,8 @@ MODULE_OBJS := \
debug.o \
detection.o \
dialogue.o \
disk.o \
disk_br.o \
disk_ns.o \
font.o \
graphics.o \
intro.o \

View File

@ -191,17 +191,24 @@ int Parallaction::init() {
_screenMaskSize = _screenMaskWidth * _screenHeight;
_screenPathSize = _screenPathWidth * _screenHeight;
if (getPlatform() == Common::kPlatformPC) {
_disk = new DosDisk(this);
} else {
if (getFeatures() & GF_DEMO) {
strcpy(_location._name, "fognedemo");
if (getGameType() == GType_Nippon) {
if (getPlatform() == Common::kPlatformPC) {
_disk = new DosDisk_ns(this);
} else {
if (getFeatures() & GF_DEMO) {
strcpy(_location._name, "fognedemo");
}
_disk = new AmigaDisk_ns(this);
_disk->selectArchive((_vm->getFeatures() & GF_DEMO) ? "disk0" : "disk1");
}
_disk = new AmigaDisk(this);
_disk->selectArchive((_vm->getFeatures() & GF_DEMO) ? "disk0" : "disk1");
}
} else
if (getGameType() == GType_BRA) {
if (getPlatform() == Common::kPlatformPC) {
_disk = new DosDisk_br(this);
} else
error("unsupported platform for Big Red Adventure");
} else
error("unknown game type");
_engineFlags = 0;

View File

@ -41,7 +41,7 @@ static uint16 walkData2 = 0; // next walk frame
uint16 queryPath(uint16 x, uint16 y) {
// NOTE: a better solution would have us mirror each byte in the mask in the loading routine
// AmigaDisk::loadPath() instead of doing it here.
// AmigaDisk_ns::loadPath() instead of doing it here.
byte _al = _buffer[y*40 + x/8];
byte _dl = (_vm->getPlatform() == Common::kPlatformPC) ? (x & 7) : (7 - (x & 7));