aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Göffringmann2003-07-01 23:31:29 +0000
committerRobert Göffringmann2003-07-01 23:31:29 +0000
commitc66457664ed3a235d0dba9a8982055147b4945b4 (patch)
treee2cecb900430dd6eeea16c8dd37fb564988ea1a8
parentb7f9b1a5d88a0872ff40d8d540bebd120632eebf (diff)
downloadscummvm-rg350-c66457664ed3a235d0dba9a8982055147b4945b4.tar.gz
scummvm-rg350-c66457664ed3a235d0dba9a8982055147b4945b4.tar.bz2
scummvm-rg350-c66457664ed3a235d0dba9a8982055147b4945b4.zip
removed useless AR saving leftovers and implemented fnRestoreGame()
svn-id: r8693
-rw-r--r--sky/compacts/savedata.cpp21
-rw-r--r--sky/control.cpp33
-rw-r--r--sky/control.h42
-rw-r--r--sky/logic.cpp4
4 files changed, 55 insertions, 45 deletions
diff --git a/sky/compacts/savedata.cpp b/sky/compacts/savedata.cpp
index fb574e8157..f8371569bb 100644
--- a/sky/compacts/savedata.cpp
+++ b/sky/compacts/savedata.cpp
@@ -957,24 +957,3 @@ Compact *SkyControl::_saveLoadCpts[833] = {
&SkyCompact::info_button
};
-uint8 *SkyControl::_saveLoadARs[18] = {
- SkyCompact::joey_auto,
- SkyCompact::lamb_auto,
- SkyCompact::monitor_auto,
- SkyCompact::ss_auto,
- SkyCompact::full_ss_auto,
- SkyCompact::loader_auto,
- SkyCompact::shades_auto,
- SkyCompact::jobs_auto,
- SkyCompact::foreman_auto,
- SkyCompact::radman_auto,
- SkyCompact::burke_auto,
- SkyCompact::babs_auto,
- SkyCompact::dan_auto,
- SkyCompact::spu_auto,
- SkyCompact::medi_auto,
- SkyCompact::wit_auto,
- SkyCompact::gal_auto,
- SkyCompact::ken_auto
-};
-
diff --git a/sky/control.cpp b/sky/control.cpp
index 01e47f64aa..5c97b76992 100644
--- a/sky/control.cpp
+++ b/sky/control.cpp
@@ -292,6 +292,33 @@ void SkyControl::drawMainPanel(void) {
_bodge->drawToScreen(WITH_MASK);
}
+void SkyControl::doLoadSavePanel(void) {
+ if (SkyState::isDemo() && (!SkyState::isCDVersion()))
+ return; // I don't think this can even happen
+ initPanel();
+ _skyScreen->clearScreen();
+ if (SkyState::_systemVars.gameVersion < 368)
+ _skyScreen->setPalette(60509);
+ else
+ _skyScreen->setPalette(60510);
+
+ _savedMouse = _skyMouse->giveCurrentMouseType();
+ _skyMouse->spriteMouse(MOUSE_NORMAL,0,0);
+ _lastButton = -1;
+ _curButtonText = 0;
+ _textSprite = NULL;
+
+ saveRestorePanel(false);
+
+ memset(_screenBuf, 0, GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
+ _system->copy_rect(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT);
+ _system->update_screen();
+ _skyScreen->forceRefresh();
+ _skyScreen->setPalette((uint8*)SkyState::fetchCompact(SkyState::_systemVars.currentPalette));
+ removePanel();
+ _skyMouse->spriteMouse(_savedMouse, 0, 0);
+}
+
void SkyControl::doControlPanel(void) {
if (SkyState::isDemo() && (!SkyState::isCDVersion())) {
@@ -335,7 +362,9 @@ void SkyControl::doControlPanel(void) {
buttonControl(NULL);
_text->drawToScreen(WITH_MASK); // flush text restore buffer
drawMainPanel();
- if (clickRes == QUIT_PANEL) quitPanel = true;
+ if ((clickRes == QUIT_PANEL) || (clickRes == GAME_SAVED) ||
+ (clickRes == GAME_RESTORED))
+ quitPanel = true;
}
_mouseClicked = false;
}
@@ -1126,7 +1155,7 @@ uint16 SkyControl::parseSaveData(uint8 *srcBuf) {
LODSD(srcPos, size);
LODSD(srcPos, saveRev);
- if (saveRev != SAVE_FILE_REVISION) {
+ if (saveRev > SAVE_FILE_REVISION) {
warning("Unknown save file revision (%d)",saveRev);
return RESTORE_FAILED;
}
diff --git a/sky/control.h b/sky/control.h
index a4817f7f36..f7b02ced37 100644
--- a/sky/control.h
+++ b/sky/control.h
@@ -147,35 +147,35 @@ class SkyControl {
public:
SkyControl(SkyScreen *screen, SkyDisk *disk, SkyMouse *mouse, SkyText *text, SkyMusicBase *music, SkyLogic *logic, OSystem *system, const char *savePath);
void doControlPanel(void);
+ void doLoadSavePanel(void);
void showGameQuitMsg(bool useScreen = true);
private:
void initPanel(void);
void removePanel(void);
- void drawMainPanel(void);
- void delay(unsigned int amount);
- void buttonControl(SkyConResource *pButton);
- void loadDescriptions(uint8 *destBuf);
- void saveDescriptions(uint8 *srcBuf);
- void setUpGameSprites(uint8 *nameBuf, dataFileHeader **nameSprites, uint16 firstNum, uint16 selectedGame, bool allowSave);
- void showSprites(dataFileHeader **nameSprites);
- bool checkKeyList(uint8 key);
- void handleKeyPress(uint8 key, uint8 *textBuf);
+ void drawMainPanel(void);
- void animClick(SkyConResource *pButton);
+ void delay(unsigned int amount);
+
+ void animClick(SkyConResource *pButton);
bool getYesNo(void);
+ void buttonControl(SkyConResource *pButton);
+ uint16 handleClick(SkyConResource *pButton);
uint16 doMusicSlide(void);
uint16 doSpeedSlide(void);
- uint16 handleClick(SkyConResource *pButton);
uint16 toggleFx(SkyConResource *pButton);
uint16 toggleText(SkyConResource *pButton);
uint16 shiftDown(uint8 speed);
uint16 shiftUp(uint8 speed);
- const char *_savePath;
- void appendMemList(uint16 *pMem);
- void freeMemList(void);
+ uint16 saveRestorePanel(bool allowSave);
+ void loadDescriptions(uint8 *destBuf);
+ void saveDescriptions(uint8 *srcBuf);
+ void setUpGameSprites(uint8 *nameBuf, dataFileHeader **nameSprites, uint16 firstNum, uint16 selectedGame, bool allowSave);
+ void showSprites(dataFileHeader **nameSprites);
+ bool checkKeyList(uint8 key);
+ void handleKeyPress(uint8 key, uint8 *textBuf);
uint16 _selectedGame;
uint16 saveGameToFile(void);
@@ -190,10 +190,12 @@ private:
void lodsStr(uint8 **srcPos, uint16 *src);
uint16 parseSaveData(uint8 *srcBuf);
- static Compact *_saveLoadCpts[833]; // \ moved to sky/compacts/savedata.cpp
- static uint8 *_saveLoadARs[18]; // /
+ static Compact *_saveLoadCpts[833]; // moved to sky/compacts/savedata.cpp
+ const char *_savePath;
- uint16 saveRestorePanel(bool allowSave);
+ AllocedMem *_memListRoot;
+ void appendMemList(uint16 *pMem);
+ void freeMemList(void);
SkyScreen *_skyScreen;
SkyDisk *_skyDisk;
@@ -206,8 +208,6 @@ private:
bool _mouseClicked;
byte _keyPressed;
- SkyConResource *createResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, int16 pX, int16 pY, uint32 pText, uint8 pOnClick, uint8 panelType);
-
struct {
uint8 *controlPanel;
uint8 *button;
@@ -221,14 +221,14 @@ private:
uint8 *musicBodge;
} _sprites;
- AllocedMem *_memListRoot;
-
uint8 *_screenBuf;
int _lastButton;
uint32 _curButtonText;
uint16 _firstText;
uint16 _savedMouse;
+ SkyConResource *createResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, int16 pX, int16 pY, uint32 pText, uint8 pOnClick, uint8 panelType);
+
dataFileHeader *_textSprite;
SkyTextResource *_text;
diff --git a/sky/logic.cpp b/sky/logic.cpp
index 29dfb264f9..24eb2d6a91 100644
--- a/sky/logic.cpp
+++ b/sky/logic.cpp
@@ -2185,7 +2185,9 @@ bool SkyLogic::fnEnterSection(uint32 sectionNo, uint32 b, uint32 c) {
}
bool SkyLogic::fnRestoreGame(uint32 a, uint32 b, uint32 c) {
- error("Stub: fnRestoreGame");
+
+ _skyControl->doLoadSavePanel();
+ return false;
}
bool SkyLogic::fnRestartGame(uint32 a, uint32 b, uint32 c) {