aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Göffringmann2003-07-01 16:06:09 +0000
committerRobert Göffringmann2003-07-01 16:06:09 +0000
commitffaeb5424fca2eba2528f8c2d9db674d47f03395 (patch)
treed321b72c5b05137de83a60f8bfbe3e19e0a04f5d
parent09e47bad3d6b7294c9dd494790c2c5a4bfeff0b0 (diff)
downloadscummvm-rg350-ffaeb5424fca2eba2528f8c2d9db674d47f03395.tar.gz
scummvm-rg350-ffaeb5424fca2eba2528f8c2d9db674d47f03395.tar.bz2
scummvm-rg350-ffaeb5424fca2eba2528f8c2d9db674d47f03395.zip
fixed mouse restore on savegame restore and bug in fnTheyStartSub
svn-id: r8690
-rw-r--r--sky/control.cpp8
-rw-r--r--sky/control.h1
-rw-r--r--sky/logic.cpp11
3 files changed, 11 insertions, 9 deletions
diff --git a/sky/control.cpp b/sky/control.cpp
index 20e857867c..08b94c31c2 100644
--- a/sky/control.cpp
+++ b/sky/control.cpp
@@ -301,7 +301,7 @@ void SkyControl::doControlPanel(void) {
drawMainPanel();
- uint16 savedMouse = _skyMouse->giveCurrentMouseType();
+ _savedMouse = _skyMouse->giveCurrentMouseType();
_skyMouse->spriteMouse(MOUSE_NORMAL,0,0);
bool quitPanel = false;
@@ -343,7 +343,7 @@ void SkyControl::doControlPanel(void) {
_skyScreen->forceRefresh();
_skyScreen->setPalette((uint8*)SkyState::fetchCompact(SkyState::_systemVars.currentPalette));
removePanel();
- _skyMouse->spriteMouse(savedMouse, 0, 0);
+ _skyMouse->spriteMouse(_savedMouse, 0, 0);
}
uint16 SkyControl::handleClick(SkyConResource *pButton) {
@@ -950,7 +950,7 @@ uint32 SkyControl::prepareSaveData(uint8 *destBuf) {
//TODO: save queued sfx
STOSD(destPos, _skyText->giveCurrentCharSet());
- STOSD(destPos, _skyMouse->giveCurrentMouseType());
+ STOSD(destPos, _savedMouse);
STOSD(destPos, SkyState::_systemVars.currentPalette);
for (cnt = 0; cnt < 838; cnt++)
STOSD(destPos, SkyLogic::_scriptVariables[cnt]);
@@ -1156,7 +1156,7 @@ uint16 SkyControl::parseSaveData(uint8 *srcBuf) {
_skyDisk->refreshFilesList(reloadList);
_skyMusic->startMusic((uint16)music);
_skyText->fnSetFont(charSet);
- _skyMouse->spriteMouse((uint16)mouseType, 0, 0);
+ _savedMouse = (uint16)mouseType;
SkyState::_systemVars.currentPalette = palette; // will be set when doControlPanel ends
SkyState::_systemVars.systemFlags |= SF_GAME_RESTORED; // what's that for?
diff --git a/sky/control.h b/sky/control.h
index 81ed63293e..474ec8f71c 100644
--- a/sky/control.h
+++ b/sky/control.h
@@ -227,6 +227,7 @@ private:
int _lastButton;
uint32 _curButtonText;
uint16 _firstText;
+ uint16 _savedMouse;
dataFileHeader *_textSprite;
SkyTextResource *_text;
diff --git a/sky/logic.cpp b/sky/logic.cpp
index 2c75f6de9a..f6c3ebef18 100644
--- a/sky/logic.cpp
+++ b/sky/logic.cpp
@@ -583,8 +583,9 @@ void SkyLogic::stopped() {
Compact *cpt = SkyState::fetchCompact(_compact->extCompact->waitingFor);
- if (!cpt->mood && collide(cpt))
- return;
+ if (cpt)
+ if (!cpt->mood && collide(cpt))
+ return;
// we are free, continue processing the script
@@ -1346,8 +1347,8 @@ bool SkyLogic::fnStartSub(uint32 scr, uint32 b, uint32 c) {
bool SkyLogic::fnTheyStartSub(uint32 mega, uint32 scr, uint32 c) {
Compact *cpt = SkyState::fetchCompact(mega);
cpt->mode += 4;
- *SkyCompact::getSub(cpt, _compact->mode) = (uint16)(scr & 0xffff);
- *SkyCompact::getSub(cpt, _compact->mode + 2) = (uint16)(scr >> 16);
+ *SkyCompact::getSub(cpt, cpt->mode) = (uint16)(scr & 0xffff);
+ *SkyCompact::getSub(cpt, cpt->mode + 2) = (uint16)(scr >> 16);
return true;
}
@@ -1830,7 +1831,7 @@ bool SkyLogic::fnFaceId(uint32 otherId, uint32 b, uint32 c) {
// sprite offsets can ruin the formula - instead we
// will use the bottom of the mouse collision area
- int16 y = _compact->ycood - (cpt->ycood - cpt->mouseRelY - cpt->mouseSizeY);
+ int16 y = _compact->ycood - (cpt->ycood + cpt->mouseRelY + cpt->mouseSizeY);
if (y < 0) { // it's below
y = -y;