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

📄 cmdfiles.c

📁 frasr200的win 版本源码(18.21),使用make文件,使用的vc版本较低,在我的环境下编译有问题! 很不错的分形程序代码!
💻 C
📖 第 1 页 / 共 5 页
字号:
      CoreBlue	= (int)floatval[2];
      return(0);
      }

   if(strcmp(variable,s_mdcorners) == 0) {
      if(floatparms != totparms || totparms < 2 || totparms > 4)
	 goto badarg;
      zzmin = floatval[0];
      zzmax = floatval[1];
      if(totparms >= 3)
	 ttmin = floatval[2];
      if(totparms == 4)
	 ttmax = floatval[3];
      return(0);
      }

   if(strcmp(variable,s_numframes) == 0) {
      NumFrames = numval;
      return(0);
      }

   if (strcmp(variable,s_autokeyname) == 0) {   /* autokeyname=? */
      strcpy(autoname,value);
      return 0;
      }

   if (strcmp(variable,s_type) == 0 ) {         /* type=? */
      if (value[valuelen-1] == '*')
	 value[--valuelen] = 0;
      /* kludge because type ifs3d has an asterisk in front */
      if(strcmp(value,s_ifs3d)==0)
         value[3]=0;
      for (k = 0; fractalspecific[k].name != NULL; k++)
	 if (strcmp(value,fractalspecific[k].name) == 0)
	    break;
      if (fractalspecific[k].name == NULL) goto badarg;
      curfractalspecific = &fractalspecific[fractype = k];
      if (initcorners == 0) {
	 xx3rd = xxmin = curfractalspecific->xmin;
	 xxmax	       = curfractalspecific->xmax;
	 yy3rd = yymin = curfractalspecific->ymin;
	 yymax	       = curfractalspecific->ymax;
	 }
      if (initparams == 0) {
	 for (k = 0; k < 4; ++k) {
	    param[k] = curfractalspecific->paramvalue[k];
	    if(fractype != CELLULAR) /* don't round cellular */
	       roundfloatd(&param[k]);
	  }
         if(curfractalspecific->flags&MORE) {
            int extra;
            if((extra=find_extra_param(fractype)) > -1)
            for(i=0;i<MAXPARAMS-4;i++) {
               param[i+4] = moreparams[extra].paramvalue[i];
           }
         }
      }   
      return 1;
      }
   if (strcmp(variable,s_inside) == 0 ) {       /* inside=? */
      if(strcmp(value,s_zmag)==0)
	 inside = -59;
      else if(strcmp(value,s_bof60)==0)
	 inside = -60;
      else if(strcmp(value,s_bof61)==0)
	 inside = -61;
      else if(strncmp(value,s_epscross,3)==0)
	 inside = -100;
      else if(strncmp(value,s_startrail,4)==0)
	 inside = -101;
      else if(strncmp(value,s_period,3)==0)
	 inside = -102;
      else if(strcmp(value,s_maxiter)==0)
	 inside = -1;
      else if(numval == NONNUMERIC)
	 goto badarg;
      else
	 inside = numval;
      return 1;
      }
   if (strcmp(variable,s_fillcolor) == 0 ) {       /* fillcolor */
      if(strcmp(value,s_normal)==0)
	 fillcolor = -1;
      else if(numval == NONNUMERIC)
	 goto badarg;
      else
	 fillcolor = numval;
      return 1;
      }

   if (strcmp(variable,s_finattract) == 0 ) {   /* finattract=? */
      if (yesnoval < 0) goto badarg;
      finattract = yesnoval;
      return 1;
      }

   if (strcmp(variable,s_function) == 0) {      /* function=?,? */
      k = 0;
      while (*value && k < 4) {
	 if(set_trig_array(k++,value)) goto badarg;
	 if ((value = strchr(value,'/')) == NULL) break;
	 ++value;
	 }
       functionpreloaded = 1; /* for old bifs  JCO 7/5/92 */
      return 1;
      }

   if (strcmp(variable,s_outside) == 0 ) {      /* outside=? */
      if(strcmp(value,s_iter)==0)
	 outside = -1;
      else if(strcmp(value,s_real)==0)
	 outside = -2;
      else if(strcmp(value,s_imag)==0)
	 outside = -3;
      else if(strcmp(value,s_mult)==0)
	 outside = -4;
      else if(strcmp(value,s_sum)==0)
	 outside = -5;

      else if(numval == NONNUMERIC)
	 goto badarg;
      else if(numval < -5 || numval > 255) goto badarg;
      else outside = numval;
      return 1;
      }

   if (strcmp(variable,s_maxiter) == 0) {       /* maxiter=? */
      if (numval < 2) goto badarg;
      maxit = numval;
      return 1;
      }

   if (strcmp(variable,s_iterincr) == 0)        /* iterincr=? */
      return 0;

   if (strcmp(variable,s_passes) == 0) {        /* passes=? */
      if ( charval != '1' && charval != '2'
	&& charval != 'g' && charval != 'b'
	&& charval != 't')
	 goto badarg;
      usr_stdcalcmode = charval;
      return 1;
      }

   if (strcmp(variable,s_cyclelimit) == 0 ) {   /* cyclelimit=? */
      if (numval <= 1 || numval > 256) goto badarg;
      initcyclelimit = numval;
      return 0;
      }

   if (strcmp(variable,s_makemig) == 0) {
       int xmult, ymult;
       if (totparms < 2) goto badarg;
       xmult = intval[0];
       ymult = intval[1];
       make_mig(xmult, ymult);
#ifndef WINFRACT
       exit(0);
#endif
       }

   if (strcmp(variable,s_cyclerange) == 0) {
      if (totparms < 2) intval[1] = 255;
      if (totparms < 1) intval[0] = 1;
      if (totparms != intparms
	|| intval[0] < 0 || intval[1] > 255 || intval[0] > intval[1])
	 goto badarg;
      rotate_lo = intval[0];
      rotate_hi = intval[1];
      return 0;
      }

   if (strcmp(variable,s_ranges) == 0) {
      int i,j,entries,prev;
      int tmpranges[128];
      if (totparms != intparms) goto badarg;
      entries = prev = i = 0;
      while (i < totparms) {
	 if ((j = intval[i++]) < 0) { /* striping */
	    if ((j = 0-j) < 1 || j >= 16384 || i >= totparms) goto badarg;
	    tmpranges[entries++] = -1; /* {-1,width,limit} for striping */
	    tmpranges[entries++] = j;
	    j = intval[i++];
	    }
	 if (j < prev) goto badarg;
	 tmpranges[entries++] = prev = j;
	 }
      if (prev == 0) goto badarg;
      if ((ranges = (int far *)farmemalloc(2L*entries)) == NULL) {
	 static char far msg[] = {"Insufficient memory for ranges="};
	 stopmsg(0,msg);
	 return(-1);
	 }
      rangeslen = entries;
      for (i = 0; i < rangeslen; ++i)
	 ranges[i] = tmpranges[i];
      return 1;
      }

   if (strcmp(variable,s_savename) == 0) {      /* savename=? */
      if (valuelen > 79) goto badarg;
      if (first_init || mode == 2)
	 strcpy(savename,value);
      return 0;
      }

   if (strcmp(variable,s_exitmode) == 0) {      /* exitmode=? */
      sscanf(value,"%x",&numval);
      exitmode = numval;
      return 0;
      }

   if (strcmp(variable,s_textcolors) == 0) {
      parse_textcolors(value);
      return 0;
      }

   if (strcmp(variable,s_potential) == 0) {     /* potential=? */
      k = 0;
      while (k < 3 && *value) {
         if(k==1)
	    potparam[k] = atof(value);
	 else
	    potparam[k] = atoi(value);
	 k++;
       if ((value = strchr(value,'/')) == NULL) k = 99;
	 ++value;
	 }
      pot16bit = 0;
      if (k < 99) {
	 if (strcmp(value,s_16bit)) goto badarg;
	 pot16bit = 1;
	 }
      return 1;
      }

   if (strcmp(variable,s_params) == 0) {        /* params=?,? */
      if (totparms != floatparms || totparms > MAXPARAMS)
	 goto badarg;
      for (k = 0; k < MAXPARAMS; ++k)
	 param[k] = (k < totparms) ? floatval[k] : 0.0;
      initparams = 1;
      return 1;
      }

   if (strcmp(variable,s_miim) == 0) {		/* miim=?[/?[/?[/?]]] */
      k = 0;
      do {
	 if (isdigit(*value) ||
	     *value == '.' || *value == '-' || *value == '+') {
	    if (k >= 4)
	       goto badarg;
	    param[k++] = atof(value);
	 }
	 else if (strncmp(value, "breadth", 7) == 0)
	    major_method = 0;
	 else if (strncmp(value, "depth",   5) == 0)
	    major_method = 1;
	 else if (strncmp(value, "walk",    4) == 0)
	    major_method = 2;
	 else if (strncmp(value, "run",     3) == 0)
	    major_method = 3;
	 else if (strncmp(value, "left",    4) == 0)
	    minor_method = 0;
	 else if (strncmp(value, "right",   5) == 0)
	    minor_method = 1;
	 else goto badarg;
	 value = strchr(value, '/');
      } while (value++);
      return 1;
   }

   if (strcmp(variable,s_initorbit) == 0) {     /* initorbit=?,? */
      if(strcmp(value,s_pixel)==0)
	 useinitorbit = 2;
      else {
	 if (totparms != 2 || floatparms != 2) goto badarg;
	 initorbit[0] = floatval[0];
	 initorbit[1] = floatval[1];
	 useinitorbit = 1;
	 }
      return 1;
      }

   if (strcmp(variable,s_orbitname) == 0 ) {         /* orbitname=? */
      if(check_orbit_name(value))
         goto badarg;
      return 1;
      }
   if (strcmp(variable,s_3dmode) == 0 ) {         /* orbitname=? */
      int i,j;
      j = -1;
      for(i=0;i<4;i++)
         if(strcmp(value,juli3Doptions[i])==0)
            j = i; 
      if(j < 0)
         goto badarg;
      else
         juli3Dmode = j;
      return 1;
      }

   if (strcmp(variable,s_julibrot3d) == 0) {       /* julibrot3d=?,?,?,? */
      if (floatparms != totparms)
	 goto badarg;
      if(totparms > 0)
         zdots = floatval[0];
      if (totparms > 1)
         originfp = floatval[1];
      if (totparms > 2)
         depthfp = floatval[2];
      if (totparms > 3)
         heightfp = floatval[3];
      if (totparms > 4)
         widthfp = floatval[4];
      if (totparms > 5)
         distfp = floatval[5];
      return 1;
      }

   if (strcmp(variable,s_julibroteyes) == 0) {       /* julibroteyes=?,?,?,? */
      if (floatparms != totparms || totparms != 1)
	 goto badarg;
      eyesfp =  floatval[0];
      return 1;
      }

   if (strcmp(variable,s_julibrotfromto) == 0) {       /* julibrotfromto=?,?,?,? */
      if (floatparms != totparms || totparms != 4)
	 goto badarg;
      mxmaxfp = floatval[0];
      mxminfp = floatval[1];
      mymaxfp = floatval[2];
      myminfp = floatval[3];
      return 1;
      }

   if (strcmp(variable,s_corners) == 0) {       /* corners=?,?,?,? */
      if (fractype == CELLULAR)
          return 1; /* skip setting the corners */
      if (floatparms != totparms || (totparms != 4 && totparms != 6))
	 goto badarg;
      usemag = 0;
      initcorners = 1;
      xx3rd = xxmin = floatval[0];
      xxmax =	      floatval[1];
      yy3rd = yymin = floatval[2];
      yymax =	      floatval[3];
      if (totparms == 6) {
	 xx3rd =      floatval[4];
	 yy3rd =      floatval[5];
	 }
      return 1;
      }

   if (strcmp(variable,s_viewwindows) == 0) {  /* viewwindows=?,?,?,?,? */
      if (totparms > 5 || floatparms-intparms > 2 || intparms > 4)
	 goto badarg;
      viewwindow = 1;
      viewreduction = 4.2;  /* reset default values */
      finalaspectratio = screenaspect;
      viewcrop = 1; /* yes */
      viewxdots = viewydots = 0;

      if((totparms > 0) && (floatval[0] > 0.001))
        viewreduction = floatval[0];
      if((totparms > 1) && (floatval[1] > 0.001))
        finalaspectratio = floatval[1];
      if((totparms > 2) && (yesnoval == 0))
        viewcrop = yesnoval;
      if((totparms > 3) && (intval[3] > 0))
        viewxdots = intval[3];
      if((totparms == 5) && (intval[4] > 0))
        viewydots = intval[4];
      return 1;
      }

   if (strcmp(variable,s_centermag) == 0) {    /* center-mag=?,?,? */
      double Xctr, Yctr,Magnification,Ratio,Height, Width,Radius;
      if (totparms != floatparms
	|| (totparms != 0 && totparms != 3)
	|| (totparms == 3 && floatval[2] <= 0.0))
	 goto badarg;
      usemag = 1;
      if (totparms == 0) return 0;
      initcorners = 1;
      Xctr = floatval[0];
      Yctr = floatval[1];
      Magnification = floatval[2];
      Radius = 1.0 / Magnification;
      Ratio = .75;	/* inverse aspect ratio of screen  */
      /* calculate bounds */
      Height = 2.0 * Radius;
      Width = Height / Ratio;
      yymax = Yctr + Radius;
      yy3rd = yymin = Yctr - Radius;
      xxmax = Xctr + Width / 2.0;
      xx3rd = xxmin = Xctr - Width / 2.0;
      return 1;
      }

   if (strcmp(variable,s_invert) == 0) {        /* invert=?,?,? */
      if (totparms != floatparms || (totparms != 1 && totparms != 3))
	 goto badarg;

⌨️ 快捷键说明

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