[Scummvm-cvs-logs] SF.net SVN: scummvm: [21640] scummvm/trunk/engines/simon

kirben at users.sourceforge.net kirben at users.sourceforge.net
Thu Apr 6 03:48:15 CEST 2006


Revision: 21640
Author:   kirben
Date:     2006-04-06 03:47:37 -0700 (Thu, 06 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21640&view=rev

Log Message:
-----------
Cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/simon/charset.cpp
    scummvm/trunk/engines/simon/icons.cpp
    scummvm/trunk/engines/simon/items.cpp
    scummvm/trunk/engines/simon/saveload.cpp
    scummvm/trunk/engines/simon/simon.cpp
    scummvm/trunk/engines/simon/simon.h
    scummvm/trunk/engines/simon/verb.cpp
Modified: scummvm/trunk/engines/simon/charset.cpp
===================================================================
--- scummvm/trunk/engines/simon/charset.cpp	2006-04-06 08:43:20 UTC (rev 21639)
+++ scummvm/trunk/engines/simon/charset.cpp	2006-04-06 10:47:37 UTC (rev 21640)
@@ -37,7 +37,7 @@
 			if (getBitFlag(93)) {
 				if (_curWindow == 3) {
 					if ((_newLines >= _textWindow->scrollY) && (_newLines < (_textWindow->scrollY + 3)))
-						fcs_putchar(*src);
+						windowPutChar(*src);
 					if (*src == '\n')		// Do two top lines of text only
 						_newLines++;
 					src++;
@@ -46,7 +46,7 @@
 				if (getBitFlag(94)) {
 					if (_curWindow == 3) {
 						if (_newLines == (_textWindow->scrollY + 7))
-							fcs_putchar(*src);
+							windowPutChar(*src);
 						if (*src == '\n')	// Do two top lines of text only
 							_newLines++;
 						src++;
@@ -54,7 +54,7 @@
 				} else {
 					//if (getBitFlag(92))
 					//	while(!_nextCharacter);
-					fcs_putchar(*src++);
+					windowPutChar(*src++);
 					//_nextCharacter = false;
 				}
 			}
@@ -66,7 +66,7 @@
 				_fcsData2[ind] = 1;
 			}
 
-			fcs_putchar(*src++);
+			windowPutChar(*src++);
 		}
 	}
 }
@@ -346,7 +346,7 @@
 	_newLines = 0;
 }
 
-void SimonEngine::video_putchar(WindowBlock *window, byte c, byte b) {
+void SimonEngine::videoPutchar(WindowBlock *window, byte c, byte b) {
 	byte width = 6;
 
 	if (c == 12) {

Modified: scummvm/trunk/engines/simon/icons.cpp
===================================================================
--- scummvm/trunk/engines/simon/icons.cpp	2006-04-06 08:43:20 UTC (rev 21639)
+++ scummvm/trunk/engines/simon/icons.cpp	2006-04-06 10:47:37 UTC (rev 21640)
@@ -553,7 +553,7 @@
 
 	if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
 		changeWindow(num);
-		fcs_putchar(12);
+		windowPutChar(12);
 		changeWindow(curWindow);
 	}
 

Modified: scummvm/trunk/engines/simon/items.cpp
===================================================================
--- scummvm/trunk/engines/simon/items.cpp	2006-04-06 08:43:20 UTC (rev 21639)
+++ scummvm/trunk/engines/simon/items.cpp	2006-04-06 10:47:37 UTC (rev 21640)
@@ -1533,93 +1533,6 @@
 	_vgaBufStart = _vgaFileBufOrg;
 }
 
-int SimonEngine::o_unk_132_helper(bool *b, char *buf) {
-	HitArea *ha;
-	*b = true;
-
-	if (!_saveLoadFlag) {
-	strange_jump:;
-		_saveLoadFlag = false;
-		saveGameDialog(buf);
-	}
-
-start_over:;
-	_keyPressed = 0;
-
-start_over_2:;
-	_lastHitArea = _lastHitArea3 = 0;
-
-	do {
-		if (_keyPressed != 0) {
-			if (_saveLoadFlag) {
-				*b = false;
-				return _keyPressed;
-			}
-			goto start_over;
-		}
-		delay(100);
-	} while (_lastHitArea3 == 0);
-
-	ha = _lastHitArea;
-
-	if (ha == NULL || ha->id < 205)
-		goto start_over_2;
-
-	if (ha->id == 205)
-		return ha->id;
-
-	if (ha->id == 206) {
-		if (_saveLoadRowCurPos == 1)
-			goto start_over_2;
-		if (_saveLoadRowCurPos < 7)
-			_saveLoadRowCurPos = 1;
-		else
-			_saveLoadRowCurPos -= 6;
-
-		goto strange_jump;
-	}
-
-	if (ha->id == 207) {
-		if (!_saveDialogFlag)
-			goto start_over_2;
-		_saveLoadRowCurPos += 6;
-		if (_saveLoadRowCurPos >= _numSaveGameRows)
-			_saveLoadRowCurPos = _numSaveGameRows;
-		goto strange_jump;
-	}
-
-	if (ha->id >= 214)
-		goto start_over_2;
-	return ha->id - 208;
-}
-
-void SimonEngine::o_unk_132_helper_3() {
-	for (int i = 208; i != 208 + 6; i++)
-		set_hitarea_bit_0x40(i);
-}
-
-void SimonEngine::o_clearCharacter(WindowBlock *window, int x, byte b) {
-	byte old_text;
-
-	video_putchar(window, x, b);
-	old_text = window->text_color;
-	window->text_color = window->fill_color;
-
-	if (_language == Common::HB_ISR) { //Hebrew
-		x = 128;
-	} else {
-		x += 120;
-		if (x != 128)
-			x = 129;
-
-	}
-
-	video_putchar(window, x);
-
-	window->text_color = old_text;
-	video_putchar(window, 8);
-}
-
 void SimonEngine::o_playMusic() {
 	int music = getVarOrWord();
 	int track = getVarOrWord();

Modified: scummvm/trunk/engines/simon/saveload.cpp
===================================================================
--- scummvm/trunk/engines/simon/saveload.cpp	2006-04-06 08:43:20 UTC (rev 21639)
+++ scummvm/trunk/engines/simon/saveload.cpp	2006-04-06 10:47:37 UTC (rev 21640)
@@ -180,7 +180,7 @@
 	int number_of_savegames;
 	int i;
 	int unk132_result;
-	WindowBlock *fcs;
+	WindowBlock *window;
 	char *name;
 	int name_len;
 	bool b;
@@ -224,20 +224,20 @@
 
 		// some code here
 
-		fcs = _windowArray[5];
+		window = _windowArray[5];
 
-		fcs->textRow = unk132_result;
+		window->textRow = unk132_result;
 
 		if (_language == Common::HB_ISR) { //Hebrew
 			// init x offset with a 2 character savegame number + a period (18 pix)
-			fcs->textColumn = 3;
-			fcs->textColumnOffset = 6;
-			fcs->textLength = 3;
+			window->textColumn = 3;
+			window->textColumnOffset = 6;
+			window->textLength = 3;
 		} else {
 			// init x offset with a 2 character savegame number + a period (18 pix)
-			fcs->textColumn = 2;
-			fcs->textColumnOffset = 2;
-			fcs->textLength = 3;
+			window->textColumn = 2;
+			window->textColumnOffset = 2;
+			window->textLength = 3;
 		}
 
 		name = buf + i * 18;
@@ -249,20 +249,20 @@
 				byte width = 6;
 				if (name[name_len] >= 64 && name[name_len] < 91)
 					width = _hebrew_char_widths [name[name_len] - 64];
-				fcs->textLength++;
-				fcs->textColumnOffset -= width;
-				if (fcs->textColumnOffset < width) {
-					fcs->textColumnOffset += 8;
-					fcs->textColumn++;
+				window->textLength++;
+				window->textColumnOffset -= width;
+				if (window->textColumnOffset < width) {
+					window->textColumnOffset += 8;
+					window->textColumn++;
 				}
 			} else {
-				fcs->textLength++;
-				fcs->textColumnOffset += 6;
+				window->textLength++;
+				window->textColumnOffset += 6;
 				if (name[name_len] == 'i' || name[name_len] == 'l')
-					fcs->textColumnOffset -= 2;
-				if (fcs->textColumnOffset >= 8) {
-					fcs->textColumnOffset -= 8;
-					fcs->textColumn++;
+					window->textColumnOffset -= 2;
+				if (window->textColumnOffset >= 8) {
+					window->textColumnOffset -= 8;
+					window->textColumn++;
 				}
 			}
 			name_len++;
@@ -271,7 +271,7 @@
 
 		// do_3_start
 		for (;;) {
-			video_putchar(fcs, 0x7f);
+			videoPutchar(window, 0x7f);
 
 			_saveLoadFlag = true;
 
@@ -322,7 +322,7 @@
 			} else if (i >= 32 && name_len != 17) {
 				name[name_len++] = i;
 
-				video_putchar(_windowArray[5], i);
+				videoPutchar(_windowArray[5], i);
 			}
 		}
 
@@ -350,8 +350,95 @@
 	g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
 }
 
-void SimonEngine::o_fileError(WindowBlock *fcs, bool save_error) {
+int SimonEngine::o_unk_132_helper(bool *b, char *buf) {
 	HitArea *ha;
+	*b = true;
+
+	if (!_saveLoadFlag) {
+	strange_jump:;
+		_saveLoadFlag = false;
+		saveGameDialog(buf);
+	}
+
+start_over:;
+	_keyPressed = 0;
+
+start_over_2:;
+	_lastHitArea = _lastHitArea3 = 0;
+
+	do {
+		if (_keyPressed != 0) {
+			if (_saveLoadFlag) {
+				*b = false;
+				return _keyPressed;
+			}
+			goto start_over;
+		}
+		delay(100);
+	} while (_lastHitArea3 == 0);
+
+	ha = _lastHitArea;
+
+	if (ha == NULL || ha->id < 205)
+		goto start_over_2;
+
+	if (ha->id == 205)
+		return ha->id;
+
+	if (ha->id == 206) {
+		if (_saveLoadRowCurPos == 1)
+			goto start_over_2;
+		if (_saveLoadRowCurPos < 7)
+			_saveLoadRowCurPos = 1;
+		else
+			_saveLoadRowCurPos -= 6;
+
+		goto strange_jump;
+	}
+
+	if (ha->id == 207) {
+		if (!_saveDialogFlag)
+			goto start_over_2;
+		_saveLoadRowCurPos += 6;
+		if (_saveLoadRowCurPos >= _numSaveGameRows)
+			_saveLoadRowCurPos = _numSaveGameRows;
+		goto strange_jump;
+	}
+
+	if (ha->id >= 214)
+		goto start_over_2;
+	return ha->id - 208;
+}
+
+void SimonEngine::o_unk_132_helper_3() {
+	for (int i = 208; i != 208 + 6; i++)
+		set_hitarea_bit_0x40(i);
+}
+
+void SimonEngine::o_clearCharacter(WindowBlock *window, int x, byte b) {
+	byte old_text;
+
+	videoPutchar(window, x, b);
+	old_text = window->text_color;
+	window->text_color = window->fill_color;
+
+	if (_language == Common::HB_ISR) { //Hebrew
+		x = 128;
+	} else {
+		x += 120;
+		if (x != 128)
+			x = 129;
+
+	}
+
+	videoPutchar(window, x);
+
+	window->text_color = old_text;
+	videoPutchar(window, 8);
+}
+
+void SimonEngine::o_fileError(WindowBlock *window, bool save_error) {
+	HitArea *ha;
 	const char *string, *string2;
 
 	if (save_error) {
@@ -362,23 +449,23 @@
 		string2 = "\r     File not found.";
 	}
 
-	video_putchar(fcs, 0xC);
+	videoPutchar(window, 0xC);
 	for (; *string; string++)
-		video_putchar(fcs, *string);
+		videoPutchar(window, *string);
 	for (; *string2; string2++)
-		video_putchar(fcs, *string2);
+		videoPutchar(window, *string2);
 
-	fcs->textColumn = (fcs->width >> 1) - 3;
-	fcs->textRow = fcs->height - 1;
-	fcs->textLength = 0;
+	window->textColumn = (window->width / 2) - 3;
+	window->textRow = window->height - 1;
+	window->textLength = 0;
 
 	string = "[ OK ]";
 	for (; *string; string++)
-		video_putchar(fcs, *string);
+		videoPutchar(window, *string);
 
 	ha = findEmptyHitArea();
-	ha->x = ((fcs->width >> 1) + (fcs->x - 3)) << 3;
-	ha->y = (fcs->height << 3) + fcs->y - 8;
+	ha->x = ((window->width >> 1) + (window->x - 3)) * 8;
+	ha->y = (window->height << 3) + window->y - 8;
 	ha->width = 48;
 	ha->height = 8;
 	ha->flags = 0x20;

Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp	2006-04-06 08:43:20 UTC (rev 21639)
+++ scummvm/trunk/engines/simon/simon.cpp	2006-04-06 10:47:37 UTC (rev 21640)
@@ -291,7 +291,7 @@
 	_leftButtonDown = 0;
 	_hitAreaSubjectItem = 0;
 	_currentVerbBox = 0;
-	_hitAreaPtr7 = 0;
+	_lastVerbOn = 0;
 	_needHitAreaRecalc = 0;
 	_verbHitArea = 0;
 	_defaultVerb = 0;
@@ -418,7 +418,7 @@
 
 	memset(_videoBuf1, 0, sizeof(_videoBuf1));
 
-	_fcs_list = new WindowBlock[16];
+	_windowList = new WindowBlock[16];
 
 	memset(_lettersToPrintBuf, 0, sizeof(_lettersToPrintBuf));
 
@@ -658,7 +658,7 @@
 	delete _dummyItem2;
 	delete _dummyItem3;
 
-	delete [] _fcs_list;
+	delete [] _windowList;
 
 	delete _sound;
 	delete _debugger;
@@ -1687,7 +1687,7 @@
 	_lockWord &= ~1;
 }
 
-void SimonEngine::handle_mouse_moved() {
+void SimonEngine::handleMouseMoved() {
 	uint x;
 
 	if (_mouseHideCount) {
@@ -1740,16 +1740,15 @@
 			setVerb(NULL);
 		}
 	}
-
 	if (getGameType() == GType_SIMON2) {
 		if (getBitFlag(79)) {
 			if (!_vgaVar9) {
-				if (_mouseX >= 630 / 2 || _mouseX < 9)
+				if (_mouseX >= 315 || _mouseX < 9)
 					goto get_out2;
 				_vgaVar9 = 1;
 			}
 			if (_scrollCount == 0) {
-				if (_mouseX >= 631 / 2) {
+				if (_mouseX >= 315) {
 					if (_scrollX != _scrollXMax)
 						_scrollFlag = 1;
 				} else if (_mouseX < 8) {
@@ -1801,7 +1800,7 @@
 	return child->array[offs];
 }
 
-void SimonEngine::f10_key() {
+void SimonEngine::displayBoxStars() {
 	HitArea *ha, *dha;
 	uint count;
 	uint y_, x_;
@@ -1918,7 +1917,7 @@
 
 		for (;;) {
 			if (_keyPressed == 35)
-				f10_key();
+				displayBoxStars();
 			processSpecialKeys();
 			if (_lastHitArea3 == (HitArea *) -1)
 				goto startOver;
@@ -1981,7 +1980,7 @@
 			Subroutine *sub = getSubroutineByID(subr_id);
 			if (sub != NULL) {
 				startSubroutineEx(sub);
-				startUp_helper_2();
+				permitInput();
 			}
 			_variableArray[254] = 0;
 			_runScriptReturn1 = false;
@@ -1996,7 +1995,7 @@
 	if ((uint) cur_time != _lastTime) {
 		_lastTime = cur_time;
 		if (kickoffTimeEvents())
-			startUp_helper_2();
+			permitInput();
 	}
 }
 
@@ -2011,7 +2010,7 @@
 		if (sub != NULL) {
 			_variableArray[249] = 0;
 			startSubroutineEx(sub);
-			startUp_helper_2();
+			permitInput();
 		}
 		_variableArray[249] = 0;
 	}
@@ -2022,7 +2021,7 @@
 		if (sub != NULL) {
 			_variableArray[254] = 0;
 			startSubroutineEx(sub);
-			startUp_helper_2();
+			permitInput();
 		}
 		_variableArray[254] = 0;
 	}
@@ -2030,7 +2029,7 @@
 	_runScriptReturn1 = false;
 }
 
-void SimonEngine::startUp_helper_2() {
+void SimonEngine::permitInput() {
 	if (!_mortalFlag) {
 		_mortalFlag = true;
 		showmessage_print_char(0);
@@ -2051,7 +2050,7 @@
 	_mouseY = _sdlMouseY;
 }
 
-void SimonEngine::handle_verb_clicked(uint verb) {
+void SimonEngine::handleVerbClicked(uint verb) {
 	Subroutine *sub;
 	int result;
 
@@ -2106,7 +2105,7 @@
 	if (getGameType() == GType_SIMON2 || getGameType() == GType_FF)
 		_runScriptReturn1 = false;
 
-	startUp_helper_2();
+	permitInput();
 }
 
 TextLocation *SimonEngine::getTextLocation(uint a) {
@@ -2786,7 +2785,7 @@
 				swapCharacterLogo();
 			}
 		}
-		handle_mouse_moved();
+		handleMouseMoved();
 		dx_update_screen_and_palette();
 		_updateScreen = false;
 	}
@@ -2847,7 +2846,6 @@
 	return item->state == b;
 }
 
-// OK
 void SimonEngine::closeWindow(uint a) {
 	if (_windowArray[a] == NULL)
 		return;
@@ -2860,7 +2858,6 @@
 	}
 }
 
-// OK
 void SimonEngine::changeWindow(uint a) {
 	a &= 7;
 
@@ -2877,11 +2874,10 @@
 		showmessage_helper_3(_textWindow->textLength, _textWindow->textMaxLength);
 }
 
-// OK
 WindowBlock *SimonEngine::openWindow(uint x, uint y, uint w, uint h, uint flags, uint fill_color, uint text_color) {
 	WindowBlock *window;
 
-	window = _fcs_list;
+	window = _windowList;
 	while (window->mode != 0)
 		window++;
 
@@ -2965,19 +2961,16 @@
 	}
 }
 
-// ok
 void SimonEngine::delete_hitarea_by_index(uint index) {
 	CHECK_BOUNDS(index, _hitAreas);
 	_hitAreas[index].flags = 0;
 }
 
-// ok
-void SimonEngine::fcs_putchar(uint a) {
+void SimonEngine::windowPutChar(uint a) {
 	if (_textWindow != _windowArray[0])
-		video_putchar(_textWindow, a);
+		videoPutchar(_textWindow, a);
 }
 
-// ok
 void SimonEngine::clearWindow(WindowBlock *window) {
 	if (window->flags & 0x10)
 		restoreWindow(window);
@@ -2990,7 +2983,6 @@
 	window->textLength = 0;
 }
 
-// ok
 void SimonEngine::restoreWindow(WindowBlock *window) {
 	_lockWord |= 0x8000;
 
@@ -3738,7 +3730,7 @@
 	vc34_setMouseOff();
 
 	runSubroutine101();
-	startUp_helper_2();
+	permitInput();
 }
 
 void SimonEngine::runSubroutine101() {
@@ -3748,7 +3740,7 @@
 	if (sub != NULL)
 		startSubroutineEx(sub);
 
-	startUp_helper_2();
+	permitInput();
 }
 
 void SimonEngine::restoreBlock(uint b, uint r, uint y, uint x) {
@@ -3940,7 +3932,7 @@
 
 	while (1) {
 		hitarea_stuff();
-		handle_verb_clicked(_verbHitArea);
+		handleVerbClicked(_verbHitArea);
 		delay(100);
 	}
 

Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h	2006-04-06 08:43:20 UTC (rev 21639)
+++ scummvm/trunk/engines/simon/simon.h	2006-04-06 10:47:37 UTC (rev 21640)
@@ -285,7 +285,7 @@
 	byte _leftButtonDown;
 	byte _rightButtonDown;
 	Item *_hitAreaSubjectItem;
-	HitArea *_currentVerbBox, *_hitAreaPtr7;
+	HitArea *_currentVerbBox, *_lastVerbOn;
 	uint _needHitAreaRecalc;
 	uint _verbHitArea;
 	uint16 _defaultVerb;
@@ -407,7 +407,7 @@
 
 	VgaTimerEntry _vgaTimerList[95];
 
-	WindowBlock *_fcs_list;
+	WindowBlock *_windowList;
 
 	byte _lettersToPrintBuf[80];
 
@@ -639,12 +639,12 @@
 	void checkDown(WindowBlock *window);
 	void inventoryUp(WindowBlock *window);
 	void inventoryDown(WindowBlock *window);
-	void hitareaChangedHelper();
-	void focusVerb(uint hitarea_id);
+	void resetNameWindow();
+	void printVerbOf(uint hitarea_id);
 	HitArea *findHitAreaByID(uint hitarea_id);
 
-	void showActionString(uint x, const byte *string);
-	void video_putchar(WindowBlock *window, byte c, byte b = 0);
+	void showActionString(const byte *string);
+	void videoPutchar(WindowBlock *window, byte c, byte b = 0);
 	void clearWindow(WindowBlock *window);
 	void video_toggle_colors(HitArea * ha, byte a, byte b, byte c, byte d);
 
@@ -656,10 +656,10 @@
 	void displayName(HitArea * ha);
 	bool printTextOf(uint a);
 	bool printNameOf(Item *item);
-	void f10_key();
+	void displayBoxStars();
 	void hitarea_stuff();
 
-	void handle_mouse_moved();
+	void handleMouseMoved();
 	void pollMouseXY();
 	void drawMousePointer();
 
@@ -675,11 +675,11 @@
 	void processSpecialKeys();
 	void hitarea_stuff_helper();
 
-	void startUp_helper_2();
+	void permitInput();
 	void showmessage_helper_3(uint a, uint b);
 	void showmessage_print_char(byte chr);
 
-	void handle_verb_clicked(uint verb);
+	void handleVerbClicked(uint verb);
 
 	void o_set_video_mode(uint mode, uint vga_res);
 	void set_video_mode_internal(uint mode, uint vga_res_id);
@@ -836,7 +836,7 @@
 	void delete_hitarea_by_index(uint index);
 
 	void removeArrows(WindowBlock *window, uint num);
-	void fcs_putchar(uint a);
+	void windowPutChar(uint a);
 
 	void restoreWindow(WindowBlock *window);
 	void colorWindow(WindowBlock *window);

Modified: scummvm/trunk/engines/simon/verb.cpp
===================================================================
--- scummvm/trunk/engines/simon/verb.cpp	2006-04-06 08:43:20 UTC (rev 21639)
+++ scummvm/trunk/engines/simon/verb.cpp	2006-04-06 10:47:37 UTC (rev 21640)
@@ -210,18 +210,17 @@
 
 	last = _currentVerbBox;
 
-	if (last == _hitAreaPtr7)
+	if (last == _lastVerbOn)
 		return;
 
-	hitareaChangedHelper();
-	_hitAreaPtr7 = last;
+	resetNameWindow();
+	_lastVerbOn = last;
 
 	if (last != NULL && (ha = findHitAreaByID(200)) && (ha->flags & 0x40) && !(last->flags & 0x40))
-		focusVerb(last->id);
+		printVerbOf(last->id);
 }
 
-void SimonEngine::focusVerb(uint hitarea_id) {
-	uint x;
+void SimonEngine::printVerbOf(uint hitarea_id) {
 	const char *txt;
 	const char * const *verb_names;
 	const char * const *verb_prep_names;
@@ -281,38 +280,42 @@
 		CHECK_BOUNDS(hitarea_id, english_verb_names);
 		txt = verb_names[hitarea_id];
 	}
-	x = (53 - strlen(txt)) * 3;
-	showActionString(x, (const byte *)txt);
+	showActionString((const byte *)txt);
 }
 
-void SimonEngine::showActionString(uint x, const byte *string) {
+void SimonEngine::showActionString(const byte *string) {
 	WindowBlock *window;
+	uint x;
 
 	window = _windowArray[1];
 	if (window == NULL || window->text_color == 0)
 		return;
 
-	window->textColumn = x >> 3;
+	// Arisme : hack for long strings in the French version
+	if ((strlen((const char*)string) - 1) <= 53)
+		x = (53 - (strlen((const char *)string) - 1)) * 3;
+	else
+		x = 0;
+
+	window->textColumn = x / 8;
 	window->textColumnOffset = x & 7;
 
 	for (; *string; string++)
-		video_putchar(window, *string);
+		videoPutchar(window, *string);
 }
 
-void SimonEngine::hitareaChangedHelper() {
+void SimonEngine::resetNameWindow() {
 	WindowBlock *window;
 
-	if (getGameType() == GType_SIMON2) {
-		if (getBitFlag(79))
-			return;
-	}
+	if (getGameType() == GType_SIMON2 && getBitFlag(79))
+		return;
 
 	window = _windowArray[1];
 	if (window != NULL && window->text_color != 0)
 		clearWindow(window);
 
 	_lastNameOn = NULL;
-	_hitAreaPtr7 = NULL;
+	_lastVerbOn = NULL;
 }
 
 HitArea *SimonEngine::findHitAreaByID(uint hitarea_id) {
@@ -574,7 +577,7 @@
 	if (getGameType() == GType_FF) {
 		_marks = 0;
 		checkUp(window);
-		loadSprite(4, 9 ,21 ,0 ,0, 0);	
+		loadSprite(4, 9, 21, 0 ,0, 0);	
 		while(1) {
 			if (_currentBoxNumber != 0x7FFB || !_leftButtonDown)
 				break;
@@ -690,7 +693,7 @@
 void SimonEngine::displayName(HitArea *ha) {
 	bool result;
 
-	hitareaChangedHelper();
+	resetNameWindow();
 	if (ha->flags & 1) {
 		result = printTextOf(ha->flags >> 8);
 	} else {
@@ -702,9 +705,6 @@
 }
 
 bool SimonEngine::printTextOf(uint a) {
-	uint x;
-	const byte *string_ptr;
-
 	if (getGameType() == GType_SIMON2) {
 		if (getBitFlag(79)) {
 			Subroutine *sub;
@@ -719,21 +719,13 @@
 	if (a >= 20)
 		return false;
 
-	string_ptr = getStringPtrByID(_stringIdArray2[a]);
-	// Arisme : hack for long strings in the French version
-	if ((strlen((const char*)string_ptr) - 1) <= 53)
-		x = (53 - (strlen((const char *)string_ptr) - 1)) * 3;
-	else
-		x = 0;
-	showActionString(x, string_ptr);
+	showActionString(getStringPtrByID(_stringIdArray2[a]));
 
 	return true;
 }
 
 bool SimonEngine::printNameOf(Item *item) {
 	Child2 *child2;
-	uint x;
-	const byte *string_ptr;
 
 	if (item == 0 || item == _dummyItem2 || item == _dummyItem3)
 		return false;
@@ -742,13 +734,7 @@
 	if (child2 == NULL)
 		return false;
 
-	string_ptr = getStringPtrByID(child2->string_id);
-	// Arisme : hack for long strings in the French version
-	if ((strlen((const char*)string_ptr) - 1) <= 53)
-		x = (53 - (strlen((const char *)string_ptr) - 1)) * 3;
-	else
-		x = 0;
-	showActionString(x, string_ptr);
+	showActionString(getStringPtrByID(child2->string_id));
 
 	return true;
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list