fixed mouse restore on savegame restore and bug in fnTheyStartSub

svn-id: r8690
This commit is contained in:
Robert Göffringmann 2003-07-01 16:06:09 +00:00
parent 09e47bad3d
commit ffaeb5424f
3 changed files with 11 additions and 9 deletions

View file

@ -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?

View file

@ -227,6 +227,7 @@ private:
int _lastButton;
uint32 _curButtonText;
uint16 _firstText;
uint16 _savedMouse;
dataFileHeader *_textSprite;
SkyTextResource *_text;

View file

@ -583,6 +583,7 @@ void SkyLogic::stopped() {
Compact *cpt = SkyState::fetchCompact(_compact->extCompact->waitingFor);
if (cpt)
if (!cpt->mood && collide(cpt))
return;
@ -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;