[Scummvm-cvs-logs] SF.net SVN: scummvm: [23623] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Jul 30 10:22:49 CEST 2006


Revision: 23623
Author:   lordhoto
Date:     2006-07-30 01:22:39 -0700 (Sun, 30 Jul 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23623&view=rev

Log Message:
-----------
- fixes bug in fileData (introduced with last commit)
- show mouse cursor in Screen::setMouseCursor if it's allready shown
- a little bit more kyra3 init stuff

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra3.cpp
    scummvm/trunk/engines/kyra/kyra3.h
    scummvm/trunk/engines/kyra/resource.cpp
    scummvm/trunk/engines/kyra/screen.cpp
Modified: scummvm/trunk/engines/kyra/kyra3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra3.cpp	2006-07-30 07:51:11 UTC (rev 23622)
+++ scummvm/trunk/engines/kyra/kyra3.cpp	2006-07-30 08:22:39 UTC (rev 23623)
@@ -133,6 +133,7 @@
 		_gameShapes[i] = _screen->getPtrToShape(_mouseSHPBuf, i);
 	}
 
+	initItems();
 	// XXX
 
 	_screen->setMouseCursor(0, 0, *_gameShapes);
@@ -531,4 +532,28 @@
 	debugC(9, kDebugLevelMain, "KyraEngine::realInit()");
 }
 
+#pragma mark - items
+
+void KyraEngine_v3::initItems() {
+	debugC(9, kDebugLevelMain, "KyraEngine::initItems()");
+
+	_screen->loadBitmap("ITEMS.CSH", 3, 3, 0);
+
+	// XXX
+
+	_screen->loadBitmap("ITEMS2.CSH", 3, 3, 0);
+
+	uint32 size = 0;
+	uint8 *itemsDat = _res->fileData("_ITEMS.DAT", &size);
+
+	assert(size >= 72+144);
+
+	memcpy(_itemBuffer1, itemsDat   ,  72);
+	memcpy(_itemBuffer2, itemsDat+72, 144);
+
+	delete [] itemsDat;
+
+	_screen->_curPage = 0;
+}
+
 } // end of namespace Kyra

Modified: scummvm/trunk/engines/kyra/kyra3.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra3.h	2006-07-30 07:51:11 UTC (rev 23622)
+++ scummvm/trunk/engines/kyra/kyra3.h	2006-07-30 08:22:39 UTC (rev 23623)
@@ -100,6 +100,8 @@
 	// items
 	uint8 *_itemBuffer1;
 	uint8 *_itemBuffer2;
+
+	void initItems();
 };
 
 } // end of namespace Kyra

Modified: scummvm/trunk/engines/kyra/resource.cpp
===================================================================
--- scummvm/trunk/engines/kyra/resource.cpp	2006-07-30 07:51:11 UTC (rev 23622)
+++ scummvm/trunk/engines/kyra/resource.cpp	2006-07-30 08:22:39 UTC (rev 23623)
@@ -156,13 +156,15 @@
 	// test to open it in the main dir
 	if (file_.open(file)) {
 
-		if (size)
-			*size = file_.size();
-		buffer = new uint8[*size];
+		uint32 temp = file_.size();
+		buffer = new uint8[temp];
 		assert(buffer);
 
-		file_.read(buffer, *size);
+		file_.read(buffer, temp);
 
+		if (size)
+			*size = temp;
+
 		file_.close();
 	} else {
 		// opens the file in a PAK File

Modified: scummvm/trunk/engines/kyra/screen.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen.cpp	2006-07-30 07:51:11 UTC (rev 23622)
+++ scummvm/trunk/engines/kyra/screen.cpp	2006-07-30 08:22:39 UTC (rev 23623)
@@ -1907,10 +1907,12 @@
 	fillRect(0, 0, mouseWidth, mouseHeight, 0, 8);
 	drawShape(8, shape, 0, 0, 0, 0);
 
-	CursorMan.showMouse(false);
+	if (!_mouseLockCount)
+		CursorMan.showMouse(false);
 	copyRegionToBuffer(8, 0, 0, mouseWidth, mouseHeight, cursor);
 	CursorMan.replaceCursor(cursor, mouseWidth, mouseHeight, x, y, 0);
-	CursorMan.showMouse(true);
+	if (!_mouseLockCount)
+		CursorMan.showMouse(true);
 	free(cursor);
 
 	// makes sure that the cursor is drawn


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