void display_img( MFDB *mfdb, INFO_IMAGE *inf, VSS_INFO *vss_info, char *name ) { int yt ; int xy[8] ; int off_x, off_y ; int x_align, y_align ; off_x = off_y = 0 ; xy[0] = xy[1] = 0 ; xy[2] = mfdb->fd_w - 1 ; if ( xy[2] > Xmax ) xy[2] = Xmax ; xy[3] = mfdb->fd_h - 1 ; if ( xy[3] > Ymax ) xy[3] = Ymax ; if ( Xmax > mfdb->fd_w ) off_x = (Xmax-mfdb->fd_w)/2 ; if ( Ymax > mfdb->fd_h ) off_y = (Ymax-mfdb->fd_h)/2 ; xy[4] = off_x ; xy[5] = off_y ; xy[6] = off_x + xy[2] ; xy[7] = off_y + xy[3] ; if ( !Truecolor && ( inf->palette != NULL ) ) set_tospalette( inf->palette, (int) (inf->nb_cpal) ) ; if ( !vss_info->do_not_show_mouse ) v_hide_c(handle) ; show_img( mfdb, xy, vss_info->transition ) ; if ( vss_info->aff_name ) { yt = ttype.hcar ; vst_alignment( handle, 1, 1, &x_align, &y_align ) ; vqt_extent( handle, name, xy ) ; aff_text( name, ( Xmax - xy[0] - xy[2] ) /2, yt, txt_color ) ; vst_alignment( handle, x_align, y_align, &x_align, &y_align ) ; } if ( vss_info->aff_prog ) { char txt_prog[20] ; sprintf( txt_prog, "%d/%d", 1+num_courant, num_total ) ; vst_alignment( handle, 0, 2, &x_align, &y_align ) ; aff_text( txt_prog, 0, yprog, txt_color ) ; vst_alignment( handle, x_align, y_align, &x_align, &y_align ) ; } if ( !vss_info->do_not_show_mouse ) v_show_c(handle, 1) ; }
void display_status(int status) { int x_align, y_align ; int xy[8] ; char txt[50] ; switch (status ) { case STATUS_LOADING : strcpy( txt, "Loading..." ) ; break ; case STATUS_SCALING : strcpy( txt, "Scaling..." ) ; break ; case STATUS_WAITING : strcpy( txt, "Waiting..." ) ; break ; default : strcpy( txt, " " ) ; } vsf_color( handle, back_color ) ; vsf_interior( handle, FIS_SOLID ) ; vqt_extent( handle, txt, xy ) ; xy[2] = xy[4] ; xy[3] = xy[5] ; yprog = xy[3] + ttype.hcar ; v_hide_c(handle) ; vr_recfl( handle, xy ) ; v_show_c(handle, 1) ; vst_alignment( handle, 0, 1, &x_align, &y_align ) ; aff_text( txt, 0, ttype.hcar, txt_color ) ; vst_alignment( handle, x_align, y_align, &x_align, &y_align ) ; }
void check_env_map4(t_data *data) { if ((data->mouse->x >= 516 && data->mouse->x <= 661) && (data->mouse->y >= 195 && data->mouse->y <= 468)) { if (data->player_pos != 1) position_handle(582, 452, data); else if (data->inv.item_min[1].used != 1) { aff_text(data, data->text.pecheur[0]); data->inv.item_min[1].used = 1; add_item(data, data->inv.items, 1); } } else if ((data->mouse->x >= 699 && data->mouse->x <= 832) && (data->mouse->y >= 88 && data->mouse->y <= 348)) { if (data->player_pos != 2) position_handle(759, 359, data); else load_map1(data); } else check_env_map4_2(data); }