2004-04-12 21:40:49 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
2006-01-18 17:39:49 +00:00
|
|
|
* Copyright (C) 2004-2006 The ScummVM project
|
2004-04-12 21:40:49 +00:00
|
|
|
*
|
|
|
|
* The ReInherit Engine is (C)2000-2003 by Daniel Balsom.
|
|
|
|
*
|
|
|
|
* 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
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2004-04-12 21:40:49 +00:00
|
|
|
*
|
2006-02-11 12:44:16 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2004-04-12 21:40:49 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2004-05-01 09:07:31 +00:00
|
|
|
// Game detection, general game parameters
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-08-02 16:20:35 +00:00
|
|
|
#include "saga/saga.h"
|
2004-12-22 19:34:41 +00:00
|
|
|
|
2005-10-14 04:28:20 +00:00
|
|
|
#include "common/config-manager.h"
|
2006-10-02 22:21:57 +00:00
|
|
|
#include "common/advancedDetector.h"
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2005-07-19 19:05:52 +00:00
|
|
|
#include "saga/rscfile.h"
|
2004-08-06 01:39:17 +00:00
|
|
|
#include "saga/interface.h"
|
2004-08-11 23:42:02 +00:00
|
|
|
#include "saga/scene.h"
|
2006-05-13 10:30:38 +00:00
|
|
|
#include "saga/sagaresnames.h"
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2005-08-10 18:27:18 +00:00
|
|
|
|
2006-03-09 14:33:07 +00:00
|
|
|
namespace Saga {
|
2007-01-21 20:24:38 +00:00
|
|
|
struct SAGAGameDescription {
|
|
|
|
Common::ADGameDescription desc;
|
|
|
|
|
|
|
|
int gameType;
|
|
|
|
int gameId;
|
|
|
|
uint32 features;
|
|
|
|
const GameDisplayInfo *gameDisplayInfo;
|
|
|
|
int startSceneNumber;
|
|
|
|
const GameResourceDescription *resourceDescription;
|
|
|
|
int fontsCount;
|
|
|
|
const GameFontDescription *fontDescriptions;
|
|
|
|
const GameSoundInfo *voiceInfo;
|
|
|
|
const GameSoundInfo *sfxInfo;
|
|
|
|
const GameSoundInfo *musicInfo;
|
|
|
|
int patchesCount;
|
|
|
|
const GamePatchDescription *patchDescriptions;
|
|
|
|
};
|
|
|
|
|
|
|
|
const bool SagaEngine::isBigEndian() const { return (_gameDescription->features & GF_BIG_ENDIAN_DATA) != 0; }
|
|
|
|
const bool SagaEngine::isMacResources() const { return (getPlatform() == Common::kPlatformMacintosh); }
|
|
|
|
const GameResourceDescription *SagaEngine::getResourceDescription() { return _gameDescription->resourceDescription; }
|
|
|
|
const GameSoundInfo *SagaEngine::getVoiceInfo() const { return _gameDescription->voiceInfo; }
|
|
|
|
const GameSoundInfo *SagaEngine::getSfxInfo() const { return _gameDescription->sfxInfo; }
|
|
|
|
const GameSoundInfo *SagaEngine::getMusicInfo() const { return _gameDescription->musicInfo; }
|
|
|
|
|
|
|
|
const GameFontDescription *SagaEngine::getFontDescription(int index) {
|
|
|
|
assert(index < _gameDescription->fontsCount);
|
|
|
|
return &_gameDescription->fontDescriptions[index];
|
|
|
|
}
|
|
|
|
int SagaEngine::getFontsCount() const { return _gameDescription->fontsCount; }
|
|
|
|
|
|
|
|
int SagaEngine::getGameId() const { return _gameDescription->gameId; }
|
|
|
|
int SagaEngine::getGameType() const { return _gameDescription->gameType; }
|
|
|
|
uint32 SagaEngine::getFeatures() const { return _gameDescription->features; }
|
|
|
|
Common::Language SagaEngine::getLanguage() const { return _gameDescription->desc.language; }
|
|
|
|
Common::Platform SagaEngine::getPlatform() const { return _gameDescription->desc.platform; }
|
|
|
|
int SagaEngine::getGameNumber() const { return _gameNumber; }
|
|
|
|
int SagaEngine::getStartSceneNumber() const { return _gameDescription->startSceneNumber; }
|
|
|
|
|
|
|
|
int SagaEngine::getPatchesCount() const { return _gameDescription->patchesCount; }
|
|
|
|
const GamePatchDescription *SagaEngine::getPatchDescriptions() const { return _gameDescription->patchDescriptions; }
|
|
|
|
const Common::ADGameFileDescription *SagaEngine::getFilesDescriptions() const { return _gameDescription->desc.filesDescriptions; }
|
|
|
|
|
2007-01-20 21:27:57 +00:00
|
|
|
static GameList GAME_detectGames(const FSList &fslist);
|
2006-03-09 14:33:07 +00:00
|
|
|
}
|
|
|
|
|
2007-01-24 23:13:00 +00:00
|
|
|
static const PlainGameDescriptor sagaGames[] = {
|
2006-03-09 14:33:07 +00:00
|
|
|
{"ite", "Inherit the Earth: Quest for the Orb"},
|
|
|
|
{"ihnm", "I Have No Mouth and I Must Scream"},
|
|
|
|
{0, 0}
|
|
|
|
};
|
|
|
|
|
2007-01-24 23:13:00 +00:00
|
|
|
namespace Saga {
|
|
|
|
|
|
|
|
#include "sagagame.cpp"
|
|
|
|
|
|
|
|
}
|
2006-08-26 11:33:15 +00:00
|
|
|
|
2007-01-24 23:13:00 +00:00
|
|
|
static const Common::ADParams detectionParams = {
|
|
|
|
// Pointer to ADGameDescription or its superset structure
|
|
|
|
(const byte *)Saga::gameDescriptions,
|
|
|
|
// Size of that superset structure
|
|
|
|
sizeof(Saga::SAGAGameDescription),
|
|
|
|
// Number of bytes to compute MD5 sum for
|
|
|
|
5000,
|
|
|
|
// List of all engine targets
|
|
|
|
sagaGames,
|
|
|
|
// Structure for autoupgrading obsolete targets
|
|
|
|
0
|
|
|
|
};
|
|
|
|
|
|
|
|
ADVANCED_DETECTOR_DEFINE_PLUGIN(SAGA, Saga::SagaEngine, Saga::GAME_detectGames, detectionParams);
|
2006-03-09 14:33:07 +00:00
|
|
|
|
2006-07-31 13:41:21 +00:00
|
|
|
REGISTER_PLUGIN(SAGA, "SAGA Engine", "Inherit the Earth (C) Wyrmkeep Entertainment");
|
2006-03-09 14:33:07 +00:00
|
|
|
|
2004-04-12 21:40:49 +00:00
|
|
|
namespace Saga {
|
2006-10-02 22:21:57 +00:00
|
|
|
|
2006-11-12 03:23:29 +00:00
|
|
|
bool SagaEngine::initGame() {
|
2007-01-25 21:16:57 +00:00
|
|
|
int i = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
|
|
|
|
if (i < 0)
|
|
|
|
return false;
|
2007-01-24 23:13:00 +00:00
|
|
|
|
2006-11-12 03:23:29 +00:00
|
|
|
_gameDescription = &gameDescriptions[i];
|
2006-12-19 13:50:34 +00:00
|
|
|
|
|
|
|
_gameDisplayInfo = *_gameDescription->gameDisplayInfo;
|
|
|
|
_displayClip.right = _gameDisplayInfo.logicalWidth;
|
|
|
|
_displayClip.bottom = _gameDisplayInfo.logicalHeight;
|
|
|
|
|
|
|
|
return _resource->createContexts();
|
2006-11-12 03:23:29 +00:00
|
|
|
}
|
2006-10-02 22:21:57 +00:00
|
|
|
|
2007-01-20 21:27:57 +00:00
|
|
|
GameList GAME_detectGames(const FSList &fslist) {
|
2007-01-25 21:16:57 +00:00
|
|
|
return Common::AdvancedDetector::detectAllGames(fslist, detectionParams);
|
2006-11-12 03:23:29 +00:00
|
|
|
}
|
2004-04-12 21:40:49 +00:00
|
|
|
|
|
|
|
} // End of namespace Saga
|