aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/cge/cge.cpp60
-rw-r--r--engines/cge/cge.h5
-rw-r--r--engines/cge/cge_main.cpp42
-rw-r--r--engines/cge/detection.cpp27
4 files changed, 54 insertions, 80 deletions
diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp
index f471b63866..514580bbe3 100644
--- a/engines/cge/cge.cpp
+++ b/engines/cge/cge.cpp
@@ -46,7 +46,6 @@ CGEEngine::CGEEngine(OSystem *syst, const ADGameDescription *gameDescription)
DebugMan.addDebugChannel(kCGEDebugFile, "file", "CGE IO debug channel");
DebugMan.addDebugChannel(kCGEDebugEngine, "engine", "CGE Engine debug channel");
- _isDemo = _gameDescription->flags & ADGF_DEMO;
_startupMode = 1;
_demoText = kDemo;
_oldLev = 0;
@@ -55,32 +54,17 @@ CGEEngine::CGEEngine(OSystem *syst, const ADGameDescription *gameDescription)
}
void CGEEngine::initCaveValues() {
- if (_isDemo) {
- _caveDx = 23;
- _caveDy = 29;
- _caveNx = 3;
- _caveNy = 1;
- } else {
- _caveDx = 9;
- _caveDy = 10;
- _caveNx = 8;
- _caveNy = 3;
- }
+ _caveDx = 9;
+ _caveDy = 10;
+ _caveNx = 8;
+ _caveNy = 3;
_caveMax = _caveNx * _caveNy;
- if (_isDemo) {
- _maxCaveArr[0] = _caveMax;
- _maxCaveArr[1] = -1;
- _maxCaveArr[2] = -1;
- _maxCaveArr[3] = -1;
- _maxCaveArr[4] = -1;
- } else {
- _maxCaveArr[0] = 1;
- _maxCaveArr[1] = 8;
- _maxCaveArr[2] = 16;
- _maxCaveArr[3] = 23;
- _maxCaveArr[4] = 24;
- };
+ _maxCaveArr[0] = 1;
+ _maxCaveArr[1] = 8;
+ _maxCaveArr[2] = 16;
+ _maxCaveArr[3] = 23;
+ _maxCaveArr[4] = 24;
_heroXY = (Hxy *) malloc (sizeof(Hxy) * _caveMax);
for (int i = 0; i < _caveMax; i++) {
@@ -100,7 +84,7 @@ void CGEEngine::freeCaveValues() {
free(_barriers);
}
-void CGEEngine::setup() {
+void CGEEngine::init() {
debugC(1, kCGEDebugEngine, "CGEEngine::setup()");
// Initialise fields
@@ -129,7 +113,7 @@ void CGEEngine::setup() {
_pocLight = new PocLight(this);
for (int i = 0; i < kPocketNX; i++)
_pocket[i] = NULL;
- _horzLine = isDemo() ? NULL : new HorizLine(this);
+ _horzLine = new HorizLine(this);
_infoLine = new InfoLine(this, kInfoW);
_cavLight = new CavLight(this);
_debugLine = new InfoLine(this, kScrWidth);
@@ -170,9 +154,7 @@ void CGEEngine::setup() {
_startGameSlot = ConfMan.hasKey("save_slot") ? ConfMan.getInt("save_slot") : -1;
}
-CGEEngine::~CGEEngine() {
- debugC(1, kCGEDebugEngine, "CGEEngine::~CGEEngine()");
-
+void CGEEngine::deinit() {
// Call classes with static members to clear them up
Talk::deinit();
Bitmap::deinit();
@@ -215,17 +197,29 @@ CGEEngine::~CGEEngine() {
freeCaveValues();
}
+CGEEngine::~CGEEngine() {
+ debugC(1, kCGEDebugEngine, "CGEEngine::~CGEEngine()");
+}
+
Common::Error CGEEngine::run() {
debugC(1, kCGEDebugEngine, "CGEEngine::run()");
+ if (_gameDescription->flags & ADGF_DEMO) {
+ warning("Demos of Soltys are not supported.\nPlease get a free version on ScummVM download page");
+ return Common::kUnsupportedGameidError;
+ }
+
// Initialize graphics using following:
initGraphics(320, 200, false);
// Setup necessary game objects
- setup();
+ init();
// Run the game
cge_main();
+ // Remove game objects
+ deinit();
+
return Common::kNoError;
}
@@ -244,8 +238,4 @@ bool CGEEngine::canSaveGameStateCurrently() {
return (_startupMode == 0) && _mouse->_active;
}
-bool CGEEngine::isDemo() const {
- return _gameDescription->flags & ADGF_DEMO;
-}
-
} // End of namespace CGE
diff --git a/engines/cge/cge.h b/engines/cge/cge.h
index f4260dc31a..98f9ba8bc2 100644
--- a/engines/cge/cge.h
+++ b/engines/cge/cge.h
@@ -104,12 +104,10 @@ public:
virtual bool hasFeature(EngineFeature f) const;
virtual bool canLoadGameStateCurrently();
virtual bool canSaveGameStateCurrently();
- bool isDemo() const;
virtual Common::Error loadGameState(int slot);
virtual Common::Error saveGameState(int slot, const Common::String &desc);
const ADGameDescription *_gameDescription;
- bool _isDemo;
int _startupMode;
int _demoText;
int _oldLev;
@@ -262,7 +260,8 @@ protected:
private:
CGEConsole *_console;
- void setup();
+ void init();
+ void deinit();
};
// Example console class
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp
index 8763cb9967..4b834c9800 100644
--- a/engines/cge/cge_main.cpp
+++ b/engines/cge/cge_main.cpp
@@ -225,6 +225,8 @@ Common::Error CGEEngine::loadGameState(int slot) {
// Load the game
loadGame(slot, NULL);
_snail->addCom(kSnLevel, -1, _oldLev, &_cavLight);
+ _cavLight->gotoxy(kCaveX + ((_now - 1) % _caveNx) * _caveDx + kCaveSX,
+ kCaveY + ((_now - 1) / _caveNx) * _caveDy + kCaveSY);
caveUp();
return Common::kNoError;
@@ -670,8 +672,7 @@ void CGEEngine::switchCave(int cav) {
if (_hero) {
_hero->park();
_hero->step(0);
- if (!_isDemo)
- _vga->_spareQ->_show = 0;
+ _vga->_spareQ->_show = 0;
}
_cavLight->gotoxy(kCaveX + ((_now - 1) % _caveNx) * _caveDx + kCaveSX,
kCaveY + ((_now - 1) / _caveNx) * _caveDy + kCaveSY);
@@ -1196,19 +1197,6 @@ void CGEEngine::loadScript(const char *fname) {
}
void CGEEngine::mainLoop() {
- if (_isDemo) {
-// static uint32 tc = 0;
- if (/* FIXME: TimerCount - tc >= ((182L * 6L) * 5L) && */ _talk == NULL && _snail->idle()) {
- if (_text->getText(_demoText)) {
- _snail->addCom(kSnSound, -1, 4, NULL); // drumla
- _snail->addCom(kSnInf, -1, _demoText, NULL);
- _snail->addCom(kSnLabel, -1, -1, NULL);
- if (_text->getText(++_demoText) == NULL)
- _demoText = kDemo + 1;
- }
- //FIXME: tc = TimerCount;
- }
- }
_vga->show();
_snail_->runCom();
_snail->runCom();
@@ -1463,18 +1451,16 @@ bool CGEEngine::showTitle(const char *name) {
}
if (_mode < 2) {
- if (!_isDemo) {
- // At this point the game originally set the protection variables
- // used by the copy protection check
- movie("X00"); // paylist
- _vga->copyPage(1, 2);
- _vga->copyPage(0, 1);
- _vga->_showQ->append(_mouse);
- // In the original game, the user had to enter his name
- // As it was only used to name savegames, it has been removed
- _vga->_showQ->clear();
- _vga->copyPage(0, 2);
- }
+ // At this point the game originally set the protection variables
+ // used by the copy protection check
+ movie("X00"); // paylist
+ _vga->copyPage(1, 2);
+ _vga->copyPage(0, 1);
+ _vga->_showQ->append(_mouse);
+ // In the original game, the user had to enter his name
+ // As it was only used to name savegames, it has been removed
+ _vga->_showQ->clear();
+ _vga->copyPage(0, 2);
if (_mode == 0) {
// The auto-load of savegame #0 is currently disabled
@@ -1531,7 +1517,7 @@ void CGEEngine::cge_main() {
movie(kLgoExt);
if (showTitle("WELCOME")) {
- if ((!_isDemo) && (_mode == 1))
+ if (_mode == 1)
movie("X02"); // intro
runGame();
_startupMode = 2;
diff --git a/engines/cge/detection.cpp b/engines/cge/detection.cpp
index 5e74166222..c64295db0e 100644
--- a/engines/cge/detection.cpp
+++ b/engines/cge/detection.cpp
@@ -57,35 +57,34 @@ static const ADGameDescription gameDescriptions[] = {
},
Common::PL_POL, Common::kPlatformPC, ADGF_NO_FLAGS, GUIO_NONE
},
+ // English ScummVM version
{
- "soltys", "Soltys Demo",
+ "soltys", "",
{
- {"vol.cat", 0, "1e077c8ff58109a187f07ac54b0c873a", 18788},
- {"vol.dat", 0, "75d385a6074c58b69f7730481f256051", 1796710},
+ {"vol.cat", 0, "bd08969b5f1acea0f92d195f750c17d5", 50176},
+ {"vol.dat", 0, "f9ae2e7f8f7cac91378cdafca43faf1e", 8428832},
AD_LISTEND
},
- Common::PL_POL, Common::kPlatformPC, ADGF_DEMO, GUIO_NONE
+ Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, GUIO_NONE
},
{
- "soltys", "Soltys Demo",
+ "soltys", "Soltys Demo (not supported)",
{
- {"vol.cat", 0, "f17987487fab1ebddd781d8d02fedecc", 7168},
- {"vol.dat", 0, "c5d9b15863cab61dc125551576dece04", 1075272},
+ {"vol.cat", 0, "1e077c8ff58109a187f07ac54b0c873a", 18788},
+ {"vol.dat", 0, "75d385a6074c58b69f7730481f256051", 1796710},
AD_LISTEND
},
- Common::PL_POL, Common::kPlatformPC, ADGF_DEMO, GUIO_NONE
+ Common::PL_POL, Common::kPlatformPC, ADGF_DEMO , GUIO_NONE
},
- // English ScummVM version
{
- "soltys", "",
+ "soltys", "Soltys Demo (not supported)",
{
- {"vol.cat", 0, "bd08969b5f1acea0f92d195f750c17d5", 50176},
- {"vol.dat", 0, "f9ae2e7f8f7cac91378cdafca43faf1e", 8428832},
+ {"vol.cat", 0, "f17987487fab1ebddd781d8d02fedecc", 7168},
+ {"vol.dat", 0, "c5d9b15863cab61dc125551576dece04", 1075272},
AD_LISTEND
},
- Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, GUIO_NONE
+ Common::PL_POL, Common::kPlatformPC, ADGF_DEMO , GUIO_NONE
},
-
AD_TABLE_END_MARKER
};