[Scummvm-cvs-logs] SF.net SVN: scummvm:[34257] scummvm/trunk/engines/tinsel

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Sep 1 22:22:11 CEST 2008


Revision: 34257
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34257&view=rev
Author:   fingolfin
Date:     2008-09-01 20:22:10 +0000 (Mon, 01 Sep 2008)

Log Message:
-----------
Merging more of the GSoC 2008 RTL branch: TINSEL

Modified Paths:
--------------
    scummvm/trunk/engines/tinsel/inventory.cpp
    scummvm/trunk/engines/tinsel/tinlib.cpp
    scummvm/trunk/engines/tinsel/tinsel.cpp
    scummvm/trunk/engines/tinsel/tinsel.h

Modified: scummvm/trunk/engines/tinsel/inventory.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/inventory.cpp	2008-09-01 20:21:53 UTC (rev 34256)
+++ scummvm/trunk/engines/tinsel/inventory.cpp	2008-09-01 20:22:10 UTC (rev 34257)
@@ -3071,7 +3071,7 @@
 					InvLoadGame();
 					break;
 				case IQUITGAME:
-					_vm->quitFlag = true;
+					_vm->quitGame();
 					break;
 				case CLOSEWIN:
 					KillInventory();

Modified: scummvm/trunk/engines/tinsel/tinlib.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/tinlib.cpp	2008-09-01 20:21:53 UTC (rev 34256)
+++ scummvm/trunk/engines/tinsel/tinlib.cpp	2008-09-01 20:22:10 UTC (rev 34257)
@@ -1271,7 +1271,7 @@
 void quitgame(void) {
 	stopmidi();
 	stopsample();
-	_vm->quitFlag = true;
+	_vm->quitGame();
 }
 
 /**

Modified: scummvm/trunk/engines/tinsel/tinsel.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/tinsel.cpp	2008-09-01 20:21:53 UTC (rev 34256)
+++ scummvm/trunk/engines/tinsel/tinsel.cpp	2008-09-01 20:22:10 UTC (rev 34257)
@@ -625,11 +625,11 @@
 	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 @@
 	_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 @@
 #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 @@
 
 	// Foreground loop
 
-	while (!quitFlag) {
+	while (!quit()) {
 		assert(_console);
 		if (_console->isAttached())
 			_console->onFrame();
@@ -775,7 +778,7 @@
 	// Write configuration
 	WriteConfig();
 
-	return 0;
+	return _eventMan->shouldRTL();
 }
 
 
@@ -805,10 +808,6 @@
 
 	// 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:

Modified: scummvm/trunk/engines/tinsel/tinsel.h
===================================================================
--- scummvm/trunk/engines/tinsel/tinsel.h	2008-09-01 20:21:53 UTC (rev 34256)
+++ scummvm/trunk/engines/tinsel/tinsel.h	2008-09-01 20:22:10 UTC (rev 34257)
@@ -107,8 +107,8 @@
 	Common::Language getLanguage() const;
 	uint16 getVersion() const;
 	Common::Platform getPlatform() const;
-	bool quitFlag;
 
+	MidiDriver *_driver;
 	SoundManager *_sound;
 	MusicPlayer *_music;
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list