void TipButton::feel( int mouse ) { init_dialog( Tip, NULL, NULL ); ready_dialog( Tip, NULL, NULL, tip_feel, NULL, NULL, NULL ); center_dialog( Tip ); save_under_dialog( Tip ); draw_dialog( Tip ); //CRASH//debug( "Render icon" ); gfx_blit( kyle_icon_data, Tip[ICON].sx, Tip[ICON].sy, Tip[ICON].width, Tip[ICON].height, 15 ); _nTipOfTheDay = rand() % _nTips; drawTipText(); do_dialog( Tip, -1 ); restore_under_dialog(); dialog_done = 0; // override inside dialog box's setting }
//ִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִ¿ // do_user_interaction ³ // ³ // Entry point from client module called on startup operation. ³ //ִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִ� void do_user_interaction() { int cursor; float t1, t2; Editable *e; static int inited = 0; char file[16]; char path[128]; char buff[32]; gfx_get_mform(cursor); gfx_set_mform(C_ARROW,0); gfx_report(""); gfx_prompt(""); gfx_prompt(""); // Force mtl_pathname to point to process directory with ESPORT.VGP // as the filename. gfx_get_paths(GFX_PROCESS_PATH,0,path,file); strcpy(mtl_palpath,path); strcpy(mtl_palname,"ESPORT.VGP"); strcpy(log_fname,path); strcat(log_fname,"\\ESPORT.LOG"); if (! inited) { char buff[256]; strcpy(buff,path); strcat(buff,"\\"); strcat(buff,"ESPORT.INI"); load_from_ini(buff); init_dialog(Escher, Escher_edit, NULL); inited = 1; } do_export=loop_done=0; gfx_get_paths(GFX_3DS_PATH,0,path,file); if (strstr(file,".3DS")) { *strstr(file,".3DS")=0; strcpy(scene_name,file); strcat(file,".IFF"); strcpy(output_name,file); strcpy(output_path,path); } Escher[TARGET].text=output_name; ready_dialog(Escher, Escher_edit, NULL, Escher_feel, Escher_rad, NULL, NULL); init_editable(&Escher[SCN_NAME], scene_name); sprintf(buff,"%f",scale_3ds); init_editable(&Escher[SCAL_3DS], buff); sprintf(buff,"%f",scale_esh); init_editable(&Escher[SCAL_ESH], buff); Escher[INC_CAMS].radio = (cameras_flag) ? 1 : 0; Escher[INC_LGTS].radio = (lights_flag) ? 1 : 0; Escher[KEYFRAME].radio = (keys_flag) ? 1 : 0; Escher[FLAGS_0].radio = (object_flags & ESCH_MSH_APP0) ? 1 : 0; Escher[FLAGS_1].radio = (object_flags & ESCH_MSH_APP1) ? 1 : 0; Escher[FLAGS_2].radio = (object_flags & ESCH_MSH_APP2) ? 1 : 0; Escher[FLAGS_3].radio = (object_flags & ESCH_MSH_APP3) ? 1 : 0; Escher[FLAGS_4].radio = (object_flags & ESCH_MSH_APP4) ? 1 : 0; Escher[FLAGS_5].radio = (object_flags & ESCH_MSH_APP5) ? 1 : 0; Escher[FLAGS_6].radio = (object_flags & ESCH_MSH_APP6) ? 1 : 0; Escher[FLAGS_7].radio = (object_flags & ESCH_MSH_APP7) ? 1 : 0; Escher[FLAGS_8].radio = (object_flags & ESCH_MSH_APP8) ? 1 : 0; Escher[FLAGS_9].radio = (object_flags & ESCH_MSH_APP9) ? 1 : 0; Escher[FLAGS_A].radio = (object_flags & ESCH_MSH_APPA) ? 1 : 0; Escher[FLAGS_B].radio = (object_flags & ESCH_MSH_APPB) ? 1 : 0; Escher[FLAGS_C].radio = (object_flags & ESCH_MSH_APPC) ? 1 : 0; Escher[FLAGS_D].radio = (object_flags & ESCH_MSH_APPD) ? 1 : 0; Escher[FLAGS_E].radio = (object_flags & ESCH_MSH_APPE) ? 1 : 0; Escher[FLAGS_F].radio = (object_flags & ESCH_MSH_APPF) ? 1 : 0; startover: ; while (!loop_done) { center_dialog(Escher); save_under_dialog(Escher); draw_dialog(Escher); do_dialog(Escher, -1); } if (do_export) { e=(Editable*)Escher[SCAL_3DS].text; t1=atof(e->string); if (t1 <= 0.0) { gfx_continu_line("Scale values must be positive and non-zero"); loop_done=0; goto startover; } e=(Editable*)Escher[SCAL_ESH].text; t2=atof(e->string); if (t2 <= 0.0) { gfx_continu_line("Scale values must be positive and non-zero"); loop_done=0; goto startover; } scale_3ds = t1; scale_esh = t2; scale_3ds2esch = t2 / t1; e=(Editable*)Escher[SCN_NAME].text; strncpy(scene_name,e->string,16); object_flags=0; if (Escher[FLAGS_0].radio) object_flags |= ESCH_MSH_APP0; if (Escher[FLAGS_1].radio) object_flags |= ESCH_MSH_APP1; if (Escher[FLAGS_2].radio) object_flags |= ESCH_MSH_APP2; if (Escher[FLAGS_3].radio) object_flags |= ESCH_MSH_APP3; if (Escher[FLAGS_4].radio) object_flags |= ESCH_MSH_APP4; if (Escher[FLAGS_5].radio) object_flags |= ESCH_MSH_APP5; if (Escher[FLAGS_6].radio) object_flags |= ESCH_MSH_APP6; if (Escher[FLAGS_7].radio) object_flags |= ESCH_MSH_APP7; if (Escher[FLAGS_8].radio) object_flags |= ESCH_MSH_APP8; if (Escher[FLAGS_9].radio) object_flags |= ESCH_MSH_APP9; if (Escher[FLAGS_A].radio) object_flags |= ESCH_MSH_APPA; if (Escher[FLAGS_B].radio) object_flags |= ESCH_MSH_APPB; if (Escher[FLAGS_C].radio) object_flags |= ESCH_MSH_APPC; if (Escher[FLAGS_D].radio) object_flags |= ESCH_MSH_APPD; if (Escher[FLAGS_E].radio) object_flags |= ESCH_MSH_APPE; if (Escher[FLAGS_F].radio) object_flags |= ESCH_MSH_APPF; cameras_flag = (Escher[INC_CAMS].radio) ? 1 : 0; lights_flag = (Escher[INC_LGTS].radio) ? 1 : 0; keys_flag = (Escher[KEYFRAME].radio) ? 1 : 0; export(); }
//ִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִ¿ // do_mtl ³ // ³ // Do material's dialog. ³ //ִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִ� void do_mtl() { int sizex, sizey; Editable *e; static int inited = 0; char buff[32]; if (! inited) { init_dialog(EschMtl, EschMtl_edit, NULL); inited = 1; } loop_done=0; EschMtl[PALETTE].text=mtl_palname; EschMtl[PALETTE].radio=0; EschMtl[COMPRESS].radio = (mtl_compress) ? 1 : 0; ready_dialog(EschMtl, EschMtl_edit, NULL, EschMtl_feel, EschMtl_rad, NULL, NULL); sprintf(buff,"%d",mtl_sizex); init_editable(&EschMtl[SIZEX], buff); sprintf(buff,"%d",mtl_sizey); init_editable(&EschMtl[SIZEY], buff); startover: ; while (!loop_done) { center_dialog(EschMtl); save_under_dialog(EschMtl); draw_dialog(EschMtl); do_dialog(EschMtl, -1); } e=(Editable*)EschMtl[SIZEX].text; sizex=atoi(e->string); switch(sizex) { case 16: case 32: case 64: case 128: case 256: break; default: gfx_continu_line("X Size must be 16, 32, 64, 128, or 256"); loop_done=0; goto startover; } e=(Editable*)EschMtl[SIZEY].text; sizey=atoi(e->string); switch(sizey) { case 16: case 32: case 64: case 128: case 256: break; default: gfx_continu_line("Y Size must be 16, 32, 64, 128, or 256"); loop_done=0; goto startover; } mtl_sizex=sizex; mtl_sizey=sizey; mtl_compress = (EschMtl[COMPRESS].radio) ? 1 : 0; }