[Scummvm-cvs-logs] SF.net SVN: scummvm: [30143] scummvm/trunk/engines/lure

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Wed Jan 2 12:15:36 CET 2008


Revision: 30143
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30143&view=rev
Author:   dreammaster
Date:     2008-01-02 03:15:36 -0800 (Wed, 02 Jan 2008)

Log Message:
-----------
Enhanced cursor code to handle cursors in EGA mode

Modified Paths:
--------------
    scummvm/trunk/engines/lure/res.cpp
    scummvm/trunk/engines/lure/res.h

Modified: scummvm/trunk/engines/lure/res.cpp
===================================================================
--- scummvm/trunk/engines/lure/res.cpp	2008-01-02 11:14:42 UTC (rev 30142)
+++ scummvm/trunk/engines/lure/res.cpp	2008-01-02 11:15:36 UTC (rev 30143)
@@ -408,6 +408,41 @@
 	p.palette()->copyFrom(_paletteSubset->palette(), 60*4, 220*4, 8*4);
 }
 
+byte *Resources::getCursor(uint8 cursorNum) { 
+	if (!LureEngine::getReference().isEGA())
+		return _cursors->data() + (cursorNum * CURSOR_SIZE);
+
+	Common::set_to(&_cursor[0], &_cursor[0] + CURSOR_SIZE, 0);
+	byte *pSrc = _cursors->data() + (cursorNum * 64);
+	byte *pDest = &_cursor[0];
+	int planeNum = 0;
+
+	for (int y = 0; y < 16; ++y) {
+		for (int x = 0; x < 2; ++x) {
+			for (int planeNum = 0; planeNum < 2; ++planeNum, ++pSrc) {
+
+				byte v = *pSrc;
+				for (int bitCtr = 0; bitCtr < 8; ++bitCtr, v <<= 1) {
+					if ((v & 0x80) != 0)
+						*(pDest + bitCtr) |= 1 << planeNum;
+					else
+						*(pDest + bitCtr) &= ~(1 << planeNum);
+				}
+			}
+
+			pDest += 8;
+		}
+	}
+
+	// Post-process the cells to swap any values of 2 and 3
+	for (int index = 0; index < CURSOR_SIZE; ++index) {
+		if (_cursor[index] == 2) _cursor[index] = 3;
+		else if (_cursor[index] == 3) _cursor[index] = 2;
+	}
+
+	return &_cursor[0];
+}
+
 HotspotData *Resources::getHotspot(uint16 hotspotId) {
 	HotspotDataList::iterator i;
 

Modified: scummvm/trunk/engines/lure/res.h
===================================================================
--- scummvm/trunk/engines/lure/res.h	2008-01-02 11:14:42 UTC (rev 30142)
+++ scummvm/trunk/engines/lure/res.h	2008-01-02 11:15:36 UTC (rev 30143)
@@ -90,6 +90,7 @@
 	int _talkSelection;
 	int _talkStartEntry;
 	uint16 _talkingCharacter;
+	byte _cursor[CURSOR_WIDTH * CURSOR_HEIGHT];
 
 	void reloadData();
 	void freeData();
@@ -104,10 +105,7 @@
 	RoomData *getRoom(uint16 roomNumber);
 	bool checkHotspotExtent(HotspotData *hotspot);
 	void insertPaletteSubset(Palette &p);
-
-	byte *getCursor(uint8 cursorNum) { 
-		return _cursors->data() + (cursorNum * CURSOR_SIZE);
-	}
+	byte *getCursor(uint8 cursorNum);
 	HotspotDataList &hotspotData() { return _hotspotData; }
 	HotspotOverrideList &hotspotOverrides() { return _hotspotOverrides; }
 	HotspotAnimList &animRecords() { return _animData; }


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