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

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sat Apr 14 05:48:24 CEST 2007


Revision: 26464
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26464&view=rev
Author:   dreammaster
Date:     2007-04-13 20:48:24 -0700 (Fri, 13 Apr 2007)

Log Message:
-----------
Implemented handling for barmen (rooms 29, 32, and 35)

Modified Paths:
--------------
    scummvm/trunk/engines/lure/hotspots.cpp
    scummvm/trunk/engines/lure/hotspots.h
    scummvm/trunk/engines/lure/luredefs.h
    scummvm/trunk/engines/lure/res.cpp
    scummvm/trunk/engines/lure/res.h
    scummvm/trunk/engines/lure/res_struct.cpp
    scummvm/trunk/engines/lure/res_struct.h
    scummvm/trunk/engines/lure/room.h

Modified: scummvm/trunk/engines/lure/hotspots.cpp
===================================================================
--- scummvm/trunk/engines/lure/hotspots.cpp	2007-04-14 03:46:30 UTC (rev 26463)
+++ scummvm/trunk/engines/lure/hotspots.cpp	2007-04-14 03:48:24 UTC (rev 26464)
@@ -80,6 +80,7 @@
 	_exitCtr = 0;
 	_walkFlag = true;
 	_startRoomNumber = 0;
+	_supportValue = 0;
 
 	if (_data->npcSchedule != 0) {
 		CharacterScheduleEntry *entry = resources.charSchedules().getEntry(_data->npcSchedule);
@@ -799,10 +800,10 @@
 	Resources &res = Resources::getReference();
 	ValueTableData &fields = res.fieldList();
 
-	if ((hotspot->hotspotId == 0x420) || (hotspot->hotspotId == 0x436) ||
-		(hotspot->hotspotId == 0x429)) {
-		// TODO: figure out specific handling code - sub_213
-		if (0)
+	if ((hotspot->hotspotId == SID_ID) || (hotspot->hotspotId == EWAN_ID) ||
+		(hotspot->hotspotId == NELLIE_ID)) {
+		// Check for a bar place
+		if (getBarPlace() == BP_KEEP_TRYING)
 			return PC_INITIAL;
 	} else if (hotspot->roomNumber != roomNumber()) {
 		// loc_884
@@ -864,6 +865,79 @@
 	return PC_EXECUTE;
 }
 
+BarPlaceResult Hotspot::getBarPlace() {
+	Resources &res = Resources::getReference();
+	BarEntry &barEntry = res.barmanLists().getDetails(roomNumber());
+
+	if (actionCtr() != 0) {
+		// Already at bar 
+		// Find the character's slot in the bar entry list
+		for (int index = 0; index < NUM_SERVE_CUSTOMERS; ++index) {
+			if (barEntry.customers[index].hotspotId == hotspotId()) 
+				return ((barEntry.customers[index].serveFlags & 0x80) == 0) ? BP_GOT_THERE : BP_KEEP_TRYING;
+		}
+
+		setActionCtr(0);
+		return BP_KEEP_TRYING;
+	}
+
+	// Try and find a bar place
+	if (!findClearBarPlace())
+		return BP_KEEP_TRYING;
+
+	// First scan for any existing entry for the character
+	int index = -1;
+	while (++index < NUM_SERVE_CUSTOMERS) {
+		if (barEntry.customers[index].hotspotId == hotspotId()) 
+			break;
+	}
+	if (index == NUM_SERVE_CUSTOMERS) {
+		// Not already present - so scan for an empty slot
+		index = -1;
+		while (++index < NUM_SERVE_CUSTOMERS) {
+			if (barEntry.customers[index].hotspotId == 0) 
+			break;
+		}
+
+		if (index == NUM_SERVE_CUSTOMERS)
+			// No slots available, so flag to keep trying
+			return BP_KEEP_TRYING;
+	}
+
+	// Set up the slot entry for the character
+	barEntry.customers[index].hotspotId = hotspotId();
+	barEntry.customers[index].serveFlags = 0x82;
+	setActionCtr(1);
+	updateMovement();
+	setDirection(UP);
+
+	return BP_KEEP_TRYING;
+}
+
+bool Hotspot::findClearBarPlace() {
+	// Check if character has reached the bar
+	Resources &res = Resources::getReference();
+	BarEntry &barEntry = res.barmanLists().getDetails(roomNumber());
+	if ((y() + heightCopy()) < ((barEntry.gridLine << 3) + 24)) 
+		return true;
+
+	RoomPathsData &paths = res.getRoom(roomNumber())->paths;
+	
+	// Scan backwards from the right side for 4 free blocks along the bar line block 
+	int numFree = 0;
+	for (int x = ROOM_PATHS_WIDTH - 1; x >= 0; --x) {
+		if (paths.isOccupied(x, barEntry.gridLine))
+			numFree = 0;
+		else if (++numFree == 4) {
+			// Start character walking to the found position
+			walkTo(x * 8, (barEntry.gridLine << 3) + 8);
+			return false;
+		}
+	}
+
+	return false;
+}
+
 bool Hotspot::characterWalkingCheck(HotspotData *hotspot) {
 	int16 xp, yp;
 
@@ -1944,6 +2018,7 @@
 	stream->writeUint16LE(_exitCtr);
 	stream->writeByte(_walkFlag);
 	stream->writeUint16LE(_startRoomNumber);
+	stream->writeUint16LE(_supportValue);
 }
 
 void Hotspot::loadFromStream(Common::ReadStream *stream) {
@@ -1979,6 +2054,7 @@
 	_exitCtr = stream->readUint16LE();
 	_walkFlag = stream->readByte() != 0;
 	_startRoomNumber = stream->readUint16LE();
+	_supportValue = stream->readUint16LE();
 }
 
 /*------------------------------------------------------------------------*/
@@ -2020,7 +2096,7 @@
 	case 0x8241:
 		return headAnimHandler;
 	case 0x82A0:
-		return sellerAnimHandler;
+		return barmanAnimHandler;
 	case 0x85ce:
 		return skorlGaurdAnimHandler;
 	case 0x882A:
@@ -2806,6 +2882,7 @@
 
 		// Setup Ratpouch
 		Hotspot *ratpouchHotspot = res.getActiveHotspot(RATPOUCH_ID);
+		assert(ratpouchHotspot);
 		ratpouchHotspot->setCharacterMode(CHARMODE_NONE);
 		ratpouchHotspot->setDelayCtr(0);
 		ratpouchHotspot->setActions(0x821C00);
@@ -3106,14 +3183,214 @@
 	h.setFrameNumber(frameNumber);
 }
 
-void HotspotTickHandlers::sellerAnimHandler(Hotspot &h) {
+void HotspotTickHandlers::barmanAnimHandler(Hotspot &h) {
+	Resources &res = Resources::getReference();
+	Room &room = Room::getReference();
+	BarEntry &barEntry = res.barmanLists().getDetails(h.roomNumber());
+	Common::RandomSource rnd;
+	static bool ewanXOffset = false;
+
 	h.handleTalkDialog();
-	if (h.frameCtr() > 0) {
-		h.decrFrameCtr();
+	if (h.delayCtr() > 0) {
+		h.setDelayCtr(h.delayCtr() - 1);
 		return;
 	}
 	
-	// TODO: Decode remainder of sellers tick proc
+	if (h.frameCtr() == 0) {
+		// Barman not currently doing something
+		if (barEntry.currentCustomer != NULL) {
+			// A customer has been set to be served
+			Hotspot *servee = res.getActiveHotspot(barEntry.currentCustomer->hotspotId);
+			if (servee != NULL) {
+				// Check whether the character is still at the bar
+				if ((servee->y() + servee->heightCopy()) >= ((barEntry.gridLine << 3) + 24)) {
+					// Customer has left - nullify their entry
+					barEntry.currentCustomer->hotspotId = 0;
+					barEntry.currentCustomer->serveFlags = 0;
+					barEntry.currentCustomer = NULL;
+				}
+				else if (servee->hotspotId() != PLAYER_ID) {
+					// Any other NPC character, so serve them
+					barEntry.currentCustomer->serveFlags = 0;
+				} else {
+					// Servee is the player, flag to stop the barman until the player walks away
+					barEntry.currentCustomer->serveFlags &= 0x7f;
+
+					if ((barEntry.currentCustomer->serveFlags & 7) != 0) {
+						// Barman needs to do something
+						h.setFrameCtr(barEntry.currentCustomer->serveFlags);
+						barEntry.currentCustomer->serveFlags &= 0xf8;
+
+					} else if (!h.useHotspotId() == 0) {
+						// Player is not currently talking
+						// Clear entry from list
+						barEntry.currentCustomer->hotspotId = 0;
+						barEntry.currentCustomer->serveFlags = 0;
+						barEntry.currentCustomer = NULL;
+						// Set the barman to polish the bar
+						h.setFrameCtr(2);
+					}
+				}
+				
+				return;
+			}
+		}
+
+		// Check for any customer waiting to be served
+		for (int index = 0; index < NUM_SERVE_CUSTOMERS; ++index) {
+			if ((barEntry.customers[index].serveFlags & 0x80) != 0) {
+				// Found one to serve
+				barEntry.customers[index].serveFlags = 0;
+				barEntry.currentCustomer = &barEntry.customers[index];
+				Hotspot *hotspot = res.getActiveHotspot(barEntry.customers[index].hotspotId);
+				assert(hotspot);
+//DEBUG/TODO: Reaching here too early, so servee's x can be outside the bar range
+				h.setSupportValue(hotspot->x());    // Save the position to move to
+				h.setFrameCtr(0x80);				// Flag for movement
+				return;
+			}
+		}
+
+		// At this point, no customers need servering. Empty the table
+		barEntry.currentCustomer = NULL;
+		for (int index = 0; index < NUM_SERVE_CUSTOMERS; ++index) {
+			barEntry.customers[index].hotspotId = 0;
+			barEntry.customers[index].serveFlags = 0;
+		}
+
+		// Choose a random action for the barman to do - walk around, polish the bar, or wait
+		h.setFrameCtr(rnd.getRandomNumber(2) + 1);
+	}
+
+	// At this point the barman is known to be doing something
+
+	if ((h.frameCtr() & 0x80) != 0)	{
+		// Bit 7 being set indicates the barman is moving to a destination
+		int16 xDiff = h.x() - h.supportValue();
+		if (ABS(xDiff) >= 2) {
+			// Keep the barman moving
+			if (xDiff > 0) {
+				// Moving left
+				h.setPosition(h.x() - 2, h.y());
+				h.setActionCtr(h.actionCtr() + 1);
+				if ((h.actionCtr() >= 12) || (h.actionCtr() < 6))
+					h.setActionCtr(6);
+			} else {
+				// Moving right
+				h.setPosition(h.x() + 2, h.y());
+				h.setActionCtr(h.actionCtr() + 1);
+				if (h.actionCtr() >= 6) h.setActionCtr(0);
+			}
+		} else {
+			// Stop the barman moving
+			h.setActionCtr(12);
+			h.setFrameCtr(h.frameCtr() & 0x7f);
+		}
+
+		h.setFrameNumber(h.actionCtr());
+		return;
+	}
+
+	// All other actions
+	uint16 xp, id;
+	uint16 *frameList;
+	uint16 frameNumber;
+
+	BarmanAction action = (BarmanAction) (h.frameCtr() & 0x3F);
+	switch (action) {
+	case WALK_AROUND:
+		// Wander around between the ends of the bar
+		if (h.hotspotId() == EWAN_ID)
+			xp = rnd.getRandomNumber(51) + 94;
+		else
+			xp = rnd.getRandomNumber(85) + 117;  
+
+		h.setSupportValue(xp);
+		h.setFrameCtr(0x83);
+		return;
+
+	case POLISH_BAR:
+	case SERVE_BEER:
+		if (action == SERVE_BEER) {
+			// Serving a beer
+			if ((h.frameCtr() & 0x40) == 0)
+				h.setSupportValue(h.resource()->flags2);
+
+		} else {
+			// Polishing the bar
+			if ((h.frameCtr() & 0x40) == 0) {
+				// New polish beginning
+				id = BG_RANDOM << 8;
+
+				if (h.hotspotId() == EWAN_ID) {
+					HotspotData *player = res.getHotspot(PLAYER_ID);
+					HotspotData *gwyn = res.getHotspot(GOEWIN_ID);
+					HotspotData *wayne = res.getHotspot(WAYNE_ID);
+
+					if ((player->roomNumber != 35) && (gwyn->roomNumber != 35) && (wayne->roomNumber != 35))
+					{
+						if (rnd.getRandomNumber(1) == 1)
+							id = BG_EXTRA1 << 8;
+						else
+						{
+							// Set up alternate animation
+							h.setWidth(32);
+							h.setAnimation(EWAN_ALT_ANIM_ID);
+							ewanXOffset = true;
+							h.setPosition(h.x() - 8, h.y());
+							id = BG_EXTRA2 << 8;
+						}
+					}
+				}
+
+				h.setSupportValue(id);
+			}
+		}
+
+		// At this point, either a polish or a beer serve is in progress
+		h.setFrameCtr(h.frameCtr() | 0x40);
+		h.setSupportValue(h.supportValue() + 1);  // Move to next frame
+		frameList = barEntry.graphics[h.supportValue() >> 8];
+		frameNumber = frameList[h.supportValue() & 0xff];
+
+		if (frameNumber != 0)
+		{
+			h.setActionCtr(frameNumber);
+			h.setFrameNumber(frameNumber);
+			return;
+		}
+
+		if (h.hotspotId() == EWAN_ID)
+		{
+			// Make sure Ewan is back to his standard animation
+			h.setWidth(16);
+			h.setAnimation(EWAN_ANIM_ID);
+			
+			if (ewanXOffset) {
+				h.setPosition(h.x() + 8, h.y());
+				ewanXOffset = false;
+			}
+		}
+		break;
+
+	case WAIT_DIALOG:
+		if (room.isDialogActive()) {
+			h.setFrameNumber(h.actionCtr());
+			return;
+		}
+		break;
+
+	case WAIT:
+		// Immediate break, since the code outside the switch handles stopping the barman
+		break;
+	}
+
+	// If this point is reached, then the barman should stop whatever he's doing
+	if (action != WAIT_DIALOG)
+		h.setDelayCtr(10);
+	h.setFrameCtr(0);
+	h.setActionCtr(12);
+	h.setFrameNumber(h.actionCtr());
 }
 
 void HotspotTickHandlers::skorlGaurdAnimHandler(Hotspot &h) {

Modified: scummvm/trunk/engines/lure/hotspots.h
===================================================================
--- scummvm/trunk/engines/lure/hotspots.h	2007-04-14 03:46:30 UTC (rev 26463)
+++ scummvm/trunk/engines/lure/hotspots.h	2007-04-14 03:48:24 UTC (rev 26464)
@@ -74,7 +74,7 @@
 	static void morkusAnimHandler(Hotspot &h);
 	static void talkAnimHandler(Hotspot &h);
 	static void headAnimHandler(Hotspot &h);
-	static void sellerAnimHandler(Hotspot &h);
+	static void barmanAnimHandler(Hotspot &h);
 	static void skorlGaurdAnimHandler(Hotspot &h);
 	static void rackSerfAnimHandler(Hotspot &h);
 
@@ -220,6 +220,8 @@
 
 enum HotspotPrecheckResult {PC_EXECUTE, PC_NOT_IN_ROOM, PC_UNKNOWN, PC_INITIAL, PC_EXCESS};
 
+enum BarPlaceResult {BP_KEEP_TRYING, BP_GOT_THERE, BP_FAIL};
+
 #define MAX_NUM_FRAMES 16
 
 class Hotspot {
@@ -265,6 +267,7 @@
 	uint8 _exitCtr;
 	bool _walkFlag;
 	uint16 _startRoomNumber;
+	uint16 _supportValue; 
 	
 	// Support methods
 	uint16 getTalkId(HotspotData *charHotspot);
@@ -273,6 +276,8 @@
 
 	// Action support methods
 	HotspotPrecheckResult actionPrecheck(HotspotData *hotspot);
+	BarPlaceResult getBarPlace();
+	bool findClearBarPlace();
 	bool characterWalkingCheck(HotspotData *hotspot);
 	bool doorCloseCheck(uint16 doorId);
 	void resetDirection();
@@ -388,6 +393,13 @@
 	void setWalkFlag(bool value) { _walkFlag = value; }
 	void setStartRoomNumber(uint16 value) { _startRoomNumber = value; }
 	void setSize(uint16 newWidth, uint16 newHeight);
+	void setWidth(uint16 newWidth) {
+		_width = newWidth;
+		_frameWidth = newWidth;
+	}
+	void setHeight(uint16 newHeight) { 
+		_height = newHeight;
+	}
 	void setScript(uint16 offset) {
 		assert(_data != NULL);
 		_sequenceOffset = offset;
@@ -449,6 +461,8 @@
 		assert(_data);
 		_data->v2b = value;
 	}
+	uint16 supportValue() { return _supportValue; }
+	void setSupportValue(uint16 value) { _supportValue = value; }
 
 	void copyTo(Surface *dest);
 	bool executeScript();

Modified: scummvm/trunk/engines/lure/luredefs.h
===================================================================
--- scummvm/trunk/engines/lure/luredefs.h	2007-04-14 03:46:30 UTC (rev 26463)
+++ scummvm/trunk/engines/lure/luredefs.h	2007-04-14 03:48:24 UTC (rev 26464)
@@ -31,7 +31,7 @@
 
 #define SUPPORT_FILENAME "lure.dat"
 #define LURE_DAT_MAJOR 1
-#define LURE_DAT_MINOR 16
+#define LURE_DAT_MINOR 17
 
 #define LURE_DEBUG 1
 
@@ -229,7 +229,11 @@
 #define FIRST_NONCHARACTER_ID 0x408
 #define SACK_ID 0x40D
 #define PRISONER_ID 0x412
+#define SID_ID 0x420
 #define TRANSFORM_ID 0x425
+#define NELLIE_ID 0x429
+#define EWAN_ID 0x436
+#define WAYNE_ID 0x3f1
 #define START_EXIT_ID 0x2710
 #define BOTTLE_HOTSPOT_ID 0x2710
 #define BRICKS_ID 0x2714
@@ -257,6 +261,8 @@
 #define SERF_ANIM_ID 0x58A0
 #define BLACKSMITH_STANDARD 0x8a12
 #define BLACKSMITH_HAMMERING_ANIM_ID 0x9c11
+#define EWAN_ANIM_ID 0x59E4
+#define EWAN_ALT_ANIM_ID 0x59ED
 
 #define CONVERSE_COUNTDOWN_SIZE 40
 #define IDLE_COUNTDOWN_SIZE 15

Modified: scummvm/trunk/engines/lure/res.cpp
===================================================================
--- scummvm/trunk/engines/lure/res.cpp	2007-04-14 03:46:30 UTC (rev 26463)
+++ scummvm/trunk/engines/lure/res.cpp	2007-04-14 03:48:24 UTC (rev 26464)
@@ -641,6 +641,7 @@
 	_activeHotspots.saveToStream(stream);
 	_fieldList.saveToStream(stream);
 	_randomActions.saveToStream(stream);
+	_barmanLists.saveToStream(stream);
 }
 
 void Resources::loadFromStream(Common::ReadStream *stream) {
@@ -652,6 +653,8 @@
 	_fieldList.loadFromStream(stream);
 	debugC(ERROR_DETAILED, kLureDebugScripts, "Loading random actions");
 	_randomActions.loadFromStream(stream);
+	debugC(ERROR_DETAILED, kLureDebugScripts, "Loading barman lists");
+	_barmanLists.loadFromStream(stream);
 	debugC(ERROR_DETAILED, kLureDebugScripts, "Finished loading");
 }
 

Modified: scummvm/trunk/engines/lure/res.h
===================================================================
--- scummvm/trunk/engines/lure/res.h	2007-04-14 03:46:30 UTC (rev 26463)
+++ scummvm/trunk/engines/lure/res.h	2007-04-14 03:48:24 UTC (rev 26464)
@@ -71,6 +71,7 @@
 	RandomActionList _randomActions;
 	RoomExitIndexedHotspotList _indexedRoomExitHospots;
 	PausedCharacterList _pausedList;
+	BarmanLists _barmanLists;
 	StringList _stringList;
 
 	int numCharOffsets;
@@ -126,6 +127,7 @@
 	RandomActionList &randomActions() { return _randomActions; }
 	RoomExitIndexedHotspotList &exitHotspots() { return _indexedRoomExitHospots; }
 	PausedCharacterList &pausedList() { return _pausedList; }
+	BarmanLists &barmanLists() { return _barmanLists; }
 	StringList &stringList() { return _stringList; }
 	uint16 getCharOffset(int index) { 
 		if (index >= numCharOffsets) 

Modified: scummvm/trunk/engines/lure/res_struct.cpp
===================================================================
--- scummvm/trunk/engines/lure/res_struct.cpp	2007-04-14 03:46:30 UTC (rev 26463)
+++ scummvm/trunk/engines/lure/res_struct.cpp	2007-04-14 03:48:24 UTC (rev 26464)
@@ -35,6 +35,38 @@
 	1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 0, 1,
 	0, 1, 1, 1, 1, 0, 0, 2, 1, 1, 0, 0, 1, 1, 2, 2, 5, 2, 2, 1};
 
+// Barman related frame lists
+
+uint16 basicPolish[] = {8+13,8+14,8+15,8+16,8+17,8+18,8+17,8+16,8+15,8+14,
+	8+15,8+16,8+17,8+18,8+17,8+16,8+15,8+14,8+13,0};
+
+uint16 sidsFetch[] = {12+1,12+2,12+3,12+4,12+5,12+6,12+5,12+6,12+5,12+4,12+3,12+7,12+8,0};
+
+uint16 nelliesScratch[] = {11+1,11+2,11+3,11+4,11+5,11+4,11+5,11+4,11+5,11+4,11+3,11+2,11+1,0};
+
+uint16 nelliesFetch[] = {1,2,3,4,5,4,5,4,3,2,6,7,0};
+
+uint16 ewansFetch[] = {13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,0};
+
+uint16 ewanExtraGraphic1[]= {
+	28,29,30,31,32,33,34,35,36,37,
+	38,39,40,41,42,43,44,45,46,47,
+	48,
+	40,39,38,37,36,35,34,33,32,31,30,29,28,
+	0};
+
+uint16 ewanExtraGraphic2[] = {
+	1,2,3,4,5,6,7,8,9,
+	10,11,12,13,14,15,16,17,18,19,
+	20,21,22,23,24,0};
+
+BarEntry barList[3] = {
+	{29, SID_ID, {{0, 0}, {0, 0}, {0, 0}, {0, 0}}, {&basicPolish[0], &sidsFetch[0], NULL, NULL}, 13, NULL},
+	{32, NELLIE_ID, {{0, 0}, {0, 0}, {0, 0}, {0, 0}}, {&nelliesScratch[0], &nelliesFetch[0], NULL, NULL}, 14, NULL},
+	{35, EWAN_ID, {{0, 0}, {0, 0}, {0, 0}, {0, 0}}, {&ewansFetch[0], &ewansFetch[0], 
+		&ewanExtraGraphic1[0], &ewanExtraGraphic2[0]}, 16, NULL}
+};
+
 // Room data holding class
 
 RoomData::RoomData(RoomResource *rec, MemoryBlock *pathData) { 
@@ -971,6 +1003,45 @@
 	return result;
 }
 
+// Wrapper class for the barman lists
+
+BarEntry &BarmanLists::getDetails(uint16 roomNumber)
+{
+	for (int index = 0; index < 3; ++index)
+		if (barList[index].roomNumber == roomNumber)
+			return barList[index];
+	error("Invalid room %d specified for barman details retrieval", roomNumber);
+}
+
+void BarmanLists::saveToStream(Common::WriteStream *stream)
+{
+	for (int index = 0; index < 2; ++index)
+	{
+		uint16 value = (barList[index].currentCustomer - &barList[index].customers[0]) / sizeof(BarEntry);
+		stream->writeUint16LE(value);
+		for (int ctr = 0; ctr < NUM_SERVE_CUSTOMERS; ++ctr)
+		{
+			stream->writeUint16LE(barList[index].customers[ctr].hotspotId);
+			stream->writeByte(barList[index].customers[ctr].serveFlags);
+		}
+	}
+}
+
+void BarmanLists::loadFromStream(Common::ReadStream *stream)
+{
+	for (int index = 0; index < 2; ++index)
+	{
+		int16 value = stream->readUint16LE();
+		barList[index].currentCustomer = (value == 0) ? NULL : &barList[index].customers[value];
+
+		for (int ctr = 0; ctr < NUM_SERVE_CUSTOMERS; ++ctr)
+		{
+			barList[index].customers[ctr].hotspotId = stream->readUint16LE();
+			barList[index].customers[ctr].serveFlags = stream->readByte();
+		}
+	}
+}
+
 // String list resource class
 
 void StringList::load(MemoryBlock *data) {

Modified: scummvm/trunk/engines/lure/res_struct.h
===================================================================
--- scummvm/trunk/engines/lure/res_struct.h	2007-04-14 03:46:30 UTC (rev 26463)
+++ scummvm/trunk/engines/lure/res_struct.h	2007-04-14 03:48:24 UTC (rev 26464)
@@ -691,6 +691,33 @@
 	int check(uint16 charId, int numImpinging, uint16 *impingingList);
 };
 
+struct ServeEntry {
+	uint16 hotspotId;
+	uint8 serveFlags;
+};
+
+#define NUM_SERVE_CUSTOMERS 4
+
+enum BarmanGraphicType {BG_RANDOM = 0, BG_BEER = 1, BG_EXTRA1 = 2, BG_EXTRA2 = 3};
+
+struct BarEntry {
+	uint16 roomNumber;
+	uint16 barmanId;
+	ServeEntry customers[NUM_SERVE_CUSTOMERS];
+	uint16 *graphics[4];
+	uint16 gridLine;
+	ServeEntry *currentCustomer;
+};
+
+class BarmanLists {
+public:
+	BarEntry &getDetails(uint16 roomNumber);
+	void saveToStream(Common::WriteStream *stream);
+	void loadFromStream(Common::ReadStream *stream);
+};
+
+enum BarmanAction {WALK_AROUND = 1, POLISH_BAR = 2, WAIT = 3, WAIT_DIALOG = 4, SERVE_BEER = 5};
+
 enum StringEnum {S_CREDITS = 25, S_RESTART_GAME = 26, S_SAVE_GAME = 27, S_RESTORE_GAME = 28, 
 	S_QUIT = 29, S_FAST_TEXT = 30, S_SLOW_TEXT = 31, S_SOUND_ON = 32, S_SOUND_OFF = 33, 
 	S_NOTHING = 34, S_FOR = 35, S_TO = 36, S_ON = 37, S_AND_THEN = 38,

Modified: scummvm/trunk/engines/lure/room.h
===================================================================
--- scummvm/trunk/engines/lure/room.h	2007-04-14 03:46:30 UTC (rev 26463)
+++ scummvm/trunk/engines/lure/room.h	2007-04-14 03:48:24 UTC (rev 26464)
@@ -106,6 +106,7 @@
 	void setShowInfo(bool value) { _showInfo = value; }
 	void setTalkDialog(uint16 srcCharacterId, uint16 destCharacterId, uint16 usedId, uint16 stringId);
 	void setCursorState(CursorState state) { _cursorState = state; }
+	bool isDialogActive() { return _talkDialog != NULL; }
 	bool checkInTalkDialog();
 	char *statusLine() { return _statusLine; }
 	void saveToStream(Common::WriteStream *stream);


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