[Scummvm-git-logs] scummvm master -> 94509bbf916dcc67704789a1ce5e833dc34d5250

dreammaster paulfgilbert at gmail.com
Wed Dec 19 06:55:14 CET 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
94509bbf91 GLK: FROTZ: Janitorial fixes


Commit: 94509bbf916dcc67704789a1ce5e833dc34d5250
    https://github.com/scummvm/scummvm/commit/94509bbf916dcc67704789a1ce5e833dc34d5250
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-12-18T21:55:07-08:00

Commit Message:
GLK: FROTZ: Janitorial fixes

Changed paths:
    engines/glk/frotz/frotz.cpp
    engines/glk/frotz/processor_input.cpp
    engines/glk/frotz/processor_objects.cpp
    engines/glk/frotz/processor_screen.cpp
    engines/glk/frotz/processor_streams.cpp
    engines/glk/frotz/processor_table.cpp
    engines/glk/frotz/processor_text.cpp
    engines/glk/frotz/processor_windows.cpp


diff --git a/engines/glk/frotz/frotz.cpp b/engines/glk/frotz/frotz.cpp
index 69ca0a3..aaae44e 100644
--- a/engines/glk/frotz/frotz.cpp
+++ b/engines/glk/frotz/frotz.cpp
@@ -102,7 +102,7 @@ Common::Error Frotz::loadGameData(strid_t file) {
 		LOW_BYTE(H_SCREEN_COLS, old_screen_cols);
 
 		// Reload cached header fields
-		restart_header ();
+		restart_header();
 
 		/* Since QUETZAL files may be saved on many different machines,
 		 * the screen sizes may vary a lot. Erasing the status window
@@ -110,7 +110,7 @@ Common::Error Frotz::loadGameData(strid_t file) {
 		 */
 		if (h_version > V3 && h_version != V6 && (h_screen_rows != old_screen_rows
 					|| h_screen_cols != old_screen_cols))
-			erase_window (1);
+			erase_window(1);
 	} else {
 		error("Error reading save file");
 	}
diff --git a/engines/glk/frotz/processor_input.cpp b/engines/glk/frotz/processor_input.cpp
index 7c1453d..91c86c8 100644
--- a/engines/glk/frotz/processor_input.cpp
+++ b/engines/glk/frotz/processor_input.cpp
@@ -166,14 +166,14 @@ void Processor::z_read() {
 			buffer[i] = unicode_tolower (buffer[i]);
 		}
 
-		storeb((zword) (zargs[0] + ((h_version <= V4) ? 1 : 2) + i), translate_to_zscii (buffer[i]));
+		storeb((zword)(zargs[0] + ((h_version <= V4) ? 1 : 2) + i), translate_to_zscii(buffer[i]));
 	}
 
 	// Add null character (V1-V4) or write input length into 2nd byte
 	if (h_version <= V4)
-		storeb((zword) (zargs[0] + 1 + i), 0);
+		storeb((zword)(zargs[0] + 1 + i), 0);
 	else
-		storeb((zword) (zargs[0] + 1), i);
+		storeb((zword)(zargs[0] + 1), i);
 
 	// Tokenise line if a token buffer is present
 	if (key == ZC_RETURN && zargs[1] != 0)
@@ -202,10 +202,10 @@ void Processor::z_read_char() {
 		return;
 
 	// Store key
-	store (translate_to_zscii (key));
+	store(translate_to_zscii(key));
 }
 
-void Processor::z_read_mouse(){
+void Processor::z_read_mouse() {
 	zword btn;
 
 	// Read the mouse position, the last menu click and which buttons are down
@@ -213,10 +213,10 @@ void Processor::z_read_mouse(){
 	hx_mouse_y = mouse_y;
 	hx_mouse_x = mouse_x;
 
-	storew((zword) (zargs[0] + 0), hx_mouse_y);
-	storew((zword) (zargs[0] + 2), hx_mouse_x);
-	storew((zword) (zargs[0] + 4), btn);			// mouse button bits
-	storew((zword) (zargs[0] + 6), menu_selected);	// menu selection
+	storew((zword)(zargs[0] + 0), hx_mouse_y);
+	storew((zword)(zargs[0] + 2), hx_mouse_x);
+	storew((zword)(zargs[0] + 4), btn);				// mouse button bits
+	storew((zword)(zargs[0] + 6), menu_selected);	// menu selection
 }
 
 } // End of namespace Scott
diff --git a/engines/glk/frotz/processor_objects.cpp b/engines/glk/frotz/processor_objects.cpp
index d60dd8b..ab136f3 100644
--- a/engines/glk/frotz/processor_objects.cpp
+++ b/engines/glk/frotz/processor_objects.cpp
@@ -348,7 +348,7 @@ void Processor::z_get_next_prop() {
 
 	// Return the property id
 	LOW_BYTE(prop_addr, value);
-	store((zword) (value & mask));
+	store((zword)(value & mask));
 }
 
 void Processor::z_get_parent() {
@@ -477,7 +477,7 @@ void Processor::z_get_prop_addr() {
 
 		if (h_version >= V4 && (value & 0x80))
 			prop_addr++;
-		store((zword) (prop_addr + 1));
+		store((zword)(prop_addr + 1));
 
 	} else {
 		store(0);
diff --git a/engines/glk/frotz/processor_screen.cpp b/engines/glk/frotz/processor_screen.cpp
index a8ddb81..33c9108 100644
--- a/engines/glk/frotz/processor_screen.cpp
+++ b/engines/glk/frotz/processor_screen.cpp
@@ -242,8 +242,8 @@ void Processor::z_erase_window() {
 }
 
 void Processor::z_get_cursor() {
-	storew((zword) (zargs[0] + 0), cury);
-	storew((zword) (zargs[0] + 2), curx);
+	storew((zword)(zargs[0] + 0), cury);
+	storew((zword)(zargs[0] + 2), curx);
 }
 
 void Processor::z_print_table() {
diff --git a/engines/glk/frotz/processor_streams.cpp b/engines/glk/frotz/processor_streams.cpp
index 84872f1..187220b 100644
--- a/engines/glk/frotz/processor_streams.cpp
+++ b/engines/glk/frotz/processor_streams.cpp
@@ -565,9 +565,9 @@ void Processor::z_save() {
 	}
 
 	if (h_version <= V3)
-		branch (success);
+		branch(success);
 	else
-		store (success);
+		store(success);
 }
 
 void Processor::z_restore() {
@@ -593,7 +593,7 @@ void Processor::z_restore() {
 	if (h_version <= V3)
 		branch(result);
 	else
-		store (result);
+		store(result);
 }
 
 void Processor::z_verify() {
diff --git a/engines/glk/frotz/processor_table.cpp b/engines/glk/frotz/processor_table.cpp
index e53dae5..b926725 100644
--- a/engines/glk/frotz/processor_table.cpp
+++ b/engines/glk/frotz/processor_table.cpp
@@ -47,7 +47,7 @@ void Processor::z_copy_table() {
 		for (i = size - 1; i >= 0; i--) {
 			addr = zargs[0] + i;
 			LOW_BYTE(addr, value);
-			storeb((zword) (zargs[1] + i), value);
+			storeb((zword)(zargs[1] + i), value);
 		}
 	}
 }
@@ -109,7 +109,7 @@ finished:
 }
 
 void Processor::z_storeb() {
-	storeb((zword) (zargs[0] + zargs[1]), zargs[2]);
+	storeb((zword)(zargs[0] + zargs[1]), zargs[2]);
 }
 
 void Processor::z_storew() {
diff --git a/engines/glk/frotz/processor_text.cpp b/engines/glk/frotz/processor_text.cpp
index 9b44d70..32625f6 100644
--- a/engines/glk/frotz/processor_text.cpp
+++ b/engines/glk/frotz/processor_text.cpp
@@ -93,7 +93,7 @@ zbyte Processor::unicode_to_zscii(zchar c) {
 				LOW_WORD(addr, unicode);
 
 				if (c == unicode)
-					return (zbyte) i;
+					return (zbyte)i;
 			}
 
 			return 0;
@@ -101,7 +101,7 @@ zbyte Processor::unicode_to_zscii(zchar c) {
 			// game uses standard set
 			for (i = 0x9b; i <= 0xdf; i++)
 			if (c == ZSCII_TO_LATIN1[i - 0x9b])
-				return (zbyte) i;
+				return (zbyte)i;
 
 			return 0;
 		}
@@ -120,7 +120,7 @@ zbyte Processor::translate_to_zscii(zchar c) {
 	if (c == 0)
 		return 0;
 
-	c = unicode_to_zscii (c);
+	c = unicode_to_zscii(c);
 	if (c == 0)
 	c = '?';
 
@@ -188,8 +188,8 @@ void Processor::find_resolution() {
 		runtimeError(ERR_DICT_LEN);
 	}
 
-	_decoded = (zchar *)malloc (sizeof (zchar) * (3 * _resolution) + 1);
-	_encoded = (zchar *)malloc (sizeof (zchar) * _resolution);
+	_decoded = (zchar *)malloc(sizeof(zchar) * (3 * _resolution) + 1);
+	_encoded = (zchar *)malloc(sizeof(zchar) * _resolution);
 }
 
 void Processor::load_string (zword addr, zword length) {
@@ -256,7 +256,7 @@ void Processor::encode_text(int padding) {
 						goto letter_found;
 
 			// Character not found, store its ZSCII value
-			c2 = translate_to_zscii (c);
+			c2 = translate_to_zscii(c);
 
 			zchars[i++] = 5;
 			zchars[i++] = 6;
@@ -577,7 +577,6 @@ void Processor::tokenise_text(zword text, zword length, zword from, zword parse,
 		addr = lookup_text(0x05, dct);
 
 		if (addr != 0 || !flag) {
-
 			parse += 4 * token_count;
 
 			storew((zword)(parse + 0), addr);
@@ -785,26 +784,26 @@ void Processor::z_check_unicode() {
 		result = 1;
 	}
 
-	store (result);
+	store(result);
 }
 
 void Processor::z_encode_text() {
 	int i;
 
-	load_string((zword) (zargs[0] + zargs[2]), zargs[1]);
+	load_string((zword)(zargs[0] + zargs[2]), zargs[1]);
 
 	encode_text(0x05);
 
 	for (i = 0; i < _resolution; i++)
-	storew((zword) (zargs[3] + 2 * i), _encoded[i]);
+	storew((zword)(zargs[3] + 2 * i), _encoded[i]);
 
 }
 
 void Processor::z_new_line() {
-	new_line ();
+	new_line();
 }
 
-void Processor::z_print () {
+void Processor::z_print() {
 	decode_text(EMBEDDED_STRING, 0);
 }
 
@@ -829,7 +828,7 @@ void Processor::z_print_form() {
 			break;
 
 		if (!first)
-			new_line ();
+			new_line();
 
 		while (count--) {
 			zbyte c;
@@ -837,7 +836,7 @@ void Processor::z_print_form() {
 			LOW_BYTE(addr, c);
 			addr++;
 
-			print_char(translate_from_zscii (c));
+			print_char(translate_from_zscii(c));
 		}
 
 		first = false;
diff --git a/engines/glk/frotz/processor_windows.cpp b/engines/glk/frotz/processor_windows.cpp
index 53d2ae1..c0a1e3f 100644
--- a/engines/glk/frotz/processor_windows.cpp
+++ b/engines/glk/frotz/processor_windows.cpp
@@ -46,7 +46,7 @@ void Processor::z_draw_picture() {
 	zword x = zargs[2];
 	int i;
 
-	flush_buffer ();
+	flush_buffer();
 
 	if (!x || !y) {
 		// Currently I only support getting the cursor for the text grid area





More information about the Scummvm-git-logs mailing list