[Scummvm-cvs-logs] CVS: scummvm/sky control.cpp,1.40,1.41 control.h,1.20,1.21 sky.cpp,1.90,1.91 sky.h,1.44,1.45

Robert G?ffringmann lavosspawn at users.sourceforge.net
Fri Jul 11 22:27:11 CEST 2003


Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv15576/sky

Modified Files:
	control.cpp control.h sky.cpp sky.h 
Log Message:
implemented -x command line option

Index: control.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/control.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- control.cpp	12 Jul 2003 03:40:44 -0000	1.40
+++ control.cpp	12 Jul 2003 05:26:23 -0000	1.41
@@ -1461,7 +1461,7 @@
 		else
 			sprintf(fName, "SKY-VM%03d.ASD", SkyState::_systemVars.gameVersion);
 	} else
-    	sprintf(fName,"SKY-VM.%03d", _selectedGame);
+		sprintf(fName,"SKY-VM.%03d", _selectedGame);
 
 	File inf;
 	if (!inf.open(fName, _savePath)) {
@@ -1489,6 +1489,41 @@
 	inf.close();
 	free(saveData);
 	return res;
+}
+
+uint16 SkyControl::quickXRestore(uint16 slot) {
+	uint16 result;
+	initPanel();
+	_mouseClicked = false;
+
+	_savedCharSet = _skyText->giveCurrentCharSet();
+	_skyText->fnSetFont(0);
+
+	if (SkyState::_systemVars.gameVersion < 331)
+		_skyScreen->setPalette(60509);
+	else
+		_skyScreen->setPalette(60510);
+
+	_savedMouse = _skyMouse->giveCurrentMouseType();
+	_skyMouse->spriteMouse(MOUSE_NORMAL,0,0);
+
+	if (slot == 0)
+		result = restoreGameFromFile(true);
+	else {
+		_selectedGame = slot - 1;
+		result = restoreGameFromFile(false);
+	}
+	if (result == GAME_RESTORED) {
+		memset(_skyScreen->giveCurrent(), 0, GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT);
+		_skyScreen->showScreen(_skyScreen->giveCurrent());
+		_skyScreen->forceRefresh();
+	}
+	_skyScreen->setPaletteEndian((uint8 *)SkyState::fetchCompact(SkyState::_systemVars.currentPalette));
+	_skyMouse->spriteMouse(_savedMouse, 0, 0);
+	_skyText->fnSetFont(_savedCharSet);
+
+	removePanel();
+    return result;
 }
 
 uint16 *SkyControl::lz77decode(uint16 *data) {

Index: control.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/control.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- control.h	12 Jul 2003 03:40:44 -0000	1.20
+++ control.h	12 Jul 2003 05:26:23 -0000	1.21
@@ -173,6 +173,7 @@
 	void restartGame(void);
 	void showGameQuitMsg(bool useScreen = true);
 	void doAutoSave(void);
+	uint16 quickXRestore(uint16 slot);
     
 private:
 	void initPanel(void);

Index: sky.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/sky.cpp,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- sky.cpp	12 Jul 2003 03:40:44 -0000	1.90
+++ sky.cpp	12 Jul 2003 05:26:23 -0000	1.91
@@ -179,14 +179,15 @@
 
 	initialise();
 
-	bool introSkipped;
-	if (_systemVars.gameVersion != 267) // don't do intro for floppydemo
-		introSkipped = !intro();
-	else introSkipped = false;
+	bool introSkipped = false;
+	if (!_quickLaunch) {
+		if (_systemVars.gameVersion != 267) // don't do intro for floppydemo
+			introSkipped = !intro();
 
-	_skyDisk->flushPrefetched();
+		_skyDisk->flushPrefetched();
 
-	loadBase0();
+		loadBase0();
+	}
 
 	if (introSkipped)
 		_skyControl->restartGame();
@@ -266,6 +267,15 @@
 
 	if (_systemVars.gameVersion == 288)
 		SkyCompact::patchFor288();
+
+	uint16 result = 0;
+	if (_detector->_save_slot >= 0)
+		result = _skyControl->quickXRestore(_detector->_save_slot);
+
+	if (result == GAME_RESTORED)
+		_quickLaunch = true;
+	else
+		_quickLaunch = false;
 }
 
 void SkyState::initItemList() {

Index: sky.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/sky.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- sky.h	12 Jul 2003 03:40:44 -0000	1.44
+++ sky.h	12 Jul 2003 05:26:23 -0000	1.45
@@ -62,6 +62,7 @@
 	byte _game;
 	byte _key_pressed;
 	static uint8 _languageTable[11];
+	bool _quickLaunch; // set when starting with -x
 
 	//intro related
 	





More information about the Scummvm-git-logs mailing list