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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Fri Oct 22 04:11:01 CEST 2010


Revision: 53698
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53698&view=rev
Author:   lordhoto
Date:     2010-10-22 02:11:00 +0000 (Fri, 22 Oct 2010)

Log Message:
-----------
KYRA: Cleanup.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/items_lok.cpp
    scummvm/trunk/engines/kyra/kyra_lok.cpp
    scummvm/trunk/engines/kyra/kyra_lok.h
    scummvm/trunk/engines/kyra/staticres.cpp

Modified: scummvm/trunk/engines/kyra/items_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/items_lok.cpp	2010-10-22 02:10:22 UTC (rev 53697)
+++ scummvm/trunk/engines/kyra/items_lok.cpp	2010-10-22 02:11:00 UTC (rev 53698)
@@ -98,7 +98,7 @@
 			int xpos2 = *xposOffset + 10;
 			if (x > xpos && x < xpos2) {
 				assert(*itemsTable >= 0);
-				int itemHeight = _itemTable[*itemsTable].height;
+				int itemHeight = _itemHtDat[*itemsTable];
 				int ypos = *yposOffset + 3;
 				int ypos2 = ypos - itemHeight - 3;
 
@@ -305,7 +305,7 @@
 		return 1;
 	}
 
-	int itemHeight = _itemTable[item].height;
+	int itemHeight = _itemHtDat[item];
 	_lastProcessedItemHeight = itemHeight;
 
 	if (x == -1)
@@ -623,7 +623,7 @@
 void KyraEngine_LoK::itemSpecialFX2(int x, int y, int item) {
 	x -= 8;
 	y -= 15;
-	int yAdd = (int8)(((16 - _itemTable[item].height) >> 1) & 0xFF);
+	int yAdd = (int8)(((16 - _itemHtDat[item]) >> 1) & 0xFF);
 	backUpItemRect0(x, y);
 	if (item >= 80 && item <= 89)
 		snd_playSoundEffect(55);

Modified: scummvm/trunk/engines/kyra/kyra_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_lok.cpp	2010-10-22 02:10:22 UTC (rev 53697)
+++ scummvm/trunk/engines/kyra/kyra_lok.cpp	2010-10-22 02:11:00 UTC (rev 53698)
@@ -247,7 +247,7 @@
 	_brandonPosX = _brandonPosY = -1;
 	_poisonDeathCounter = 0;
 
-	memset(_itemTable, 0, sizeof(_itemTable));
+	memset(_itemHtDat, 0, sizeof(_itemHtDat));
 	memset(_exitList, 0xFFFF, sizeof(_exitList));
 	_exitListPtr = 0;
 	_pathfinderFlag = _pathfinderFlag2 = 0;

Modified: scummvm/trunk/engines/kyra/kyra_lok.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_lok.h	2010-10-22 02:10:22 UTC (rev 53697)
+++ scummvm/trunk/engines/kyra/kyra_lok.h	2010-10-22 02:11:00 UTC (rev 53698)
@@ -69,13 +69,6 @@
 	uint8 needInit[12];
 };
 
-struct ItemDescription {
-	uint8 unk1;
-	uint8 height;
-	uint8 unk2;
-	uint8 unk3;
-};
-
 struct SeqLoop {
 	const uint8 *ptr;
 	uint16 count;
@@ -456,7 +449,7 @@
 
 	int8 *_sceneAnimTable[50];
 
-	ItemDescription _itemTable[145];
+	uint8 _itemHtDat[145];
 	int _lastProcessedItem;
 	int _lastProcessedItemHeight;
 

Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp	2010-10-22 02:10:22 UTC (rev 53697)
+++ scummvm/trunk/engines/kyra/staticres.cpp	2010-10-22 02:11:00 UTC (rev 53698)
@@ -912,16 +912,7 @@
 			_shapes[216 + i] = _screen->encodeShape( (i % 20) * 16, i/20 * 16, 16, 16, 0);
 	}
 
-	uint32 size;
-	uint8 *fileData = _res->fileData("_ITEM_HT.DAT", &size);
-	assert(fileData);
-
-	for (int i = 0; i < 107; i++) {
-		_itemTable[i].height = fileData[i];
-		_itemTable[i].unk1 = _itemTable[i].unk2 = 0;
-	}
-
-	delete[] fileData;
+	_res->loadFileToBuf("_ITEM_HT.DAT", &_itemHtDat, sizeof(_itemHtDat));
 }
 
 void KyraEngine_LoK::loadButtonShapes() {


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