[Scummvm-cvs-logs] SF.net SVN: scummvm: [28544] scummvm/trunk/engines/lure

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sun Aug 12 13:07:44 CEST 2007


Revision: 28544
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28544&view=rev
Author:   dreammaster
Date:     2007-08-12 04:07:44 -0700 (Sun, 12 Aug 2007)

Log Message:
-----------
Skeleton code added for restart/restore screen

Modified Paths:
--------------
    scummvm/trunk/engines/lure/surface.cpp
    scummvm/trunk/engines/lure/surface.h

Modified: scummvm/trunk/engines/lure/surface.cpp
===================================================================
--- scummvm/trunk/engines/lure/surface.cpp	2007-08-12 11:03:04 UTC (rev 28543)
+++ scummvm/trunk/engines/lure/surface.cpp	2007-08-12 11:07:44 UTC (rev 28544)
@@ -29,6 +29,7 @@
 #include "lure/screen.h"
 #include "lure/lure.h"
 #include "lure/room.h"
+#include "lure/sound.h"
 #include "lure/strings.h"
 #include "common/endian.h"
 
@@ -778,4 +779,83 @@
 	return doneFlag;
 }
 
+/*--------------------------------------------------------------------------*/
+
+struct RestartRecordPos {
+	int16 x, y;
+};
+
+struct RestartRecord {
+	Common::Language Language;
+	int16 width, height;
+	RestartRecordPos BtnRestart;
+	RestartRecordPos BtnRestore;
+};
+
+RestartRecord buttonBounds[] = {
+	{EN_ANY, 48, 14, 118, 152, 168, 152},
+	{DE_DEU, 48, 14, 106, 152, 168, 152},
+	{UNK_LANG, 48, 14, 112, 152, 168, 152}
+};
+
+
+bool RestartRestoreDialog::show()
+{
+	Resources &res = Resources::getReference();
+	Events &events = Events::getReference();
+	Mouse &mouse = Mouse::getReference();
+	Screen &screen = Screen::getReference();
+	LureEngine &engine = LureEngine::getReference();
+
+	Sound.killSounds();
+	Sound.musicInterface_Play(60, true, 0);
+	mouse.setCursorNum(CURSOR_ARROW);
+
+	// See if there are any savegames that can be restored
+	String *firstSave = engine.detectSave(1);
+	bool restartFlag = (firstSave == NULL);
+
+	if (!restartFlag) {
+		Memory::dealloc(firstSave);
+
+		// Get the correct button bounds record to use
+		RestartRecord *btnRecord = &buttonBounds[0];
+		while ((btnRecord->Language != engine.getLanguage()) && 
+			   (btnRecord->Language != UNK_LANG))
+			++btnRecord;
+
+		// Fade in the restart/restore screen
+		Palette p(RESTART_RESOURCE_ID + 1);
+		Surface *s = Surface::getScreen(RESTART_RESOURCE_ID);
+
+		res.activeHotspots().clear();
+		Hotspot *btnHotspot = new Hotspot();
+		// Restart button
+		btnHotspot->setSize(btnRecord->width, btnRecord->height);
+		btnHotspot->setPosition(btnRecord->BtnRestart.x, btnRecord->BtnRestart.y);
+		btnHotspot->setAnimation(0x184B);
+		btnHotspot->copyTo(s);
+		// Restore button
+		btnHotspot->setFrameNumber(1);
+		btnHotspot->setPosition(btnRecord->BtnRestore.x, btnRecord->BtnRestore.y);
+		btnHotspot->copyTo(s);
+
+		// Copy the surface to the screen
+		screen.setPaletteEmpty();
+		s->copyToScreen(0, 0);
+		delete s;
+
+		screen.paletteFadeIn(&p);
+
+		events.waitForPress();
+		screen.paletteFadeOut();
+
+		//restartFlag = !SaveRestoreDialog::show(false);
+	}
+
+	Sound.killSounds();
+
+	return restartFlag;
+}
+
 } // end of namespace Lure

Modified: scummvm/trunk/engines/lure/surface.h
===================================================================
--- scummvm/trunk/engines/lure/surface.h	2007-08-12 11:03:04 UTC (rev 28543)
+++ scummvm/trunk/engines/lure/surface.h	2007-08-12 11:07:44 UTC (rev 28544)
@@ -104,6 +104,11 @@
 	static bool show(bool saveDialog);
 };
 
+class RestartRestoreDialog {
+public:
+	static bool show();
+};
+
 } // End of namespace Lure
 
 #endif


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