Add hyperlink on/off functions of oracle in Feeble Files

svn-id: r20665
This commit is contained in:
Travis Howell 2006-02-13 10:29:25 +00:00
parent aaa11f6efb
commit 81b820f7c9
6 changed files with 87 additions and 0 deletions

View File

@ -90,6 +90,7 @@ struct FillOrCopyStruct {
uint16 x, y;
uint16 width, height;
uint16 textColumn, textRow;
uint16 scrollY;
uint8 textColumnOffset, textLength, textMaxLength;
uint8 fill_color, text_color, unk5;
FillOrCopyData *fcs_data;

View File

@ -990,6 +990,22 @@ int SimonEngine::runScript() {
}
break;
case 171:{ /* oracle hyperlink on */
if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2)
goto invalid_opcode;
hyperLinkOn(getVarOrWord());
}
break;
case 172:{ /* oracle hyperlink off */
if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2)
goto invalid_opcode;
hyperLinkOff();
}
break;
case 175:{ /* vga pointer op 1 */
o_lockZone();
}

View File

@ -10,6 +10,7 @@ MODULE_OBJS := \
items.o \
midi.o \
midiparser_s1d.o \
oracle.o \
res.o \
saveload.o \
sound.o \

55
engines/simon/oracle.cpp Normal file
View File

@ -0,0 +1,55 @@
/* ScummVM - Scumm Interpreter
* Copyright (C) 2001-2006 The ScummVM project
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*
*/
#include "common/stdafx.h"
#include "simon/simon.h"
#include "simon/intern.h"
#include "simon/vga.h"
#include <sys/stat.h>
namespace Simon {
void SimonEngine::hyperLinkOn(uint16 x)
{
if ((_bitArray[3] & (1 << 3)) == 0)
return;
_hyperLink = x;
_variableArray[50] = _textWindow->textColumn+_textWindow->x;
_variableArray[51] = _textWindow->textRow+_textWindow->y+
(_oracleMaxScrollY - _textWindow->scrollY) * 15;
}
void SimonEngine::hyperLinkOff()
{
if ((_bitArray[3] & (1 << 3)) == 0)
return;
_variableArray[52] = _textWindow->x + _textWindow->textColumn - _variableArray[50];
addNewHitArea(_variableArray[53], _variableArray[50], _variableArray[51], _variableArray[52], 15, 145, 208, _dummyItem1);
_variableArray[53]++;
_hyperLink = 0;
}
} // End of namespace Simon

View File

@ -509,6 +509,10 @@ SimonEngine::SimonEngine(OSystem *syst)
_saveOrLoad = false;
_saveLoadFlag = false;
_hyperLink = 0;
_oracleMaxScrollY = 0;
_noOracleScroll = 0;
_sdlMouseX = 0;
_sdlMouseY = 0;
@ -3508,6 +3512,10 @@ void SimonEngine::playSpeech(uint speech_id, uint vgaSpriteId) {
}
void SimonEngine::printText(uint vgaSpriteId, uint color, const char *string, int16 x, int16 y, int16 width) {
// FIXME
if (getGameType() == GType_FF)
return;
char convertedString[320];
char *convertedString2 = convertedString;
int16 height, talkDelay;

View File

@ -265,6 +265,9 @@ protected:
const byte *_scrollImage;
byte _vgaVar8;
uint16 _hyperLink;
uint16 _oracleMaxScrollY, _noOracleScroll;
int16 _scriptVerb, _scriptNoun1, _scriptNoun2;
int16 _scriptAdj1, _scriptAdj2;
@ -580,6 +583,9 @@ protected:
void o_inventory_descriptions();
void hyperLinkOn(uint16 x);
void hyperLinkOff();
void mouseOff();
void mouseOn();