[Scummvm-cvs-logs] CVS: scummvm/sky cd_intro.cpp,1.12,1.13 control.cpp,1.12,1.13 control.h,1.7,1.8 intro.cpp,1.26,1.27 logic.cpp,1.109,1.110 sky.cpp,1.68,1.69 sky.h,1.36,1.37
Robert G?ffringmann
lavosspawn at users.sourceforge.net
Tue Jul 1 18:47:06 CEST 2003
Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv6152/sky
Modified Files:
cd_intro.cpp control.cpp control.h intro.cpp logic.cpp sky.cpp
sky.h
Log Message:
fixed save/restore grid problems
Index: cd_intro.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/cd_intro.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- cd_intro.cpp 1 Jun 2003 22:53:44 -0000 1.12
+++ cd_intro.cpp 2 Jul 2003 01:46:24 -0000 1.13
@@ -195,13 +195,13 @@
#define LOAD_NEW_VOICE(num) ( free (vocBuffer), vocBuffer = _skyDisk->loadFile(num, NULL), loadedVocSize = _skyDisk->_lastLoadedFileSize )
#define LOAD_NEW_BG(num) ( free (bgVocBuffer), bgVocBuffer = _skyDisk->loadFile(num, NULL), bgVocSize = _skyDisk->_lastLoadedFileSize )
#define WAIT_VOICE while (_skySound->_voiceHandle != 0) { delay(50); CHECK_ESC }
-#define CHECK_ESC if (_key_pressed == 27) { _skyScreen->stopSequence(); _mixer->stopAll(); return; }
+#define CHECK_ESC if (_key_pressed == 27) { _skyScreen->stopSequence(); _mixer->stopAll(); return false; }
#define WAIT_SEQUENCE while (_skyScreen->sequenceRunning()) { delay(50); CHECK_ESC }
#define WAIT_RELATIVE(x) ( delay(20 * (x)) )
#define NORMAL_CD_INTRO
-void SkyState::doCDIntro() {
+bool SkyState::doCDIntro() {
uint32 loadedVocSize, bgVocSize;
byte *vocBuffer, *bgVocBuffer;
@@ -794,4 +794,5 @@
WAIT_SEQUENCE; //104
_skyScreen->startSequence(cd_105);
WAIT_SEQUENCE; //105
+ return true;
}
Index: control.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/control.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- control.cpp 2 Jul 2003 01:31:35 -0000 1.12
+++ control.cpp 2 Jul 2003 01:46:24 -0000 1.13
@@ -292,6 +292,18 @@
_bodge->drawToScreen(WITH_MASK);
}
+void SkyControl::restartGame(void) {
+ if (SkyState::isDemo() && (!SkyState::isCDVersion()))
+ return; // I don't think this can happen
+
+ /*parseSaveData(_restartData);
+
+ _skyScreen->forceRefresh();
+ _skyScreen->setPalette((uint8*)SkyState::fetchCompact(SkyState::_systemVars.currentPalette));
+ _skyMouse->spriteMouse(_savedMouse, 0, 0);
+ SkyState::_systemVars.pastIntro = true;*/
+}
+
void SkyControl::doLoadSavePanel(void) {
if (SkyState::isDemo())
return; // I don't think this can even happen
Index: control.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/control.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- control.h 1 Jul 2003 23:31:29 -0000 1.7
+++ control.h 2 Jul 2003 01:46:24 -0000 1.8
@@ -148,6 +148,7 @@
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 restartGame(void);
void showGameQuitMsg(bool useScreen = true);
private:
@@ -191,6 +192,7 @@
uint16 parseSaveData(uint8 *srcBuf);
static Compact *_saveLoadCpts[833]; // moved to sky/compacts/savedata.cpp
+ //static uint8 _restartData[0xCC10];
const char *_savePath;
AllocedMem *_memListRoot;
Index: intro.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/intro.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- intro.cpp 2 Jun 2003 00:01:34 -0000 1.26
+++ intro.cpp 2 Jul 2003 01:46:24 -0000 1.27
@@ -30,7 +30,7 @@
FREE_IF_NOT_0(_introTextSpace) \
FREE_IF_NOT_0(_introTextSave) \
_mixer->stopAll();
-#define CHECK_ESC if (_key_pressed == 27) { _skyScreen->stopSequence(); REMOVE_INTRO return; }
+#define CHECK_ESC if (_key_pressed == 27) { _skyScreen->stopSequence(); REMOVE_INTRO return false; }
#define WAIT_SEQUENCE while (_skyScreen->sequenceRunning()) { checkCommands(commandPtr); delay(50); CHECK_ESC }
#define INTRO_TEXT_WIDTH 128
@@ -201,7 +201,7 @@
}
}
-void SkyState::intro(void) {
+bool SkyState::intro(void) {
uint32 *commandPtr = (uint32 *)zeroCommands;
@@ -243,7 +243,7 @@
if (isCDVersion()) {
- doCDIntro();
+ return doCDIntro();
} else {
_skyDisk->prefetchFile(FN_A_PAL);
_skyDisk->prefetchFile(FN_1A_LOG);
@@ -303,7 +303,7 @@
delay(40);
if (_key_pressed == 27) {
REMOVE_INTRO;
- return;
+ return false;
}
//non-scrolling frame update
@@ -366,6 +366,7 @@
commandPtr = (uint32 *)anim6bCommands;
WAIT_SEQUENCE; //6b
}
+ return true;
}
void SkyState::introFrame(uint8 **diffPtr, uint8 **vgaPtr, uint8 *screenData) {
Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/logic.cpp,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -d -r1.109 -r1.110
--- logic.cpp 1 Jul 2003 23:31:29 -0000 1.109
+++ logic.cpp 2 Jul 2003 01:46:24 -0000 1.110
@@ -2156,6 +2156,8 @@
if (sectionNo == 5) //linc section - has different mouse icons
_skyMouse->replaceMouseCursors(60302);
+ _currentSection = 0xFF; // force music-, sound- and gridreload
+
return true;
}
@@ -2191,7 +2193,10 @@
}
bool SkyLogic::fnRestartGame(uint32 a, uint32 b, uint32 c) {
- error("Stub: fnRestartGame");
+
+ error("Stub: fnRestartGame()");
+ //_skyControl->restartGame();
+ return false;
}
bool SkyLogic::fnNewSwingSeq(uint32 a, uint32 b, uint32 c) {
@@ -2210,7 +2215,7 @@
}
bool SkyLogic::fnSkipIntroCode(uint32 a, uint32 b, uint32 c) {
- warning("Stub: fnSkipIntroCode");
+ SkyState::_systemVars.pastIntro = true;
return true;
}
Index: sky.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/sky.cpp,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- sky.cpp 1 Jul 2003 22:21:20 -0000 1.68
+++ sky.cpp 2 Jul 2003 01:46:25 -0000 1.69
@@ -54,7 +54,7 @@
void **SkyState::_itemList[300];
-SystemVars SkyState::_systemVars = {0, 0, 0, 0, 4316, 0};
+SystemVars SkyState::_systemVars = {0, 0, 0, 0, 4316, 0, false};
SkyState::SkyState(GameDetector *detector, OSystem *syst)
: Engine(detector, syst) {
@@ -96,8 +96,10 @@
initialise();
+ bool introSkipped;
if (!isDemo() || isCDVersion())
- intro();
+ introSkipped = !intro();
+ else introSkipped = false;
_skyDisk->flushPrefetched();
@@ -105,6 +107,9 @@
_paintGrid = false;
+ /*if (introSkipped)
+ _skyControl->restartGame();*/
+
while (1) {
delay(_systemVars.gameSpeed);
if (_key_pressed == 'r') {
@@ -119,10 +124,15 @@
_skyScreen->forceRefresh();
_key_pressed = 0;
}
+
if (_key_pressed == 63) {
_key_pressed = 0;
_skyControl->doControlPanel();
}
+
+ /*if ((_key_pressed == 27) && (!_systemVars.pastIntro))
+ _skyControl->restartGame();*/
+
_skyMouse->mouseEngine((uint16)_sdl_mouse_x, (uint16)_sdl_mouse_y);
_skyLogic->engine();
if (!_skyLogic->checkProtection()) { // don't let copy prot. screen flash up
Index: sky.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/sky.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- sky.h 1 Jul 2003 22:21:20 -0000 1.36
+++ sky.h 2 Jul 2003 01:46:25 -0000 1.37
@@ -47,6 +47,7 @@
uint16 language;
uint32 currentPalette;
uint16 gameSpeed;
+ bool pastIntro;
};
class SkyLogic;
@@ -127,8 +128,8 @@
void initItemList();
void initVirgin();
- void intro();
- void doCDIntro();
+ bool intro();
+ bool doCDIntro();
void startTimerSequence(byte *sequence);
static void timerHandler(void *ptr);
void gotTimerTick();
More information about the Scummvm-git-logs
mailing list