[Scummvm-cvs-logs] CVS: scummvm/queen bankman.cpp,1.1,1.2 bankman.h,1.1,1.2 command.cpp,1.54,1.55 credits.cpp,1.2,1.3 cutaway.cpp,1.107,1.108 debug.cpp,1.10,1.11 display.cpp,1.48,1.49 display.h,1.35,1.36 graphics.cpp,1.76,1.77 graphics.h,1.58,1.59 grid.cpp,1.1,1.2 grid.h,1.1,1.2 journal.cpp,1.21,1.22 logic.cpp,1.166,1.167 logic.h,1.109,1.110 queen.cpp,1.71,1.72 talk.cpp,1.73,1.74 xref.txt,1.60,1.61

Gregory Montoir cyx at users.sourceforge.net
Fri Jan 9 05:37:02 CET 2004


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

Modified Files:
	bankman.cpp bankman.h command.cpp credits.cpp cutaway.cpp 
	debug.cpp display.cpp display.h graphics.cpp graphics.h 
	grid.cpp grid.h journal.cpp logic.cpp logic.h queen.cpp 
	talk.cpp xref.txt 
Log Message:
renamed some methods and moved some code to Display

Index: bankman.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/bankman.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- bankman.cpp	8 Jan 2004 14:10:32 -0000	1.1
+++ bankman.cpp	9 Jan 2004 13:36:37 -0000	1.2
@@ -38,7 +38,7 @@
 	for(uint32 i = 0; i < MAX_BANKS_NUMBER; ++i) {
 		close(i);
 	}
-	eraseAllFrames(true);
+	eraseFrames(true);
 }
 
 
@@ -131,7 +131,7 @@
 }
 
 
-void BankManager::eraseAllFrames(bool joe) {
+void BankManager::eraseFrames(bool joe) {
     uint32 i = 0;
 	if (!joe) {
 		i = FRAMES_JOE + FRAMES_JOE_XTRA;

Index: bankman.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/bankman.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- bankman.h	8 Jan 2004 14:10:32 -0000	1.1
+++ bankman.h	9 Jan 2004 13:36:37 -0000	1.2
@@ -42,7 +42,7 @@
 
 	BobFrame *fetchFrame(uint32 index);
 	void eraseFrame(uint32 index);
-	void eraseAllFrames(bool joe);
+	void eraseFrames(bool joe);
 
 	enum {
 		MAX_BANK_SIZE     = 110,

Index: command.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/command.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- command.cpp	8 Jan 2004 22:46:42 -0000	1.54
+++ command.cpp	9 Jan 2004 13:36:37 -0000	1.55
@@ -42,8 +42,8 @@
 
 
 void CmdText::display(uint8 color) {
-	_vm->graphics()->textCurrentColor(color);
-	_vm->graphics()->textSetCentered(COMMAND_Y_POS, _command, false);
+	_vm->display()->textCurrentColor(color);
+	_vm->display()->setTextCentered(COMMAND_Y_POS, _command, false);
 }
 
 
@@ -58,16 +58,16 @@
 		strcat(temp, " ");
 		strcat(temp, name);
 	}
-	_vm->graphics()->textCurrentColor(color);
-	_vm->graphics()->textSetCentered(COMMAND_Y_POS, temp, false);
+	_vm->display()->textCurrentColor(color);
+	_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);
-	_vm->graphics()->textCurrentColor(color);
-	_vm->graphics()->textSetCentered(COMMAND_Y_POS, temp, false);
+	_vm->display()->textCurrentColor(color);
+	_vm->display()->setTextCentered(COMMAND_Y_POS, temp, false);
 }
 
 
@@ -113,7 +113,7 @@
 void Command::clear(bool clearTexts) {
 	_cmdText.clear();
 	if (clearTexts) {
-		_vm->graphics()->textClear(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
+		_vm->display()->clearTexts(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
 	}
 	_parse = false;
 	_state.init();
@@ -736,7 +736,7 @@
 	if (strlen(description) > 4 && 
 		scumm_stricmp(description + strlen(description) - 4, ".cut") == 0) {
 
-		_vm->graphics()->textClear(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
+		_vm->display()->clearTexts(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
 
 		char nextCutaway[20];
 		memset(nextCutaway, 0, sizeof(nextCutaway));
@@ -754,7 +754,7 @@
 	if (strlen(description) > 4 && 
 		scumm_stricmp(description + strlen(description) - 4, ".dog") == 0) {
 
-		_vm->graphics()->textClear(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
+		_vm->display()->clearTexts(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
 
 		char cutaway[20];
 		memset(cutaway, 0, sizeof(cutaway));
@@ -780,7 +780,7 @@
 	if ((_state.selAction == VERB_WALK_TO || _state.selAction == VERB_NONE) && 
 		(_state.selNoun > objMax || _state.selNoun == 0)) {
 		if (_state.selAction == VERB_NONE) {
-			_vm->graphics()->textClear(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
+			_vm->display()->clearTexts(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
 		}
 		_vm->walk()->moveJoe(0, _selPosX, _selPosY, false);
 		return true;
@@ -1136,7 +1136,7 @@
 					if (image1 != 0 && image2 == 0 && objData->room == _vm->logic()->currentRoom()) {
 						uint16 bobNum = _vm->logic()->findBob(dstObj);
 						if (bobNum != 0) {
-							_vm->graphics()->bobClear(bobNum);
+							_vm->graphics()->clearBob(bobNum);
 						}
 					}
 				}
@@ -1324,7 +1324,7 @@
 	ObjectData *od = findObjectData(_state.noun);
 	if (od == NULL || od->name <= 0) {
 		_state.oldNoun = _state.noun;
-		_vm->graphics()->textClear(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
+		_vm->display()->clearTexts(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
 		if (_state.defaultVerb != VERB_NONE) {
 			_cmdText.displayTemp(INK_CMD_LOCK, true, _state.defaultVerb);
 		} else if (_state.action != VERB_NONE) {
@@ -1358,7 +1358,7 @@
 		if (_state.action == VERB_NONE) {
 			_cmdText.clear();
 		}
-		_vm->graphics()->textClear(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
+		_vm->display()->clearTexts(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
 
 		if (isVerbInv(_state.verb)) {
 			ItemData *id = findItemData(_state.verb);

Index: credits.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/credits.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- credits.cpp	6 Jan 2004 12:45:29 -0000	1.2
+++ credits.cpp	9 Jan 2004 13:36:37 -0000	1.3
@@ -22,7 +22,7 @@
 #include "stdafx.h"
 #include "queen/credits.h"
 
-#include "queen/graphics.h"
+#include "queen/display.h"
 #include "queen/queen.h"
 #include "queen/resource.h"
 
@@ -35,14 +35,14 @@
 }
 
 Credits::~Credits() {
-	_vm->graphics()->textClear(0, 199);
+	_vm->display()->clearTexts(0, 199);
 	delete _credits;
 }
 
 void Credits::nextRoom() {
 	if (-1 == _pause) {
 		_pause = 0;
-		_vm->graphics()->textClear(0, 199);
+		_vm->display()->clearTexts(0, 199);
 	}
 }
 
@@ -53,7 +53,7 @@
 	if (_pause > 0) {
 		_pause--;
 		if (!_pause)
-			_vm->graphics()->textClear(0, 199);
+			_vm->display()->clearTexts(0, 199);
 		return;
 	}
 
@@ -102,8 +102,8 @@
 
 					for(i = 0; i < _count; i++)
 					{
-						_vm->graphics()->textCurrentColor(_list[i].color);
-						_vm->graphics()->textSet(_list[i].x, _list[i].y, _list[i].text);
+						_vm->display()->textCurrentColor(_list[i].color);
+						_vm->display()->setText(_list[i].x, _list[i].y, _list[i].text);
 					}
 
 					_count = 0;
@@ -137,12 +137,12 @@
 					_list[_count].x = (_zone % 3) * (320 / 3) + 8;
 					break;
 				case 1:
-					_list[_count].x = (_zone % 3) * (320 / 3) + 54 - _vm->graphics()->textWidth(line) / 2;
+					_list[_count].x = (_zone % 3) * (320 / 3) + 54 - _vm->display()->textWidth(line) / 2;
 					if (_list[_count].x < 8)
 						_list[_count].x = 8;
 					break;
 				case 2:
-					_list[_count].x = (_zone % 3) * (320 / 3) + 100 - _vm->graphics()->textWidth(line);
+					_list[_count].x = (_zone % 3) * (320 / 3) + 100 - _vm->display()->textWidth(line);
 					break;
 			}
 

Index: cutaway.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/cutaway.cpp,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -d -r1.107 -r1.108
--- cutaway.cpp	8 Jan 2004 22:46:42 -0000	1.107
+++ cutaway.cpp	9 Jan 2004 13:36:37 -0000	1.108
@@ -418,7 +418,7 @@
 			mode = RDM_FADE_JOE_XY;
 	}
 
-	_vm->logic()->roomDisplay(_vm->logic()->currentRoom(), mode, object.scale, comPanel, true);
+	_vm->logic()->displayRoom(_vm->logic()->currentRoom(), mode, object.scale, comPanel, true);
 
 	_currentImage = _vm->graphics()->numFrames();
 
@@ -1078,7 +1078,7 @@
 		_vm->logic()->joePos(joeX, joeY);
 		_vm->logic()->currentRoom(joeRoom);
 		_vm->logic()->oldRoom(_initialRoom);
-		_vm->logic()->roomDisplay(_vm->logic()->currentRoom(), RDM_FADE_JOE_XY, 0, _comPanel, true);
+		_vm->logic()->displayRoom(_vm->logic()->currentRoom(), RDM_FADE_JOE_XY, 0, _comPanel, true);
 	}
 
 	if (_vm->input()->cutawayQuit()) {
@@ -1088,7 +1088,7 @@
 		// Stop the credits from running
 		_vm->logic()->stopCredits();
 		
-		_vm->graphics()->bobStopAll();
+		_vm->graphics()->stopBobs();
 
 		for (i = 1; i <= _personFaceCount; i++) {
 			int index =  _personFace[i].index;
@@ -1124,7 +1124,7 @@
 
 					ObjectData *from = _vm->logic()->objectData(fromIndex);
 					if (object->image && !from->image && bobIndex && _vm->logic()->currentRoom() == object->room)
-						_vm->graphics()->bobClear(bobIndex);
+						_vm->graphics()->clearBob(bobIndex);
 				}
 
 				if (_vm->logic()->currentRoom() == room)
@@ -1155,7 +1155,7 @@
 					int objectFrame = _vm->logic()->findFrame(objectIndex);
 
 					if (objectFrame == 1000) {
-						_vm->graphics()->bobClear(bobIndex);
+						_vm->graphics()->clearBob(bobIndex);
 					}
 					else if (objectFrame) {
 						_vm->bankMan()->unpack(ABS(frame), objectFrame, bank);
@@ -1341,7 +1341,7 @@
 	int flags;
 
 	if (OBJECT_TYPE_TEXT_DISPLAY == type) {
-		x = _vm->graphics()->textCenterX(sentence);
+		x = _vm->display()->textCenterX(sentence);
 		flags = 2;
 	}
 	else {
@@ -1352,7 +1352,7 @@
 	BobSlot *bob = 
 		_vm->graphics()->bob( _vm->logic()->findBob(ABS(object.objectNumber)) );
 
-	_vm->graphics()->bobSetText(bob, sentence, x, object.bobStartY, object.specialMove, flags);
+	_vm->graphics()->setBobText(bob, sentence, x, object.bobStartY, object.specialMove, flags);
 
 	if (OBJECT_TYPE_TEXT_SPEAK == type || OBJECT_TYPE_TEXT_DISPLAY_AND_SPEAK == type) {
 		char voiceFileName[MAX_STRING_SIZE];
@@ -1378,7 +1378,7 @@
 		}
 	}
 
-	_vm->graphics()->textClear(0,198);
+	_vm->display()->clearTexts(0,198);
 	_vm->update();
 }
 		

Index: debug.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/debug.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- debug.cpp	6 Jan 2004 12:45:29 -0000	1.10
+++ debug.cpp	9 Jan 2004 13:36:37 -0000	1.11
@@ -60,7 +60,7 @@
 
 void Debugger::postEnter() {
 	// XXX un-mute all sounds
-	_vm->graphics()->bobSetupControl(); // re-init mouse cursor
+	_vm->graphics()->setupMouseCursor();
 }
 
 

Index: display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- display.cpp	8 Jan 2004 16:41:03 -0000	1.48
+++ display.cpp	9 Jan 2004 13:36:37 -0000	1.49
@@ -591,6 +591,7 @@
 
 
 void Display::update(bool dynalum, int16 dynaX, int16 dynaY) {
+	drawTexts();
 	if (_pal.scrollable && dynalum) {
 		dynalumUpdate(dynaX, dynaY);
 	}
@@ -845,6 +846,50 @@
 	}
 	_charWidth[(uint8)' '] = 4;
 	--_charWidth[(uint8)'^'];
+}
+
+
+void Display::setText(uint16 x, uint16 y, const char *text, bool outlined) {
+	if (y < GAME_SCREEN_HEIGHT) {
+		if (x == 0) x = 1;
+		if (y == 0) y = 1;
+		TextSlot *pts = &_texts[y];
+
+		pts->x = x;
+		pts->color = _curTextColor;
+		pts->outlined = outlined;
+		pts->text = text;
+	}
+}
+
+
+void Display::setTextCentered(uint16 y, const char *text, bool outlined) {
+	uint16 x = (GAME_SCREEN_WIDTH - textWidth(text)) / 2;
+	setText(x, y, text, outlined);
+}
+
+
+void Display::drawTexts() {
+	int y;
+	for (y = GAME_SCREEN_HEIGHT - 1; y > 0; --y) {
+		const TextSlot *pts = &_texts[y];
+		if (!pts->text.isEmpty()) {
+			_vm->display()->drawText(pts->x, y, pts->color, pts->text.c_str(), pts->outlined);
+		}
+	}
+}
+
+
+void Display::clearTexts(uint16 y1, uint16 y2) {
+	while (y1 <= y2) {
+		_texts[y1].text.clear();
+		++y1;
+	}
+}
+
+
+int Display::textCenterX(const char *text) const {
+	return 160 - textWidth(text) / 2;
 }
 
 

Index: display.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- display.h	8 Jan 2004 10:25:17 -0000	1.35
+++ display.h	9 Jan 2004 13:36:37 -0000	1.36
@@ -22,6 +22,7 @@
 #ifndef QUEENDISPLAY_H
 #define QUEENDISPLAY_H
 
+#include "common/str.h"
 #include "common/util.h"
 #include "queen/defs.h"
 
@@ -89,6 +90,13 @@
 
 	void initFont();
 
+	void setText(uint16 x, uint16 y, const char *text, bool outlined = true);
+	void setTextCentered(uint16 y, const char *text, bool outlined = true);
+	void drawTexts();
+	void clearTexts(uint16 y1, uint16 y2);
+	void textCurrentColor(uint8 color) { _curTextColor = color; }
+	void textColor(uint16 y, uint8 color) { _texts[y].color = color; }
+	int textCenterX(const char *text) const;
 	uint16 textWidth(const char *text) const;
 	void drawChar(uint16 x, uint16 y, uint8 color, const uint8 *chr);
 	void drawText(uint16 x, uint16 y, uint8 color, const char *text, bool outlined = true);
@@ -132,6 +140,13 @@
 		uint8 prevColMask;
 	};
 
+	struct TextSlot {
+		uint16 x;
+		uint8 color;
+		Common::String text;
+		bool outlined;
+	};
+
 	uint8 *_screenBuf;
 	uint8 *_panelBuf;
 	uint8 *_backdropBuf;
@@ -144,6 +159,9 @@
 
 	uint16 _horizontalScroll;
 	uint16 _bdWidth, _bdHeight;
+
+	TextSlot _texts[GAME_SCREEN_HEIGHT];
+	uint8 _curTextColor;
 
 	uint8 _charWidth[256];
 

Index: graphics.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/graphics.cpp,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- graphics.cpp	8 Jan 2004 23:28:29 -0000	1.76
+++ graphics.cpp	9 Jan 2004 13:36:37 -0000	1.77
@@ -196,25 +196,28 @@
 }
 
 
-void Graphics::bobSetupControl() {
+void Graphics::unpackControlBank() {
 	_vm->bankMan()->load("control.BBK",17);
 	_vm->bankMan()->unpack(1, 1, 17); // Mouse pointer
 	_vm->bankMan()->unpack(3, 3, 17); // Up arrow dialogue
 	_vm->bankMan()->unpack(4, 4, 17); // Down arrow dialogue
 	_vm->bankMan()->close(17);
+}
+
 
+void Graphics::setupMouseCursor() {
 	BobFrame *bf = _vm->bankMan()->fetchFrame(1);
 	_vm->display()->setMouseCursor(bf->data, bf->width, bf->height, bf->xhotspot, bf->yhotspot);
 }
 
 
-void Graphics::bobDraw(const BobSlot *bs, int16 x, int16 y) {
-	debug(9, "Graphics::bobDraw(%d, %d, %d)", bs->frameNum, x, y);
+void Graphics::drawBob(const BobSlot *bs, int16 x, int16 y) {
+	debug(9, "Graphics::drawBob(%d, %d, %d)", bs->frameNum, x, y);
 
 	uint16 w, h;
 	BobFrame *pbf = _vm->bankMan()->fetchFrame(bs->frameNum);
 	if (bs->scale < 100) {
-		bobShrink(pbf, bs->scale);
+		shrinkFrame(pbf, bs->scale);
 		pbf = &_shrinkBuffer;
 	}
 	w = pbf->width;
@@ -262,7 +265,7 @@
 }
 
 
-void Graphics::bobDrawInventoryItem(uint32 frameNum, uint16 x, uint16 y) {
+void Graphics::drawInventoryItem(uint32 frameNum, uint16 x, uint16 y) {
 	if (frameNum != 0) {
 		BobFrame *bf = _vm->bankMan()->fetchFrame(frameNum);
 		_vm->display()->drawInventoryItem(bf->data, x, y, bf->width, bf->height);
@@ -272,7 +275,7 @@
 }
 
 
-void Graphics::bobPaste(uint16 objNum, uint16 image) {
+void Graphics::pasteBob(uint16 objNum, uint16 image) {
 	GraphicData *pgd = _vm->logic()->graphicData(objNum);
 	_vm->bankMan()->unpack(pgd->firstFrame, image, 15);
 	BobFrame *bf = _vm->bankMan()->fetchFrame(image);
@@ -281,12 +284,12 @@
 }
 
 
-void Graphics::bobShrink(const BobFrame *bf, uint16 percentage) {
+void Graphics::shrinkFrame(const BobFrame *bf, uint16 percentage) {
 	// computing new size, rounding to upper value
 	uint16 new_w = (bf->width  * percentage + 50) / 100;
 	uint16 new_h = (bf->height * percentage + 50) / 100;
 
-	debug(9, "Graphics::bobShrink() - scale = %d, bufsize = %d", percentage, new_w * new_h);
+	debug(9, "Graphics::shrinkFrame() - scale = %d, bufsize = %d", percentage, new_w * new_h);
 
 	if (new_w != 0 && new_h != 0) {
 
@@ -326,7 +329,7 @@
 }
 
 
-void Graphics::bobClear(uint32 bobNum) {
+void Graphics::clearBob(uint32 bobNum) {
 	BobSlot *pbs = bob(bobNum);
 	pbs->clear();
 	if (_vm->display()->fullscreen()) {
@@ -335,7 +338,7 @@
 }
 
 
-void Graphics::bobSortAll() {
+void Graphics::sortBobs() {
 	_sortedBobsCount = 0;
 
 	// animate/move the bobs
@@ -378,7 +381,7 @@
 }
 
 
-void Graphics::bobDrawAll() {
+void Graphics::drawBobs() {
 	int i;
 	for (i = 0; i < _sortedBobsCount; ++i) {
 		BobSlot *pbs = _sortedBobs[i];
@@ -404,20 +407,20 @@
 			x = pbs->x - xh - _vm->display()->horizontalScroll();
 			y = pbs->y - yh;
 
-			bobDraw(pbs, x, y);
+			drawBob(pbs, x, y);
 		}
 	}
 }
 
 
-void Graphics::bobClearAll() {
+void Graphics::clearBobs() {
 	for(int32 i = 0; i < ARRAYSIZE(_bobs); ++i) {
-		bobClear(i);
+		clearBob(i);
 	}
 }
 
 
-void Graphics::bobStopAll() {
+void Graphics::stopBobs() {
 	for(int32 i = 0; i < ARRAYSIZE(_bobs); ++i) {
 		_bobs[i].moving = false;
 	}
@@ -434,75 +437,7 @@
 }
 
 
-void Graphics::bobCustomParallax(uint16 roomNum) {
-	int i;
-	uint16 screenScroll = _vm->display()->horizontalScroll();
-	switch (roomNum) {
-	case ROOM_AMAZON_HIDEOUT:
-		_bobs[8].x = 250 - screenScroll / 2;
-		break;
-	case ROOM_TEMPLE_MAZE_5:
-		_bobs[5].x = 410 - screenScroll / 2;
-		_bobs[6].x = 790 - screenScroll / 2;
-		break;
-	case ROOM_TEMPLE_OUTSIDE:
-		_bobs[5].x = 320 - screenScroll / 2;
-		break;
-	case ROOM_TEMPLE_TREE:
-		_bobs[5].x = 280 - screenScroll / 2;
-		break;
-	case ROOM_VALLEY_CARCASS:
-		_bobs[5].x = 600 - screenScroll / 2;
-		break;
-	case ROOM_HOTEL_LOBBY:
-		if(_vm->display()->fullscreen()) {
-			for(i = 1; i <= 3; ++i) {
-				_bobs[i].box.y2 = 199;
-			}
-			_bobs[24].box.y2 = 199;
-		}
-		break;
-	case ROOM_UNUSED_INTRO_1:
-		_bobs[5].x = 340 - screenScroll / 2;
-		_bobs[6].x = 50 - screenScroll / 2;
-		_bobs[7].x = 79 - screenScroll / 2;
-		for(i = 1; i <= 8; ++i) {
-			_bobs[i].box.y2 = 199;
-		}
-		_bobs[20].box.y2 = 199;
-		break;
-	case ROOM_UNUSED_INTRO_5:
-		for(i = 0; i < 3; ++i) {
-			_bobs[i].box.y2 = 199;
-		}
-		break;
-	case ROOM_CAR_CHASE:
-		_vm->bam()->updateCarAnimation();
-		break;
-	case ROOM_FINAL_FIGHT:
-		_vm->bam()->updateFightAnimation();
-		break;
-	case ROOM_INTRO_RITA_JOE_HEADS: // CR 2 - CD-Rom pan right while Rita talks...
-		_cameraBob = -1;
-		if (screenScroll < 80) {
-			_vm->display()->horizontalScroll(screenScroll + 4);
-			// Joe's body and head
-			_bobs[ 1].x += 4;
-			_bobs[20].x += 4;
-			// Rita's body and head
-			_bobs[ 2].x -= 2;
-			_bobs[21].x -= 2;
-		}
-		break;
-	case ROOM_INTRO_EXPLOSION: // CR 2 - CD-Rom the guys move off screen
-		_bobs[21].x += 2;
-		_bobs[21].y += 2;
-		break;
-	}
-}
-
-
-void Graphics::bobSetText(
+void Graphics::setBobText(
 		BobSlot *pbs, 
 		const char *text, 
 		int textX, int textY, 
@@ -559,7 +494,7 @@
 	int maxLineWidth = 0;
 
 	for (i = 0; i < lineCount; i++) {
-		int width = textWidth(lines[i]);
+		int width = _vm->display()->textWidth(lines[i]);
 		if (maxLineWidth < width)
 			maxLineWidth = width;
 	}
@@ -606,69 +541,88 @@
 	else if ((x + maxLineWidth) > 320)
 		x = 320 - maxLineWidth - 4;
 
-	textCurrentColor(color);
+	_vm->display()->textCurrentColor(color);
 
 	for (i = 0; i < lineCount; i++) {
-		int lineX = x + (maxLineWidth - textWidth(lines[i])) / 2;
+		int lineX = x + (maxLineWidth - _vm->display()->textWidth(lines[i])) / 2;
 
 		//debug(0, "Setting text '%s' at (%i, %i)", lines[i], lineX, y + 9 * i);
-		textSet(lineX, y + 9 * i, lines[i]);
-	}
-}
-
-
-void Graphics::textSet(uint16 x, uint16 y, const char *text, bool outlined) {
-	if (y < GAME_SCREEN_HEIGHT) {
-		if (x == 0) x = 1;
-		if (y == 0) y = 1;
-		TextSlot *pts = &_texts[y];
-
-		pts->x = x;
-		pts->color = _curTextColor;
-		pts->outlined = outlined;
-		pts->text = text;
+		_vm->display()->setText(lineX, y + 9 * i, lines[i]);
 	}
 }
 
 
-void Graphics::textSetCentered(uint16 y, const char *text, bool outlined) {
-	uint16 x = (GAME_SCREEN_WIDTH - textWidth(text)) / 2;
-	textSet(x, y, text, outlined);
-}
-
-
-void Graphics::textDrawAll() {
-	int y;
-	for (y = GAME_SCREEN_HEIGHT - 1; y > 0; --y) {
-		const TextSlot *pts = &_texts[y];
-		if (!pts->text.isEmpty()) {
-			_vm->display()->drawText(pts->x, y, pts->color, pts->text.c_str(), pts->outlined);
+void Graphics::handleParallax(uint16 roomNum) {
+	int i;
+	uint16 screenScroll = _vm->display()->horizontalScroll();
+	switch (roomNum) {
+	case ROOM_AMAZON_HIDEOUT:
+		_bobs[8].x = 250 - screenScroll / 2;
+		break;
+	case ROOM_TEMPLE_MAZE_5:
+		_bobs[5].x = 410 - screenScroll / 2;
+		_bobs[6].x = 790 - screenScroll / 2;
+		break;
+	case ROOM_TEMPLE_OUTSIDE:
+		_bobs[5].x = 320 - screenScroll / 2;
+		break;
+	case ROOM_TEMPLE_TREE:
+		_bobs[5].x = 280 - screenScroll / 2;
+		break;
+	case ROOM_VALLEY_CARCASS:
+		_bobs[5].x = 600 - screenScroll / 2;
+		break;
+	case ROOM_HOTEL_LOBBY:
+		if(_vm->display()->fullscreen()) {
+			for(i = 1; i <= 3; ++i) {
+				_bobs[i].box.y2 = 199;
+			}
+			_bobs[24].box.y2 = 199;
 		}
+		break;
+	case ROOM_UNUSED_INTRO_1:
+		_bobs[5].x = 340 - screenScroll / 2;
+		_bobs[6].x = 50 - screenScroll / 2;
+		_bobs[7].x = 79 - screenScroll / 2;
+		for(i = 1; i <= 8; ++i) {
+			_bobs[i].box.y2 = 199;
+		}
+		_bobs[20].box.y2 = 199;
+		break;
+	case ROOM_UNUSED_INTRO_5:
+		for(i = 0; i < 3; ++i) {
+			_bobs[i].box.y2 = 199;
+		}
+		break;
+	case ROOM_CAR_CHASE:
+		_vm->bam()->updateCarAnimation();
+		break;
+	case ROOM_FINAL_FIGHT:
+		_vm->bam()->updateFightAnimation();
+		break;
+	case ROOM_INTRO_RITA_JOE_HEADS: // CR 2 - CD-Rom pan right while Rita talks...
+		_cameraBob = -1;
+		if (screenScroll < 80) {
+			_vm->display()->horizontalScroll(screenScroll + 4);
+			// Joe's body and head
+			_bobs[ 1].x += 4;
+			_bobs[20].x += 4;
+			// Rita's body and head
+			_bobs[ 2].x -= 2;
+			_bobs[21].x -= 2;
+		}
+		break;
+	case ROOM_INTRO_EXPLOSION: // CR 2 - CD-Rom the guys move off screen
+		_bobs[21].x += 2;
+		_bobs[21].y += 2;
+		break;
 	}
 }
 
 
-void Graphics::textClear(uint16 y1, uint16 y2) {
-	while (y1 <= y2) {
-		_texts[y1].text.clear();
-		++y1;
-	}
-}
-
-
-uint16 Graphics::textWidth(const char* text) const {
-	return _vm->display()->textWidth(text);
-}
-
-
-int Graphics::textCenterX(const char *text) const {
-	return 160 - textWidth(text) / 2;
-}
-
-
 void Graphics::setupNewRoom(const char *room, uint16 roomNum, int16 *furniture, uint16 furnitureCount) {
 	// reset sprites table (bounding box...)
-	bobClearAll();
+	clearBobs();
 
 	// load/setup objects associated to this room
 	char filename[20];	
@@ -885,7 +839,7 @@
 	if (pod->image == -3 || pod->image == -4) {
 		// a person object
 		if (pod->name <= 0) {
-			bobClear(curBob);
+			clearBob(curBob);
 		} else {
 			// find person number
 			uint16 pNum = _vm->logic()->findPersonNumber(obj);
@@ -903,7 +857,7 @@
 
 	if (pod->name < 0 || pod->image < 0) {
 		// object is hidden or disabled
-		bobClear(curBob);
+		clearBob(curBob);
 		return curImage;
 	}
 
@@ -1015,7 +969,7 @@
 	// unpack the paste downs
 	for  (i = 1; i <= furnitureCount; ++i) {
 		if (furniture[i] > 5000) {;
-			bobPaste(furniture[i] - 5000, curImage + 1);
+			pasteBob(furniture[i] - 5000, curImage + 1);
 		}
 	}
 }
@@ -1090,7 +1044,7 @@
 				// static objects
 				curBob = 20 + _numFurnitureStatic + numObjectStatic;
 				++curImage;
-				bobClear(curBob);
+				clearBob(curBob);
 
 				// XXX if((COMPANEL==2) && (FULLSCREEN==1)) bobs[CURRBOB].y2=199;
 
@@ -1126,7 +1080,7 @@
 	for (i = firstRoomObj; i <= lastRoomObj; ++i) {
 		ObjectData *pod = _vm->logic()->objectData(i);
 		if (pod->name > 0 && pod->image > 5000) {
-			bobPaste(pod->image - 5000, curImage);
+			pasteBob(pod->image - 5000, curImage);
 		}
 	}
 }
@@ -1173,7 +1127,6 @@
 uint16 Graphics::allocPerson(uint16 noun, uint16 curImage) {
 	Person p;
 	if (_vm->logic()->initPerson(noun, "", false, &p) && p.anim != NULL) {
-		debug(0, "allocPerson() : anim=%s", p.anim);
 		curImage += countAnimFrames(p.anim);
 		_personFrames[p.actor->bobNum] = curImage + 1;
 	}
@@ -1182,14 +1135,13 @@
 
 
 void Graphics::update(uint16 room) {
-	bobSortAll();
+	sortBobs();
 	if (_cameraBob >= 0) {
 		_vm->display()->horizontalScrollUpdate(_bobs[_cameraBob].x);
 	}
-	bobCustomParallax(room);
+	handleParallax(room);
 	_vm->display()->prepareUpdate();
-	bobDrawAll();
-	textDrawAll();
+	drawBobs();
 }
 
 
@@ -1201,15 +1153,15 @@
 
 void BamScene::prepareAnimation() {
 	_obj1 = _vm->graphics()->bob(BOB_OBJ1);
-	_vm->graphics()->bobClear(BOB_OBJ1);
+	_obj1->clear();
 	_obj1->active = true;
 
 	_obj2 = _vm->graphics()->bob(BOB_OBJ2);
-	_vm->graphics()->bobClear(BOB_OBJ2);
+	_obj2->clear();
 	_obj2->active = true;
 
 	_objfx = _vm->graphics()->bob(BOB_FX);
-	_vm->graphics()->bobClear(BOB_FX);
+	_objfx->clear();
 	_objfx->active = true;
 
 	_index = 0;

Index: graphics.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/graphics.h,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- graphics.h	8 Jan 2004 22:46:42 -0000	1.58
+++ graphics.h	9 Jan 2004 13:36:37 -0000	1.59
@@ -22,7 +22,6 @@
 #ifndef QUEENGRAPHICS_H
 #define QUEENGRAPHICS_H
 
-#include "common/str.h"
 #include "common/util.h"
 #include "queen/defs.h"
 #include "queen/structs.h"
@@ -85,13 +84,6 @@
 	void clear();
 };
 
-struct TextSlot {
-	uint16 x;
-	uint8 color;
-	Common::String text;
-	bool outlined;
-};
-
 class QueenEngine;
 
 class Graphics {
@@ -100,30 +92,22 @@
 	Graphics(QueenEngine *vm);
 	~Graphics();
 
-	void bobSetupControl();
-	void bobDraw(const BobSlot *bs, int16 x, int16 y);
-	void bobDrawInventoryItem(uint32 frameNum, uint16 x, uint16 y);
-	void bobPaste(uint16 objNum, uint16 image);
-	void bobShrink(const BobFrame *bf, uint16 percentage);
-	void bobClear(uint32 bobNum);
-	void bobSortAll();
-	void bobDrawAll();
-	void bobClearAll();
-	void bobStopAll();
-	BobSlot *bob(int index);
-
-	void bobCustomParallax(uint16 roomNum); // CHECK_PARALLAX()
+	void unpackControlBank();
+	void setupMouseCursor();
 
-	void bobSetText(BobSlot *bob, const char *text, int textX, int textY, int color, int flags);
+	void drawBob(const BobSlot *bs, int16 x, int16 y);
+	void drawInventoryItem(uint32 frameNum, uint16 x, uint16 y);
+	void pasteBob(uint16 objNum, uint16 image);
+	void shrinkFrame(const BobFrame *bf, uint16 percentage);
+	void clearBob(uint32 bobNum);
+	void sortBobs();
+	void drawBobs();
+	void clearBobs();
+	void stopBobs();
+	BobSlot *bob(int index);
+	void setBobText(BobSlot *bob, const char *text, int textX, int textY, int color, int flags);
 
-	void textCurrentColor(uint8 color) { _curTextColor = color; }
-	void textSet(uint16 x, uint16 y, const char *text, bool outlined = true); // text()
-	void textSetCentered(uint16 y, const char *text, bool outlined = true);
-	void textDrawAll(); // drawtext()
-	void textClear(uint16 y1, uint16 y2); // blanktexts()
-	uint16 textWidth(const char *text) const; // textlen()
-	int textCenterX(const char *text) const; // MIDDLE()
-	void textColor(uint16 y, uint8 color) { _texts[y].color = color; }
+	void handleParallax(uint16 roomNum);
 
 	void setupNewRoom(const char *room, uint16 roomNum, int16 *furniture, uint16 furnitureCount);
 
@@ -175,9 +159,6 @@
 
 	//! used to scale a BobFrame
 	BobFrame _shrinkBuffer;
-
-	TextSlot _texts[GAME_SCREEN_HEIGHT];
-	uint8 _curTextColor;
 
 	AnimFrame _newAnim[17][30];
 

Index: grid.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/grid.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- grid.cpp	8 Jan 2004 14:10:32 -0000	1.1
+++ grid.cpp	9 Jan 2004 13:36:37 -0000	1.2
@@ -41,17 +41,17 @@
 
 	_objMax  = new int16[numRooms + 1];
 	_areaMax = new int16[numRooms + 1];
-	_area    = new Area[numRooms + 1][MAX_AREAS];
+	_area    = new Area[numRooms + 1][MAX_AREAS_NUMBER];
 
 	_objMax[0] = 0;
 	_areaMax[0] = 0;
-	memset(&_area[0], 0, sizeof(Area) * MAX_AREAS);
+	memset(&_area[0], 0, sizeof(Area) * MAX_AREAS_NUMBER);
 	for (i = 1; i <= numRooms; i++) {
 		_objMax[i] = (int16)READ_BE_UINT16(ptr); ptr += 2;
 		_areaMax[i] = (int16)READ_BE_UINT16(ptr); ptr += 2;
 		memset(&_area[i][0], 0, sizeof(Area));
 		for (j = 1; j <= _areaMax[i]; j++) {
-			assert(j < MAX_AREAS);
+			assert(j < MAX_AREAS_NUMBER);
 			_area[i][j].readFromBE(ptr);
 		}
 	}
@@ -89,7 +89,7 @@
 	if (screen == GS_PANEL) {
 		y -= ROOM_ZONE_HEIGHT;
 	}
-	for(i = 1; i < MAX_ZONES; ++i) {
+	for(i = 1; i < MAX_ZONES_NUMBER; ++i) {
 		const ZoneSlot *pzs = &_zones[screen][i];
 		if (pzs->valid && pzs->box.contains(x, y)) {
 			return i;
@@ -113,7 +113,7 @@
 
 void Grid::clear(GridScreen screen) {
 	debug(9, "Grid::clear(%d)", screen);
-	for(int i = 1; i < MAX_ZONES; ++i) {
+	for(int i = 1; i < MAX_ZONES_NUMBER; ++i) {
 		_zones[screen][i].valid = false;
 	}
 }
@@ -163,7 +163,7 @@
 
 
 void Grid::drawZones() {
-	for(int i = 1; i < MAX_ZONES; ++i) {
+	for(int i = 1; i < MAX_ZONES_NUMBER; ++i) {
 		const ZoneSlot *pzs = &_zones[GS_ROOM][i];
 		if (pzs->valid) {
 			const Box *b = &pzs->box;

Index: grid.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/grid.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- grid.h	8 Jan 2004 14:10:32 -0000	1.1
+++ grid.h	9 Jan 2004 13:36:37 -0000	1.2
@@ -62,8 +62,8 @@
 	uint16 objMax(int room) const { return _objMax[room]; } 
 
 	enum {
-		MAX_ZONES = 32,
-		MAX_AREAS = 11
+		MAX_ZONES_NUMBER = 32,
+		MAX_AREAS_NUMBER = 11
 	};
 
 
@@ -74,13 +74,13 @@
 		Box box;
 	};
 
-	ZoneSlot _zones[GS_COUNT][MAX_ZONES];
+	ZoneSlot _zones[GS_COUNT][MAX_ZONES_NUMBER];
 	
 	int16 *_objMax;
 
 	int16 *_areaMax;
 
-	Area (*_area)[MAX_AREAS];
+	Area (*_area)[MAX_AREAS_NUMBER];
 
 	Box *_objectBox;
 

Index: journal.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/journal.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- journal.cpp	8 Jan 2004 16:41:03 -0000	1.21
+++ journal.cpp	9 Jan 2004 13:36:37 -0000	1.22
@@ -89,7 +89,7 @@
 
 	_vm->writeOptionSettings();
 
-	_vm->graphics()->textClear(0, GAME_SCREEN_HEIGHT - 1);
+	_vm->display()->clearTexts(0, GAME_SCREEN_HEIGHT - 1);
 	_vm->graphics()->putCameraOnBob(0);
 	if (_quitCleanly) {
 		restore();
@@ -102,10 +102,10 @@
 	_vm->display()->fullscreen(true);
 
 	_vm->graphics()->putCameraOnBob(-1);
-	_vm->graphics()->bobClearAll();
-	_vm->graphics()->textClear(0, GAME_SCREEN_HEIGHT - 1);
-	_vm->bankMan()->eraseAllFrames(false);
-	_vm->graphics()->textCurrentColor(INK_JOURNAL);
+	_vm->graphics()->clearBobs();
+	_vm->display()->clearTexts(0, GAME_SCREEN_HEIGHT - 1);
+	_vm->bankMan()->eraseFrames(false);
+	_vm->display()->textCurrentColor(INK_JOURNAL);
 
 	int i;
 	_vm->grid()->clear(GS_ROOM);
@@ -148,7 +148,7 @@
 	_vm->logic()->joeCutFacing(_vm->logic()->joeFacing());
 
 	_vm->logic()->oldRoom(_vm->logic()->currentRoom());
-	_vm->logic()->roomDisplay(_vm->logic()->currentRoom(), RDM_FADE_JOE, 0, 0, false);
+	_vm->logic()->displayRoom(_vm->logic()->currentRoom(), RDM_FADE_JOE, 0, 0, false);
 }
 
 
@@ -214,8 +214,8 @@
 		char nb[4];
 		sprintf(nb, "%d", n + 1);
 		int y = 9 + i * 13;
-		_vm->graphics()->textSet(136, y, _saveDescriptions[n], false);
-		_vm->graphics()->textSet(109, y + 1, nb, false);
+		_vm->display()->setText(136, y, _saveDescriptions[n], false);
+		_vm->display()->setText(109, y + 1, nb, false);
 	}
 	// hightlight current page
 	showBob(BOB_SAVE_PAGE, 300, 3 + _currentSavePage * 15, 6 + _currentSavePage);
@@ -306,7 +306,7 @@
 			if (_saveDescriptions[currentSlot][0]) {
 				_vm->display()->palFadeOut(0, 223, JOURNAL_ROOM);
 				loadState(currentSlot);
-				_vm->graphics()->textClear(0, GAME_SCREEN_HEIGHT - 1);
+				_vm->display()->clearTexts(0, GAME_SCREEN_HEIGHT - 1);
 				// XXX panelflag=1;
 				// XXX walkgameload=1;
 				_quit = true;
@@ -376,7 +376,7 @@
 void Journal::clearPanelTexts() {
 	int i;
 	for (i = 0; i < _panelTextCount; ++i) {
-		_vm->graphics()->textClear(_panelTextY[i], _panelTextY[i]);
+		_vm->display()->clearTexts(_panelTextY[i], _panelTextY[i]);
 	}
 }
 
@@ -386,8 +386,8 @@
 	strcpy(s, text);
 	char *p = strchr(s, ' ');
 	if (p == NULL) {
-		int x = (128 - _vm->graphics()->textWidth(s)) / 2;
-		_vm->graphics()->textSet(x, y, s, false);
+		int x = (128 - _vm->display()->textWidth(s)) / 2;
+		_vm->display()->setText(x, y, s, false);
 		_panelTextY[_panelTextCount++] = y;
 	} else {
 		*p++ = '\0';
@@ -461,49 +461,49 @@
 
 
 void Journal::showInformationBox() {
-	_vm->graphics()->textClear(0, GAME_SCREEN_HEIGHT - 1);
+	_vm->display()->clearTexts(0, GAME_SCREEN_HEIGHT - 1);
 	showBob(BOB_INFO_BOX, 72, 221, FRAME_INFO_BOX);
 
 	const char *ver = _vm->resource()->JASVersion();
 	switch (ver[0]) {
 	case 'P':
-		_vm->graphics()->textSetCentered(132, "PC Hard Drive", false);
+		_vm->display()->setTextCentered(132, "PC Hard Drive", false);
 		break;
 	case 'C':
-		_vm->graphics()->textSetCentered(132, "PC CD-ROM", false);
+		_vm->display()->setTextCentered(132, "PC CD-ROM", false);
 		break;
 	case 'a':
-		_vm->graphics()->textSetCentered(132, "Amiga A500/600", false);
+		_vm->display()->setTextCentered(132, "Amiga A500/600", false);
 		break;
 	case 'A':
-		_vm->graphics()->textSetCentered(132, "Amiga A1200", false);
+		_vm->display()->setTextCentered(132, "Amiga A1200", false);
 		break;
 	case 'c':
-		_vm->graphics()->textSetCentered(132, "Amiga CD-32", false);
+		_vm->display()->setTextCentered(132, "Amiga CD-32", false);
 		break;
 	}
 	switch (ver[1]) {
 	case 'E':
-		_vm->graphics()->textSetCentered(144, "English", false);
+		_vm->display()->setTextCentered(144, "English", false);
 		break;
 	case 'G':
-		_vm->graphics()->textSetCentered(144, "Deutsch", false);
+		_vm->display()->setTextCentered(144, "Deutsch", false);
 		break;
 	case 'I':
-		_vm->graphics()->textSetCentered(144, "Italiano", false);
+		_vm->display()->setTextCentered(144, "Italiano", false);
 		break;
 	case 'F' :
-		_vm->graphics()->textSetCentered(144, "Fran\x87""ais", false);
+		_vm->display()->setTextCentered(144, "Fran\x87""ais", false);
 		break;
 	}
 	char versionId[13];
 	sprintf(versionId, "Version %c.%c%c", ver[2], ver[3], ver[4]);
-	_vm->graphics()->textSetCentered(156, versionId, false);
+	_vm->display()->setTextCentered(156, versionId, false);
 }
 
 
 void Journal::hideInformationBox() {
-	_vm->graphics()->textClear(0, GAME_SCREEN_HEIGHT - 1);
+	_vm->display()->clearTexts(0, GAME_SCREEN_HEIGHT - 1);
 	hideBob(BOB_INFO_BOX);
 	redraw();
 }
@@ -511,7 +511,7 @@
 
 void Journal::initEditBuffer(const char *desc) {
 	_edit.enable = true;
-	_edit.posCursor = _vm->graphics()->textWidth(desc);
+	_edit.posCursor = _vm->display()->textWidth(desc);
 	_edit.textCharsCount = strlen(desc);
 	memset(_edit.text, 0, sizeof(_edit.text));
 	strcpy(_edit.text, desc);
@@ -535,7 +535,7 @@
 	default:
 		if (isprint((char)ascii) && 
 			_edit.textCharsCount < (sizeof(_edit.text) - 1) && 
-			_vm->graphics()->textWidth(_edit.text) < 146) {
+			_vm->display()->textWidth(_edit.text) < 146) {
 			_edit.text[_edit.textCharsCount] = (char)ascii;
 			++_edit.textCharsCount;
 			dirty = true;
@@ -543,8 +543,8 @@
 		break;
 	}
 	if (dirty) {
-		_vm->graphics()->textSet(136, 9 + _currentSaveSlot * 13, _edit.text, false);
-		_edit.posCursor = _vm->graphics()->textWidth(_edit.text);
+		_vm->display()->setText(136, 9 + _currentSaveSlot * 13, _edit.text, false);
+		_edit.posCursor = _vm->display()->textWidth(_edit.text);
 		update();
 	}
 }

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.cpp,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -d -r1.166 -r1.167
--- logic.cpp	8 Jan 2004 23:28:29 -0000	1.166
+++ logic.cpp	9 Jan 2004 13:36:37 -0000	1.167
@@ -242,7 +242,8 @@
 	_scene = 0;
 	memset(_gameState, 0, sizeof(_gameState));
 	_vm->display()->setupPanel();
-	_vm->graphics()->bobSetupControl();
+	_vm->graphics()->unpackControlBank();
+	_vm->graphics()->setupMouseCursor();
 	setupJoe();
 	_vm->grid()->setupPanel();
 
@@ -458,8 +459,8 @@
 }
 
 
-void Logic::roomErase() {
-	_vm->bankMan()->eraseAllFrames(false);
+void Logic::eraseRoom() {
+	_vm->bankMan()->eraseFrames(false);
 	_vm->bankMan()->close(15);
 	_vm->bankMan()->close(11);
 	_vm->bankMan()->close(10);
@@ -496,7 +497,7 @@
 }
 
 
-void Logic::roomSetup(const char *room, int comPanel, bool inCutaway) {
+void Logic::setupRoom(const char *room, int comPanel, bool inCutaway) {
 	// load backdrop image, init dynalum, setup colors
 	_vm->display()->setupNewRoom(room, _currentRoom);
 
@@ -520,15 +521,15 @@
 }
 
 
-void Logic::roomDisplay(uint16 room, RoomDisplayMode mode, uint16 scale, int comPanel, bool inCutaway) {
-	debug(6, "Logic::roomDisplay(%d, %d, %d, %d, %d)", room, mode, scale, comPanel, inCutaway);
+void Logic::displayRoom(uint16 room, RoomDisplayMode mode, uint16 scale, int comPanel, bool inCutaway) {
+	debug(6, "Logic::displayRoom(%d, %d, %d, %d, %d)", room, mode, scale, comPanel, inCutaway);
 
-	roomErase();
+	eraseRoom();
 
 	if (_credits)
 		_credits->nextRoom();
 
-	roomSetup(roomName(room), comPanel, inCutaway);
+	setupRoom(roomName(room), comPanel, inCutaway);
 	ObjectData *pod = NULL;
 	if (mode != RDM_FADE_NOJOE) {
 		pod = setupJoeInRoom(mode != RDM_FADE_JOE_XY, scale);
@@ -588,7 +589,7 @@
 		if (loadBank && pad->file != 0) {
 			_vm->bankMan()->load(_aFile[pad->file], pad->bankNum);
 			// if there is no valid actor file (ie pad->file is 0), the person 
-			// data is already loaded as it is contained in objects room bank (.bbk)
+			// data is already loaded as it is included in objects room bank (.bbk)
 		}
 		pp->bobFrame = 29 + FRAMES_JOE_XTRA + pp->actor->bobNum;
 	} 
@@ -890,7 +891,7 @@
 	if (next == NULL) {
 		next = nextFile;
 	}
-	_vm->graphics()->textClear(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
+	_vm->display()->clearTexts(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
 	Cutaway::run(cutFile, next, _vm);
 }
 
@@ -943,10 +944,10 @@
 			uint16 dstFrame = (itemNum != 0) ? 8 : 9;
 			// unpack frame for object and draw it
 			_vm->bankMan()->unpack(_itemData[itemNum].frame, dstFrame, 14);
-			_vm->graphics()->bobDrawInventoryItem(dstFrame, x, 14);
+			_vm->graphics()->drawInventoryItem(dstFrame, x, 14);
 		} else {
 			// no object, clear the panel 
-			_vm->graphics()->bobDrawInventoryItem(0, x, 14);
+			_vm->graphics()->drawInventoryItem(0, x, 14);
 		}
 		x += 35;
 	}
@@ -1231,7 +1232,7 @@
 void Logic::handlePinnacleRoom() {
 	// camera does not follow Joe anymore
 	_vm->graphics()->putCameraOnBob(-1);
-	roomDisplay(ROOM_JUNGLE_PINNACLE, RDM_NOFADE_JOE, 100, 2, true);
+	displayRoom(ROOM_JUNGLE_PINNACLE, RDM_NOFADE_JOE, 100, 2, true);
 
 	BobSlot *joe   = _vm->graphics()->bob(6);
 	BobSlot *piton = _vm->graphics()->bob(7);
@@ -1252,7 +1253,7 @@
 
 	_vm->update();
 	_vm->display()->palFadeIn(0, 223, ROOM_JUNGLE_PINNACLE, joe->active, joe->x, joe->y);
-	_vm->graphics()->textCurrentColor(INK_PINNACLE_ROOM);
+	_vm->display()->textCurrentColor(INK_PINNACLE_ROOM);
 
 	_entryObj = 0;
 	uint16 prevObj = 0;
@@ -1269,7 +1270,7 @@
 		joe->x = piton->x = 3 * mx / 4 + 200;
 		joe->frameNum = mx / 36 + 43 + FRAMES_JOE_XTRA;
 
-		_vm->graphics()->textClear(5, 5);
+		_vm->display()->clearTexts(5, 5);
 
 		uint16 curObj = _vm->grid()->findObjectUnderCursor(mx, my);
 		if (curObj != 0 && curObj != prevObj) {
@@ -1280,7 +1281,7 @@
 				_entryObj = objData->entryObj;
 				char textCmd[CmdText::MAX_COMMAND_LEN];
 				sprintf(textCmd, "%s %s", verbName(VERB_WALK_TO), objectName(objData->name));
-				_vm->graphics()->textSetCentered(5, textCmd);
+				_vm->display()->setTextCentered(5, textCmd);
 			}
 			prevObj = curObj;
 		}
@@ -1319,7 +1320,7 @@
 	}
 
 	joe->active = piton->active = false;
-	_vm->graphics()->textClear(5, 5);
+	_vm->display()->clearTexts(5, 5);
 
 	// camera follows Joe again
 	_vm->graphics()->putCameraOnBob(0);
@@ -1533,7 +1534,7 @@
 
 void Logic::changeRoom() {
 	if (!preChangeRoom()) 
-		roomDisplay(currentRoom(), RDM_FADE_JOE, 100, 1, false);
+		displayRoom(currentRoom(), RDM_FADE_JOE, 100, 1, false);
 	_vm->display()->showMouseCursor(true);
 }
 
@@ -2200,12 +2201,12 @@
 bool LogicDemo::preChangeRoom() {
 	if (currentRoom() == FOTAQ_LOGO && gameState(VAR_INTRO_PLAYED) == 0) {
 		currentRoom(79);
-		roomDisplay(currentRoom(), RDM_FADE_NOJOE, 100, 2, true);
+		displayRoom(currentRoom(), RDM_FADE_NOJOE, 100, 2, true);
 		playCutaway("clogo.cut");
 		sceneReset();
 		currentRoom(ROOM_HOTEL_LOBBY);
 		entryObj(584);
-		roomDisplay(currentRoom(), RDM_FADE_JOE, 100, 2, true);
+		displayRoom(currentRoom(), RDM_FADE_JOE, 100, 2, true);
 		playCutaway("c70d.cut");
 		gameState(VAR_INTRO_PLAYED, 1);
 		inventorySetup();
@@ -2219,7 +2220,7 @@
 bool LogicInterview::preChangeRoom() {
 	if (currentRoom() == 2 && gameState(2) == 0) {
 		currentRoom(6);
-		roomDisplay(currentRoom(), RDM_FADE_NOJOE, 100, 2, true);
+		displayRoom(currentRoom(), RDM_FADE_NOJOE, 100, 2, true);
 		playCutaway("start.cut");
 		gameState(2, 1);
 		inventorySetup();
@@ -2235,7 +2236,7 @@
 		handlePinnacleRoom();
 		return true;
 	} else if (currentRoom() == FOTAQ_LOGO && gameState(VAR_INTRO_PLAYED) == 0) {
-		roomDisplay(currentRoom(), RDM_FADE_NOJOE, 100, 2, true);
+		displayRoom(currentRoom(), RDM_FADE_NOJOE, 100, 2, true);
 		playCutaway("copy.cut");
 		playCutaway("clogo.cut");
 
@@ -2252,7 +2253,7 @@
 		sceneReset();
 		currentRoom(ROOM_HOTEL_LOBBY);
 		entryObj(584);
-		roomDisplay(currentRoom(), RDM_FADE_JOE, 100, 2, true);
+		displayRoom(currentRoom(), RDM_FADE_JOE, 100, 2, true);
 		playCutaway("c70d.cut");
 		gameState(VAR_INTRO_PLAYED, 1);
 		inventorySetup();

Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.h,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -d -r1.109 -r1.110
--- logic.h	8 Jan 2004 23:28:29 -0000	1.109
+++ logic.h	9 Jan 2004 13:36:37 -0000	1.110
@@ -138,9 +138,9 @@
 	const char *objectName(uint16 objNum) const { return _objName[objNum]; }
 	const char *objectTextualDescription(uint16 objNum) const { return _objDescription[objNum]; }
 
-	void roomErase();
-	void roomSetup(const char *room, int comPanel, bool inCutaway);
-	void roomDisplay(uint16 room, RoomDisplayMode mode, uint16 joeScale, int comPanel, bool inCutaway);
+	void eraseRoom();
+	void setupRoom(const char *room, int comPanel, bool inCutaway);
+	void displayRoom(uint16 room, RoomDisplayMode mode, uint16 joeScale, int comPanel, bool inCutaway);
 
 	int16 entryObj() const { return _entryObj; }
 	void entryObj(int16 obj) { _entryObj = obj; }

Index: queen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/queen.cpp,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- queen.cpp	8 Jan 2004 14:10:32 -0000	1.71
+++ queen.cpp	9 Jan 2004 13:36:37 -0000	1.72
@@ -233,7 +233,7 @@
 	for (;;) {
 		// queen.c lines 4080-4104
 		if (_logic->newRoom() > 0) {
-			_graphics->textClear(151, 151);
+			_display->clearTexts(151, 151);
 			_logic->update();
 			_logic->oldRoom(_logic->currentRoom());
 			_logic->currentRoom(_logic->newRoom());

Index: talk.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/talk.cpp,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- talk.cpp	8 Jan 2004 22:46:42 -0000	1.73
+++ talk.cpp	9 Jan 2004 13:36:37 -0000	1.74
@@ -323,7 +323,7 @@
 		if (_oldSelectedSentenceIndex > 0)
 			selectedValue(_oldSelectedSentenceIndex, _oldSelectedSentenceValue);
 		_vm->input()->talkQuitReset();
-		_vm->graphics()->textClear(0, 198);
+		_vm->display()->clearTexts(0, 198);
 		speak(_talkString[15], NULL, "JOE0015");
 	}
 	else {
@@ -1011,7 +1011,7 @@
 	int startFrame = 0;
 
 	if (_talkHead && isJoe) {
-		_vm->graphics()->bobSetText(bob, segment, textX, textY, color, true);
+		_vm->graphics()->setBobText(bob, segment, textX, textY, color, true);
 		defaultAnimation(segment, isJoe, parameters, startFrame, bankNum);
 	}
 	else {
@@ -1066,7 +1066,7 @@
 			headStringAnimation(parameters, bobNum, bankNum);
 		}
 
-		_vm->graphics()->bobSetText(bob, segment, textX, textY, color, _talkHead);
+		_vm->graphics()->setBobText(bob, segment, textX, textY, color, _talkHead);
 
 		if (parameters->animation[0] != '\0' && parameters->animation[0] != 'E') {
 			stringAnimation(parameters, startFrame, bankNum);
@@ -1108,7 +1108,7 @@
 	}
 
 	// Moved here so that Text is cleared when a Torso command done!
-	_vm->graphics()->textClear(0,198);
+	_vm->display()->clearTexts(0,198);
 
 	if (oracle) {
 		uint16 frameNum = _vm->graphics()->personFrames(bobNum);
@@ -1242,7 +1242,7 @@
 
 	// Change NORMAL_INK -> TALK_NORMAL_INK
 
-	_vm->graphics()->textCurrentColor(INK_TALK_NORMAL);
+	_vm->display()->textCurrentColor(INK_TALK_NORMAL);
 
 	// These bobs are up and down arrows
 
@@ -1275,7 +1275,7 @@
 			_vm->grid()->setZone(GS_PANEL, ARROW_ZONE_DOWN, MAX_TEXT_WIDTH + 1, 25, 319, 49);
 		}
 
-		_vm->graphics()->textClear(151,199);
+		_vm->display()->clearTexts(151,199);
 
 		int sentenceCount = 0;
 		int yOffset = 1;
@@ -1304,7 +1304,7 @@
 				for (j = 0; j < optionLines; j++) {
 					if (yOffset < 5) {
 						//debug(6, "Draw text '%s'", optionText[j]);
-						_vm->graphics()->textSet(
+						_vm->display()->setText(
 								(j == 0) ? 0 : 24, 
 								150 - PUSHUP + yOffset * LINE_HEIGHT, 
 								optionText[j]);
@@ -1355,13 +1355,13 @@
 						if (zone > 0) {
 							const Box *b = _vm->grid()->zone(GS_PANEL, zone);
 							for (y = b->y1; y < b->y2; y += 10)
-								_vm->graphics()->textColor(150 + y, INK_JOE);
+								_vm->display()->textColor(150 + y, INK_JOE);
 						}
 
 						if (oldZone > 0) {
 							const Box *b = _vm->grid()->zone(GS_PANEL, oldZone);
 							for (y = b->y1; y < b->y2; y += 10)
-								_vm->graphics()->textColor(150 + y, INK_TALK_NORMAL);
+								_vm->display()->textColor(150 + y, INK_TALK_NORMAL);
 						}
 
 						oldZone = zone;
@@ -1412,12 +1412,12 @@
 	arrowBobDown->active  = false;
 
 	if (selectedSentence > 0) {
-		_vm->graphics()->textClear(0,198);
+		_vm->display()->clearTexts(0, 198);
 
 		speak(_talkString[selectedSentence], NULL, _joeVoiceFilePrefix[selectedSentence]);
 	}
 	
-	_vm->graphics()->textClear(151,151);
+	_vm->display()->clearTexts(151, 151);
 
 	return selectedSentence;
 }

Index: xref.txt
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/xref.txt,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- xref.txt	8 Jan 2004 22:46:42 -0000	1.60
+++ xref.txt	9 Jan 2004 13:36:37 -0000	1.61
@@ -7,8 +7,8 @@
 BANKS
 =====
 erase()						BankManager::close
-freeallframes()				BankManager::eraseAllFrames(true)
-freeframes()				BankManager::eraseAllFrames(false)
+freeallframes()				BankManager::eraseFrames(true)
+freeframes()				BankManager::eraseFrames(false)
 loadbank()					BankManager::load
 overpack()					BankManager::overpack
 unpack()					BankManager::unpack
@@ -119,24 +119,23 @@
 
 GRAPHICS
 ========
-bob()						Graphics::bobDraw
-Box()						Display::drawBox
-CHECK_PARALLAX()			Graphics::bobCustomParallax
-clearallbobs()				Graphics::bobClearAll
-clearbob()					Graphics::bobClear
+bob()						Graphics::drawBob
+CHECK_PARALLAX()			Graphics::handleParallax
+clearallbobs()				Graphics::clearBobs
+clearbob()					Graphics::clearBob
 DISP_OBJECTS()				Graphics::setupRoomObjects
-drawbobs()					Graphics::bobDrawAll
-invbob()					Graphics::bobDrawInventoryItem
+drawbobs()					Graphics::drawBobs
+invbob()					Graphics::drawInventoryItem
 loadbackdrop()				*not needed* (included in Display::setupNewRoom)
 loadpanel()					Display::setupPanel
-MAKE_SPEAK_BOB()			Graphics::bobSetText
+MAKE_SPEAK_BOB()			Graphics::setBobText
 makeanim()					BobSlot::animNormal
 movebob()					BobSlot::move
-pastebob()					Graphics::bobPaste
+pastebob()					Graphics::pasteBob
 REDISP_OBJECT()				Graphics::refreshObject
 requestor()
-shrinkbob()					Graphics::bobShrink
-sortbobs()					Graphics::bobSortAll
+shrinkbob()					Graphics::shrinkFrame
+sortbobs()					Graphics::sortBobs
 stringanim()				BobSlot::animString
 -
 bobs						Graphics::_bobs
@@ -208,14 +207,14 @@
 =====
 CHECK_PLAYER()				QueenEngine::update
 CUTAWAY_SPECIAL()			Logic::removeHotelItemsFromInventory
-DISP_ROOM()					Logic::roomDisplay
+DISP_ROOM()					Logic::displayRoom
 FIND_BOB()					Logic::findBob
 FIND_FRAME()				Logic::findFrame
 FIND_GRAPHIC()				Logic::graphicData
 P3_COPY_FROM()				Logic::objectCopy
 R_MAP()						Logic::handlePinnacleRoom
 restart_game()
-SETUP_BOBS()				Graphics::bobSetupControl
+SETUP_BOBS()				Graphics::unpackControlBank / Graphics::setupMouseCursor
 SETUP_FURNITURE()			Graphics::setupRoomFurniture
 SETUP_ROOM()				Logic::changeRoom
 SETUP_SCREENS()				*not needed* (only calls Display::setupPanel)
@@ -290,6 +289,7 @@
 
 SCREEN
 ======
+Box()						Display::drawBox
 calc_screen_scroll()		Display::horizontalScrollUpdate
 changejoepal()				Display::palSetJoe*
 check_colors()				Display::palCustomColors
@@ -377,15 +377,15 @@
 
 TEXTS
 =====
-blanktexts()				Graphics::textClear
-drawtext()					Graphics::textDrawAll
-Ink() 						Graphics::textCurrentColor
-MIDDLE() 					Graphics::textCenterX / Graphics::textSetCentered
-text()						Graphics::textSet
-textlen() 					Graphics::textWidth
+blanktexts()				Display::clearTexts
+drawtext()					Display::drawTexts
+Ink() 						Display::textCurrentColor
+MIDDLE() 					Display::textCenterX / Display::textSetCentered
+text()						Display::setText
+textlen() 					Display::textWidth
 -
-textcol						Graphics::_curTextColor
-texts						Graphics::_texts
+textcol						Display::_curTextColor
+texts						Display::_texts
 
 
 WALK





More information about the Scummvm-git-logs mailing list