aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2008-09-01 20:22:10 +0000
committerMax Horn2008-09-01 20:22:10 +0000
commit958647a6b5a7562e2d95042259397f81daf44e55 (patch)
treed952776807a6eabf008c3ecaff8ee3cf73a94b0b
parent7002aa8981187dfde3a8849ebf4b8f5df498236f (diff)
parent852bc9dbb750b9995d31e70f4158c97d3758c46f (diff)
downloadscummvm-rg350-958647a6b5a7562e2d95042259397f81daf44e55.tar.gz
scummvm-rg350-958647a6b5a7562e2d95042259397f81daf44e55.tar.bz2
scummvm-rg350-958647a6b5a7562e2d95042259397f81daf44e55.zip
Merging more of the GSoC 2008 RTL branch: TINSEL
svn-id: r34257
-rw-r--r--engines/tinsel/inventory.cpp2
-rw-r--r--engines/tinsel/tinlib.cpp2
-rw-r--r--engines/tinsel/tinsel.cpp19
-rw-r--r--engines/tinsel/tinsel.h2
4 files changed, 12 insertions, 13 deletions
diff --git a/engines/tinsel/inventory.cpp b/engines/tinsel/inventory.cpp
index 836e1194fe..ffecacd1be 100644
--- a/engines/tinsel/inventory.cpp
+++ b/engines/tinsel/inventory.cpp
@@ -3071,7 +3071,7 @@ void InventoryProcess(CORO_PARAM, const void *) {
InvLoadGame();
break;
case IQUITGAME:
- _vm->quitFlag = true;
+ _vm->quitGame();
break;
case CLOSEWIN:
KillInventory();
diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp
index d518baa7e8..07c1b22b2a 100644
--- a/engines/tinsel/tinlib.cpp
+++ b/engines/tinsel/tinlib.cpp
@@ -1271,7 +1271,7 @@ void printtag(HPOLYGON hp, SCNHANDLE text) {
void quitgame(void) {
stopmidi();
stopsample();
- _vm->quitFlag = true;
+ _vm->quitGame();
}
/**
diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
index 1d145a3cc7..70dd0170b4 100644
--- a/engines/tinsel/tinsel.cpp
+++ b/engines/tinsel/tinsel.cpp
@@ -625,11 +625,11 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc)
bool native_mt32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32"));
//bool adlib = (midiDriver == MD_ADLIB);
- MidiDriver *driver = MidiDriver::createMidi(midiDriver);
+ _driver = MidiDriver::createMidi(midiDriver);
if (native_mt32)
- driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
+ _driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
- _music = new MusicPlayer(driver);
+ _music = new MusicPlayer(_driver);
//_music->setNativeMT32(native_mt32);
//_music->setAdlib(adlib);
@@ -641,13 +641,14 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc)
_mousePos.y = 0;
_keyHandler = NULL;
_dosPlayerDir = 0;
- quitFlag = false;
}
TinselEngine::~TinselEngine() {
delete _sound;
delete _music;
delete _console;
+ delete _driver;
+ _screenSurface.free();
FreeSs();
FreeTextBuffer();
FreeHandleTable();
@@ -681,6 +682,8 @@ int TinselEngine::init() {
#if 1
// FIXME: The following is taken from RestartGame().
// It may have to be adjusted a bit
+ CountOut = 1;
+
RebootCursor();
RebootDeadTags();
RebootMovers();
@@ -741,7 +744,7 @@ int TinselEngine::go() {
// Foreground loop
- while (!quitFlag) {
+ while (!quit()) {
assert(_console);
if (_console->isAttached())
_console->onFrame();
@@ -775,7 +778,7 @@ int TinselEngine::go() {
// Write configuration
WriteConfig();
- return 0;
+ return _eventMan->shouldRTL();
}
@@ -805,10 +808,6 @@ bool TinselEngine::pollEvent() {
// Handle the various kind of events
switch (event.type) {
- case Common::EVENT_QUIT:
- quitFlag = true;
- break;
-
case Common::EVENT_LBUTTONDOWN:
case Common::EVENT_LBUTTONUP:
case Common::EVENT_RBUTTONDOWN:
diff --git a/engines/tinsel/tinsel.h b/engines/tinsel/tinsel.h
index de308864a6..369fd64a9b 100644
--- a/engines/tinsel/tinsel.h
+++ b/engines/tinsel/tinsel.h
@@ -107,8 +107,8 @@ public:
Common::Language getLanguage() const;
uint16 getVersion() const;
Common::Platform getPlatform() const;
- bool quitFlag;
+ MidiDriver *_driver;
SoundManager *_sound;
MusicPlayer *_music;