void z_picture_data (void) { zword pic = zargs[0]; zword table = zargs[1]; int height, width; int i; bool avail = os_picture_data (pic, &height, &width); for (i = 0; mapper[i].story_id != UNKNOWN; i++) if (story_id == mapper[i].story_id) { if (pic == mapper[i].pic) { int height2, width2; avail &= os_picture_data (mapper[i].pic1, &height2, &width2); avail &= os_picture_data (mapper[i].pic2, &height2, &width2); height += height2; } else if (pic == mapper[i].pic1 || pic == mapper[i].pic2) avail = FALSE; } storew ((zword) (table + 0), (zword) (height)); storew ((zword) (table + 2), (zword) (width)); branch (avail); }/* z_picture_data */
void z_draw_picture (void) { zword pic = zargs[0]; zword y = zargs[1]; zword x = zargs[2]; int i; flush_buffer (); if (y == 0) /* use cursor line if y-coordinate is 0 */ y = cwp->y_cursor; if (x == 0) /* use cursor column if x-coordinate is 0 */ x = cwp->x_cursor; y += cwp->y_pos - 1; x += cwp->x_pos - 1; /* The following is necessary to make Amiga and Macintosh story files work with MCGA graphics files. Some screen-filling pictures of the original Amiga release like the borders of Zork Zero were split into several MCGA pictures (left, right and top borders). We pretend this has not happened. */ for (i = 0; mapper[i].story_id != UNKNOWN; i++) if (story_id == mapper[i].story_id && pic == mapper[i].pic) { int height1, width1; int height2, width2; int delta = 0; os_picture_data (pic, &height1, &width1); os_picture_data (mapper[i].pic2, &height2, &width2); if (story_id == ARTHUR && pic == 54) delta = h_screen_width / 160; os_draw_picture (mapper[i].pic1, y + height1, x + delta); os_draw_picture (mapper[i].pic2, y + height1, x + width1 - width2 - delta); } os_draw_picture (pic, y, x); if (story_id == SHOGUN) if (pic == 3) { int height, width; os_picture_data (59, &height, &width); os_draw_picture (59, y, h_screen_width - width + 1); } }/* z_draw_picture */
void z_erase_picture (void) { int height, width; zword y = zargs[1]; zword x = zargs[2]; flush_buffer (); /* Do nothing if the background is transparent */ if (hi (cwp->colour) == TRANSPARENT_COLOUR) return; if (y == 0) /* use cursor line if y-coordinate is 0 */ y = cwp->y_cursor; if (x == 0) /* use cursor column if x-coordinate is 0 */ x = cwp->x_cursor; os_picture_data (zargs[0], &height, &width); y += cwp->y_pos - 1; x += cwp->x_pos - 1; os_erase_area (y, x, y + height - 1, x + width - 1, -1); }/* z_erase_picture */
void os_draw_picture (int num, int row, int col) { int width, height, r, c; if (!os_picture_data(num, &height, &width) || !width || !height) return; col--, row--; /* Draw corners */ dumb_set_picture_cell(row, col, '+'); dumb_set_picture_cell(row, col + width - 1, '+'); dumb_set_picture_cell(row + height - 1, col, '+'); dumb_set_picture_cell(row + height - 1, col + width - 1, '+'); /* sides */ for (c = col + 1; c < col + width - 1; c++) { dumb_set_picture_cell(row, c, '-'); dumb_set_picture_cell(row + height - 1, c, '-'); } for (r = row + 1; r < row + height - 1; r++) { dumb_set_picture_cell(r, col, '|'); dumb_set_picture_cell(r, col + width - 1, '|'); } /* body, but for last line */ for (r = row + 1; r < row + height - 2; r++) for (c = col + 1; c < col + width - 1; c++) dumb_set_picture_cell(r, c, ':'); /* Last line of body, including picture number. */ if (height >= 3) for (c = col + width - 2; c > col; c--, (num /= 10)) dumb_set_picture_cell(row + height - 2, c, num ? (num % 10 + '0') : ':'); }
void GlkInterface::showBeyondZorkTitle() { uint winW, winH, imgW, imgH; winid_t win = glk_window_open(0, 0, 0, wintype_Graphics, 0); glk_window_get_size(win, &winW, &winH); if (os_picture_data(1, &imgW, &imgH)) { os_draw_picture(1, win, Common::Rect(0, 0, winW, winH)); _events->waitForPress(); } glk_window_close(win, nullptr); }
void z_erase_picture (void) { int height, width; zword y = zargs[1]; zword x = zargs[2]; flush_buffer (); if (y == 0) /* use cursor line if y-coordinate is 0 */ y = cwp->y_cursor; if (x == 0) /* use cursor column if x-coordinate is 0 */ x = cwp->x_cursor; os_picture_data (zargs[0], &height, &width); y += cwp->y_pos - 1; x += cwp->x_pos - 1; os_erase_area (y, x, y + height - 1, x + width - 1); }/* z_erase_picture */