📄 cmdfiles.c
字号:
invert = ((inversion[0] = floatval[0]) != 0.0) ? totparms : 0;
if (totparms == 3) {
inversion[1] = floatval[1];
inversion[2] = floatval[2];
}
return 1;
}
if (strcmp(variable,s_askvideo) == 0 ) { /* askvideo=? */
if (yesnoval < 0) goto badarg;
askvideo = yesnoval;
return 0;
}
if (strcmp(variable,s_ramvideo) == 0 ) /* ramvideo=? */
return 0; /* just ignore and return, for old time's sake */
if (strcmp(variable,s_float) == 0 ) { /* float=? */
if (yesnoval < 0) goto badarg;
usr_floatflag = yesnoval;
return 3;
}
if (strcmp(variable,s_biomorph) == 0 ) { /* biomorph=? */
usr_biomorph = numval;
return 1;
}
if (strcmp(variable,s_orbitsave) == 0 ) { /* orbitsave=? */
if (yesnoval < 0) goto badarg;
orbitsave = yesnoval;
return 1;
}
if (strcmp(variable,s_bailout) == 0 ) { /* bailout=? */
if (numval < 4 || numval > 32000) goto badarg;
bailout = numval;
return 1;
}
if (strcmp(variable,s_symmetry) == 0 ) { /* symmetry=? */
if (strcmp(value,s_xaxis )==0) forcesymmetry = XAXIS;
else if(strcmp(value,s_yaxis )==0) forcesymmetry = YAXIS;
else if(strcmp(value,s_xyaxis)==0) forcesymmetry = XYAXIS;
else if(strcmp(value,s_origin)==0) forcesymmetry = ORIGIN;
else if(strcmp(value,s_pi )==0) forcesymmetry = PI_SYM;
else if(strcmp(value,s_none )==0) forcesymmetry = NOSYM;
else goto badarg;
return 1;
}
if (strcmp(variable,s_printer) == 0 ) { /* printer=? */
if (parse_printer(value) < 0) goto badarg;
return 0;
}
if (strcmp(variable,s_printfile) == 0) { /* print-to-file? SWT */
if (valuelen > 79) goto badarg;
Print_To_File = 1;
strcpy(PrintName,value);
return 0;
}
if(strcmp(variable,s_rleps) == 0) {
Printer_Compress = yesnoval;
return(0);
}
if(strcmp(variable,s_colorps) == 0) {
ColorPS = yesnoval;
return(0);
}
if (strcmp(variable,s_epsf) == 0) { /* EPS type? SWT */
Print_To_File = 1;
EPSFileType = numval;
Printer_Type = 5;
if (strcmp(PrintName,s_fract001prn)==0)
strcpy(PrintName,"fract001.eps");
return 0;
}
if (strcmp(variable,s_title) == 0) { /* Printer title block? SWT */
if (yesnoval < 0) goto badarg;
Printer_Titleblock = yesnoval;
return 0;
}
if (strcmp(variable,s_translate) == 0) { /* Translate color? SWT */
Printer_ColorXlat=0;
if (charval == 'y')
Printer_ColorXlat=1;
else if (numval > 1 || numval < -1)
Printer_ColorXlat=numval;
return 0;
}
if (strcmp(variable,s_plotstyle) == 0) { /* plot style? SWT */
Printer_SStyle = numval;
return 0;
}
if (strcmp(variable,s_halftone) == 0) { /* New halftoning? SWT */
if (totparms != intparms) goto badarg;
Printer_SetScreen=1;
if ((totparms > 0) && ( intval[ 0] >= 0))
Printer_SFrequency = intval[ 0];
if ((totparms > 1) && ( intval[ 1] >= 0))
Printer_SAngle = intval[ 1];
if ((totparms > 2) && ( intval[ 2] >= 0))
Printer_SStyle = intval[ 2];
if ((totparms > 3) && ( intval[ 3] >= 0))
Printer_RFrequency = intval[ 3];
if ((totparms > 4) && ( intval[ 4] >= 0))
Printer_RAngle = intval[ 4];
if ((totparms > 5) && ( intval[ 5] >= 0))
Printer_RStyle = intval[ 5];
if ((totparms > 6) && ( intval[ 6] >= 0))
Printer_GFrequency = intval[ 6];
if ((totparms > 7) && ( intval[ 7] >= 0))
Printer_GAngle = intval[ 7];
if ((totparms > 8) && ( intval[ 8] >= 0))
Printer_GStyle = intval[ 8];
if ((totparms > 9) && ( intval[ 9] >= 0))
Printer_BFrequency = intval[ 9];
if ((totparms > 10) && ( intval[10] >= 0))
Printer_BAngle = intval[10];
if ((totparms > 11) && ( intval[11] >= 0))
Printer_BStyle = intval[11];
return 0;
}
if (strcmp(variable,s_linefeed) == 0) { /* Use LF for printer */
if (strcmp(value,s_cr) == 0) Printer_CRLF = 1;
else if (strcmp(value,s_lf) == 0) Printer_CRLF = 2;
else if (strcmp(value,s_crlf) == 0) Printer_CRLF = 0;
else goto badarg;
return 0;
}
if (strcmp(variable,s_comport) == 0 ) { /* Set the COM parameters */
if ((value=strchr(value,'/')) == NULL) goto badarg;
switch (atoi(++value)) {
case 110: l = 0; break;
case 150: l = 32; break;
case 300: l = 64; break;
case 600: l = 96; break;
case 1200: l = 128; break;
case 2400: l = 160; break;
case 4800: l = 192; break;
case 9600:
default: l = 224; break;
}
if ((value=strchr(value,'/')) == NULL) goto badarg;
for (k=0; k < strlen(value); k++) {
switch (value[k]) {
case '7': l |= 2; break;
case '8': l |= 3; break;
case 'o': l |= 8; break;
case 'e': l |= 24; break;
case '2': l |= 4; break;
}
}
#ifndef XFRACT
#ifndef WINFRACT
_bios_serialcom(0,numval-1,l);
#endif
#endif
return 0;
}
if (strcmp(variable,s_sound) == 0 ) { /* sound=? */
soundflag = 0;
if (strncmp(value,"ye",2) == 0) {
soundflag = -1;
return(0);
}
if (charval == 'x')
soundflag = 1;
if (charval == 'y')
soundflag = 2;
if (charval == 'z')
soundflag = 3;
return 0;
}
if (strcmp(variable,s_hertz) == 0) { /* Hertz=? */
if (numval < 200 || numval > 10000) goto badarg;
basehertz = numval;
return 0;
}
if (strcmp(variable,s_periodicity) == 0 ) { /* periodicity=? */
usr_periodicitycheck=1;
if ((charval == 'n') || (numval == 0))
usr_periodicitycheck=0;
else if (charval == 'y')
usr_periodicitycheck=1;
else if (charval == 's') /* 's' for 'show' */
usr_periodicitycheck= -1;
else if(numval == NONNUMERIC)
goto badarg;
else if(numval != 0)
usr_periodicitycheck=numval;
return 1;
}
if (strcmp(variable,s_logmap) == 0 ) { /* logmap=? */
if (charval == 'y')
LogFlag = 1; /* palette is logarithmic */
else if (charval == 'n')
LogFlag = 0;
else if (charval == 'o')
LogFlag = -1; /* old log palette */
else
LogFlag = numval;
return 1;
}
if (strcmp(variable,s_debugflag) == 0
|| strcmp(variable,s_debug) == 0) { /* internal use only */
debugflag = numval;
timerflag = debugflag & 1; /* separate timer flag */
debugflag -= timerflag;
return 0;
}
if (strcmp(variable,s_rseed) == 0) {
rseed = numval;
rflag = 1;
return 1;
}
if (strcmp(variable,s_orbitdelay) == 0) {
orbit_delay = numval;
return 0;
}
if (strcmp(variable,s_showdot) == 0) {
showdot=numval;
if(showdot<0)
showdot=0;
return 0;
}
if (strcmp(variable,s_decomp) == 0) {
if (totparms != intparms || totparms < 1) goto badarg;
decomp[0] = intval[0];
decomp[1] = 0;
if (totparms > 1) /* backward compatibility */
bailout = decomp[1] = intval[1];
return 1;
}
if (strcmp(variable,s_distest) == 0) {
if (totparms != intparms || totparms < 1) goto badarg;
usr_distest = intval[0];
distestwidth = 71;
if (totparms > 1)
distestwidth = intval[1];
return 1;
}
if (strcmp(variable,s_formulafile) == 0) { /* formulafile=? */
if (valuelen > 79) goto badarg;
strcpy(FormFileName,value);
return 1;
}
if (strcmp(variable,s_formulaname) == 0) { /* formulaname=? */
if (valuelen > ITEMNAMELEN) goto badarg;
strcpy(FormName,value);
return 1;
}
if (strcmp(variable,s_lfile) == 0) {
if (valuelen > 79) goto badarg;
strcpy(LFileName,value);
return 1;
}
if (strcmp(variable,s_lname) == 0) {
if (valuelen > ITEMNAMELEN) goto badarg;
strcpy(LName,value);
return 1;
}
if (strcmp(variable,s_ifsfile) == 0) {
if (valuelen > 79) goto badarg;
strcpy(IFSFileName,value);
reset_ifs_defn();
return 1;
}
if (strcmp(variable,s_ifs) == 0
|| strcmp(variable,s_ifs3d) == 0) { /* ifs3d for old time's sake */
if (valuelen > ITEMNAMELEN) goto badarg;
strcpy(IFSName,value);
reset_ifs_defn();
return 1;
}
if (strcmp(variable,s_parmfile) == 0) {
if (valuelen > 79) goto badarg;
strcpy(CommandFile,value);
return 0;
}
if (strcmp(variable,s_stereo) == 0) { /* stereo=? */
if ((numval<0) || (numval>3)) goto badarg;
glassestype = numval;
return 3;
}
if (strcmp(variable,s_rotation) == 0) { /* rotation=?/?/? */
if (totparms != 3 || intparms != 3) goto badarg;
XROT = intval[0];
YROT = intval[1];
ZROT = intval[2];
return 3;
}
if (strcmp(variable,s_perspective) == 0) { /* perspective=? */
if (numval == NONNUMERIC) goto badarg;
ZVIEWER = numval;
return 3;
}
if (strcmp(variable,s_xyshift) == 0) { /* xyshift=?/? */
if (totparms != 2 || intparms != 2) goto badarg;
XSHIFT = intval[0];
YSHIFT = intval[1];
return 3;
}
if (strcmp(variable,s_interocular) == 0) { /* interocular=? */
eyeseparation = numval;
return 3;
}
if (strcmp(variable,s_converge) == 0) { /* converg=? */
xadjust = numval;
return 3;
}
if (strcmp(variable,s_crop) == 0) { /* crop=? */
if (totparms != 4 || intparms != 4
|| intval[0] < 0 || intval[0] > 100
|| intval[1] < 0 || intval[1] > 100
|| intval[2] < 0 || intval[2] > 100
|| intval[3] < 0 || intval[3] > 100)
goto badarg;
red_crop_left = intval[0];
red_crop_right = intval[1];
blue_crop_left = intval[2];
blue_crop_right = intval[3];
return 3;
}
if (strcmp(variable,s_bright) == 0) { /* bright=? */
if (totparms != 2 || intparms != 2) goto badarg;
red_bright = intval[0];
blue_bright = intval[1];
return 3;
}
if (strcmp(variable,s_xyadjust) == 0) { /* trans=? */
if (totparms != 2 || intparms != 2) goto badarg;
xtrans = intval[0];
ytrans = intval[1];
return 3;
}
if (strcmp(variable,s_3d) == 0) { /* 3d=?/?/.. */
if(strcmp(value,s_overlay)==0) {
yesnoval=1;
if(calc_status > -1) /* if no image, treat same as 3D=yes */
overlay3d=1;
}
else if (yesnoval < 0) goto badarg;
display3d = yesnoval;
initvars_3d();
return (display3d) ? 6 : 2;
}
if (strcmp(variable,s_sphere) == 0 ) { /* sphere=? */
if (yesnoval < 0) goto badarg;
SPHERE = yesnoval;
return 2;
}
if (strcmp(variable,s_scalexyz) == 0) { /* scalexyz=?/?/? */
if (totparms < 2 || intparms != totparms) goto badarg;
XSCALE = intval[0];
YSCALE = intval[1];
if (totparms > 2) ROUGH = intval[2];
return 2;
}
/* "rough" is really scale z, but we add it here for convenience */
if (strcmp(variable,s_roughness) == 0) { /* roughness=? */
ROUGH = numval;
return 2;
}
if (strcmp(variable,s_waterline) ==
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -