aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/actor.cpp2
-rw-r--r--engines/scumm/detection.cpp22
-rw-r--r--engines/scumm/he/cup_player_he.cpp4
-rw-r--r--engines/scumm/he/resource_he.cpp15
-rw-r--r--engines/scumm/he/resource_he.h2
-rw-r--r--engines/scumm/he/script_v60he.cpp8
-rw-r--r--engines/scumm/resource.cpp2
-rw-r--r--engines/scumm/scumm-md5.h5
-rw-r--r--engines/scumm/scumm.cpp11
-rw-r--r--engines/scumm/smush/smush_player.cpp11
10 files changed, 38 insertions, 44 deletions
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index b2bb8be9c9..1ea0da86d8 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -1475,7 +1475,7 @@ void Actor::prepareDrawActorCostume(BaseCostumeRenderer *bcr) {
bcr->_shadow_table = _vm->_shadowPalette;
}
- bcr->setCostume(_costume, _heXmapNum);
+ bcr->setCostume(_costume, (_vm->_game.heversion == 0) ? 0 : _heXmapNum);
bcr->setPalette(_palette);
bcr->setFacing(this);
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index b14f51cb14..3059fc1033 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -178,7 +178,7 @@ static Common::String generateFilenameForDetection(const char *pattern, Filename
}
struct DetectorDesc {
- Common::FilesystemNode node;
+ Common::FSNode node;
Common::String md5;
const MD5Table *md5Entry; // Entry of the md5 table corresponding to this file, if any.
};
@@ -192,7 +192,7 @@ static bool testGame(const GameSettings *g, const DescMap &fileMD5Map, const Com
// when performing the matching. The first match is returned, so if you
// search for "resource" and two nodes "RESOURE and "resource" are present,
// the first match is used.
-static bool searchFSNode(const Common::FSList &fslist, const Common::String &name, Common::FilesystemNode &result) {
+static bool searchFSNode(const Common::FSList &fslist, const Common::String &name, Common::FSNode &result) {
for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
if (!scumm_stricmp(file->getName().c_str(), name.c_str())) {
result = *file;
@@ -213,16 +213,16 @@ static Common::Language detectLanguage(const Common::FSList &fslist, byte id) {
// switch to MD5 based detection).
const char *filename = (id == GID_CMI) ? "LANGUAGE.TAB" : "LANGUAGE.BND";
Common::FilePtr tmp;
- Common::FilesystemNode langFile;
+ Common::FSNode langFile;
if (searchFSNode(fslist, filename, langFile))
tmp = Common::FilePtr(langFile.openForReading());
if (!tmp) {
// try loading in RESOURCE sub dir...
- Common::FilesystemNode resDir;
+ Common::FSNode resDir;
Common::FSList tmpList;
if (searchFSNode(fslist, "RESOURCE", resDir)
&& resDir.isDirectory()
- && resDir.getChildren(tmpList, Common::FilesystemNode::kListFilesOnly)
+ && resDir.getChildren(tmpList, Common::FSNode::kListFilesOnly)
&& searchFSNode(tmpList, filename, langFile)) {
tmp = Common::FilePtr(langFile.openForReading());
}
@@ -695,10 +695,10 @@ bool ScummMetaEngine::hasFeature(MetaEngineFeature f) const {
(f == kSupportsListSaves) ||
(f == kSupportsDirectLoad) ||
(f == kSupportsDeleteSave) ||
- (f == kSupportsMetaInfos) ||
- (f == kSupportsThumbnails) ||
- (f == kSupportsSaveDate) ||
- (f == kSupportsSavePlayTime);
+ (f == kSavesSupportMetaInfo) ||
+ (f == kSavesSupportThumbnail) ||
+ (f == kSavesSupportCreationDate) ||
+ (f == kSavesSupportPlayTime);
}
GameList ScummMetaEngine::getSupportedGames() const {
@@ -787,8 +787,8 @@ PluginError ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) cons
// Fetch the list of files in the current directory
Common::FSList fslist;
- Common::FilesystemNode dir(ConfMan.get("path"));
- if (!dir.getChildren(fslist, Common::FilesystemNode::kListFilesOnly)) {
+ Common::FSNode dir(ConfMan.get("path"));
+ if (!dir.getChildren(fslist, Common::FSNode::kListFilesOnly)) {
return kInvalidPathError;
}
diff --git a/engines/scumm/he/cup_player_he.cpp b/engines/scumm/he/cup_player_he.cpp
index 685bd00065..51176c5df9 100644
--- a/engines/scumm/he/cup_player_he.cpp
+++ b/engines/scumm/he/cup_player_he.cpp
@@ -99,7 +99,7 @@ void CUP_Player::play() {
debug(1, "rate %d width %d height %d", _playbackRate, _width, _height);
int ticks = _system->getMillis();
- while (_dataSize != 0 && !_vm->quit()) {
+ while (_dataSize != 0 && !_vm->shouldQuit()) {
while (parseNextBlockTag(_fileStream)) {
if (_fileStream.ioFailed()) {
return;
@@ -190,7 +190,7 @@ void CUP_Player::waitForSfxChannel(int channel) {
CUP_SfxChannel *sfxChannel = &_sfxChannels[channel];
debug(1, "waitForSfxChannel %d", channel);
if ((sfxChannel->flags & kSfxFlagLoop) == 0) {
- while (_mixer->isSoundHandleActive(sfxChannel->handle) && !_vm->quit()) {
+ while (_mixer->isSoundHandleActive(sfxChannel->handle) && !_vm->shouldQuit()) {
_vm->parseEvents();
_system->delayMillis(10);
}
diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp
index 4f74a74b89..9858206209 100644
--- a/engines/scumm/he/resource_he.cpp
+++ b/engines/scumm/he/resource_he.cpp
@@ -159,15 +159,16 @@ int Win32ResExtractor::extractResource_(const char *resType, char *resName, byte
/* initiate stuff */
fi.memory = NULL;
- fi.file = new Common::File;
+ fi.file = NULL;
if (_fileName.empty()) { // We are running for the first time
_fileName = _vm->generateFilename(-3);
}
/* get file size */
- fi.file->open(_fileName);
- if (!fi.file->isOpen()) {
+ Common::FSNode node(_fileName);
+ fi.file = node.openForReading();
+ if (!fi.file) {
error("Cannot open file %s", _fileName.c_str());
}
@@ -199,12 +200,8 @@ int Win32ResExtractor::extractResource_(const char *resType, char *resName, byte
/* free stuff and close file */
cleanup:
- if (fi.file != NULL) {
- fi.file->close();
- delete fi.file;
- }
- if (fi.memory != NULL)
- free(fi.memory);
+ delete fi.file;
+ free(fi.memory);
return ressize;
}
diff --git a/engines/scumm/he/resource_he.h b/engines/scumm/he/resource_he.h
index 9f4b423d3d..cbe19a4fdf 100644
--- a/engines/scumm/he/resource_he.h
+++ b/engines/scumm/he/resource_he.h
@@ -168,7 +168,7 @@ class Win32ResExtractor : public ResExtractor {
#include "common/pack-start.h" // START STRUCT PACKING
struct WinLibrary {
- Common::File *file;
+ Common::SeekableReadStream *file;
byte *memory;
byte *first_resource;
int total_size;
diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp
index 7f36d53791..f60bbdd84b 100644
--- a/engines/scumm/he/script_v60he.cpp
+++ b/engines/scumm/he/script_v60he.cpp
@@ -1010,12 +1010,8 @@ void ScummEngine_v60he::o60_openFile() {
// TODO / FIXME: Consider using listSavefiles to avoid unneccessary openForLoading calls
_hInFileTable[slot] = _saveFileMan->openForLoading(filename);
if (_hInFileTable[slot] == 0) {
- Common::File *f = new Common::File();
- f->open(filename);
- if (!f->isOpen())
- delete f;
- else
- _hInFileTable[slot] = f;
+ Common::FSNode node(filename);
+ _hInFileTable[slot] = node.openForReading();
}
break;
case 2:
diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp
index 50e0d221ca..87ded6723b 100644
--- a/engines/scumm/resource.cpp
+++ b/engines/scumm/resource.cpp
@@ -676,7 +676,7 @@ int ScummEngine::loadResource(int type, int idx) {
if (tag != _res->tags[type] && _game.heversion < 70) {
error("%s %d not in room %d at %d+%d in file %s",
_res->name[type], idx, roomNr,
- _fileOffset, fileOffs, _fileHandle->name());
+ _fileOffset, fileOffs, _fileHandle->getName());
}
size = _fileHandle->readUint32BE();
diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h
index ce40d808b1..eb8ef58754 100644
--- a/engines/scumm/scumm-md5.h
+++ b/engines/scumm/scumm-md5.h
@@ -1,5 +1,5 @@
/*
- This file was generated by the md5table tool on Mon Sep 29 00:06:57 2008
+ This file was generated by the md5table tool on Fri Oct 3 16:12:45 2008
DO NOT EDIT MANUALLY!
*/
@@ -226,7 +226,7 @@ static const MD5Table md5table[] = {
{ "55d3987641bf229c83bc729210173383", "zak", "V1", "", 174848, Common::EN_ANY, Common::kPlatformC64 },
{ "55e4cc866ff9046824e1c638ba2b8c7f", "ft", "", "", -1, Common::RU_RUS, Common::kPlatformUnknown },
{ "566165a7338fa11029e7c14d94fa70d0", "freddi", "HE 73", "Demo", 9800, Common::EN_ANY, Common::kPlatformWindows },
- { "5719fc8a13b4638b78d9d8d12f091f94", "puttrace", "HE 98.5", "", -1, Common::FR_FRA, Common::kPlatformWindows },
+ { "5719fc8a13b4638b78d9d8d12f091f94", "puttrace", "HE 99", "", -1, Common::FR_FRA, Common::kPlatformWindows },
{ "5798972220cd458be2626d54c80f71d7", "atlantis", "", "Floppy", -1, Common::IT_ITA, Common::kPlatformAmiga },
{ "57a17febe2183f521250e55d55b83e60", "PuttTime", "HE 99", "", -1, Common::FR_FRA, Common::kPlatformWindows },
{ "57a5cfec9ef231a007043cc1917e8988", "freddi", "HE 100", "", -1, Common::EN_ANY, Common::kPlatformWii },
@@ -406,6 +406,7 @@ static const MD5Table md5table[] = {
{ "9e5e0fb43bd22f4628719b7501adb717", "monkey", "No Adlib", "EGA", -1, Common::FR_FRA, Common::kPlatformAtariST },
{ "9fd66fb3b04703bd50da4356e4202558", "spyfox2", "", "", -1, Common::EN_ANY, Common::kPlatformMacintosh },
{ "a00554c31d623fdb9fcb0f924b89b42b", "loom", "EGA", "EGA Demo", -1, Common::EN_ANY, Common::kPlatformPC },
+ { "a01fab4a64d47b96e2e58e6b0f825cc7", "monkey", "VGA", "VGA", 8347, Common::FR_FRA, Common::kPlatformPC },
{ "a095616d2d23ccf43b8e257711202cba", "football2002", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown },
{ "a095e33061606d231ff37dca4c64c8ac", "pajama", "HE 99", "", -1, Common::DE_DEU, Common::kPlatformUnknown },
{ "a0a7dea72003933b8b3f8b99b9f7ddeb", "loom", "No Adlib", "EGA", -1, Common::EN_ANY, Common::kPlatformAtariST },
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index a10af41145..bb22ee6381 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -24,7 +24,6 @@
*/
-
#include "common/config-manager.h"
#include "common/md5.h"
#include "common/events.h"
@@ -1017,7 +1016,7 @@ int ScummEngine::init() {
// We now have to determine the correct _filenamePattern. To do this
- // we simply hardcode the possibilites.
+ // we simply hardcode the possibilities.
const char *p1 = 0, *p2 = 0;
switch (_game.id) {
case GID_INDY4:
@@ -1726,7 +1725,7 @@ int ScummEngine::go() {
int diff = 0; // Duration of one loop iteration
- while (!quit()) {
+ while (!shouldQuit()) {
if (_debugger->isAttached())
_debugger->onFrame();
@@ -1759,7 +1758,7 @@ int ScummEngine::go() {
diff = _system->getMillis() - diff;
- if (quit()) {
+ if (shouldQuit()) {
// TODO: Maybe perform an autosave on exit?
}
}
@@ -1777,7 +1776,7 @@ void ScummEngine::waitForTimer(int msec_delay) {
start_time = _system->getMillis();
- while (!quit()) {
+ while (!shouldQuit()) {
_sound->updateCD(); // Loop CD Audio if needed
parseEvents();
_system->updateScreen();
@@ -1900,7 +1899,7 @@ load_game:
checkExecVerbs();
checkAndRunSentenceScript();
- if (quit())
+ if (shouldQuit())
return;
// HACK: If a load was requested, immediately perform it. This avoids
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp
index 6b79b7e2c4..55cdc2a25e 100644
--- a/engines/scumm/smush/smush_player.cpp
+++ b/engines/scumm/smush/smush_player.cpp
@@ -1017,16 +1017,17 @@ void SmushPlayer::parseNextFrame() {
}
assert(_base);
+
+ const uint32 subType = _base->readUint32BE();
+ const int32 subSize = _base->readUint32BE();
+ const int32 subOffset = _base->pos();
+
if (_base->eos()) {
_vm->_smushVideoShouldFinish = true;
_endOfFile = true;
return;
}
- const uint32 subType = _base->readUint32BE();
- const int32 subSize = _base->readUint32BE();
- const int32 subOffset = _base->pos();
-
switch (subType) {
case MKID_BE('AHDR'): // FT INSANE may seek file to the beginning
handleAnimHeader(subSize, *_base);
@@ -1253,7 +1254,7 @@ void SmushPlayer::play(const char *filename, int32 speed, int32 offset, int32 st
}
if (_endOfFile)
break;
- if (_vm->quit() || _vm->_saveLoadFlag || _vm->_smushVideoShouldFinish) {
+ if (_vm->shouldQuit() || _vm->_saveLoadFlag || _vm->_smushVideoShouldFinish) {
_smixer->stop();
_vm->_mixer->stopHandle(_compressedFileSoundHandle);
_vm->_mixer->stopHandle(_IACTchannel);