[Scummvm-cvs-logs] CVS: scummvm/simon charset.cpp,1.19,1.20 items.cpp,1.95,1.96 simon.cpp,1.318,1.319 simon.h,1.93,1.94

Travis Howell kirben at users.sourceforge.net
Tue Oct 21 03:22:14 CEST 2003


Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1:/tmp/cvs-serv22958/simon

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

Rename a few vars


Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/charset.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- charset.cpp	21 Oct 2003 06:35:19 -0000	1.19
+++ charset.cpp	21 Oct 2003 10:14:42 -0000	1.20
@@ -61,23 +61,23 @@
 	}
 }
 
-void SimonEngine::render_string(uint num_1, uint color, uint width, uint height, const char *txt) {
+void SimonEngine::render_string(uint vga_struct_id, uint color, uint width, uint height, const char *txt) {
 	VgaPointersEntry *vpe = &_vga_buffer_pointers[2];
 	byte *src, *dst, *p, *dst_org, chr;
 	uint count;
 
-	if (num_1 >= 100) {
-		num_1 -= 100;
+	if (vga_struct_id >= 100) {
+		vga_struct_id -= 100;
 		vpe++;
 	}
 
 	src = dst = vpe->vgaFile2;
 
 	count = 4000;
-	if (num_1 == 1)
+	if (vga_struct_id == 1)
 		count *= 2;
 
-	p = dst + num_1 * 8;
+	p = dst + vga_struct_id * 8;
 
 	*(uint16 *)(p + 4) = TO_BE_16(height);
 	*(uint16 *)(p + 6) = TO_BE_16(width);

Index: items.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/items.cpp,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -d -r1.95 -r1.96
--- items.cpp	21 Oct 2003 09:43:37 -0000	1.95
+++ items.cpp	21 Oct 2003 10:14:42 -0000	1.96
@@ -991,26 +991,26 @@
 			break;
 
 		case 179:{									/* conversation responses */
-				uint b = getVarOrByte();					/* and room descriptions */
-				uint c = getVarOrByte();
-				uint a = getVarOrByte();
-				uint d = 0;
+				uint vga_struct_id = getVarOrByte();				/* and room descriptions */
+				uint color = getVarOrByte();
+				uint string_id = getVarOrByte();
+				uint speech_id = 0;
 
-				const char *s = (const char *)getStringPtrByID(_stringid_array_3[a]);
-				ThreeValues *tv = getThreeValues(b);
+				const char *string_ptr = (const char *)getStringPtrByID(_stringid_array_3[string_id]);
+				ThreeValues *tv = getThreeValues(vga_struct_id);
 				if (_game & GF_TALKIE) 
-					d = _array_4[a];
+					speech_id = _array_4[string_id];
 
 				if (_game & GF_SIMON2) {
-					if (d != 0 && (_language == 20 || !_subtitles))
-						talk_with_speech(d, b);
-					if (s != NULL && _subtitles)
-						talk_with_text(b, c, s, tv->a, tv->b, tv->c);
+					if (speech_id != 0 && (_language == 20 || !_subtitles))
+						talk_with_speech(speech_id, vga_struct_id);
+					if (string_ptr != NULL && _subtitles)
+						talk_with_text(vga_struct_id, color, string_ptr, tv->a, tv->b, tv->c);
 				} else {
-					if (d != 0)
-						talk_with_speech(d, b);
-					if (s != NULL && _subtitles)
-						talk_with_text(b, c, s, tv->a, tv->b, tv->c);
+					if (speech_id != 0)
+						talk_with_speech(speech_id, vga_struct_id);
+					if (string_ptr != NULL && _subtitles)
+						talk_with_text(vga_struct_id, color, string_ptr, tv->a, tv->b, tv->c);
 				}
 			}
 			break;
@@ -1238,16 +1238,16 @@
 }
 
 void SimonEngine::o_inventory_descriptions() {
-	uint a = getVarOrByte();
-	uint b = getVarOrByte();
-	const char *s = NULL;
+	uint vga_struct_id = getVarOrByte();
+	uint color = getVarOrByte();
+	const char *string_ptr = NULL;
 	ThreeValues *tv = NULL;
 	char buf[256];
 
 	Child2 *child = (Child2 *)findChildOfType(getNextItemPtr(), 2);
 	if (child != NULL && child->avail_props & 1) {
-		s = (const char *)getStringPtrByID(child->array[0]);
-		tv = getThreeValues(a);
+		string_ptr = (const char *)getStringPtrByID(child->array[0]);
+		tv = getThreeValues(vga_struct_id);
 	}
 
 	if ((_game & GF_SIMON2) && (_game & GF_TALKIE)) {
@@ -1299,26 +1299,26 @@
 			}
 
 			if (_language == 20 || !_subtitles)
-				talk_with_speech(var200, a);
+				talk_with_speech(var200, vga_struct_id);
 		}
 
 	} else if (_game & GF_TALKIE) {
 		if (child != NULL && child->avail_props & 0x200) {
 			uint offs = getOffsetOfChild2Param(child, 0x200);
-			talk_with_speech(child->array[offs], a);
+			talk_with_speech(child->array[offs], vga_struct_id);
 		} else if (child != NULL && child->avail_props & 0x100) {
 			uint offs = getOffsetOfChild2Param(child, 0x100);
-			talk_with_speech(child->array[offs] + 3550, a);
+			talk_with_speech(child->array[offs] + 3550, vga_struct_id);
 		}
 	}
 
 	if (child != NULL && (child->avail_props & 1) && _subtitles) {
 		if (child->avail_props & 0x100) {
-			sprintf(buf, "%d%s", child->array[getOffsetOfChild2Param(child, 0x100)], s);
-			s = buf;
+			sprintf(buf, "%d%s", child->array[getOffsetOfChild2Param(child, 0x100)], string_ptr);
+			string_ptr = buf;
 		}
-		if (s != NULL)
-			talk_with_text(a, b, s, tv->a, tv->b, tv->c);
+		if (string_ptr != NULL)
+			talk_with_text(vga_struct_id, color, string_ptr, tv->a, tv->b, tv->c);
 	}
 }
 

Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.318
retrieving revision 1.319
diff -u -d -r1.318 -r1.319
--- simon.cpp	21 Oct 2003 09:43:37 -0000	1.318
+++ simon.cpp	21 Oct 2003 10:14:42 -0000	1.319
@@ -2111,8 +2111,8 @@
 }
 
 void SimonEngine::o_print_str() {
-	uint num_1 = getVarOrByte();
-	uint num_2 = getVarOrByte();
+	uint vga_struct_id = getVarOrByte();
+	uint color = getVarOrByte();
 	uint string_id = getNextStringID();
 	const byte *string_ptr = NULL;
 	uint speech_id = 0;
@@ -2127,26 +2127,26 @@
 		string_ptr = getStringPtrByID(string_id);
 	}
 
-	tv = getThreeValues(num_1);
+	tv = getThreeValues(vga_struct_id);
 
 	if ((_game & GF_SIMON2) && (_game & GF_TALKIE)) {
-		if (speech_id != 0 && num_1 == 1 && (_language == 20 || !_subtitles))
-			talk_with_speech(speech_id, num_1);
+		if (speech_id != 0 && vga_struct_id == 1 && (_language == 20 || !_subtitles))
+			talk_with_speech(speech_id, vga_struct_id);
 
 		if ((_game & GF_TALKIE) && (speech_id == 0))
-			o_kill_sprite_simon2(2, num_1 + 2);
+			o_kill_sprite_simon2(2, vga_struct_id + 2);
 
 		if (string_ptr != NULL && (speech_id == 0 || _subtitles))
-			talk_with_text(num_1, num_2, (const char *)string_ptr, tv->a, tv->b, tv->c);
+			talk_with_text(vga_struct_id, color, (const char *)string_ptr, tv->a, tv->b, tv->c);
 
 	} else if (_game & GF_TALKIE) {
 		if (speech_id != 0)
-			talk_with_speech(speech_id, num_1);
+			talk_with_speech(speech_id, vga_struct_id);
 		if (string_ptr != NULL && (speech_id == 0 || _subtitles))
-			talk_with_text(num_1, num_2, (const char *)string_ptr, tv->a, tv->b, tv->c);
+			talk_with_text(vga_struct_id, color, (const char *)string_ptr, tv->a, tv->b, tv->c);
 
 	} else {
-		talk_with_text(num_1, num_2, (const char *)string_ptr, tv->a, tv->b, tv->c);
+		talk_with_text(vga_struct_id, color, (const char *)string_ptr, tv->a, tv->b, tv->c);
 
 	}
 
@@ -3910,7 +3910,7 @@
 	_lock_word &= ~0x40;
 }
 
-void SimonEngine::talk_with_speech(uint speech_id, uint num_1) {
+void SimonEngine::talk_with_speech(uint speech_id, uint vga_struct_id) {
 	if (!(_game & GF_SIMON2)) {
 		if (speech_id == 9999) {
 			if (_subtitles)
@@ -3928,9 +3928,9 @@
 				o_wait_for_vga(204);
 				o_kill_sprite_simon1(204);
 			}
-			o_kill_sprite_simon1(num_1 + 201);
+			o_kill_sprite_simon1(vga_struct_id + 201);
 			_sound->playVoice(speech_id);
-			start_vga_code(4, 2, num_1 + 201, 0, 0, 0);
+			start_vga_code(4, 2, vga_struct_id + 201, 0, 0, 0);
 		}
 	} else {
 		if (speech_id == 0xFFFF) {
@@ -3949,14 +3949,14 @@
 				o_wait_for_vga(205);
 				o_kill_sprite_simon2(2, 5);
 			}
-			o_kill_sprite_simon2(2, num_1 + 2);
+			o_kill_sprite_simon2(2, vga_struct_id + 2);
 			_sound->playVoice(speech_id);
-			start_vga_code(4, 2, num_1 + 2, 0, 0, 0);
+			start_vga_code(4, 2, vga_struct_id + 2, 0, 0, 0);
 		}
 	}
 }
 
-void SimonEngine::talk_with_text(uint num_1, uint num_2, const char *string_ptr, uint threeval_a, int threeval_b, uint width) {
+void SimonEngine::talk_with_text(uint vga_struct_id, uint color, const char *string_ptr, uint threeval_a, int threeval_b, uint width) {
 	char print_str_buf[0x140];
 	char *char_buf;
 	const char *string_ptr_2, *string_ptr_3;
@@ -3966,8 +3966,8 @@
 	uint height;
 
 	// FIXME: Simon1dos Dwarf Mine - Fix text for dwarf song
-	if (num_1 >= 100)
-		num_1 -= 100;
+	if (vga_struct_id >= 100)
+		vga_struct_id -= 100;
 
 	char_buf = print_str_buf;
 	string_ptr_3 = string_ptr_2 = string_ptr;
@@ -4197,13 +4197,13 @@
 
 	strcpy(char_buf, string_ptr_2);
 	if (!(_game & GF_SIMON2)) {
-		o_kill_sprite_simon1(199 + num_1);
+		o_kill_sprite_simon1(199 + vga_struct_id);
 	} else {
-		o_kill_sprite_simon2(2, num_1);
+		o_kill_sprite_simon2(2, vga_struct_id);
 	}
-	num_2 = num_2 * 3 + 192;
+	color = color * 3 + 192;
 
-	render_string(num_1, num_2, width, height, print_str_buf);
+	render_string(vga_struct_id, color, width, height, print_str_buf);
 	num_of_rows = 4;
 	if (!(_bit_array[8] & 0x20))
 		num_of_rows = 3;
@@ -4212,9 +4212,9 @@
 		threeval_b = 2;
 
 	if (!(_game & GF_SIMON2)) {
-		start_vga_code(num_of_rows, 2, 199 + num_1, threeval_a >> 3, threeval_b, 12);
+		start_vga_code(num_of_rows, 2, 199 + vga_struct_id, threeval_a >> 3, threeval_b, 12);
 	} else {
-		start_vga_code(num_of_rows, 2, num_1, threeval_a >> 3, threeval_b, 12);
+		start_vga_code(num_of_rows, 2, vga_struct_id, threeval_a >> 3, threeval_b, 12);
 	}
 }
 

Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -d -r1.93 -r1.94
--- simon.h	21 Oct 2003 09:43:37 -0000	1.93
+++ simon.h	21 Oct 2003 10:14:42 -0000	1.94
@@ -574,11 +574,11 @@
 
 	void start_vga_code(uint b, uint vga_res, uint vga_struct_id, uint c, uint d, uint f);
 	void o_unk26_helper(uint a, uint b, uint c, uint d, uint e, uint f, uint g, uint h);
-	void talk_with_speech(uint speech_id, uint num_1);
-	void talk_with_text(uint num_1, uint num_2, const char *string_ptr, uint a, int b, uint c);
+	void talk_with_speech(uint speech_id, uint vga_struct_id);
+	void talk_with_text(uint vga_struct_id, uint color, const char *string_ptr, uint threeval_a, int threeval_b, uint width);
 	FillOrCopyStruct *fcs_alloc(uint x, uint y, uint w, uint h, uint flags, uint fill_color, uint unk4);
 
-	void render_string(uint num_1, uint color, uint width, uint height, const char *txt);
+	void render_string(uint vga_struct_id, uint color, uint width, uint height, const char *txt);
 
 	void setup_hit_areas(FillOrCopyStruct *fcs, uint fcs_index);
 





More information about the Scummvm-git-logs mailing list