⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 winfract.c

📁 frasr200的win 版本源码(18.21),使用make文件,使用的vc版本较低,在我的环境下编译有问题! 很不错的分形程序代码!
💻 C
📖 第 1 页 / 共 5 页
字号:
                       wsprintf(StatusTitle, "Saving:  %s", (LPSTR)FullPathName);
                       OpenStatusBox(hWnd, hInst);
                       resave_flag = overwrite = 1;
                    }
                    break;

                case IDF_PRINT:
                    if (winfract_menustyle) {	/* Fractint prompts */
                        /* (no change) */
                        }
                case IDM_PRINT:
                    time_to_print = 1;
                    time_to_cycle = 0;
                    break;

                case IDM_PARFILE:
winfract_loadpar:
                    {
                    FILE *parmfile;
                    extern char CommandFile[];
                    extern char CommandName[];
                    long point;

                    win_kill_all_zooming();
                    lstrcpy(DialogTitle,"Parameter File to Load");
                    lstrcpy(FileName, CommandFile);
                    lstrcpy(DefSpec,"*.par");
                    lstrcpy(DefExt,".par");
                    Return = Win_OpenFile(FileName);
                    if (Return) {
                        lstrcpy(LFileName, FileName);
                        lstrcpy(CommandFile, FileName);
                        get_lsys_name();
                        lstrcpy(DialogTitle,"Parameter Entry to Load");
                        win_choicemade = 0;
                        lpSelectFractal = MakeProcInstance(SelectFractal, hInst);
                        Return = DialogBox(hInst, "SelectFractal",
                            hWnd, lpSelectFractal);
                        FreeProcInstance(lpSelectFractal);
                        if (Return) { 
                            parmfile = fopen(CommandFile,"rb");
                            memcpy((char *)&point,
                                (char *)&win_choices[win_choicemade][21],
                                4);
                            fseek(parmfile,point,SEEK_SET);
                            Return = load_commands(parmfile);
                            }
                        if (Return) {
                            if (xx3rd != xxmin || yy3rd != yymin)
                                stopmsg(4," This image uses a skewed zoom-box,\n a feature not available in Winfract.\n All Skewness has been dropped"); 
                            if (colorpreloaded)
                                win_savedac();
                	    maxiter = maxit;
		            time_to_restart = 1;
		            time_to_cycle = 0;
		            calc_status = 0;
                            }
                        }
                    break;
                    }

                case IDM_SAVEPAR:
                    {
                    extern char CommandFile[];
                    win_kill_all_zooming();
                    lstrcpy(DialogTitle,"Parameter File to SaveAs");
                    lstrcpy(FileName, CommandFile);
                    lstrcpy(DefSpec,"*.par");
                    lstrcpy(DefExt,".par");
                    Return = Win_SaveFile(FileName);
                    if (Return) {
                        lstrcpy(LFileName, FileName);
                        lstrcpy(CommandFile, FileName);
		        lpSelectSavePar = MakeProcInstance(SelectSavePar, hInst);
		        Return = DialogBox(hInst, "SelectSavePar",
		 	    hWnd, lpSelectSavePar);
		        FreeProcInstance(lpSelectSavePar);
		        }
		    if (Return) {
		        time_to_resume = 1;
		        win_make_batch_file();
		 	}
                    break;
                    }

                case IDF_SAVEPAR:
                    win_kill_all_zooming();
                    time_to_resume = 1;
                    make_batch_file();
                    break;
                   
                case IDM_COPY:
                   win_copy_to_clipboard();

                    break;

                case IDM_EXIT:
                    win_kill_all_zooming();
                    time_to_quit = 1;
                    time_to_cycle = 0;
                    ValidateRect(hWnd, NULL);
                    hWndCopy = hWnd;
                    /* the main routine will actually call 'DestroyWindow()' */
                    break;

                /* Fractals menu items */

                case IDF_FORMULA:
                    if (winfract_menustyle) {	/* Fractint prompts */
                        win_kill_all_zooming();
                        time_to_resume = 1;
                        julibrot = 0;		/* disable Julibrot logic */
julibrot_fudge:				/* dive in here for Julibrots */
                	stackscreen();
			i = get_fracttype();
                	unstackscreen();
                	SetFocus(hWnd);
	                if (i == 0) {		/* time to redraw? */
		            time_to_restart = 1;
		            time_to_cycle = 0;
		            calc_status = 0;
		            }
                	break;
                        }
                case IDM_FORMULA:
                    lstrcpy(DialogTitle,"Select a Fractal Formula");
                    win_kill_all_zooming();
                    win_numchoices = CountFractalList;
                    win_choicemade = 0;
                    CurrentFractal = fractype;
                    for (i = 0; i < win_numchoices; i++) {
                        win_choices[i] = fractalspecific[onthelist[i]].name;
                        if (onthelist[i] == fractype ||
                            fractalspecific[onthelist[i]].tofloat == fractype)
                            win_choicemade = i;
                        }
                    lpSelectFractal = MakeProcInstance(SelectFractal, hInst);
                    Return = DialogBox(hInst, "SelectFractal",
                        hWnd, lpSelectFractal);
                    FreeProcInstance(lpSelectFractal);
                    fchoice = win_choicemade;
                    if (Return && (onthelist[fchoice] == IFS ||
                        onthelist[fchoice] == IFS3D)) {
                        lstrcpy(DialogTitle,"IFS Filename to Load");
                        lstrcpy(FileName, IFSFileName);
                        lstrcpy(DefSpec,"*.ifs");
                        lstrcpy(DefExt,".ifs");
                        Return = Win_OpenFile(FileName);
                        if (Return) {
                            lstrcpy(IFSFileName, FileName);
                            lstrcpy(FormFileName, FileName);
                            get_formula_names();
                            lstrcpy(DialogTitle,"Select an IFS type");
                            win_choicemade = 0;
                            lpSelectFractal = MakeProcInstance(SelectFractal, hInst);
                            Return = DialogBox(hInst, "SelectFractal",
                                hWnd, lpSelectFractal);
                            FreeProcInstance(lpSelectFractal);
                            if (Return) {
                                lstrcpy(IFSName, win_choices[win_choicemade]);
                                Return = ! ifsload();
                                }
                            }
                        }
                    if (Return && (onthelist[fchoice] == FORMULA || 
                        onthelist[fchoice] == FFORMULA)) {
                        /* obtain the formula filename */
                        lstrcpy(DialogTitle,"Formula File to Load");
                        lstrcpy(FileName, FormFileName);
                        lstrcpy(DefSpec,"*.frm");
                        lstrcpy(DefExt,".frm");
                        Return = Win_OpenFile(FileName);
                        if (Return) {
                            lstrcpy(FormFileName, FileName);
                            get_formula_names();
                            lstrcpy(DialogTitle,"Select a Formula");
                            win_choicemade = 0;
                            lpSelectFractal = MakeProcInstance(SelectFractal, hInst);
                            Return = DialogBox(hInst, "SelectFractal",
                                hWnd, lpSelectFractal);
                            FreeProcInstance(lpSelectFractal);
                            if (Return) 
                                Return = parse_formula_names();
                            }
                        }
                    if (Return && (onthelist[fchoice] == LSYSTEM)) {
                        lstrcpy(DialogTitle,"Lsystem File to Load");
                        lstrcpy(FileName, LFileName);
                        lstrcpy(DefSpec,"*.l");
                        lstrcpy(DefExt,".l");
                        Return = Win_OpenFile(FileName);
                        if (Return) {
                            lstrcpy(LFileName, FileName);
                            get_lsys_name();
                            lstrcpy(DialogTitle,"Select a Formula");
                            win_choicemade = 0;
                            lpSelectFractal = MakeProcInstance(SelectFractal, hInst);
                            Return = DialogBox(hInst, "SelectFractal",
                                hWnd, lpSelectFractal);
                            FreeProcInstance(lpSelectFractal);
                            if (Return) {
                                lstrcpy(LName, win_choices[win_choicemade]);
                                Return = !LLoad();
                                }
                            }
                        }
                    julibrot = 0;
                    if (Return) {
                        double oldxxmin, oldxxmax, oldyymin, oldyymax;
                        double oldparam[4];
                        int i;
                        oldxxmin = xxmin;
                        oldxxmax = xxmax;
                        oldyymin = yymin;
                        oldyymax = yymax;
                        for (i = 0; i < 4; i++)
                            oldparam[i] = param[i];
                        CurrentFractal = onthelist[fchoice];
                        curfractalspecific = &fractalspecific[CurrentFractal];
                        if (CurrentFractal == BIFURCATION
                            || CurrentFractal == LBIFURCATION
                            || CurrentFractal == BIFSTEWART
                            || CurrentFractal == LBIFSTEWART
                            || CurrentFractal == BIFLAMBDA
                            || CurrentFractal == LBIFLAMBDA
                            ) set_trig_array(0,"ident");
                        if (CurrentFractal == BIFEQSINPI
                            || CurrentFractal == LBIFEQSINPI
                            || CurrentFractal == BIFADSINPI
                            || CurrentFractal == LBIFADSINPI
                            ) set_trig_array(0,"sin");
                        set_default_parms();
                        if (CurrentFractal == JULIBROT || CurrentFractal == JULIBROTFP) {
                            fractype = CurrentFractal;
                            julibrot = 1;
                    	    stackscreen();
                            if (get_fract_params(0) < 0)
                                Return = 0;
                	    unstackscreen();
                            }
                        else {
                            lpSelectFracParams = MakeProcInstance(SelectFracParams,
                                hInst);
                            Return = DialogBox(hInst, "SelectFracParams",
                                hWnd, lpSelectFracParams);
                            FreeProcInstance(lpSelectFracParams);
                            }
                        if (! Return) {
                            xxmin = oldxxmin;
                            xxmax = oldxxmax;
                            yymin = oldyymin;
                            yymax = oldyymax;
                            for (i = 0; i < 4; i++)
                                param[i] = oldparam[i];
                            }
                        }
                    if (Return) {
                        time_to_reinit = 1;
                        time_to_cycle = 0;
                        calc_status = 0;
                        }
                    break;

                case IDF_PARFILE:
                    if (!winfract_menustyle) {	/* winfract prompts */
                        goto winfract_loadpar; /* for now */
                        }
                case IDF_DOODADX:
                    if (!winfract_menustyle)   /* Windows menus */
                        goto winfract_xmenu;   /* for now */
                case IDF_DOODADY:
                    if (!winfract_menustyle)   /* Windows menus */
                        goto winfract_ymenu;   /* for now */
                case IDF_DOODADZ:
                    if (!winfract_menustyle)   /* Windows menus */
                        goto winfract_zmenu;   /* for now */

                    if (winfract_menustyle) {	/* fractint prompts */
                        win_kill_all_zooming();
                        time_to_resume = 1;
                	stackscreen();
                	maxiter = maxit;
                        if (wParam == IDF_DOODADX || wParam == IDM_DOODADX)
                            i = get_toggles();
                        else if (wParam == IDF_DOODADY || wParam == IDM_DOODADY)
                            i = get_toggles2();
                        else if (wParam == IDF_DOODADZ || wParam == IDM_DOODADZ)
                            i = get_fract_params(1);
                        else {
			    i = get_commands();
                            if (xx3rd != xxmin || yy3rd != yymin)
                                stopmsg(4," This image uses a skewed zoom-box,\n a feature not available in Winfract.\n All Skewness has been dropped"); 
			    if (colorpreloaded)
			        win_savedac();
			    }
                	unstackscreen();
                	SetFocus(hWnd);
                        time_to_cycle = 0;
	                if (i > 0) {		/* time to redraw? */
	                    maxiter = maxit;
		            time_to_restart = 1;
		            calc_status = 0;
		            }
                	break;
                   }

                case IDM_DOODADX:
winfract_xmenu:
			lpSelectDoodads = MakeProcInstance(SelectDoodads, hInst);
			Return = DialogBox(hInst, "SelectDoodads",
				hWnd, lpSelectDoodads);
			FreeProcInstance(lpSelectDoodads);
			if (Return) {
                                win_kill_all_zooming();
				win_savedac();
				time_to_restart = 1;
                                time_to_cycle = 0;
                                calc_status = 0;
				}
                        break;

                case IDM_DOODADY:
winfract_ymenu:
			lpSelectExtended = MakeProcInstance(SelectExtended, hInst);
			Return = DialogBox(hInst, "SelectExtended",
				hWnd, lpSelectExtended);
			FreeProcInstance(lpSelectExtended);
			if (Return) {
                                win_kill_all_zooming();
				win_savedac();
				time_to_restart = 1;
                                time_to_cycle = 0;
                                calc_status = 0;
				}
                        break;

	       case IDM_DOODADZ:
winfract_zmenu:
		    CurrentFractal = fractype;
                    lpSelectFracParams = MakeProcInstance(SelectFracParams,
                        hInst);
                    Return = Di

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -