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

kirben at users.sourceforge.net kirben at users.sourceforge.net
Mon Apr 3 07:41:02 CEST 2006


Revision: 21579
Author:   kirben
Date:     2006-04-03 07:40:07 -0700 (Mon, 03 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21579&view=rev

Log Message:
-----------
Add initial support for oracle icons in FF

Modified Paths:
--------------
    scummvm/trunk/engines/simon/icons.cpp
    scummvm/trunk/engines/simon/oracle.cpp
    scummvm/trunk/engines/simon/simon.cpp
    scummvm/trunk/engines/simon/simon.h
Modified: scummvm/trunk/engines/simon/icons.cpp
===================================================================
--- scummvm/trunk/engines/simon/icons.cpp	2006-04-03 12:11:04 UTC (rev 21578)
+++ scummvm/trunk/engines/simon/icons.cpp	2006-04-03 14:40:07 UTC (rev 21579)
@@ -52,6 +52,19 @@
 	in.close();
 }
 
+void SimonEngine::loadIconData() {
+	loadZone(8);
+	VgaPointersEntry *vpe = &_vgaBufferPointers[8];
+	byte *src = vpe->vgaFile2;
+
+	_iconFilePtr = (byte *)malloc(43 * 336);
+	if (_iconFilePtr == NULL)
+		error("Out of icon memory");
+
+	memcpy(_iconFilePtr, src, 43 * 336);
+	o_unfreezeBottom();
+}
+
 // Thanks to Stuart Caie for providing the original
 // C conversion upon which this function is based.
 void decompress_icon_amiga (byte *dst, byte *src, byte base, uint pitch) {

Modified: scummvm/trunk/engines/simon/oracle.cpp
===================================================================
--- scummvm/trunk/engines/simon/oracle.cpp	2006-04-03 12:11:04 UTC (rev 21578)
+++ scummvm/trunk/engines/simon/oracle.cpp	2006-04-03 14:40:07 UTC (rev 21579)
@@ -52,4 +52,72 @@
 	_hyperLink = 0;
 }
 
+void SimonEngine::oracleLogo() {
+	Common::Rect srcRect, dstRect;
+	byte *src, *dst;
+	uint16 w, h;
+
+	dstRect.left = 16;
+	dstRect.top = 16;
+	dstRect.right = 58;
+	dstRect.bottom = 59;
+
+	srcRect.left = 0;
+	srcRect.top = 0;
+	srcRect.right = 42;
+	srcRect.bottom = 43;
+
+	src = _iconFilePtr;
+	dst = getBackBuf() + _screenWidth * dstRect.top + dstRect.left;
+
+	for (h = 0; h < dstRect.height(); h++) {
+		for (w = 0; w < dstRect.width(); w++) {
+			if (src[w])
+				dst[w] = src[w];
+		}
+		src += 336;
+		dst += _screenWidth;
+	}
+}
+
+void SimonEngine::swapCharacterLogo() {
+	Common::Rect srcRect, dstRect;
+	byte *src, *dst;
+	uint16 w, h;
+	int x;
+
+	dstRect.left = 64;
+	dstRect.top = 16;
+	dstRect.right = 106;
+	dstRect.bottom = 59;
+
+	srcRect.top = 0;
+	srcRect.bottom = 43;
+
+	x = _variableArray[91];
+	if (x > _variableArray[90])
+		x--;
+	if( x < _variableArray[90])
+		x++;
+	_variableArray[91] = x;
+
+	x++;
+	x *= 42;
+
+	srcRect.left = x;
+	srcRect.right = srcRect.left + 42;
+
+	src = _iconFilePtr + srcRect.top * 336 + srcRect.left;
+	dst = getBackBuf() + _screenWidth * dstRect.top + dstRect.left;
+
+	for (h = 0; h < dstRect.height(); h++) {
+		for (w = 0; w < dstRect.width(); w++) {
+			if (src[w])
+				dst[w] = src[w];
+		}
+		src += 336;
+		dst += _screenWidth;
+	}
+}
+
 } // End of namespace Simon

Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp	2006-04-03 12:11:04 UTC (rev 21578)
+++ scummvm/trunk/engines/simon/simon.cpp	2006-04-03 14:40:07 UTC (rev 21579)
@@ -2857,6 +2857,13 @@
 	}
 
 	if (_updateScreen) {
+		if (getGameType() == GType_FF) {
+			if (vcGetBit(78) == false) {
+				oracleLogo();
+			} else if (vcGetBit(76) == true) {
+				swapCharacterLogo();
+			}
+		}
 		handle_mouse_moved();
 		dx_update_screen_and_palette();
 		_updateScreen = false;
@@ -3817,7 +3824,9 @@
 #endif
 	}
 
-	if (getGameType() != GType_FF)
+	if (getGameType() == GType_FF)
+		loadIconData();
+	else
 		loadIconFile();
 
 	vc34_setMouseOff();

Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h	2006-04-03 12:11:04 UTC (rev 21578)
+++ scummvm/trunk/engines/simon/simon.h	2006-04-03 14:40:07 UTC (rev 21579)
@@ -589,7 +589,9 @@
 
  	void hyperLinkOn(uint16 x);
  	void hyperLinkOff();
- 
+	void oracleLogo();
+	void swapCharacterLogo();
+
 	void mouseOff();
 	void mouseOn();
 
@@ -647,6 +649,7 @@
 	uint setup_icon_hit_area(FillOrCopyStruct *fcs, uint x, uint y, uint icon_number, Item *item_ptr);
 	void addArrows(FillOrCopyStruct *fcs, uint fcs_index);
 
+	void loadIconData();	
 	void loadIconFile();
 	void processSpecialKeys();
 	void hitarea_stuff_helper();


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list