Skip to content

Commit

Permalink
GLK: FROTZ: Whitespace fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Aug 18, 2019
1 parent 34f842e commit 1f38a82
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 34 deletions.
30 changes: 15 additions & 15 deletions engines/glk/frotz/processor_screen.cpp
Expand Up @@ -451,8 +451,8 @@ void Processor::z_show_status() {
brief = true;

// Print the object description for the global variable 0
print_char (' ');
print_object (global0);
print_char(' ');
print_object(global0);

// A header flag tells us whether we have to display the current
// time or the score/moves information
Expand All @@ -462,34 +462,34 @@ void Processor::z_show_status() {

pad_status_line (brief ? 15 : 20);

print_string ("Time: ");
print_string("Time: ");

if (hours < 10)
print_char (' ');
print_num (hours);
print_char(' ');
print_num(hours);

print_char (':');
print_char(':');

if (global2 < 10)
print_char ('0');
print_num (global2);
print_char('0');
print_num(global2);

print_char (' ');
print_char(' ');

print_char ((global1 >= 12) ? 'p' : 'a');
print_char ('m');
print_char((global1 >= 12) ? 'p' : 'a');
print_char('m');

} else {
// print score and moves
pad_status_line (brief ? 15 : 30);

print_string (brief ? "S: " : "Score: ");
print_num (global1);
print_string(brief ? "S: " : "Score: ");
print_num(global1);

pad_status_line (brief ? 8 : 14);

print_string (brief ? "M: " : "Moves: ");
print_num (global2);
print_string(brief ? "M: " : "Moves: ");
print_num(global2);
}

// Pad the end of the status line with spaces
Expand Down
46 changes: 29 additions & 17 deletions engines/glk/frotz/processor_streams.cpp
Expand Up @@ -155,7 +155,7 @@ zchar Processor::stream_read_key(zword timeout, zword routine, bool hot_keys) {

// Handle timeouts
if (key == ZC_TIME_OUT)
if (direct_call (routine) == 0)
if (direct_call(routine) == 0)
goto continue_input;

// Return key
Expand Down Expand Up @@ -490,22 +490,34 @@ void Processor::z_output_stream() {
flush_buffer();

switch ((short) zargs[0]) {
case 1: ostream_screen = true;
break;
case -1: ostream_screen = false;
break;
case 2: if (!ostream_script) script_open();
break;
case -2: if (ostream_script) script_close();
break;
case 3: memory_open(zargs[1], zargs[2], zargc >= 3);
break;
case -3: memory_close();
break;
case 4: if (!ostream_record) record_open();
break;
case -4: if (ostream_record) record_close();
break;
case 1:
ostream_screen = true;
break;
case -1:
ostream_screen = false;
break;
case 2:
if (!ostream_script)
script_open();
break;
case -2:
if (ostream_script)
script_close();
break;
case 3:
memory_open(zargs[1], zargs[2], zargc >= 3);
break;
case -3:
memory_close();
break;
case 4:
if (!ostream_record)
record_open();
break;
case -4:
if (ostream_record)
record_close();
break;
default:
break;
}
Expand Down
4 changes: 2 additions & 2 deletions engines/glk/frotz/processor_text.cpp
Expand Up @@ -253,7 +253,7 @@ void Processor::encode_text(int padding) {
// Search character in the alphabet
for (set = 0; set < 3; set++)
for (index = 0; index < 26; index++)
if (c == alphabet (set, index))
if (c == alphabet(set, index))
goto letter_found;

// Character not found, store its ZSCII value
Expand Down Expand Up @@ -871,7 +871,7 @@ void Processor::z_print_form() {
}

void Processor::z_print_num() {
print_num (zargs[0]);
print_num(zargs[0]);
}

void Processor::z_print_obj() {
Expand Down

0 comments on commit 1f38a82

Please sign in to comment.