2009-02-16 01:58:30 +00:00
|
|
|
/* 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.
|
|
|
|
*
|
2009-02-17 15:20:21 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2009-02-16 01:58:30 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-02-15 06:10:59 +00:00
|
|
|
#ifndef SCI_H
|
|
|
|
#define SCI_H
|
|
|
|
|
|
|
|
#include "engines/engine.h"
|
2009-11-23 23:55:19 +00:00
|
|
|
//#include "engines/advancedDetector.h"
|
|
|
|
|
|
|
|
struct ADGameDescription;
|
2009-02-21 09:45:34 +00:00
|
|
|
|
2009-11-24 22:10:14 +00:00
|
|
|
/**
|
|
|
|
* This is the namespace of the SCI engine.
|
|
|
|
*
|
|
|
|
* Status of this engine: ???
|
|
|
|
*
|
|
|
|
* Supported games:
|
|
|
|
* - ???
|
|
|
|
*/
|
2009-02-20 14:45:28 +00:00
|
|
|
namespace Sci {
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-12-21 12:19:57 +00:00
|
|
|
// Uncomment this to include old graphics code
|
|
|
|
//#define INCLUDE_OLDGFX
|
|
|
|
// Uncomment this if you want to use the old graphics code. INCLUDE_OLDGFX must be defined
|
2009-12-08 21:22:22 +00:00
|
|
|
//#define USE_OLDGFX
|
2009-12-19 16:19:53 +00:00
|
|
|
// Uncomment this to use old music functions
|
|
|
|
#define USE_OLD_MUSIC_FUNCTIONS
|
2009-12-28 17:17:22 +00:00
|
|
|
// Uncomment this to use old pathfinding code
|
2009-12-30 15:38:50 +00:00
|
|
|
//#define OLD_PATHFINDING
|
2009-10-28 13:20:30 +00:00
|
|
|
|
2009-05-11 17:07:38 +00:00
|
|
|
class Console;
|
2009-05-14 12:38:50 +00:00
|
|
|
struct EngineState;
|
2009-07-11 23:45:54 +00:00
|
|
|
class Kernel;
|
|
|
|
class Vocabulary;
|
2009-08-30 01:37:27 +00:00
|
|
|
class ResourceManager;
|
2009-11-04 09:36:18 +00:00
|
|
|
class AudioPlayer;
|
2009-05-11 13:31:17 +00:00
|
|
|
|
2009-02-15 06:10:59 +00:00
|
|
|
// our engine debug levels
|
2009-02-20 20:11:12 +00:00
|
|
|
enum kDebugLevels {
|
|
|
|
kDebugLevelError = 1 << 0,
|
|
|
|
kDebugLevelNodes = 1 << 1,
|
|
|
|
kDebugLevelGraphics = 1 << 2,
|
|
|
|
kDebugLevelStrings = 1 << 3,
|
2009-05-30 15:40:49 +00:00
|
|
|
kDebugLevelMemory = 1 << 4,
|
2009-02-20 20:11:12 +00:00
|
|
|
kDebugLevelFuncCheck = 1 << 5,
|
|
|
|
kDebugLevelBresen = 1 << 6,
|
|
|
|
kDebugLevelSound = 1 << 7,
|
|
|
|
kDebugLevelGfxDriver = 1 << 8,
|
|
|
|
kDebugLevelBaseSetter = 1 << 9,
|
|
|
|
kDebugLevelParser = 1 << 10,
|
2009-07-04 11:33:51 +00:00
|
|
|
kDebugLevelMenu = 1 << 11,
|
|
|
|
kDebugLevelSaid = 1 << 12,
|
|
|
|
kDebugLevelFile = 1 << 13,
|
|
|
|
kDebugLevelTime = 1 << 14,
|
|
|
|
kDebugLevelRoom = 1 << 15,
|
|
|
|
kDebugLevelAvoidPath = 1 << 16,
|
|
|
|
kDebugLevelDclInflate = 1 << 17,
|
|
|
|
kDebugLevelVM = 1 << 18,
|
2009-07-06 10:39:22 +00:00
|
|
|
kDebugLevelScripts = 1 << 19,
|
2009-09-06 21:56:49 +00:00
|
|
|
kDebugLevelGC = 1 << 20,
|
2009-10-10 00:07:19 +00:00
|
|
|
kDebugLevelSci0Pic = 1 << 21,
|
|
|
|
kDebugLevelResMan = 1 << 22
|
2009-02-15 06:10:59 +00:00
|
|
|
};
|
|
|
|
|
2009-08-16 19:18:19 +00:00
|
|
|
extern const char *versionNames[];
|
2009-05-14 12:38:50 +00:00
|
|
|
|
2009-08-30 01:37:27 +00:00
|
|
|
/** SCI versions */
|
|
|
|
enum SciVersion {
|
|
|
|
SCI_VERSION_AUTODETECT,
|
|
|
|
SCI_VERSION_0_EARLY, // Early KQ4, 1988 xmas card
|
|
|
|
SCI_VERSION_0_LATE, // KQ4, LSL2, LSL3, SQ3 etc
|
|
|
|
SCI_VERSION_01, // KQ1 and multilingual games (S.old.*)
|
|
|
|
SCI_VERSION_1_EGA, // EGA with parser, QFG2
|
|
|
|
SCI_VERSION_1_EARLY, // KQ5. (EGA/VGA)
|
|
|
|
SCI_VERSION_1_MIDDLE, // LSL1, JONESCD. (EGA?/VGA)
|
|
|
|
SCI_VERSION_1_LATE, // ECO1, LSL5. (EGA/VGA)
|
|
|
|
SCI_VERSION_1_1, // KQ6, ECO2
|
|
|
|
SCI_VERSION_2, // GK1, PQ4 (Floppy), QFG4 (Floppy)
|
|
|
|
SCI_VERSION_2_1, // GK2, KQ7, SQ6, Torin
|
|
|
|
SCI_VERSION_3 // LSL7, RAMA, Lighthouse
|
|
|
|
};
|
|
|
|
|
2009-10-09 17:41:59 +00:00
|
|
|
enum MoveCountType {
|
|
|
|
kMoveCountUninitialized,
|
|
|
|
kIgnoreMoveCount,
|
|
|
|
kIncrementMoveCount
|
|
|
|
};
|
|
|
|
|
2009-02-15 06:10:59 +00:00
|
|
|
class SciEngine : public Engine {
|
2009-06-07 23:04:34 +00:00
|
|
|
friend class Console;
|
2009-02-15 22:43:13 +00:00
|
|
|
public:
|
2009-10-09 23:19:53 +00:00
|
|
|
SciEngine(OSystem *syst, const ADGameDescription *desc);
|
2009-02-15 22:43:13 +00:00
|
|
|
~SciEngine();
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-03-01 04:42:46 +00:00
|
|
|
// Engine APIs
|
|
|
|
virtual Common::Error run();
|
2009-10-11 15:51:43 +00:00
|
|
|
bool hasFeature(EngineFeature f) const;
|
2009-06-02 19:03:43 +00:00
|
|
|
void pauseEngineIntern(bool pause);
|
2009-05-11 13:31:17 +00:00
|
|
|
virtual GUI::Debugger *getDebugger();
|
2009-07-03 14:22:50 +00:00
|
|
|
Console *getSciDebugger();
|
2009-10-11 15:51:43 +00:00
|
|
|
Common::Error loadGameState(int slot);
|
|
|
|
Common::Error saveGameState(int slot, const char *desc);
|
|
|
|
bool canLoadGameStateCurrently();
|
|
|
|
bool canSaveGameStateCurrently();
|
2009-02-21 09:45:34 +00:00
|
|
|
|
2009-02-18 20:08:49 +00:00
|
|
|
const char* getGameID() const;
|
2009-02-22 03:40:51 +00:00
|
|
|
int getResourceVersion() const;
|
2009-02-18 20:08:49 +00:00
|
|
|
Common::Language getLanguage() const;
|
|
|
|
Common::Platform getPlatform() const;
|
|
|
|
uint32 getFlags() const;
|
2009-09-02 12:02:37 +00:00
|
|
|
ResourceManager *getResourceManager() const { return _resMan; }
|
2009-07-11 23:45:54 +00:00
|
|
|
Kernel *getKernel() const { return _kernel; }
|
2009-10-13 18:51:59 +00:00
|
|
|
EngineState *getEngineState() const { return _gamestate; }
|
2009-07-11 23:45:54 +00:00
|
|
|
Vocabulary *getVocabulary() const { return _vocabulary; }
|
2009-12-30 16:00:56 +00:00
|
|
|
bool isDemo() const;
|
2009-02-27 01:17:24 +00:00
|
|
|
|
2009-02-20 23:41:15 +00:00
|
|
|
Common::String getSavegameName(int nr) const;
|
2009-02-27 01:17:24 +00:00
|
|
|
Common::String getSavegamePattern() const;
|
|
|
|
|
2010-01-01 09:40:28 +00:00
|
|
|
Common::String getFilePrefix() const;
|
|
|
|
|
2009-02-27 01:17:24 +00:00
|
|
|
/** Prepend 'TARGET-' to the given filename. */
|
|
|
|
Common::String wrapFilename(const Common::String &name) const;
|
|
|
|
|
|
|
|
/** Remove the 'TARGET-' prefix of the given filename, if present. */
|
|
|
|
Common::String unwrapFilename(const Common::String &name) const;
|
|
|
|
|
2009-02-15 22:43:13 +00:00
|
|
|
private:
|
2009-10-09 23:19:53 +00:00
|
|
|
const ADGameDescription *_gameDescription;
|
2009-11-04 09:36:18 +00:00
|
|
|
AudioPlayer *_audio;
|
2009-09-02 12:02:37 +00:00
|
|
|
ResourceManager *_resMan;
|
2009-06-03 14:09:25 +00:00
|
|
|
EngineState *_gamestate;
|
2009-07-11 23:45:54 +00:00
|
|
|
Kernel *_kernel;
|
|
|
|
Vocabulary *_vocabulary;
|
2009-06-03 14:09:25 +00:00
|
|
|
Console *_console;
|
2009-10-03 20:49:18 +00:00
|
|
|
OSystem *_system;
|
2009-02-15 06:10:59 +00:00
|
|
|
};
|
|
|
|
|
2009-09-17 16:50:53 +00:00
|
|
|
/**
|
|
|
|
* Convenience function to obtain the active SCI version.
|
|
|
|
*/
|
2009-09-23 12:12:37 +00:00
|
|
|
SciVersion getSciVersion();
|
2009-09-17 16:50:53 +00:00
|
|
|
|
2009-09-23 10:55:35 +00:00
|
|
|
inline static Common::String getSciVersionDesc(SciVersion version) {
|
|
|
|
switch (version) {
|
|
|
|
case SCI_VERSION_AUTODETECT:
|
|
|
|
return "Autodetect";
|
|
|
|
case SCI_VERSION_0_EARLY:
|
|
|
|
return "Early SCI0";
|
|
|
|
case SCI_VERSION_0_LATE:
|
|
|
|
return "Late SCI0";
|
|
|
|
case SCI_VERSION_01:
|
|
|
|
return "SCI01";
|
|
|
|
case SCI_VERSION_1_EGA:
|
|
|
|
return "SCI1 EGA";
|
|
|
|
case SCI_VERSION_1_EARLY:
|
|
|
|
return "Early SCI1";
|
|
|
|
case SCI_VERSION_1_MIDDLE:
|
|
|
|
return "Middle SCI1";
|
|
|
|
case SCI_VERSION_1_LATE:
|
|
|
|
return "Late SCI1";
|
|
|
|
case SCI_VERSION_1_1:
|
|
|
|
return "SCI1.1";
|
|
|
|
case SCI_VERSION_2:
|
|
|
|
return "SCI2";
|
|
|
|
case SCI_VERSION_2_1:
|
|
|
|
return "SCI2.1";
|
|
|
|
case SCI_VERSION_3:
|
|
|
|
return "SCI3";
|
|
|
|
default:
|
|
|
|
return "Unknown";
|
|
|
|
}
|
|
|
|
}
|
2009-09-17 16:50:53 +00:00
|
|
|
|
2009-02-20 14:45:28 +00:00
|
|
|
} // End of namespace Sci
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
#endif // SCI_H
|