static void load_overlay(int how) { char *title; SHORT ounder; char sbuf[50]; Vset_path cpath; vset_get_pathinfo(FLI_PATH,&cpath); if((title = pj_get_filename(stack_string(overl_msgs[how],sbuf), ".FLC;.CEL;.FLI", ok_str, cpath.path,NULL,FALSE, &cpath.scroller_top,cpath.wildcard))!=NULL) { ounder = vs.render_under; if(how == 1) /* underlay */ { how = 0; vs.render_under = 1; } else vs.render_under = 0; draw_flibord(); load_fli_overlay(title, how); vs.render_under = ounder; } }
static void config_input(void) { int choice; char dev_type; char buf[PATH_SIZE]; USHORT idis[9]; UBYTE modes[IDR_MAX_OPTIONS]; char sbuf[80]; clear_mem(idis,sizeof(idis)); idis[vconfg.dev_type] = QCF_ASTERISK; if(!resource_exists(summa_idriver_name)) idis[1] |= QCF_DISABLED; choice = soft_qchoice(idis, "input_device" ); switch (choice) { default: return; case 0: dev_type = 0; strcpy(buf, mouse_idriver_name); break; case 1: dev_type = 1; strcpy(buf, summa_idriver_name); break; case 2: if(vconfg.dev_type == 2) strcpy(buf,vconfg.idr_name); else buf[0] = 0; if(!req_resource_name(buf,"*.idr", stack_string("idr_scroll", sbuf))) { return; } dev_type = 2; break; case 3: if (!get_serial_port()) return; goto REWRITE; } memcpy(modes,vconfg.idr_modes,sizeof(modes)); if(config_idriver(buf, modes, txtcmp(vconfg.idr_name,buf) == 0, (SHORT)vconfg.comm_port) < Success) { return; } vconfg.dev_type = dev_type; memcpy(vconfg.idr_modes,modes,sizeof(modes)); strcpy(vconfg.idr_name, buf); REWRITE: rewrite_config(); cleanup_idriver(); init_input(); }
void qload_vsettings(void) { char *title; char sbuf[50]; if ((title = vset_get_filename(stack_string("load_set",sbuf), ".SET;.FLC", load_str, SETTINGS_PATH, NULL, 1)) !=NULL) { load_vsettings(title); } }
void qload_path(void) { char *path; char buf[50]; if ((path = vset_get_filename(stack_string("load_path",buf), ".PLY",load_str,OPTPATH_PATH,NULL,0)) != NULL) { cant_load(load_path(path),path); a3d_disables(); } }
void qload_polygon(void) { char *path; char buf[50]; if ((path = vset_get_filename(stack_string("load_poly",buf), ".PLY",load_str,POLY_PATH,NULL,0)) != NULL) { load_polygon(path); a3d_disables(); } }
void qsave_tween(void) { char *path; char buf[50]; if ((path = vset_get_filename(stack_string("save_tween",buf), ".TWE",save_str,TWEEN_PATH,NULL,TRUE)) != NULL) { if (overwrite_old(path)) po_save_tween(path); } }
void qsave_vsettings(void) { char *title; char sbuf[50]; if ((title = vset_get_filename(stack_string("save_set",sbuf), ".SET", save_str, SETTINGS_PATH, NULL, 1)) != NULL) { if(overwrite_old(title)) softerr(save_settings_file(title,FALSE),"!%s","cant_save",title); } }
void qload_tween(void) { char *path; char buf[50]; if ((path = vset_get_filename(stack_string("load_tween",buf), ".TWE",load_str,TWEEN_PATH,NULL,0)) != NULL) { po_load_tween(path); a3d_disables(); } }
static void fml_kill(void) { char *path; char suffix[WILD_SIZE]; char *ends; char buf1[50], buf2[16]; hide_mp(); ends = file_ends[vs.file_type]; parse_to_semi(&ends,suffix,sizeof(suffix)); if ((path = vset_get_filename(stack_string("del_file",buf1), suffix, stack_string("del_str",buf2), file_paths[vs.file_type],NULL,0)) != NULL) { if(!pj_exists(path)) cant_find(path); else if(really_delete(path)) pj_delete(path); } show_mp(); }
static char *substitute_alternative(char *s, char *param) { if (selector['q'-'a']) printf("[%x:a::%p \"%s\"]\n", masm_level, s, s); if ((masm_level) && (s)) { s = substitute(s, param); if (s) s = stack_string(s); } if (selector['q'-'a']) printf("[%X:A::%p \"%s\"]\n", masm_level, s, s); return s; }
void qsave_polygon(void) { char *path; char buf[50]; if ((path = vset_get_filename(stack_string("save_poly",buf), ".PLY",save_str,POLY_PATH,NULL,TRUE)) != NULL) { if (overwrite_old(path)) { save_polygon(path); } } }
static void save_cur_shape(void) /* Save one end of the tween to a .ply file */ { char *path; Poly *p; char sbuf[50]; if ((p = query_end(TRUE)) == NULL) return; if ((path = vset_get_filename(stack_string("save_shape", sbuf), ".PLY",save_str,POLY_PATH,NULL,TRUE)) != NULL) { if(overwrite_old(path)) save_poly(path, p); } }
static void ask_qsave_seg(char *title_key, char *save_word, SHORT sstart, SHORT send) { Errcode err; char suffi[PDR_SUFFI_SIZE]; char titbuf[80]; char pdrinfo[40]; char sbuf[50]; char *flicname; int num_frames; if((num_frames = send - sstart) < 0) num_frames = -num_frames; ++num_frames; if((err = get_flisave_info(suffi, pdrinfo, sizeof(pdrinfo))) < Success) goto error; snftextf(titbuf,sizeof(titbuf),"!%d%d%s", stack_string(title_key,sbuf), sstart+1, send+1, pdrinfo ); if(!save_as_fli()) { /* arrrgh take of trailing period from title */ flicname = &pdrinfo[strlen(pdrinfo) - 1]; if(*flicname == '.') *flicname = 0; if(!soft_yes_no_box("!%d%s", "save_conv", num_frames, &pdrinfo )) return; } if ((flicname = vset_get_filename(titbuf, suffi, save_word, FLI_PATH,NULL,1))!=NULL) { if(!overwrite_old(flicname)) return; if((err = save_flx_segment(flicname,sstart,send)) < Success) goto error; } error: softerr(err,"!%s", "fli_savef", flicname); }
void qsave_macro(void) { char *title; char buf[50]; close_macro(); if (!pj_exists(macro_name)) soft_continu_box("no_macro"); else { if ((title = vset_get_filename(stack_string("save_mac",buf), ".REC", save_str,MACRO_PATH,NULL,1))!= NULL) { if (overwrite_old(title)) { pj_copyfile(macro_name, title); /* < 0 is bad */ } } } }
void qload_macro(void) { Errcode err; Machead mh; char *title; Jfile f; char buf[50]; if ((title = vset_get_filename(stack_string("load_mac",buf), ".REC", load_str,MACRO_PATH,NULL,1)) == NULL) { return; } close_macro(); if ((f = pj_open(title, JREADONLY)) == JNONE) { err = pj_ioerr(); goto error; } if((err = pj_read_ecode(f,&mh,(long)sizeof(mh))) < Success) { if(err == Err_eof) err = Err_truncated; goto error; } if(mh.id.type != MAC_MAGIC) { err = Err_bad_magic; goto error; } pj_close(f); f = JNONE; err = pj_copyfile(title, macro_name); error: pj_close(f); softerr(err,"!%s", "macro_load", title); }
static Errcode go_screen_menu(Screen_mode *sm) { Errcode err; Mode_entry *mlist; Names *wildlist; Names *current; char sbuf[80]; hide_mp(); if((err = build_mode_list(&mlist,&wildlist,¤t)) < Success) goto error; err = go_driver_scroller(stack_string("screen_menu", sbuf), (Names *)mlist, current, pick_screen_mode, show_driver_info, sm, NULL); error: free_mode_list(&mlist,&wildlist); show_mp(); return(err); }
static void load_cur_shape(void) /* Load one end of the tween from a .ply file */ { char *path; Poly *p; char sbuf[50]; if ((p = query_end(FALSE)) == NULL) return; if ((path = vset_get_filename(stack_string("load_shape", sbuf), ".PLY",load_str,POLY_PATH,NULL,FALSE)) != NULL) { if (tween_save_undo()>=Success) { if (load_a_poly(path, p) >= Success) { softerr(force_other(p),NULL); redraw_both_ends(); } } } }