void screen_char (zchar c) { int width; if (discarding) return; if (c == ZC_INDENT && cwp->x_cursor != cwp->left + 1) c = ' '; if (units_left () < (width = os_char_width (c))) { if (!enable_wrapping) { cwp->x_cursor = cwp->x_size - cwp->right; return; } screen_new_line (); } os_display_char (c); cwp->x_cursor += width; }/* screen_char */
/* Haxor your boxor? */ void os_display_string (const zchar *s) { zchar c; while ((c = *s++) != 0) if (c == ZC_NEW_FONT) s++; else if (c == ZC_NEW_STYLE) os_set_text_style(*s++); else { os_display_char (c); } }
void os_display_string (const zchar *s) { zchar c; while ((c = (unsigned char) *s++) != 0) if (c == ZC_NEW_FONT || c == ZC_NEW_STYLE) { int arg = (unsigned char) *s++; if (c == ZC_NEW_FONT) os_set_font (arg); if (c == ZC_NEW_STYLE) os_set_text_style (arg); } else os_display_char (c); }/* os_display_string */
void os_display_string (const zchar *s) { zchar c; while ((c = (unsigned char) *s++) != 0) /* Is this superfluous given it's also done in screen_word()? */ if (c == ZC_NEW_FONT || c == ZC_NEW_STYLE) { int arg = (unsigned char) *s++; if (c == ZC_NEW_FONT) os_set_font (arg); if (c == ZC_NEW_STYLE) os_set_text_style (arg); } else os_display_char (c); }/* os_display_string */
void screen_new_line (void) { if (discarding) return; if (os_wrap_window (cwp - wp) == 0) os_display_char ('\n'); /* Handle newline interrupts at the start (for most cases) */ if (h_interpreter_number != INTERP_MSDOS || story_id != ZORK_ZERO || h_release != 393) countdown (); /* Check whether the last input line gets destroyed */ if (input_window == cwin) input_redraw = TRUE; /* If the cursor has not reached the bottom line, then move it to the next line; otherwise scroll the window or reset the cursor to the top left. */ cwp->x_cursor = cwp->left + 1; if (cwp->y_cursor + 2 * font_height - 1 > cwp->y_size) if (enable_scrolling) { zword y = cwp->y_pos; zword x = cwp->x_pos; os_scroll_area (y, x, y + cwp->y_size - 1, x + cwp->x_size - 1, font_height); } else cwp->y_cursor = 1; else cwp->y_cursor += font_height; update_cursor (); /* See if we need to print a more prompt (unless the game has set the line counter to -999 in order to suppress more prompts). */ if (enable_scrolling && (short) cwp->line_count != -999) { zword above = (cwp->y_cursor - 1) / font_height; zword below = (cwp->y_size - cwp->y_cursor + 1) / font_height; cwp->line_count++; if ((short) cwp->line_count >= (short) above + below - 1) { if (more_prompts) os_more_prompt (); cwp->line_count = option_context_lines; } } /* Handle newline interrupts at the end for Zork Zero under DOS */ if (h_interpreter_number == INTERP_MSDOS && story_id == ZORK_ZERO && h_release == 393) countdown (); }/* screen_new_line */