[Scummvm-cvs-logs] CVS: scummvm/queen bankman.cpp,1.2,1.3 bankman.h,1.2,1.3 command.cpp,1.57,1.58 cutaway.cpp,1.111,1.112 graphics.cpp,1.80,1.81 graphics.h,1.60,1.61 logic.cpp,1.168,1.169 logic.h,1.110,1.111 queen.cpp,1.72,1.73 structs.h,1.32,1.33

Gregory Montoir cyx at users.sourceforge.net
Sun Jan 11 06:13:00 CET 2004


Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1:/tmp/cvs-serv11437/queen

Modified Files:
	bankman.cpp bankman.h command.cpp cutaway.cpp graphics.cpp 
	graphics.h logic.cpp logic.h queen.cpp structs.h 
Log Message:
cleanup

Index: bankman.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/bankman.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- bankman.cpp	9 Jan 2004 13:36:37 -0000	1.2
+++ bankman.cpp	11 Jan 2004 14:11:36 -0000	1.3
@@ -26,14 +26,12 @@
 
 namespace Queen {
 
-
 BankManager::BankManager(Resource *res) 
 	: _res(res) {
 	memset(_frames, 0, sizeof(_frames));
 	memset(_banks, 0, sizeof(_banks));
 }
 
-
 BankManager::~BankManager() {
 	for(uint32 i = 0; i < MAX_BANKS_NUMBER; ++i) {
 		close(i);
@@ -41,20 +39,15 @@
 	eraseFrames(true);
 }
 
-
 void BankManager::load(const char *bankname, uint32 bankslot) {
 	close(bankslot);
 
 	_banks[bankslot].data = _res->loadFile(bankname);
-	if (!_banks[bankslot].data) {
-		error("Unable to open bank '%s'", bankname);	
-	}
 
 	int16 entries = (int16)READ_LE_UINT16(_banks[bankslot].data);
 	if (entries < 0 || entries >= MAX_BANK_SIZE) {
 		error("Maximum bank size exceeded or negative bank size : %d", entries);
 	}
-
 	debug(9, "BankManager::load(%s, %d) - entries = %d", bankname, bankslot, entries); 
 
 	uint32 offset = 2;
@@ -68,11 +61,9 @@
 	}
 }
 
-
 void BankManager::unpack(uint32 srcframe, uint32 dstframe, uint32 bankslot) {
 	debug(9, "BankManager::unpack(%d, %d, %d)", srcframe, dstframe, bankslot);
-	if (!_banks[bankslot].data)
-		error("BankManager::unpack() _banks[bankslot].data is NULL!");
+	assert(_banks[bankslot].data != NULL);
 		
 	BobFrame *pbf = &_frames[dstframe];
 	uint8 *p = _banks[bankslot].data + _banks[bankslot].indexes[srcframe];
@@ -87,11 +78,9 @@
 	memcpy(pbf->data, p + 8, size);
 }
 
-
 void BankManager::overpack(uint32 srcframe, uint32 dstframe, uint32 bankslot) {
 	debug(9, "BankManager::overpack(%d, %d, %d)", srcframe, dstframe, bankslot);
-	if (!_banks[bankslot].data)
-		error("BankManager::overpack() _banks[bankslot].data is NULL!");
+	assert(_banks[bankslot].data != NULL);
 
 	uint8 *p = _banks[bankslot].data + _banks[bankslot].indexes[srcframe];
 	uint16 src_w = READ_LE_UINT16(p + 0);
@@ -106,14 +95,12 @@
 	}
 }
 
-
 void BankManager::close(uint32 bankslot) {
 	debug(9, "BankManager::close(%d)", bankslot);
 	delete[] _banks[bankslot].data;
 	memset(&_banks[bankslot], 0, sizeof(_banks[bankslot]));
 }
 
-
 BobFrame *BankManager::fetchFrame(uint32 index) {
 	debug(9, "BankManager::fetchFrame(%d)", index);
 	if (index >= MAX_FRAMES_NUMBER) {
@@ -122,7 +109,6 @@
 	return &_frames[index];
 }
 
-
 void BankManager::eraseFrame(uint32 index) {
 	debug(9, "BankManager::eraseFrame(%d)", index);
 	BobFrame *pbf = &_frames[index];
@@ -130,7 +116,6 @@
 	memset(pbf, 0, sizeof(BobFrame));
 }
 
-
 void BankManager::eraseFrames(bool joe) {
     uint32 i = 0;
 	if (!joe) {
@@ -141,6 +126,5 @@
 		++i;
 	}
 }
-
 
 } // End of namespace Queen

Index: bankman.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/bankman.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- bankman.h	9 Jan 2004 13:36:37 -0000	1.2
+++ bankman.h	11 Jan 2004 14:11:36 -0000	1.3
@@ -50,7 +50,6 @@
 		MAX_BANKS_NUMBER  =  18
 	};
 
-
 private:
 
 	struct PackedBank {

Index: command.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/command.cpp,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- command.cpp	10 Jan 2004 22:31:41 -0000	1.57
+++ command.cpp	11 Jan 2004 14:11:36 -0000	1.58
@@ -35,18 +35,15 @@
 
 namespace Queen {
 
-
 void CmdText::clear() {
 	memset(_command, 0, sizeof(_command));
 }
 
-
 void CmdText::display(uint8 color) {
 	_vm->display()->textCurrentColor(color);
 	_vm->display()->setTextCentered(COMMAND_Y_POS, _command, false);
 }
 
-
 void CmdText::displayTemp(uint8 color, bool locked, Verb v, const char *name) {
 	char temp[MAX_COMMAND_LEN];
 	if (locked) {
@@ -62,7 +59,6 @@
 	_vm->display()->setTextCentered(COMMAND_Y_POS, temp, false);
 }
 
-
 void CmdText::displayTemp(uint8 color, const char *name) {
 	char temp[MAX_COMMAND_LEN];
 	sprintf(temp, "%s %s", _command, name);
@@ -70,29 +66,24 @@
 	_vm->display()->setTextCentered(COMMAND_Y_POS, temp, false);
 }
 
-
 void CmdText::setVerb(Verb v) {
 	strcpy(_command, _vm->logic()->verbName(v));
 }
 
-
 void CmdText::addLinkWord(Verb v) {
 	strcat(_command, " ");
 	strcat(_command, _vm->logic()->verbName(v));
 }
 
-
 void CmdText::addObject(const char *objName) {
 	strcat(_command, " ");
 	strcat(_command, objName);
 }
 
-
 bool CmdText::isEmpty() const {
 	return _command[0] == 0;
 }
 
-
 void CmdState::init() {
 	commandLevel = 1;
 	oldVerb = verb = action = VERB_NONE;
@@ -102,14 +93,12 @@
 	selNoun = 0;
 }
 
-
 Command::Command(QueenEngine *vm)
 	: _vm(vm) {
 
 	_cmdText._vm = vm;
 }
 
-
 void Command::clear(bool clearTexts) {
 	_cmdText.clear();
 	if (clearTexts) {
@@ -119,14 +108,9 @@
 	_state.init();
 }
 
-
 void Command::executeCurrentAction() {
 	_vm->logic()->entryObj(0);
 
-//	if (_state.commandLevel == 2 && _mouseKey == Input::MOUSE_RBUTTON) {
-//		_mouseKey = Input::MOUSE_LBUTTON;
-//	}
-
 	if (_mouseKey == Input::MOUSE_RBUTTON && _state.subject[0] > 0) {
 
 		ObjectData *od = _vm->logic()->objectData(_state.subject[0]);
@@ -216,7 +200,6 @@
 	cleanupCurrentAction();
 }
 
-
 void Command::updatePlayer() {	
 	if (_vm->logic()->joeWalk() != JWM_MOVE) {
 		int16 cx = _vm->input()->mousePosX();
@@ -255,15 +238,18 @@
 	}
 }
 
-
 void Command::readCommandsFrom(byte *&ptr) {
 	uint16 i;
 
 	_numCmdList = READ_BE_UINT16(ptr); ptr += 2;
 	_cmdList = new CmdListData[_numCmdList + 1];
-	memset(&_cmdList[0], 0, sizeof(CmdListData));
-	for (i = 1; i <= _numCmdList; i++) {
-		_cmdList[i].readFromBE(ptr);
+	if (_numCmdList == 0) {
+		_cmdList[0].readFromBE(ptr);
+	} else {
+		memset(&_cmdList[0], 0, sizeof(CmdListData));
+		for (i = 1; i <= _numCmdList; i++) {
+			_cmdList[i].readFromBE(ptr);
+		}
 	}
 	
 	_numCmdArea = READ_BE_UINT16(ptr); ptr += 2;
@@ -311,7 +297,6 @@
 	}
 }
 
-
 ObjectData *Command::findObjectData(uint16 objRoomNum) const {
 	ObjectData *od = NULL;
 	if (objRoomNum != 0) {
@@ -321,7 +306,6 @@
 	return od;
 }
 
-
 ItemData *Command::findItemData(Verb invNum) const {
 	ItemData *id = NULL;
 	uint16 itNum = _vm->logic()->findInventoryItem(invNum - VERB_INV_FIRST);
@@ -331,7 +315,6 @@
 	return id;
 }
 
-
 int16 Command::executeCommand(uint16 comId, int16 condResult) {
 	// execute.c l.313-452
 	debug(6, "Command::executeCommand() - cond = %X, com = %X", condResult, comId);
@@ -355,9 +338,6 @@
 
 	bool cutDone = false;
 	if (condResult > 0) {
-		// as we don't handle the pinnacle room exactly like the original, 
-		// the hack described on l.334-339 in execute.c became useless
-
 		// check for cutaway/dialogs before updating Objects
 		const char *desc = _vm->logic()->objectTextualDescription(condResult);
 		if (executeIfCutaway(desc)) {
@@ -454,7 +434,6 @@
 	return condResult;
 }
 
-
 int16 Command::makeJoeWalkTo(int16 x, int16 y, int16 objNum, Verb v, bool mustWalk) {
 	// Check to see if object is actually an exit to another
 	// room. If so, then set up new room
@@ -502,7 +481,6 @@
 	return p;
 }
 
-
 void Command::grabCurrentSelection() {
 	_selPosX = _vm->input()->mousePosX();
 	_selPosY = _vm->input()->mousePosY();
@@ -530,7 +508,6 @@
 	}
 }
 
-
 void Command::grabSelectedObject(int16 objNum, uint16 objState, uint16 objName) {
 	if (_state.action != VERB_NONE) {
 		_cmdText.addObject(_vm->logic()->objectName(objName));
@@ -570,7 +547,6 @@
 	}
 }
 
-
 void Command::grabSelectedItem() {
 //	_parse = true;
 
@@ -644,7 +620,6 @@
 	grabSelectedObject(-item, id->state, id->name);
 }
 
-
 void Command::grabSelectedNoun() {
 	// if the NOUN has been selected from screen then it is positive
 	// otherwise it has been selected from inventory and is negative
@@ -707,7 +682,6 @@
 	grabSelectedObject(objNum, od->state, od->name);
 }
 
-
 void Command::grabSelectedVerb() {
 	_state.action = _state.verb;
 	_state.subject[0] = 0;
@@ -731,7 +705,6 @@
 	}
 }
 
-
 bool Command::executeIfCutaway(const char *description) {
 	if (strlen(description) > 4 && 
 		scumm_stricmp(description + strlen(description) - 4, ".cut") == 0) {
@@ -749,7 +722,6 @@
 	return false;
 }
 
-
 bool Command::executeIfDialog(const char *description) {
 	if (strlen(description) > 4 && 
 		scumm_stricmp(description + strlen(description) - 4, ".dog") == 0) {
@@ -770,7 +742,6 @@
 	return false;
 }
 
-
 bool Command::handleWrongAction() {
 	// l.96-141 execute.c
 	uint16 objMax = _vm->grid()->objMax(_vm->logic()->currentRoom());
@@ -813,7 +784,6 @@
 	return false;
 }
 
-
 void Command::sayInvalidAction(Verb action, int16 subj1, int16 subj2) {
 	// l.158-272 execute.c
 	switch (action) {
@@ -895,13 +865,12 @@
 			}
 		}
 		break;
-
+		
 	default:
 		break;
 	}
 }
 
-
 void Command::changeObjectState(Verb action, int16 obj, int16 song, bool cutDone) {
 	// l.456-533 execute.c
 	ObjectData *objData = _vm->logic()->objectData(obj);
@@ -956,7 +925,6 @@
 	_state.oldVerb = VERB_NONE;
 }
 
-
 void Command::openOrCloseAssociatedObject(Verb action, int16 otherObj) {
 	CmdListData *cmdList = &_cmdList[1];
 	uint16 com = 0;
@@ -1010,7 +978,6 @@
 	}
 }
 
-
 int16 Command::setConditions(uint16 command, bool lastCmd) {
 	debug(9, "Command::setConditions(%d, %d)", command, lastCmd);
 	// Test conditions, if FAIL write &&  exit, Return -1
@@ -1066,7 +1033,6 @@
 	return ret;
 }
 
-
 void Command::setAreas(uint16 command) {
 	debug(9, "Command::setAreas(%d)", command);
 
@@ -1087,7 +1053,6 @@
 	}
 }
 
-
 void Command::setObjects(uint16 command) {
 	debug(9, "Command::setObjects(%d)", command);
 
@@ -1160,7 +1125,6 @@
 	}
 }
 
-
 void Command::setItems(uint16 command) {
 	debug(9, "Command::setItems(%d)", command);
 
@@ -1194,7 +1158,6 @@
 	}
 }
 
-
 uint16 Command::nextObjectDescription(ObjectDescription* objDesc, uint16 firstDesc) {
 	// l.69-103 select.c
 	uint16 i;
@@ -1233,7 +1196,6 @@
 	return objDesc->lastSeenNumber;
 }
 
-
 void Command::lookAtSelectedObject() {
 	uint16 desc;
 	if (_state.subject[0] < 0) {
@@ -1262,7 +1224,6 @@
 	_vm->logic()->joeFace();
 }
 
-
 void Command::lookForCurrentObject(int16 cx, int16 cy) {
 	uint16 obj = _vm->grid()->findObjectUnderCursor(cx, cy);
 	_state.noun = _vm->grid()->findObjectNumber(obj);
@@ -1271,23 +1232,6 @@
 		return;
 	}
 
-	// if pointing at an Area then exit
-	// if the AREA is linked to an object, then dont exit. Find
-	// the object its linked to &&  store in AOBJ
-
-//	if (_state.noun > _vm->logic()->currentRoomObjMax()) {
-//		if (_state.oldNoun != 0) {
-//			if (_state.defaultVerb != VERB_NONE) {
-//				_cmdText.displayTemp(INK_CMD_LOCK, true, _state.defaultVerb);
-//			}
-//			else if (_state.action != VERB_NONE) {
-//				_cmdText.display(INK_CMD_NORMAL);
-//			}
-//			_state.oldNoun = 0;
-//			return;
-//		}
-//	}
-
 	ObjectData *od = findObjectData(_state.noun);
 	if (od == NULL || od->name <= 0) {
 		_state.oldNoun = _state.noun;
@@ -1317,7 +1261,6 @@
 	_state.oldNoun = _state.noun;
 }
 
-
 void Command::lookForCurrentIcon(int16 cx, int16 cy) {
 	_state.verb = _vm->grid()->findVerbUnderCursor(cx, cy);
 	if (_state.oldVerb != _state.verb) {
@@ -1349,6 +1292,5 @@
 		_state.oldVerb = _state.verb;
 	}
 }
-
 
 } // End of namespace Queen

Index: cutaway.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/cutaway.cpp,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -d -r1.111 -r1.112
--- cutaway.cpp	10 Jan 2004 16:13:21 -0000	1.111
+++ cutaway.cpp	11 Jan 2004 14:11:36 -0000	1.112
@@ -401,9 +401,9 @@
 		comPanel = 1;
 	}
 
-	// FIXME: in the original engine, panel is hidden after displaying head. We do
-	// it before.
-	if(object.room == FAYE_HEAD || object.room == AZURA_HEAD || object.room == FRANK_HEAD) {
+	// FIXME - in the original engine, panel is hidden once the 'head room' is displayed, we
+	// do it before (ie before palette fading)
+	if (object.room == FAYE_HEAD || object.room == AZURA_HEAD || object.room == FRANK_HEAD) {
 		comPanel = 2;
 	}
 

Index: graphics.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/graphics.cpp,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- graphics.cpp	10 Jan 2004 22:31:41 -0000	1.80
+++ graphics.cpp	11 Jan 2004 14:11:36 -0000	1.81
@@ -32,14 +32,12 @@
 
 namespace Queen {
 
-
 void BobSlot::curPos(int16 xx, int16 yy) {
 	active = true;
 	x = xx;
 	y = yy;
 }
 
-
 void BobSlot::move(int16 dstx, int16 dsty, int16 spd) {
 	active = true;
 	moving = true;
@@ -78,7 +76,6 @@
 	moveOneStep();
 }
 
-
 void BobSlot::moveOneStep() {
 	if(xmajor) {
 		if(x == endx) {
@@ -107,7 +104,6 @@
 	}
 }
 
-
 void BobSlot::animOneStep() {
 	if (anim.string.buffer != NULL) {
 		--anim.speed;
@@ -142,7 +138,6 @@
 	}
 }
 
-
 void BobSlot::animString(const AnimFrame *animBuf) {
 	active = true;
 	animating = true;
@@ -152,7 +147,6 @@
 	anim.speed = animBuf->speed / 4;
 }
 
-
 void BobSlot::animNormal(uint16 firstFrame, uint16 lastFrame, uint16 spd, bool rebound, bool flip) {
 	active = true;
 	animating = true;
@@ -167,7 +161,6 @@
 	xflip = flip;
 }
 
-
 void BobSlot::clear() {
 	active = false;
 	xflip  = false;
@@ -190,12 +183,10 @@
 	_shrinkBuffer.data = new uint8[ BOB_SHRINK_BUF_SIZE ];
 }
 
-
 Graphics::~Graphics() {
 	delete[] _shrinkBuffer.data;
 }
 
-
 void Graphics::unpackControlBank() {
 	_vm->bankMan()->load("control.BBK",17);
 	_vm->bankMan()->unpack(1, 1, 17); // Mouse pointer
@@ -204,13 +195,11 @@
 	_vm->bankMan()->close(17);
 }
 
-
 void Graphics::setupMouseCursor() {
 	BobFrame *bf = _vm->bankMan()->fetchFrame(1);
 	_vm->display()->setMouseCursor(bf->data, bf->width, bf->height);
 }
 
-
 void Graphics::drawBob(const BobSlot *bs, int16 x, int16 y) {
 	debug(9, "Graphics::drawBob(%d, %d, %d)", bs->frameNum, x, y);
 
@@ -264,7 +253,6 @@
 	}
 }
 
-
 void Graphics::drawInventoryItem(uint32 frameNum, uint16 x, uint16 y) {
 	if (frameNum != 0) {
 		BobFrame *bf = _vm->bankMan()->fetchFrame(frameNum);
@@ -274,7 +262,6 @@
 	}
 }
 
-
 void Graphics::pasteBob(uint16 objNum, uint16 image) {
 	GraphicData *pgd = _vm->logic()->graphicData(objNum);
 	_vm->bankMan()->unpack(pgd->firstFrame, image, 15);
@@ -283,7 +270,6 @@
 	_vm->bankMan()->eraseFrame(image);
 }
 
-
 void Graphics::shrinkFrame(const BobFrame *bf, uint16 percentage) {
 	// computing new size, rounding to upper value
 	uint16 new_w = (bf->width  * percentage + 50) / 100;
@@ -328,7 +314,6 @@
 	}
 }
 
-
 void Graphics::clearBob(uint32 bobNum) {
 	BobSlot *pbs = bob(bobNum);
 	pbs->clear();
@@ -337,7 +322,6 @@
 	}
 }
 
-
 void Graphics::sortBobs() {
 	_sortedBobsCount = 0;
 
@@ -377,10 +361,8 @@
 			SWAP(_sortedBobs[index], _sortedBobs[smallest]);
 		}
 	}
-
 }
 
-
 void Graphics::drawBobs() {
 	int i;
 	for (i = 0; i < _sortedBobsCount; ++i) {
@@ -412,21 +394,18 @@
 	}
 }
 
-
 void Graphics::clearBobs() {
 	for(int32 i = 0; i < ARRAYSIZE(_bobs); ++i) {
 		clearBob(i);
 	}
 }
 
-
 void Graphics::stopBobs() {
 	for(int32 i = 0; i < ARRAYSIZE(_bobs); ++i) {
 		_bobs[i].moving = false;
 	}
 }
 
-
 BobSlot *Graphics::bob(int index) {
 	if (index < MAX_BOBS_NUMBER)
 		return _bobs + index;
@@ -436,7 +415,6 @@
 	}
 }
 
-
 void Graphics::setBobText(
 		BobSlot *pbs, 
 		const char *text, 
@@ -551,7 +529,6 @@
 	}
 }
 
-
 void Graphics::handleParallax(uint16 roomNum) {
 	int i;
 	uint16 screenScroll = _vm->display()->horizontalScroll();
@@ -619,7 +596,6 @@
 	}
 }
 
-
 void Graphics::setupNewRoom(const char *room, uint16 roomNum, int16 *furniture, uint16 furnitureCount) {
 	// reset sprites table (bounding box...)
 	clearBobs();
@@ -638,7 +614,6 @@
 	}
 }
 
-
 void Graphics::fillAnimBuffer(const char *anim, AnimFrame *af) {
 	while (true) {
 		sscanf(anim, "%3hu,%3hu", &af->frame, &af->speed);
@@ -649,7 +624,6 @@
 	}
 }
 
-
 uint16 Graphics::countAnimFrames(const char *anim) {
 	AnimFrame afbuf[30];
 	fillAnimBuffer(anim, afbuf);
@@ -671,7 +645,6 @@
 	return count;
 }
 
-
 void Graphics::setupObjectAnim(const GraphicData *gd, uint16 firstImage, uint16 bobNum, bool visible) {
 	int16 tempFrames[20];
 	memset(tempFrames, 0, sizeof(tempFrames));
@@ -747,7 +720,6 @@
 	}
 }
 
-
 uint16 Graphics::setupPersonAnim(const ActorData *ad, const char *anim, uint16 curImage) {
 	debug(9, "Graphics::setupPersonAnim(%s, %d)", anim, curImage);
 	_personFrames[ad->bobNum] = curImage + 1;
@@ -795,14 +767,12 @@
 	return curImage;
 }
 
-
 void Graphics::resetPersonAnim(uint16 bobNum) {
 	if (_newAnim[bobNum][0].frame != 0) {
 		bob(bobNum)->animString(_newAnim[bobNum]);
 	}
 }
 
-
 void Graphics::erasePersonAnim(uint16 bobNum) {
 	_newAnim[bobNum][0].frame = 0;
 	BobSlot *pbs = bob(bobNum);
@@ -810,14 +780,12 @@
 	pbs->anim.string.buffer = NULL;
 }
 
-
 void Graphics::eraseAllAnims() {
 	for (int i = 1; i <= 16; ++i) {
 		_newAnim[i][0].frame = 0;
 	}
 }
 
-
 uint16 Graphics::refreshObject(uint16 obj) {
 	debug(6, "Graphics::refreshObject(%X)", obj);
 	uint16 curImage = _numFrames;
@@ -903,7 +871,6 @@
 	return curImage;
 }
 
-
 void Graphics::setupRoomFurniture(int16 *furniture, uint16 furnitureCount) {
 	uint16 i;
 	uint16 curImage = 36 + FRAMES_JOE_XTRA;
@@ -974,7 +941,6 @@
 	}
 }
 
-
 void Graphics::setupRoomObjects() {
 	uint16 i;
 	// furniture frames are reserved in ::setupRoomFurniture(), we append objects 
@@ -1085,7 +1051,6 @@
 	}
 }
 
-
 uint16 Graphics::setupPerson(uint16 noun, uint16 curImage) {
 	if (noun == 0) {
 		warning("Trying to setup person 0");
@@ -1123,7 +1088,6 @@
 	return curImage;
 }
 
-
 uint16 Graphics::allocPerson(uint16 noun, uint16 curImage) {
 	Person p;
 	if (_vm->logic()->initPerson(noun, "", false, &p) && p.anim != NULL) {
@@ -1133,7 +1097,6 @@
 	return curImage;
 }
 
-
 void Graphics::update(uint16 room) {
 	sortBobs();
 	if (_cameraBob >= 0) {
@@ -1145,12 +1108,10 @@
 }
 
 
-
 BamScene::BamScene(QueenEngine *vm)
 	: _flag(F_STOP), _screenShaked(false), _fightData(_fight1Data), _vm(vm) {
 }
 
-
 void BamScene::playSfx() {
 	// FIXME - we don't play all sfx here. This is only necessary for
 	// the fight bam, where the number of 'sfx bam frames' is too much 
@@ -1163,7 +1124,6 @@
 	}
 }
 
-
 void BamScene::prepareAnimation() {
 	_obj1 = _vm->graphics()->bob(BOB_OBJ1);
 	_obj1->clear();
@@ -1181,7 +1141,6 @@
 	_lastSoundIndex = 0;
 }
 
-
 void BamScene::updateCarAnimation() {
 	if (_flag != F_STOP) {
 		const BamDataBlock *bdb = &_carData[_index];
@@ -1215,7 +1174,6 @@
 	}
 }
 
-
 void BamScene::updateFightAnimation() {
 	if (_flag != F_STOP) {
 		const BamDataBlock *bdb = &_fightData[_index];
@@ -1275,7 +1233,6 @@
 	}
 }
 
-
 const BamScene::BamDataBlock BamScene::_carData[] = {
 	{ { 310, 105, 1 }, { 314, 106, 17 }, { 366, 101,  1 },  0 },
 	{ { 303, 105, 1 }, { 307, 106, 17 }, { 214,   0, 10 },  0 },
@@ -1542,7 +1499,6 @@
 	{ {  75, 96,  1 }, { 187,  96, -23 }, { 183,  41, 47 },  0 },
 	{ {  75, 96,  1 }, { 187,  96, -23 }, { 183,  41, 47 }, 99 }
 };
-
 
 } // End of namespace Queen
 

Index: graphics.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/graphics.h,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- graphics.h	10 Jan 2004 16:23:34 -0000	1.60
+++ graphics.h	11 Jan 2004 14:11:36 -0000	1.61
@@ -138,7 +138,6 @@
 
 	void update(uint16 room);
 
-
 	enum {
 		MAX_BOBS_NUMBER     =  64,
 		MAX_STRING_LENGTH   = 255,
@@ -180,7 +179,6 @@
 
 	QueenEngine *_vm;
 };
-
 
 class BamScene {
 public:

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.cpp,v
retrieving revision 1.168
retrieving revision 1.169
diff -u -d -r1.168 -r1.169
--- logic.cpp	11 Jan 2004 01:36:00 -0000	1.168
+++ logic.cpp	11 Jan 2004 14:11:36 -0000	1.169
@@ -511,7 +511,7 @@
 	for (uint16 i = 1; i <= _numFurniture; ++i) {
 		if (_furnitureData[i].room == _currentRoom) {
 			++furnTot;
-			furn[furnTot] = _furnitureData[i].gameStateValue;
+			furn[furnTot] = _furnitureData[i].objNum;
 		}
 	}
 	_vm->graphics()->setupNewRoom(room, _currentRoom, furn, furnTot);
@@ -548,7 +548,7 @@
 
 ActorData *Logic::findActor(uint16 noun, const char *name) {
 	uint16 obj = currentRoomData() + noun;
-	int16 img = _objectData[obj].image;
+	int16 img = objectData(obj)->image;
 	if (img != -3 && img != -4) {
 		warning("Logic::findActor() - Object %d is not a person", obj);
 		return NULL;
@@ -573,10 +573,7 @@
 }
 
 
-bool Logic::initPerson(int16 noun, const char *actorName, bool loadBank, Person *pp) {
-	if (noun <= 0) {
-		warning("Logic::initPerson() - Invalid object number: %i", noun);
-	}
+bool Logic::initPerson(uint16 noun, const char *actorName, bool loadBank, Person *pp) {
 	ActorData *pad = findActor(noun, actorName);
 	if (pad != NULL) {
 		pp->actor = pad;
@@ -634,15 +631,13 @@
 
 ObjectData *Logic::setupJoeInRoom(bool autoPosition, uint16 scale) {
 	debug(9, "Logic::setupJoeInRoom(%d, %d) joe.x=%d joe.y=%d", autoPosition, scale, _joe.x, _joe.y);
-
-	uint16 oldx;
-	uint16 oldy;
 	WalkOffData *pwo = NULL;
 	ObjectData *pod = objectData(_entryObj);
 	if (pod == NULL) {
 		error("Logic::setupJoeInRoom() - No object data for obj %d", _entryObj);
 	}
 
+	uint16 oldx, oldy;
 	if (!autoPosition || joeX() != 0 || joeY() != 0) {
 		oldx = joeX();
 		oldy = joeY();

Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.h,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -d -r1.110 -r1.111
--- logic.h	9 Jan 2004 13:36:37 -0000	1.110
+++ logic.h	11 Jan 2004 14:11:36 -0000	1.111
@@ -146,7 +146,7 @@
 	void entryObj(int16 obj) { _entryObj = obj; }
 
 	ActorData *findActor(uint16 noun, const char *name = NULL);
-	bool initPerson(int16 noun, const char *actorName, bool loadBank, Person *pp);
+	bool initPerson(uint16 noun, const char *actorName, bool loadBank, Person *pp);
 	uint16 findPersonNumber(uint16 obj) const;
 
 	void loadJoeBanks(const char *animBank, const char *standBank);

Index: queen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/queen.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- queen.cpp	9 Jan 2004 13:36:37 -0000	1.72
+++ queen.cpp	11 Jan 2004 14:11:36 -0000	1.73
@@ -100,7 +100,6 @@
 	_system->init_size(GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT);
 }
 
-
 QueenEngine::~QueenEngine() {
 	_timer->removeTimerProc(&timerHandler);
 	delete _bam;
@@ -118,7 +117,6 @@
 	delete _walk;	
 }
 
-
 void QueenEngine::registerDefaultSettings() {
 	ConfMan.registerDefault("master_volume", 255);
 	ConfMan.registerDefault("music_mute", false);
@@ -128,7 +126,6 @@
 	ConfMan.registerDefault("subtitles", true);
 }
 
-
 void QueenEngine::checkOptionSettings() {
 	// check talkspeed value
 	if (_talkSpeed < 4) {
@@ -150,7 +147,6 @@
 	}
 }
 
-
 void QueenEngine::readOptionSettings() {
 	// XXX master_volume
 	_sound->musicToggle(!ConfMan.getBool("music_mute"));
@@ -161,7 +157,6 @@
 	checkOptionSettings();
 }
 
-
 void QueenEngine::writeOptionSettings() {
 	// XXX master_volume
 	ConfMan.set("music_mute", !_sound->musicOn());
@@ -172,7 +167,6 @@
 	ConfMan.flushToDisk();
 }
 
-
 void QueenEngine::update(bool checkPlayerInput) {
 	if (_debugger->isAttached()) {
 		_debugger->onFrame();
@@ -214,13 +208,8 @@
 
 void QueenEngine::errorString(const char *buf1, char *buf2) {
 	strcpy(buf2, buf1);
-	if (_debugger && !_debugger->isAttached()) {
-		_debugger->attach(buf2);
-		_debugger->onFrame();
-	}
 }
 
-
 void QueenEngine::go() {
 	initialise();
 
@@ -247,9 +236,6 @@
 				_logic->joeWalk(JWM_NORMAL);
 				_command->executeCurrentAction();
 			} else {
-//				if (_command->parse()) {
-//					_command->clear(true);
-//				}
 				_logic->joeWalk(JWM_NORMAL);
 				update(true);
 			}
@@ -257,7 +243,6 @@
 	}
 }
 
-
 void QueenEngine::initialise(void) {
 	_bam = new BamScene(this);
 	_resource = new Resource(_gameDataPath, _system->get_savefile_manager(), getSavePath());
@@ -287,11 +272,9 @@
 	_timer->installTimerProc(&timerHandler, 1000000 / 50, this); //call 50 times per second
 }
 
-
 void QueenEngine::timerHandler(void *ptr) {
 	((QueenEngine *)ptr)->gotTimerTick();
 }
-
 
 void QueenEngine::gotTimerTick() {
 	_display->handleTimer();

Index: structs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/structs.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- structs.h	8 Jan 2004 14:10:32 -0000	1.32
+++ structs.h	11 Jan 2004 14:11:36 -0000	1.33
@@ -511,12 +511,12 @@
 struct FurnitureData {
 	//! room in which the furniture are
 	int16 room;
-	//! type of furniture (stored in GAMESTATE) 
+	//! furniture object number
 	/*!
 		<table>
 			<tr>
-				<td>value</td>
-				<td>description</td>
+				<td>range</td>
+				<td>type</td>
 			</tr>
 			<tr>
 				<td>]0..5000]</td>
@@ -528,11 +528,11 @@
 			</tr>
 		</table>
 	*/
-	int16 gameStateValue;
+	int16 objNum;
 
 	void readFromBE(byte *&ptr) {
 		room = (int16)READ_BE_UINT16(ptr); ptr += 2;
-		gameStateValue = (int16)READ_BE_UINT16(ptr); ptr += 2;
+		objNum = (int16)READ_BE_UINT16(ptr); ptr += 2;
 	}
 };
 





More information about the Scummvm-git-logs mailing list