[Scummvm-cvs-logs] CVS: scummvm/simon charset.cpp,1.40,1.41 items.cpp,1.131,1.132 saveload.cpp,1.19,1.20 simon.cpp,1.522,1.523 simon.h,1.151,1.152 verb.cpp,1.31,1.32

kirben kirben at users.sourceforge.net
Wed Oct 19 04:33:15 CEST 2005


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

Modified Files:
	charset.cpp items.cpp saveload.cpp simon.cpp simon.h verb.cpp 
Log Message:

Cleanup


Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/charset.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- charset.cpp	19 Oct 2005 10:54:22 -0000	1.40
+++ charset.cpp	19 Oct 2005 11:32:25 -0000	1.41
@@ -28,12 +28,12 @@
 void SimonEngine::print_char_helper_1(const byte *src, uint len) {
 	uint ind;
 
-	if (_fcsPtr1 == NULL)
+	if (_textWindow == NULL)
 		return;
 
 	while (len-- != 0) {
-		if (*src != 12 && _fcsPtr1->fcs_data != NULL &&
-				_fcsData1[ind = get_fcs_ptr_3_index(_fcsPtr1)] != 2) {
+		if (*src != 12 && _textWindow->fcs_data != NULL &&
+				_fcsData1[ind = get_fcs_ptr_3_index(_textWindow)] != 2) {
 
 			_fcsData1[ind] = 2;
 			_fcsData2[ind] = 1;
@@ -54,7 +54,7 @@
 
 	if (_fcsData2[i]) {
 		lock();
-		fcs = _fcsPtrArray3[i];
+		fcs = _windowArray[i];
 		drawIconArray(i, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1, fcs->fcs_data->unk2);
 		_fcsData2[i] = 0;
 		unlock();
@@ -226,15 +226,15 @@
 	vsnprintf(buf, STRINGBUFLEN, s, va);
 	va_end(va);
 
-	if (!_fcsData1[_fcsUnk1]) {
+	if (!_fcsData1[_curWindow]) {
 		showmessage_helper_2();
 		if (!_showMessageFlag) {
-			_fcsPtrArray3[0] = _fcsPtr1;
-			showmessage_helper_3(_fcsPtr1->textLength,
-                                 _fcsPtr1->textMaxLength);
+			_windowArray[0] = _textWindow;
+			showmessage_helper_3(_textWindow->textLength,
+                                 _textWindow->textMaxLength);
 		}
 		_showMessageFlag = true;
-		_fcsData1[_fcsUnk1] = 1;
+		_fcsData1[_curWindow] = 1;
 	}
 
 	for (str = buf; *str; str++)
@@ -244,35 +244,35 @@
 void SimonEngine::showmessage_print_char(byte chr) {
 	if (chr == 12) {
 		_numLettersToPrint = 0;
-		_printCharUnk1 = 0;
+		_printCharCurPos = 0;
 		print_char_helper_1(&chr, 1);
-		print_char_helper_5(_fcsPtr1);
+		print_char_helper_5(_textWindow);
 	} else if (chr == 0 || chr == ' ' || chr == 10) {
-		if (_printCharUnk2 - _printCharUnk1 >= _numLettersToPrint) {
-			_printCharUnk1 += _numLettersToPrint;
+		if (_printCharMaxPos - _printCharCurPos >= _numLettersToPrint) {
+			_printCharCurPos += _numLettersToPrint;
 			print_char_helper_1(_lettersToPrintBuf, _numLettersToPrint);
 
-			if (_printCharUnk1 == _printCharUnk2) {
-				_printCharUnk1 = 0;
+			if (_printCharCurPos == _printCharMaxPos) {
+				_printCharCurPos = 0;
 			} else {
 				if (chr)
 					print_char_helper_1(&chr, 1);
 				if (chr == 10)
-					_printCharUnk1 = 0;
+					_printCharCurPos = 0;
 				else if (chr != 0)
-					_printCharUnk1++;
+					_printCharCurPos++;
 			}
 		} else {
 			const byte newline_character = 10;
-			_printCharUnk1 = _numLettersToPrint;
+			_printCharCurPos = _numLettersToPrint;
 			print_char_helper_1(&newline_character, 1);
 			print_char_helper_1(_lettersToPrintBuf, _numLettersToPrint);
 			if (chr == ' ') {
 				print_char_helper_1(&chr, 1);
-				_printCharUnk1++;
+				_printCharCurPos++;
 			} else {
 				print_char_helper_1(&chr, 1);
-				_printCharUnk1 = 0;
+				_printCharCurPos = 0;
 			}
 		}
 		_numLettersToPrint = 0;
@@ -282,15 +282,15 @@
 }
 
 void SimonEngine::showmessage_helper_2() {
-	if (_fcsPtr1)
+	if (_textWindow)
 		return;
 
-	_fcsPtr1 = fcs_alloc(8, 0x90, 0x18, 6, 1, 0, 0xF);
+	_textWindow = openWindow(8, 0x90, 0x18, 6, 1, 0, 0xF);
 }
 
 void SimonEngine::showmessage_helper_3(uint a, uint b) {
-	_printCharUnk1 = a;
-	_printCharUnk2 = b;
+	_printCharCurPos = a;
+	_printCharMaxPos = b;
 	_numLettersToPrint = 0;
 }
 

Index: items.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/items.cpp,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -d -r1.131 -r1.132
--- items.cpp	19 Oct 2005 10:54:22 -0000	1.131
+++ items.cpp	19 Oct 2005 11:32:25 -0000	1.132
@@ -566,12 +566,12 @@
 				uint e = getVarOrWord();
 				uint f = getVarOrWord();
 				uint g = getVarOrWord();
-				o_unk26_helper(a, b, c, d, e, f, g, 0);
+				o_defineWindow(a, b, c, d, e, f, g, 0);
 			}
 			break;
 
 		case 102:{
-				fcs_unk_2(getVarOrByte() & 7);
+				changeWindow(getVarOrByte() & 7);
 			}
 			break;
 
@@ -581,7 +581,7 @@
 			break;
 
 		case 104:{
-				fcs_delete(getVarOrByte() & 7);
+				closeWindow(getVarOrByte() & 7);
 			}
 			break;
 
@@ -762,7 +762,7 @@
 					debug(1, "Switch to CD number %d", readVariable(97));
 				} else {
 					_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
-					o_quit_if_user_presses_y();
+					o_confirmQuit();
 					_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
 				}
 			}
@@ -955,12 +955,12 @@
 			break;
 
 		case 175:{									/* vga pointer op 1 */
-				o_unk_175();
+				o_lockZone();
 			}
 			break;
 
 		case 176:{									/* vga pointer op 2 */
-				o_unk_176();
+				o_unlockZone();
 			}
 			break;
 
@@ -1004,7 +1004,7 @@
 		case 181:{									/* force lock */
 				o_force_lock();
 				if (_game & GF_SIMON2) {
-					fcs_unk_2(1);
+					changeWindow(1);
 					showMessageFormat("\xC");
 				}
 			}
@@ -1381,7 +1381,7 @@
 	}
 }
 
-void SimonEngine::o_quit_if_user_presses_y() {
+void SimonEngine::o_confirmQuit() {
 	// If all else fails, use English as fallback.
 	byte keyYes = 'y';
 	byte keyNo = 'n';
@@ -1430,7 +1430,7 @@
 void SimonEngine::o_restoreIconArray(uint fcs_index) {
 	FillOrCopyStruct *fcs;
 
-	fcs = _fcsPtrArray3[fcs_index & 7];
+	fcs = _windowArray[fcs_index & 7];
 	if (fcs->fcs_data == NULL)
 		return;
 	drawIconArray(fcs_index, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1, fcs->fcs_data->unk2);
@@ -1447,11 +1447,11 @@
 	_vgaFileBufOrg = _vgaFileBufOrg2;
 }
 
-void SimonEngine::o_unk_175() {
+void SimonEngine::o_lockZone() {
 	_vgaBufStart = _vgaBufFreeStart;
 }
 
-void SimonEngine::o_unk_176() {
+void SimonEngine::o_unlockZone() {
 	_vgaBufFreeStart = _vgaFileBufOrg;
 	_vgaBufStart = _vgaFileBufOrg;
 }
@@ -1643,12 +1643,12 @@
 }
 
 void SimonEngine::o_unk_160(uint a) {
-	fcs_setTextColor(_fcsPtrArray3[_fcsUnk1], a);
+	fcs_setTextColor(_windowArray[_curWindow], a);
 }
 
 void SimonEngine::o_unk_103() {
 	lock();
-	removeIconArray(_fcsUnk1);
+	removeIconArray(_curWindow);
 	showMessageFormat("\x0C");
 	unlock();
 }
@@ -1674,17 +1674,17 @@
 }
 
 /* OK */
-void SimonEngine::o_unk26_helper(uint a, uint b, uint c, uint d, uint e, uint f, uint g, uint h) {
+void SimonEngine::o_defineWindow(uint a, uint b, uint c, uint d, uint e, uint f, uint g, uint h) {
 	a &= 7;
 
-	if (_fcsPtrArray3[a])
-		fcs_delete(a);
+	if (_windowArray[a])
+		closeWindow(a);
 
-	_fcsPtrArray3[a] = fcs_alloc(b, c, d, e, f, g, h);
+	_windowArray[a] = openWindow(b, c, d, e, f, g, h);
 
-	if (a == _fcsUnk1) {
-		_fcsPtr1 = _fcsPtrArray3[a];
-		showmessage_helper_3(_fcsPtr1->textLength, _fcsPtr1->textMaxLength);
+	if (a == _curWindow) {
+		_textWindow = _windowArray[a];
+		showmessage_helper_3(_textWindow->textLength, _textWindow->textMaxLength);
 	}
 }
 

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/saveload.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- saveload.cpp	19 Oct 2005 10:54:22 -0000	1.19
+++ saveload.cpp	19 Oct 2005 11:32:25 -0000	1.20
@@ -223,7 +223,7 @@
 
 		// some code here
 
-		fcs = _fcsPtrArray3[5];
+		fcs = _windowArray[5];
 
 		fcs->textRow = unk132_result;
 
@@ -283,7 +283,7 @@
 						goto get_out;
 					clear_hitarea_bit_0x40(0xd0 + unk132_result);
 					if (_saveLoadFlag) {
-						o_clear_character(_fcsPtrArray3[5], 8);
+						o_clear_character(_windowArray[5], 8);
 						// move code
 					}
 					goto if_1;
@@ -297,7 +297,7 @@
 			} while (i >= 0x80 || i == 0);
 
 			// after_do_2
-			o_clear_character(_fcsPtrArray3[5], 8);
+			o_clear_character(_windowArray[5], 8);
 			if (i == 10 || i == 13)
 				break;
 			if (i == 8) {
@@ -316,21 +316,21 @@
 
 					name[name_len] = 0;
 
-					o_clear_character(_fcsPtrArray3[5], x, m);
+					o_clear_character(_windowArray[5], x, m);
 				}
 			} else if (i >= 32 && name_len != 17) {
 				name[name_len++] = i;
 
-				video_putchar(_fcsPtrArray3[5], i);
+				video_putchar(_windowArray[5], i);
 			}
 		}
 
 		// do_save
 		if (!save_game(_saveLoadRowCurPos + unk132_result, buf + unk132_result * 18))
-			o_file_error(_fcsPtrArray3[5], true);
+			o_file_error(_windowArray[5], true);
 	} else {
 		if (!load_game(_saveLoadRowCurPos + i))
-			o_file_error(_fcsPtrArray3[5], false);
+			o_file_error(_windowArray[5], false);
 	}
 
 get_out:;

Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.522
retrieving revision 1.523
diff -u -d -r1.522 -r1.523
--- simon.cpp	19 Oct 2005 10:54:22 -0000	1.522
+++ simon.cpp	19 Oct 2005 11:32:25 -0000	1.523
@@ -547,8 +547,8 @@
 	_scriptCondB = 0;
 	_scriptCondC = 0;
 
-	_fcsUnk1 = 0;
-	_fcsPtr1 = 0;
+	_curWindow = 0;
+	_textWindow = 0;
 
 	_subjectItem = 0;
 	_objectItem = 0;
@@ -569,8 +569,8 @@
 
 	_windowNum = 0;
 
-	_printCharUnk1 = 0;
-	_printCharUnk2 = 0;
+	_printCharCurPos = 0;
+	_printCharMaxPos = 0;
 	_numLettersToPrint = 0;
 
 	_lastTime = 0;
@@ -647,7 +647,7 @@
 	memset(_bitArray, 0, sizeof(_bitArray));
 	memset(_variableArray, 0, sizeof(_variableArray));
 
-	memset(_fcsPtrArray3, 0, sizeof(_fcsPtrArray3));
+	memset(_windowArray, 0, sizeof(_windowArray));
 
 	memset(_fcsData1, 0, sizeof(_fcsData1));
 	memset(_fcsData2, 0, sizeof(_fcsData2));
@@ -1226,7 +1226,7 @@
 	lock();
 
 	for (i = 0; i != 8; i++) {
-		fcs = _fcsPtrArray3[i];
+		fcs = _windowArray[i];
 		if (fcs && fcs->fcs_data && fcs->fcs_data->item_ptr == item) {
 			if (_fcsData1[i]) {
 				_fcsData2[i] = true;
@@ -1735,8 +1735,8 @@
 uint SimonEngine::get_fcs_ptr_3_index(FillOrCopyStruct *fcs) {
 	uint i;
 
-	for (i = 0; i != ARRAYSIZE(_fcsPtrArray3); i++)
-		if (_fcsPtrArray3[i] == fcs)
+	for (i = 0; i != ARRAYSIZE(_windowArray); i++)
+		if (_windowArray[i] == fcs)
 			return i;
 
 	error("get_fcs_ptr_3_index: not found");
@@ -1837,7 +1837,7 @@
 	bool item_again;
 	uint x_pos, y_pos;
 
-	fcs_ptr = _fcsPtrArray3[fcs_index & 7];
+	fcs_ptr = _windowArray[fcs_index & 7];
 
 	if (!(_game & GF_SIMON2)) {
 		width_div_3 = fcs_ptr->width / 3;
@@ -2243,10 +2243,10 @@
 	if (!_mortalFlag) {
 		_mortalFlag = true;
 		showmessage_print_char(0);
-		_fcsUnk1 = 0;
-		if (_fcsPtrArray3[0] != 0) {
-			_fcsPtr1 = _fcsPtrArray3[0];
-			showmessage_helper_3(_fcsPtr1->textLength, _fcsPtr1->textMaxLength);
+		_curWindow = 0;
+		if (_windowArray[0] != 0) {
+			_textWindow = _windowArray[0];
+			showmessage_helper_3(_textWindow->textLength, _textWindow->textMaxLength);
 		}
 		_mortalFlag = false;
 	}
@@ -3037,34 +3037,34 @@
 }
 
 // OK
-void SimonEngine::fcs_delete(uint a) {
-	if (_fcsPtrArray3[a] == NULL)
+void SimonEngine::closeWindow(uint a) {
+	if (_windowArray[a] == NULL)
 		return;
 	removeIconArray(a);
-	video_copy_if_flag_0x8_c(_fcsPtrArray3[a]);
-	_fcsPtrArray3[a] = NULL;
-	if (_fcsUnk1 == a) {
-		_fcsPtr1 = NULL;
-		fcs_unk_2(0);
+	video_copy_if_flag_0x8_c(_windowArray[a]);
+	_windowArray[a] = NULL;
+	if (_curWindow == a) {
+		_textWindow = NULL;
+		changeWindow(0);
 	}
 }
 
 // OK
-void SimonEngine::fcs_unk_2(uint a) {
+void SimonEngine::changeWindow(uint a) {
 	a &= 7;
 
-	if (_fcsPtrArray3[a] == NULL || _fcsUnk1 == a)
+	if (_windowArray[a] == NULL || _curWindow == a)
 		return;
 
-	_fcsUnk1 = a;
+	_curWindow = a;
 	showmessage_print_char(0);
-	_fcsPtr1 = _fcsPtrArray3[a];
+	_textWindow = _windowArray[a];
 
-	showmessage_helper_3(_fcsPtr1->textLength, _fcsPtr1->textMaxLength);
+	showmessage_helper_3(_textWindow->textLength, _textWindow->textMaxLength);
 }
 
 // OK
-FillOrCopyStruct *SimonEngine::fcs_alloc(uint x, uint y, uint w, uint h, uint flags, uint fill_color, uint text_color) {
+FillOrCopyStruct *SimonEngine::openWindow(uint x, uint y, uint w, uint h, uint flags, uint fill_color, uint text_color) {
 	FillOrCopyStruct *fcs;
 
 	fcs = _fcs_list;
@@ -3146,15 +3146,15 @@
 	uint16 fcsunk1;
 	uint16 i;
 
-	fcs = _fcsPtrArray3[fcs_index & 7];
-	fcsunk1 = _fcsUnk1;
+	fcs = _windowArray[fcs_index & 7];
+	fcsunk1 = _curWindow;
 
 	if (fcs == NULL || fcs->fcs_data == NULL)
 		return;
 
-	fcs_unk_2(fcs_index);
+	changeWindow(fcs_index);
 	fcs_putchar(12);
-	fcs_unk_2(fcsunk1);
+	changeWindow(fcsunk1);
 
 	for (i = 0; fcs->fcs_data->e[i].item != NULL; i++) {
 		delete_hitarea_by_index(fcs->fcs_data->e[i].hit_area);
@@ -3189,8 +3189,8 @@
 
 // ok
 void SimonEngine::fcs_putchar(uint a) {
-	if (_fcsPtr1 != _fcsPtrArray3[0])
-		video_putchar(_fcsPtr1, a);
+	if (_textWindow != _windowArray[0])
+		video_putchar(_textWindow, a);
 }
 
 // ok
@@ -3211,10 +3211,10 @@
 	_lockWord |= 0x8000;
 
 	if (!(_game & GF_SIMON2)) {
-		dx_copy_rgn_from_3_to_2(fcs->y + fcs->height * 8 + ((fcs == _fcsPtrArray3[2]) ? 1 : 0), (fcs->x + fcs->width) * 8, fcs->y, fcs->x * 8);
+		dx_copy_rgn_from_3_to_2(fcs->y + fcs->height * 8 + ((fcs == _windowArray[2]) ? 1 : 0), (fcs->x + fcs->width) * 8, fcs->y, fcs->x * 8);
 	} else {
-		if (_vgaVar6 && _fcsPtrArray3[2] == fcs) {
-			fcs = _fcsPtrArray3[0x18 / 4];
+		if (_vgaVar6 && _windowArray[2] == fcs) {
+			fcs = _windowArray[0x18 / 4];
 			_vgaVar6 = 0;
 		}
 

Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -d -r1.151 -r1.152
--- simon.h	19 Oct 2005 10:54:22 -0000	1.151
+++ simon.h	19 Oct 2005 11:32:25 -0000	1.152
@@ -219,8 +219,8 @@
 
 	int16 _scriptCondA, _scriptCondB, _scriptCondC;
 
-	uint16 _fcsUnk1;
-	FillOrCopyStruct *_fcsPtr1;
+	uint16 _curWindow;
+	FillOrCopyStruct *_textWindow;
 
 	Item *_subjectItem, *_objectItem;
 	Item *_item1;
@@ -239,7 +239,7 @@
 
 	uint16 _windowNum;
 
-	uint _printCharUnk1, _printCharUnk2;
+	uint _printCharCurPos, _printCharMaxPos;
 	uint _numLettersToPrint;
 
 	uint _lastTime;
@@ -309,7 +309,7 @@
 	uint16 _bitArray[48];
 	int16 _variableArray[256];
 
-	FillOrCopyStruct *_fcsPtrArray3[8];
+	FillOrCopyStruct *_windowArray[8];
 
 	byte _fcsData1[8];
 	bool _fcsData2[8];
@@ -471,9 +471,9 @@
 	void o_kill_sprite_simon2(uint a, uint b);
 
 	void o_vga_reset();
-	void fcs_unk_2(uint a);
+	void changeWindow(uint a);
 	void o_unk_103();
-	void fcs_delete(uint a);
+	void closeWindow(uint a);
 	void o_unk_108(uint a);
 	void clear_hitarea_bit_0x40(uint hitarea);
 	void set_hitarea_bit_0x40(uint hitarea);
@@ -495,7 +495,7 @@
 	void o_play_music_resource();
 	void o_save_game();
 	void o_load_game();
-	void o_quit_if_user_presses_y();
+	void o_confirmQuit();
 	void o_restoreIconArray(uint a);
 	void o_unk_138();
 	void killAllTimers();
@@ -503,8 +503,8 @@
 	uint getOffsetOfChild2Param(Child2 *child, uint prop);
 	void o_unk_160(uint a);
 	void o_play_sound(uint a);
-	void o_unk_175();
-	void o_unk_176();
+	void o_lockZone();
+	void o_unlockZone();
 	void o_pathfind(int x, int y, uint var_1, uint var_2);
 	void o_force_unlock();
 	void o_force_lock();
@@ -596,10 +596,10 @@
 	void ensureVgaResLoaded(uint vga_res);
 
 	void loadSprite(uint windowNum, uint vga_res, uint vga_sprite_id, uint x, uint y, uint palette);
-	void o_unk26_helper(uint a, uint b, uint c, uint d, uint e, uint f, uint g, uint h);
+	void o_defineWindow(uint a, uint b, uint c, uint d, uint e, uint f, uint g, uint h);
 	void talk_with_speech(uint speech_id, uint vga_sprite_id);
 	void talk_with_text(uint vga_sprite_id, uint color, const char *string_ptr, int16 x, int16 y, int16 width);
-	FillOrCopyStruct *fcs_alloc(uint x, uint y, uint w, uint h, uint flags, uint fill_color, uint text_color);
+	FillOrCopyStruct *openWindow(uint x, uint y, uint w, uint h, uint flags, uint fill_color, uint text_color);
 
 	void render_string_amiga(uint vga_sprite_id, uint color, uint width, uint height, const char *txt);
 	void render_string(uint vga_sprite_id, uint color, uint width, uint height, const char *txt);

Index: verb.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/verb.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- verb.cpp	19 Oct 2005 10:54:22 -0000	1.31
+++ verb.cpp	19 Oct 2005 11:32:25 -0000	1.32
@@ -251,7 +251,7 @@
 void SimonEngine::showActionString(uint x, const byte *string) {
 	FillOrCopyStruct *fcs;
 
-	fcs = _fcsPtrArray3[1];
+	fcs = _windowArray[1];
 	if (fcs == NULL || fcs->text_color == 0)
 		return;
 
@@ -270,7 +270,7 @@
 			return;
 	}
 
-	fcs = _fcsPtrArray3[1];
+	fcs = _windowArray[1];
 	if (fcs != NULL && fcs->text_color != 0)
 		video_fill_or_copy_from_3_to_2(fcs);
 





More information about the Scummvm-git-logs mailing list