[Scummvm-cvs-logs] CVS: scummvm/queen command.cpp,1.68.2.5,1.68.2.6 command.h,1.18.2.2,1.18.2.3 cutaway.cpp,1.123.2.4,1.123.2.5 cutaway.h,1.34.2.1,1.34.2.2 debug.cpp,1.11.2.1,1.11.2.2 graphics.cpp,1.94.2.3,1.94.2.4 graphics.h,1.66.2.2,1.66.2.3 journal.cpp,1.29.2.5,1.29.2.6 logic.cpp,1.187.2.7,1.187.2.8 talk.cpp,1.89.2.3,1.89.2.4 talk.h,1.29.2.2,1.29.2.3

Gregory Montoir cyx at users.sourceforge.net
Thu Apr 8 11:14:08 CEST 2004


Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4504/queen

Modified Files:
      Tag: branch-0-6-0
	command.cpp command.h cutaway.cpp cutaway.h debug.cpp 
	graphics.cpp graphics.h journal.cpp logic.cpp talk.cpp talk.h 
Log Message:
backport of fixed/new stuff :
- journal in spanish version is now fully usable
- hebrew version support
- no more crash during Oracle scene


Index: command.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/command.cpp,v
retrieving revision 1.68.2.5
retrieving revision 1.68.2.6
diff -u -d -r1.68.2.5 -r1.68.2.6
--- command.cpp	14 Mar 2004 13:23:55 -0000	1.68.2.5
+++ command.cpp	8 Apr 2004 18:00:19 -0000	1.68.2.6
@@ -35,16 +35,21 @@
 
 namespace Queen {
 
+CmdText::CmdText(bool reversed, uint8 y, QueenEngine *vm)
+	: _isReversed(reversed), _y(y), _vm(vm) {
+	clear();
+}
+
 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);
+	_vm->display()->setTextCentered(_y, _command, false);
 }
 
-void CmdText::displayTemp(uint8 color, Verb v, const char *name) {
+void CmdText::displayTemp(uint8 color, Verb v, const char *name, bool outlined) {
 	char temp[MAX_COMMAND_LEN] = "";
 	if (_isReversed) {
 		if (name != NULL)
@@ -58,17 +63,17 @@
 		}
 	}
 	_vm->display()->textCurrentColor(color);
-	_vm->display()->setTextCentered(COMMAND_Y_POS, temp, false);
+	_vm->display()->setTextCentered(_y, temp, outlined);
 }
 
-void CmdText::displayTemp(uint8 color, const char *name) {
+void CmdText::displayTemp(uint8 color, const char *name, bool outlined) {
 	char temp[MAX_COMMAND_LEN];
 	if (_isReversed)
 		sprintf(temp, "%s %s", name, _command);
 	else
 		sprintf(temp, "%s %s", _command, name);
 	_vm->display()->textCurrentColor(color);
-	_vm->display()->setTextCentered(COMMAND_Y_POS, temp, false);
+	_vm->display()->setTextCentered(_y, temp, outlined);
 }
 
 void CmdText::setVerb(Verb v) {
@@ -117,9 +122,7 @@
 }
 
 Command::Command(QueenEngine *vm)
-	: _vm(vm) {
-	_cmdText._isReversed = (vm->resource()->getLanguage() == HEBREW);
-	_cmdText._vm = vm;
+	: _cmdText((vm->resource()->getLanguage() == HEBREW), CmdText::COMMAND_Y_POS, vm), _vm(vm) {
 }
 
 void Command::clear(bool clearTexts) {

Index: command.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/command.h,v
retrieving revision 1.18.2.2
retrieving revision 1.18.2.3
diff -u -d -r1.18.2.2 -r1.18.2.3
--- command.h	14 Mar 2004 00:52:53 -0000	1.18.2.2
+++ command.h	8 Apr 2004 18:00:19 -0000	1.18.2.3
@@ -32,10 +32,12 @@
 
 struct CmdText {
 
+	CmdText(bool reversed, uint8 y, QueenEngine *vm);
+
 	void clear();
 	void display(uint8 color);
-	void displayTemp(uint8 color, Verb v, const char *name = NULL);
-	void displayTemp(uint8 color, const char *name);
+	void displayTemp(uint8 color, Verb v, const char *name = NULL, bool outlined = false);
+	void displayTemp(uint8 color, const char *name, bool outlined = false);
 	void setVerb(Verb v);
 	void addLinkWord(Verb v);
 	void addObject(const char *objName);
@@ -47,6 +49,7 @@
 	};
 
 	bool _isReversed;
+	uint8 _y;
 	char _command[MAX_COMMAND_LEN];
 	QueenEngine *_vm;
 };

Index: cutaway.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/cutaway.cpp,v
retrieving revision 1.123.2.4
retrieving revision 1.123.2.5
diff -u -d -r1.123.2.4 -r1.123.2.5
--- cutaway.cpp	23 Mar 2004 23:46:36 -0000	1.123.2.4
+++ cutaway.cpp	8 Apr 2004 18:00:20 -0000	1.123.2.5
@@ -1229,23 +1229,20 @@
 int Cutaway::makeComplexAnimation(int16 currentImage, Cutaway::CutawayAnim *objAnim, int frameCount) {
 	int frameIndex[256];
 	int i;
-	int bobNum = objAnim[0].object;
-	assert(bobNum < 21);
+	assert(frameCount < 30);
+	AnimFrame cutAnim[30];
 	
 	memset(frameIndex, 0, sizeof(frameIndex));
 	debug(6, "[Cutaway::makeComplexAnimation] currentImage = %i", currentImage);
 
-	BobSlot *bob = _vm->graphics()->bob(bobNum);
-	bob->xflip = objAnim[0].flip;
-
 	for (i = 0; i < frameCount; i++) {
-		_cutAnim[bobNum][i].frame = objAnim[i].unpackFrame;
-		_cutAnim[bobNum][i].speed = objAnim[i].speed;
+		cutAnim[i].frame = objAnim[i].unpackFrame;
+		cutAnim[i].speed = objAnim[i].speed;
 		frameIndex[objAnim[i].unpackFrame] = 1;
 	}
 
-	_cutAnim[bobNum][frameCount].frame = 0;	
-	_cutAnim[bobNum][frameCount].speed = 0;
+	cutAnim[frameCount].frame = 0;	
+	cutAnim[frameCount].speed = 0;
 
 	int nextFrameIndex = 1;
 
@@ -1254,20 +1251,17 @@
 			frameIndex[i] = nextFrameIndex++;
 
 	for (i = 0; i < frameCount; i++) {
-		_cutAnim[bobNum][i].frame = currentImage + frameIndex[objAnim[i].unpackFrame];
-		//debug(6, "_cutAnim[%i][%i].frame = %i", bobNum, i, _cutAnim[bobNum][i].frame);
+		cutAnim[i].frame = currentImage + frameIndex[objAnim[i].unpackFrame];
 	}
 
 	for (i = 1; i < 256; i++) {
 		if (frameIndex[i]) {
 			currentImage++;
-			//debug(6, "bankUnpack(%i, %i, %i)", i, currentImage, objAnim[0].bank);
 			_vm->bankMan()->unpack(i, currentImage, objAnim[0].bank);
 		}
 	}
 
-	bob->animString(_cutAnim[bobNum]);
-
+	_vm->graphics()->setBobCutawayAnim(objAnim[0].object, objAnim[0].flip, cutAnim, frameCount + 1);
 	return currentImage;
 }
 

Index: cutaway.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/cutaway.h,v
retrieving revision 1.34.2.1
retrieving revision 1.34.2.2
diff -u -d -r1.34.2.1 -r1.34.2.2
--- cutaway.h	7 Mar 2004 10:44:43 -0000	1.34.2.1
+++ cutaway.h	8 Apr 2004 18:00:20 -0000	1.34.2.2
@@ -194,8 +194,6 @@
 
 		int16 _currentImage;
 
-		AnimFrame _cutAnim[21][30];
-
 		Cutaway(const char *filename, 
 				QueenEngine *vm);
 		~Cutaway();


Index: graphics.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/graphics.cpp,v
retrieving revision 1.94.2.3
retrieving revision 1.94.2.4
diff -u -d -r1.94.2.3 -r1.94.2.4
--- graphics.cpp	18 Mar 2004 21:53:20 -0000	1.94.2.3
+++ graphics.cpp	8 Apr 2004 18:00:20 -0000	1.94.2.4
@@ -593,6 +593,13 @@
 	}
 }
 
+void Graphics::setBobCutawayAnim(uint16 bobNum, bool xflip, const AnimFrame *af, uint8 frameCount) {
+	assert(bobNum < 21 && frameCount < 30);
+	memcpy(_cutAnim[bobNum], af, sizeof(AnimFrame) * frameCount);
+	_bobs[bobNum].xflip = xflip;
+	_bobs[bobNum].animString(_cutAnim[bobNum]);
+}
+
 void Graphics::fillAnimBuffer(const char *anim, AnimFrame *af) {
 	for (;;) {
 		// anim frame format is "%3hu,%3hu," (frame number, frame speed)

Index: graphics.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/graphics.h,v
retrieving revision 1.66.2.2
retrieving revision 1.66.2.3
diff -u -d -r1.66.2.2 -r1.66.2.3
--- graphics.h	7 Mar 2004 10:44:43 -0000	1.66.2.2
+++ graphics.h	8 Apr 2004 18:00:20 -0000	1.66.2.3
@@ -115,6 +115,7 @@
 
 	void setupNewRoom(const char *room, uint16 roomNum, int16 *furniture, uint16 furnitureCount);
 
+	void setBobCutawayAnim(uint16 bobNum, bool xflip, const AnimFrame *af, uint8 frameCount);
 	void fillAnimBuffer(const char *anim, AnimFrame *af);
 	uint16 countAnimFrames(const char *anim);
 	void setupObjectAnim(const GraphicData *gd, uint16 firstImage, uint16 bobNum, bool visible);
@@ -165,8 +166,12 @@
 	//! used to scale a BobFrame
 	BobFrame _shrinkBuffer;
 
+	//! in-game objects/persons animations
 	AnimFrame _newAnim[17][30];
 
+	//! cutaway objects/persons animations
+	AnimFrame _cutAnim[21][30];
+	
 	uint16 _personFrames[4];
 
 	//! Number of animated furniture in current room

Index: journal.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/journal.cpp,v
retrieving revision 1.29.2.5
retrieving revision 1.29.2.6
diff -u -d -r1.29.2.5 -r1.29.2.6
--- journal.cpp	9 Mar 2004 00:58:57 -0000	1.29.2.5
+++ journal.cpp	8 Apr 2004 18:00:20 -0000	1.29.2.6
@@ -34,14 +34,12 @@
 
 namespace Queen {
 
-
 Journal::Journal(QueenEngine *vm)
 	: _vm(vm) {
 	_currentSavePage = 0;
 	_currentSaveSlot = 0;
 }
 
-
 void Journal::use() {
 	BobSlot *joe = _vm->graphics()->bob(0);
 	_prevJoeX = joe->x;
@@ -97,7 +95,6 @@
 	}
 }
 
-
 void Journal::prepare() {
 	_vm->display()->horizontalScroll(0);
 	_vm->display()->fullscreen(true);
@@ -140,7 +137,6 @@
 	_vm->bankMan()->close(JOURNAL_BANK);
 }
 
-
 void Journal::restore() {
 	_vm->display()->fullscreen(false);
 	_vm->display()->forceFullRefresh();
@@ -152,7 +148,6 @@
 	_vm->logic()->displayRoom(_vm->logic()->currentRoom(), RDM_FADE_JOE, 0, 0, false);
 }
 
-
 void Journal::redraw() {
 	drawNormalPanel();
 	drawConfigPanel();
@@ -160,7 +155,6 @@
 	drawSaveSlot();
 }
 
-
 void Journal::update() {
 	_vm->graphics()->update(JOURNAL_ROOM);
 	if (_edit.enable) {
@@ -172,19 +166,16 @@
 	_vm->display()->update();
 }
 
-
 void Journal::showBob(int bobNum, int16 x, int16 y, int frameNum) {
 	BobSlot *bob = _vm->graphics()->bob(bobNum);
 	bob->curPos(x, y);
 	bob->frameNum = JOURNAL_FRAMES + frameNum;
 }
 
-
 void Journal::hideBob(int bobNum) {
 	_vm->graphics()->bob(bobNum)->active = false;
 }
 
-
 void Journal::drawSaveDescriptions() {
 	int i;
 	for (i = 0; i < SAVE_PER_PAGE; ++i) {
@@ -199,19 +190,16 @@
 	showBob(BOB_SAVE_PAGE, 300, 3 + _currentSavePage * 15, 6 + _currentSavePage);
 }
 
-
 void Journal::drawSaveSlot() {
 	showBob(BOB_SAVE_DESC, 130, 6 + _currentSaveSlot * 13, 17);
 }
 
-
 void Journal::enterYesNoMode(int16 zoneNum, int titleNum) {
 	_mode = M_YES_NO;
 	_prevZoneNum = zoneNum;
 	drawYesNoPanel(titleNum);
 }
 
-
 void Journal::exitYesNoMode() {
 	_mode = M_NORMAL;
 	if (_prevZoneNum == ZN_MAKE_ENTRY) {
@@ -223,7 +211,6 @@
 	redraw();
 }
 
-
 void Journal::handleNormalMode(int16 zoneNum, int x) {
 	if (zoneNum == ZN_REVIEW_ENTRY) {
 		enterYesNoMode(zoneNum, TXT_REVIEW_ENTRY);
@@ -271,13 +258,11 @@
 	}
 }
 
-
 void Journal::handleInfoBoxMode(int16 zoneNum) {
 	hideInformationBox();
 	_mode = M_NORMAL;
 }
 
-
 void Journal::handleYesNoMode(int16 zoneNum) {
 	if (zoneNum == ZN_YES) {
 		_mode = M_NORMAL;
@@ -316,7 +301,6 @@
 	}
 }
 
-
 void Journal::handleMouseWheel(int inc) {
 	if (_mode == M_NORMAL) {
 		int curSave = _currentSavePage * SAVE_PER_PAGE + _currentSaveSlot + inc;
@@ -330,7 +314,6 @@
 	}
 }
 
-
 void Journal::handleMouseDown(int x, int y) {
 	int16 zone = _vm->grid()->findZoneForPos(GS_ROOM, x, y);
 	if (_mode == M_INFO_BOX) {
@@ -343,7 +326,6 @@
 	update();
 }
 
-
 void Journal::handleKeyDown(uint16 ascii, int keycode) {
 	if (_mode == M_YES_NO) {
 		if (keycode == 27) { // escape
@@ -356,7 +338,6 @@
 	}
 }
 
-
 void Journal::clearPanelTexts() {
 	int i;
 	for (i = 0; i < _panelTextCount; ++i) {
@@ -364,23 +345,28 @@
 	}
 }
 
-
 void Journal::drawPanelText(int y, const char *text) {
+	debug(5, "Journal::drawPanelText(%d, '%s')", y, text);	
 	char s[80];
 	strcpy(s, text);
 	char *p = strchr(s, ' ');
 	if (p == NULL) {
 		int x = (128 - _vm->display()->textWidth(s)) / 2;
 		_vm->display()->setText(x, y, s, false);
+		assert(_panelTextCount < MAX_PANEL_TEXTS);
 		_panelTextY[_panelTextCount++] = y;
 	} else {
 		*p++ = '\0';
-		drawPanelText(y - 5, s);
-		drawPanelText(y + 5, p);
+		if (_vm->resource()->getLanguage() == HEBREW) {
+			drawPanelText(y - 5, p);
+			drawPanelText(y + 5, s);
+		} else {
+			drawPanelText(y - 5, s);
+			drawPanelText(y + 5, p);
+		}
 	}
 }
 
-
 void Journal::drawCheckBox(bool active, int bobNum, int16 x, int16 y, int frameNum) {
 	if (active) {
 		showBob(bobNum, x, y, frameNum);
@@ -389,12 +375,10 @@
 	}
 }
 
-
 void Journal::drawSlideBar(int value, int hi, int lo, int bobNum, int16 x, int16 y, int frameNum) {
 	showBob(bobNum, x + value * hi / lo, y, frameNum);
 }
 
-
 void Journal::drawPanel(const int *frames, const int *titles, int n) { 
 	clearPanelTexts();
 	_panelTextCount = 0;
@@ -407,14 +391,12 @@
 	}
 }
 
-
 void Journal::drawNormalPanel() {
 	int frames[] = { FRAME_BLUE_1, FRAME_BLUE_2, FRAME_BLUE_1, FRAME_ORANGE };
 	int titles[] = { TXT_REVIEW_ENTRY, TXT_MAKE_ENTRY, TXT_CLOSE, TXT_GIVE_UP };
 	drawPanel(frames, titles, 4);
 }
 
-
 void Journal::drawYesNoPanel(int titleNum) {
 	int frames[] = { FRAME_GREY, FRAME_BLUE_1, FRAME_BLUE_2 };
 	int titles[] = { titleNum, TXT_YES, TXT_NO };
@@ -429,7 +411,6 @@
 	hideBob(BOB_MUSIC_TOGGLE);
 }
 
-
 void Journal::drawConfigPanel() {
 	_vm->checkOptionSettings();
 
@@ -442,7 +423,6 @@
 	drawCheckBox(_vm->sound()->musicOn(), BOB_MUSIC_TOGGLE, 125, 181, FRAME_CHECK_BOX);
 }
 
-
 void Journal::showInformationBox() {
 	_vm->display()->clearTexts(0, GAME_SCREEN_HEIGHT - 1);
 	showBob(BOB_INFO_BOX, 72, 221, FRAME_INFO_BOX);
@@ -490,14 +470,12 @@
 	_vm->display()->setTextCentered(156, versionId, false);
 }
 
-
 void Journal::hideInformationBox() {
 	_vm->display()->clearTexts(0, GAME_SCREEN_HEIGHT - 1);
 	hideBob(BOB_INFO_BOX);
 	redraw();
 }
 
-
 void Journal::initEditBuffer(const char *desc) {
 	OSystem::Property prop;
 	prop.show_keyboard = true;
@@ -509,7 +487,6 @@
 	strcpy(_edit.text, desc);
 }
 
-
 void Journal::updateEditBuffer(uint16 ascii, int keycode) {
 	bool dirty = false;
 	switch (keycode) {

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.cpp,v
retrieving revision 1.187.2.7
retrieving revision 1.187.2.8
diff -u -d -r1.187.2.7 -r1.187.2.8
--- logic.cpp	23 Mar 2004 20:32:18 -0000	1.187.2.7
+++ logic.cpp	8 Apr 2004 18:00:20 -0000	1.187.2.8
@@ -43,6 +43,17 @@
 
 namespace Queen {
 
+static char *trim(char *str) {
+	char *p = str + strlen(str) - 1;
+	while (p != str && *p == ' ') {
+		*p-- = '\0';
+	}
+	while (str != p && *str == ' ') {
+		++str;
+	}
+	return str;
+}
+
 Logic::Logic(QueenEngine *vm)
 	:  _queen2jas(NULL), _credits(NULL), _vm(vm) {
 	_joe.x = _joe.y = 0;
@@ -204,6 +215,15 @@
 	_joeResponse[0] = 0;
 	for (i = 1; i <= JOE_RESPONSE_MAX; i++)
 		_joeResponse[i] = _queen2jas->nextLine();
+	
+	// FIXME - the spanish version adds some space characters (0x20) at the
+	// beginning and the end of the journal button captions. As we don't need
+	// that 'trick' to center horizontally the texts, we simply trim them.
+	if (_vm->resource()->getLanguage() == SPANISH) {
+		for (i = 30; i <= 35; i++) {
+			_joeResponse[i] = trim(_joeResponse[i]);
+		}
+	}
 
 	_aAnim = new char*[_numAAnim + 1];
 	_aAnim[0] = 0;
@@ -1176,10 +1196,11 @@
 
 	_vm->update();
 	_vm->display()->palFadeIn(0, 223, ROOM_JUNGLE_PINNACLE, joe->active, joe->x, joe->y);
-	_vm->display()->textCurrentColor(INK_PINNACLE_ROOM);
 
 	_entryObj = 0;
 	uint16 prevObj = 0;
+	CmdText cmdText((_vm->resource()->getLanguage() == HEBREW), 5, _vm);
+	cmdText.setVerb(VERB_WALK_TO);
 	while (_vm->input()->mouseButton() == 0 || _entryObj == 0) {
 
 		_vm->update();
@@ -1202,9 +1223,7 @@
 			ObjectData *objData = objectData(curObj);
 			if (objData->name > 0) {
 				_entryObj = objData->entryObj;
-				char textCmd[CmdText::MAX_COMMAND_LEN];
-				sprintf(textCmd, "%s %s", verbName(VERB_WALK_TO), objectName(objData->name));
-				_vm->display()->setTextCentered(5, textCmd);
+				cmdText.displayTemp(INK_PINNACLE_ROOM, objectName(objData->name), true);
 			}
 			prevObj = curObj;
 		}

Index: talk.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/talk.cpp,v
retrieving revision 1.89.2.3
retrieving revision 1.89.2.4
diff -u -d -r1.89.2.3 -r1.89.2.4
--- talk.cpp	23 Mar 2004 20:32:18 -0000	1.89.2.3
+++ talk.cpp	8 Apr 2004 18:00:20 -0000	1.89.2.4
@@ -1181,15 +1181,69 @@
 
 int Talk::splitOption(const char *str, char optionText[5][MAX_STRING_SIZE]) {
 	debug(6, "Talk::splitOption(%s)", str);
-	// Check to see if option fits on one line, and exit early
+	int lines;
+	memset(optionText, 0, 5 * MAX_STRING_SIZE);
 	if (_vm->resource()->getLanguage() == ENGLISH || 
 		_vm->display()->textWidth(str) <= MAX_TEXT_WIDTH) {
 		strcpy(optionText[0], str);
-		return 1;
+		lines = 1;
+	} else if (_vm->resource()->getLanguage() == HEBREW) {
+		lines = splitOptionHebrew(str, optionText);
+	} else {
+		lines = splitOptionDefault(str, optionText);
+	}
+	return lines;
+}
+
+int Talk::splitOptionHebrew(const char *str, char optionText[5][MAX_STRING_SIZE]) {
+	char tmpString[MAX_STRING_SIZE] = "";
+	uint16 len = 0;
+	uint16 spaceCharWidth = _vm->display()->textWidth(" ");
+	uint16 width = 0;
+	uint16 optionLines = 0;
+	uint16 maxTextLen = MAX_TEXT_WIDTH;
+	char *p = strchr(str, '\0');
+	while (p != str - 1) {
+		while (*p != ' ' && p != str - 1) {
+			--p;
+			++len;
+		}
+		if (p != str - 1) {
+			uint16 wordWidth = _vm->display()->textWidth(p, len);
+			width += wordWidth;
+			if (width > maxTextLen) {
+				++optionLines;
+				strncpy(optionText[optionLines], p, len);
+				optionText[optionLines][len] = '\0';
+				width = wordWidth;
+				maxTextLen = MAX_TEXT_WIDTH - OPTION_TEXT_MARGIN;
+			} else {
+				strcpy(tmpString, optionText[optionLines]);
+				strncpy(optionText[optionLines], p, len);
+				optionText[optionLines][len] = '\0';
+				strcat(optionText[optionLines], tmpString);
+			}
+			--p;
+			len = 1;
+			width += spaceCharWidth;
+		} else {
+				if (len > 1) {
+				if (width + _vm->display()->textWidth(p + 1, len) > maxTextLen) {
+					++optionLines;
+				}
+				strcpy(tmpString, optionText[optionLines]);
+				strncpy(optionText[optionLines], p + 1, len);
+				optionText[optionLines][len] = '\0';
+				strcat(optionText[optionLines], tmpString);				
+			}
+			++optionLines;
+		}
 	}
+	return optionLines;
+}
 
+int Talk::splitOptionDefault(const char *str, char optionText[5][MAX_STRING_SIZE]) {
 	// Split up multiple line option at closest space character
-	memset(optionText, 0, 5 * MAX_STRING_SIZE);
 	uint16 spaceCharWidth = _vm->display()->textWidth(" ");
 	uint16 width = 0;
 	uint16 optionLines = 0;
@@ -1201,7 +1255,7 @@
 			uint16 len = p - str;
 			uint16 wordWidth = _vm->display()->textWidth(str, len);
 			width += wordWidth;
-			if (width> maxTextLen) {
+			if (width > maxTextLen) {
 				++optionLines;
 				strncpy(optionText[optionLines], str, len + 1);
 				width = wordWidth;

Index: talk.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/talk.h,v
retrieving revision 1.29.2.2
retrieving revision 1.29.2.3
diff -u -d -r1.29.2.2 -r1.29.2.3
--- talk.h	7 Mar 2004 10:44:43 -0000	1.29.2.2
+++ talk.h	8 Apr 2004 18:00:20 -0000	1.29.2.3
@@ -224,7 +224,10 @@
 			int faceDirection);
 
 	int splitOption(const char *str, char optionText[5][MAX_STRING_SIZE]);
+	
+	int splitOptionHebrew(const char *str, char optionText[5][MAX_STRING_SIZE]);
 
+	int splitOptionDefault(const char *str, char optionText[5][MAX_STRING_SIZE]);
 
 };
 





More information about the Scummvm-git-logs mailing list