[Scummvm-cvs-logs] SF.net SVN: scummvm:[46074] scummvm/trunk/engines/scumm/cursor.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sun Nov 22 11:56:49 CET 2009


Revision: 46074
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46074&view=rev
Author:   eriktorbjorn
Date:     2009-11-22 10:56:49 +0000 (Sun, 22 Nov 2009)

Log Message:
-----------
Added hard-coded cursor, and adjusted the colours slightly, for the PC-Engine
version of Loom, based on information from hennymcc.

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/cursor.cpp

Modified: scummvm/trunk/engines/scumm/cursor.cpp
===================================================================
--- scummvm/trunk/engines/scumm/cursor.cpp	2009-11-22 09:31:09 UTC (rev 46073)
+++ scummvm/trunk/engines/scumm/cursor.cpp	2009-11-22 10:56:49 UTC (rev 46074)
@@ -45,7 +45,7 @@
 };
 
 static const uint16 default_pce_cursor_colors[4] = {
-	0x01FF, 0x016D, 0x0000, 0x0092
+	0x01FF, 0x01FF, 0x016D, 0x0092
 };
 
 static const byte default_cursor_colors[4] = {
@@ -356,33 +356,46 @@
 
 //	const int oldID = _charset->getCurID();
 
-	if (_game.version == 3) {
-		_charset->setCurID(0);
-	} else if (_game.version >= 4) {
-		_charset->setCurID(1);
-	}
+	uint16 *ptr = _cursorImages[index];
+	int h;
 
-	Graphics::Surface s;
-	byte buf[16*17];
-	memset(buf, 123, 16*17);
-	s.pixels = buf;
-	s.w = _charset->getCharWidth(chr);
-	s.h = _charset->getFontHeight();
-	s.pitch = s.w;
-	// s.h = 17 for FM-TOWNS Loom Japanese. Fixes bug #1166917
-	assert(s.w <= 16 && s.h <= 17);
-	s.bytesPerPixel = 1;
+	if (index == 1 && _game.platform == Common::kPlatformPCEngine) {
+		uint16 cursorPCE[] = {
+			0x8000, 0xC000, 0xE000, 0xF000, 0xF800, 0xFC00, 0xFE00, 0xFF00,
+			0xF180, 0xF800, 0x8C00, 0x0C00, 0x0600, 0x0600, 0x0300
+		};
 
-	_charset->drawChar(chr, s, 0, 0);
+		for (h = 0; h < ARRAYSIZE(cursorPCE); h++) {
+			*ptr++ = cursorPCE[h];
+		}
+	} else {
+		if (_game.version == 3) {
+			_charset->setCurID(0);
+		} else if (_game.version >= 4) {
+			_charset->setCurID(1);
+		}
 
-	uint16 *ptr = _cursorImages[index];
-	memset(ptr, 0, 17 * sizeof(uint16));
-	for (int h = 0; h < s.h; h++) {
-		for (int w = 0; w < s.w; w++) {
-			if (buf[s.pitch * h + w] != 123)
-				*ptr |= 1 << (15 - w);
+		Graphics::Surface s;
+		byte buf[16*17];
+		memset(buf, 123, 16*17);
+		s.pixels = buf;
+		s.w = _charset->getCharWidth(chr);
+		s.h = _charset->getFontHeight();
+		s.pitch = s.w;
+		// s.h = 17 for FM-TOWNS Loom Japanese. Fixes bug #1166917
+		assert(s.w <= 16 && s.h <= 17);
+		s.bytesPerPixel = 1;
+
+		_charset->drawChar(chr, s, 0, 0);
+
+		memset(ptr, 0, 17 * sizeof(uint16));
+		for (h = 0; h < s.h; h++) {
+			for (int w = 0; w < s.w; w++) {
+				if (buf[s.pitch * h + w] != 123)
+					*ptr |= 1 << (15 - w);
+			}
+			ptr++;
 		}
-		ptr++;
 	}
 
 //	_charset->setCurID(oldID);


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