[Scummvm-cvs-logs] SF.net SVN: scummvm: [20665] scummvm/trunk/engines/simon

kirben at users.sourceforge.net kirben at users.sourceforge.net
Mon Feb 13 02:30:05 CET 2006


Revision: 20665
Author:   kirben
Date:     2006-02-13 02:29:25 -0800 (Mon, 13 Feb 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm?rev=20665&view=rev

Log Message:
-----------
Add hyperlink on/off functions of oracle in Feeble Files

Modified Paths:
--------------
    scummvm/trunk/engines/simon/intern.h
    scummvm/trunk/engines/simon/items.cpp
    scummvm/trunk/engines/simon/module.mk
    scummvm/trunk/engines/simon/simon.cpp
    scummvm/trunk/engines/simon/simon.h

Added Paths:
-----------
    scummvm/trunk/engines/simon/oracle.cpp
Modified: scummvm/trunk/engines/simon/intern.h
===================================================================
--- scummvm/trunk/engines/simon/intern.h	2006-02-13 05:38:47 UTC (rev 20664)
+++ scummvm/trunk/engines/simon/intern.h	2006-02-13 10:29:25 UTC (rev 20665)
@@ -90,6 +90,7 @@
 	uint16 x, y;
 	uint16 width, height;
 	uint16 textColumn, textRow;
+	uint16 scrollY;
 	uint8 textColumnOffset, textLength, textMaxLength;
     uint8 fill_color, text_color, unk5;
 	FillOrCopyData *fcs_data;

Modified: scummvm/trunk/engines/simon/items.cpp
===================================================================
--- scummvm/trunk/engines/simon/items.cpp	2006-02-13 05:38:47 UTC (rev 20664)
+++ scummvm/trunk/engines/simon/items.cpp	2006-02-13 10:29:25 UTC (rev 20665)
@@ -990,6 +990,22 @@
 			}
 			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();
 			}

Modified: scummvm/trunk/engines/simon/module.mk
===================================================================
--- scummvm/trunk/engines/simon/module.mk	2006-02-13 05:38:47 UTC (rev 20664)
+++ scummvm/trunk/engines/simon/module.mk	2006-02-13 10:29:25 UTC (rev 20665)
@@ -10,6 +10,7 @@
 	items.o \
 	midi.o \
 	midiparser_s1d.o \
+ 	oracle.o \
 	res.o \
 	saveload.o \
 	sound.o \

Added: scummvm/trunk/engines/simon/oracle.cpp
===================================================================
--- scummvm/trunk/engines/simon/oracle.cpp	                        (rev 0)
+++ scummvm/trunk/engines/simon/oracle.cpp	2006-02-13 10:29:25 UTC (rev 20665)
@@ -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


Property changes on: scummvm/trunk/engines/simon/oracle.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp	2006-02-13 05:38:47 UTC (rev 20664)
+++ scummvm/trunk/engines/simon/simon.cpp	2006-02-13 10:29:25 UTC (rev 20665)
@@ -509,6 +509,10 @@
 	_saveOrLoad = false;
 	_saveLoadFlag = false;
 
+	_hyperLink = 0;
+	_oracleMaxScrollY = 0;
+	_noOracleScroll = 0;
+
 	_sdlMouseX = 0;
 	_sdlMouseY = 0;
 
@@ -3508,6 +3512,10 @@
 }
 
 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;

Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h	2006-02-13 05:38:47 UTC (rev 20664)
+++ scummvm/trunk/engines/simon/simon.h	2006-02-13 10:29:25 UTC (rev 20665)
@@ -265,6 +265,9 @@
 	const byte *_scrollImage;
 	byte _vgaVar8;
 
+ 	uint16 _hyperLink;
+ 	uint16 _oracleMaxScrollY, _noOracleScroll;
+ 
 	int16 _scriptVerb, _scriptNoun1, _scriptNoun2;
 	int16 _scriptAdj1, _scriptAdj2;
 
@@ -580,6 +583,9 @@
 
 	void o_inventory_descriptions();
 
+ 	void hyperLinkOn(uint16 x);
+ 	void hyperLinkOff();
+ 
 	void mouseOff();
 	void mouseOn();
 







More information about the Scummvm-git-logs mailing list