aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sci.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/sci.cpp')
-rw-r--r--engines/sci/sci.cpp93
1 files changed, 74 insertions, 19 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index eeea998b51..1232b6559b 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -63,6 +63,7 @@
#include "sci/graphics/transitions.h"
#ifdef ENABLE_SCI32
+#include "sci/graphics/palette32.h"
#include "sci/graphics/text32.h"
#include "sci/graphics/frameout.h"
#include "sci/video/robot_decoder.h"
@@ -94,6 +95,8 @@ SciEngine::SciEngine(OSystem *syst, const ADGameDescription *desc, SciGameId gam
_console = 0;
_opcode_formats = 0;
+ _forceHiresGraphics = false;
+
// Set up the engine specific debug levels
DebugMan.addDebugChannel(kDebugLevelError, "Error", "Script error debugging");
DebugMan.addDebugChannel(kDebugLevelNodes, "Lists", "Lists and nodes debugging");
@@ -153,6 +156,9 @@ SciEngine::~SciEngine() {
DebugMan.clearAllDebugChannels();
#ifdef ENABLE_SCI32
+ // _gfxPalette32 is the same as _gfxPalette16
+ // and will be destroyed when _gfxPalette16 is
+ // destroyed
delete _gfxControls32;
delete _gfxText32;
delete _robotDecoder;
@@ -168,7 +174,7 @@ SciEngine::~SciEngine() {
delete _gfxCoordAdjuster;
delete _gfxPorts;
delete _gfxCache;
- delete _gfxPalette;
+ delete _gfxPalette16;
delete _gfxCursor;
delete _gfxScreen;
@@ -194,12 +200,6 @@ SciEngine::~SciEngine() {
extern void showScummVMDialog(const Common::String &message);
Common::Error SciEngine::run() {
- // Assign default values to the config manager, in case settings are missing
- ConfMan.registerDefault("originalsaveload", "false");
- ConfMan.registerDefault("native_fb01", "false");
- ConfMan.registerDefault("windows_cursors", "false"); // Windows cursors for KQ6 Windows
- ConfMan.registerDefault("silver_cursors", "false"); // Silver cursors for SQ4 CD
-
_resMan = new ResourceManager();
assert(_resMan);
_resMan->addAppropriateSources();
@@ -224,6 +224,38 @@ Common::Error SciEngine::run() {
_scriptPatcher = new ScriptPatcher();
SegManager *segMan = new SegManager(_resMan, _scriptPatcher);
+ // Read user option for hires graphics
+ // Only show/selectable for:
+ // - King's Quest 6 CD
+ // - King's Quest 6 CD demo
+ // - Gabriel Knight 1 CD
+ // - Police Quest 4 CD
+ // TODO: Check, if Gabriel Knight 1 floppy supports high resolution
+ // TODO: Check, if Gabriel Knight 1 on Mac supports high resolution
+ switch (getPlatform()) {
+ case Common::kPlatformDOS:
+ case Common::kPlatformWindows:
+ // Only DOS+Windows
+ switch (_gameId) {
+ case GID_KQ6:
+ if (isCD())
+ _forceHiresGraphics = ConfMan.getBool("enable_high_resolution_graphics");
+ break;
+ case GID_GK1:
+ if ((isCD()) && (!isDemo()))
+ _forceHiresGraphics = ConfMan.getBool("enable_high_resolution_graphics");
+ break;
+ case GID_PQ4:
+ if (isCD())
+ _forceHiresGraphics = ConfMan.getBool("enable_high_resolution_graphics");
+ break;
+ default:
+ break;
+ }
+ default:
+ break;
+ };
+
// Initialize the game screen
_gfxScreen = new GfxScreen(_resMan);
_gfxScreen->enableUndithering(ConfMan.getBool("disable_dithering"));
@@ -620,7 +652,7 @@ void SciEngine::initGraphics() {
_gfxMenu = 0;
_gfxPaint = 0;
_gfxPaint16 = 0;
- _gfxPalette = 0;
+ _gfxPalette16 = 0;
_gfxPorts = 0;
_gfxText16 = 0;
_gfxTransitions = 0;
@@ -630,14 +662,25 @@ void SciEngine::initGraphics() {
_robotDecoder = 0;
_gfxFrameout = 0;
_gfxPaint32 = 0;
+ _gfxPalette32 = 0;
#endif
if (hasMacIconBar())
_gfxMacIconBar = new GfxMacIconBar();
- _gfxPalette = new GfxPalette(_resMan, _gfxScreen);
- _gfxCache = new GfxCache(_resMan, _gfxScreen, _gfxPalette);
- _gfxCursor = new GfxCursor(_resMan, _gfxPalette, _gfxScreen);
+#ifdef ENABLE_SCI32
+ if (getSciVersion() >= SCI_VERSION_2) {
+ _gfxPalette32 = new GfxPalette32(_resMan, _gfxScreen);
+ _gfxPalette16 = _gfxPalette32;
+ } else {
+#endif
+ _gfxPalette16 = new GfxPalette(_resMan, _gfxScreen);
+#ifdef ENABLE_SCI32
+ }
+#endif
+
+ _gfxCache = new GfxCache(_resMan, _gfxScreen, _gfxPalette16);
+ _gfxCursor = new GfxCursor(_resMan, _gfxPalette16, _gfxScreen);
#ifdef ENABLE_SCI32
if (getSciVersion() >= SCI_VERSION_2) {
@@ -645,12 +688,12 @@ void SciEngine::initGraphics() {
_gfxCoordAdjuster = new GfxCoordAdjuster32(_gamestate->_segMan);
_gfxCursor->init(_gfxCoordAdjuster, _eventMan);
_gfxCompare = new GfxCompare(_gamestate->_segMan, _gfxCache, _gfxScreen, _gfxCoordAdjuster);
- _gfxPaint32 = new GfxPaint32(_resMan, _gfxCoordAdjuster, _gfxScreen, _gfxPalette);
+ _gfxPaint32 = new GfxPaint32(_resMan, _gfxCoordAdjuster, _gfxScreen, _gfxPalette32);
_gfxPaint = _gfxPaint32;
_gfxText32 = new GfxText32(_gamestate->_segMan, _gfxCache, _gfxScreen);
_gfxControls32 = new GfxControls32(_gamestate->_segMan, _gfxCache, _gfxText32);
_robotDecoder = new RobotDecoder(getPlatform() == Common::kPlatformMacintosh);
- _gfxFrameout = new GfxFrameout(_gamestate->_segMan, _resMan, _gfxCoordAdjuster, _gfxCache, _gfxScreen, _gfxPalette, _gfxPaint32);
+ _gfxFrameout = new GfxFrameout(_gamestate->_segMan, _resMan, _gfxCoordAdjuster, _gfxCache, _gfxScreen, _gfxPalette32, _gfxPaint32);
} else {
#endif
// SCI0-SCI1.1 graphic objects creation
@@ -658,10 +701,10 @@ void SciEngine::initGraphics() {
_gfxCoordAdjuster = new GfxCoordAdjuster16(_gfxPorts);
_gfxCursor->init(_gfxCoordAdjuster, _eventMan);
_gfxCompare = new GfxCompare(_gamestate->_segMan, _gfxCache, _gfxScreen, _gfxCoordAdjuster);
- _gfxTransitions = new GfxTransitions(_gfxScreen, _gfxPalette);
- _gfxPaint16 = new GfxPaint16(_resMan, _gamestate->_segMan, _gfxCache, _gfxPorts, _gfxCoordAdjuster, _gfxScreen, _gfxPalette, _gfxTransitions, _audio);
+ _gfxTransitions = new GfxTransitions(_gfxScreen, _gfxPalette16);
+ _gfxPaint16 = new GfxPaint16(_resMan, _gamestate->_segMan, _gfxCache, _gfxPorts, _gfxCoordAdjuster, _gfxScreen, _gfxPalette16, _gfxTransitions, _audio);
_gfxPaint = _gfxPaint16;
- _gfxAnimate = new GfxAnimate(_gamestate, _gfxCache, _gfxPorts, _gfxPaint16, _gfxScreen, _gfxPalette, _gfxCursor, _gfxTransitions);
+ _gfxAnimate = new GfxAnimate(_gamestate, _gfxCache, _gfxPorts, _gfxPaint16, _gfxScreen, _gfxPalette16, _gfxCursor, _gfxTransitions);
_gfxText16 = new GfxText16(_gfxCache, _gfxPorts, _gfxPaint16, _gfxScreen);
_gfxControls16 = new GfxControls16(_gamestate->_segMan, _gfxPorts, _gfxPaint16, _gfxText16, _gfxScreen);
_gfxMenu = new GfxMenu(_eventMan, _gamestate->_segMan, _gfxPorts, _gfxPaint16, _gfxText16, _gfxScreen, _gfxCursor);
@@ -676,7 +719,7 @@ void SciEngine::initGraphics() {
#endif
// Set default (EGA, amiga or resource 999) palette
- _gfxPalette->setDefault();
+ _gfxPalette16->setDefault();
}
void SciEngine::initStackBaseWithSelector(Selector selector) {
@@ -796,6 +839,10 @@ bool SciEngine::isCD() const {
return _gameDescription->flags & ADGF_CD;
}
+bool SciEngine::forceHiresGraphics() const {
+ return _forceHiresGraphics;
+}
+
bool SciEngine::isBE() const{
switch(_gameDescription->platform) {
case Common::kPlatformAmiga:
@@ -816,7 +863,7 @@ Common::String SciEngine::getSavegameName(int nr) const {
}
Common::String SciEngine::getSavegamePattern() const {
- return _targetName + ".???";
+ return _targetName + ".###";
}
Common::String SciEngine::getFilePrefix() const {
@@ -903,7 +950,9 @@ void SciEngine::syncIngameAudioOptions() {
break;
#ifdef ENABLE_SCI32
case SCI_VERSION_2:
- case SCI_VERSION_2_1:
+ case SCI_VERSION_2_1_EARLY:
+ case SCI_VERSION_2_1_MIDDLE:
+ case SCI_VERSION_2_1_LATE:
// Only use global 90 for some specific games, not all SCI32 games used this method
switch (_gameId) {
case GID_KQ7: // SCI2.1
@@ -1026,4 +1075,10 @@ void SciEngine::loadMacExecutable() {
}
}
+uint32 SciEngine::getTickCount() {
+ return g_engine->getTotalPlayTime() * 60 / 1000;
+}
+void SciEngine::setTickCount(const uint32 ticks) {
+ return g_engine->setTotalPlayTime(ticks * 1000 / 60);
+}
} // End of namespace Sci