Commits

Trammell Hudson  committed e7d067b

Remove dead code

  • Participants
  • Parent commits 7d65fb5

Comments (0)

Files changed (1)

 	fprintf(pjl_file, "\e%%1BPU"); // start HLGL, pen up?
 
 	return true;
-
-#if 0
-                if (!isalpha(*buf)) {
-                    int x,
-                        y;
-                    if (!passstart) {
-                        passstart = 1;
-
-
-                    }
-                    switch (*buf) {
-                    case 'M': // move
-                        if (sscanf((char *) buf + 1, "%d,%d", &y, &x)
-                            == 2) {
-                            sx = x;
-                            sy = y;
-                            newline = 1;
-                        }
-                        break;
-                    case 'C': // close - only makes sense after an "L"
-                        if (newline == 0 && up == 0 && (lx != sx || ly
-                                                        != sy)) {
-                            fprintf(pjl_file, ",%d,%d", basex + offx + sx +
-                                    HPGLX, basey + offy + sy + HPGLY);
-                        }
-                        break;
-                    case 'P': // power
-                        if (sscanf((char *)buf + 1, "%d", &x) == 1
-                            && x != power) {
-                            int epower;
-                            power = x;
-                            if (!started) {
-                                started = 1;
-                                /* XXX disabled as current code path inserts
-                                 *  this statement AFTER the IN; statement.
-                                 */
-                                /* start HPGL */
-/*                                 fprintf(pjl_file, "\e%%1B");     */
-                            }
-                            if (!up) {
-                                fprintf(pjl_file, ";PU");
-                            }
-                            up = 1;
-                            epower = (power * vector_power + 50) / 100;
-                            if (vector_speed && vector_speed < 100) {
-                                int espeed = vector_speed;
-                                int efreq = vector_freq;
-                                if (epower && x < 100) {
-                                    int r;
-                                    int q;
-                                    r = 10000 / x; // power, up to set power level (i.e. x=100)
-                                    q = 10000 / espeed;
-                                    if (q < r)
-                                        r = q;
-                                    q = 500000 / efreq;
-                                    if (q < r)
-                                        r = q;
-                                    epower = (50 + epower * r) / 100;
-                                    espeed = (50 + espeed * r) / 100;
-                                    efreq = (50 + espeed * r) / 100;
-                                }
-                                fprintf(pjl_file, ";ZS%03d;XR%04d;", espeed, efreq);
-                            }
-                            fprintf(pjl_file, ";YP%03d;", epower);
-                        }
-                        break;
-                    case 'L': // line
-                        if (!started) {
-                            started = 1;
-                            //fprintf(pjl_file, "\e%%1B;");      // start HPGL
-                        }
-                        if (newline) {
-                            if (!up)
-                                fprintf(pjl_file, ";");
-                            fprintf(pjl_file, "PU%d,%d",
-                                    basex + offx + sx + HPGLX,
-                                    basey + offy + sy + HPGLY);
-                            up = 1;
-                            newline = 0;
-                        }
-                        if (up) {
-                            fprintf(pjl_file, ";PD");
-                        } else {
-                            fprintf(pjl_file, ",");
-                        }
-                        up = 0;
-                        if (sscanf ((char *) buf + 1, "%d,%d", &y, &x)
-                            == 2) {
-                            fprintf (pjl_file, "%d,%d", basex + offx + x +
-                                     HPGLX, basey + offy + y + HPGLY);
-                        }
-                        lx = x;
-                        ly = y;
-                        break;
-                    }
-                    if (*buf == 'X')
-                        break;
-                }
-            }
-    char up = 1;           // output status
-    char newline = 1;      // input status (last was M)
-    char started = 0;
-    int sx = 0;
-    int sy = 0;
-    int lx = 0;
-    int ly = 0;
-    int power = 100;
-    int offx;
-    int offy;
-    int basex = 0;
-    int basey = 0;
-
-    if (x_center) {
-        basex = x_center - width / 2;
-    }
-    if (y_center) {
-        basey = y_center - height / 2;
-    }
-    if (basex < 0) {
-        basex = 0;
-    }
-    if (basey < 0) {
-        basey = 0;
-    }
-    // rasterises
-    basex = basex * resolution / POINTS_PER_INCH;
-    basey = basey * resolution / POINTS_PER_INCH;
-
-
-    for (offy = height * (y_repeat - 1); offy >= 0; offy -= height) {
-        for (offx = width * (x_repeat - 1); offx >= 0; offx -= width) {
-            char passstart = 0;
-            rewind(vector_file);
-            while (fgets((char *) buf, sizeof (buf), vector_file)) {
-                if (isalpha(*buf)) {
-                    int x,
-                        y;
-                    if (!passstart) {
-                        passstart = 1;
-                        fprintf(pjl_file, "IN;");
-                        fprintf(pjl_file, "XR%04d;", vector_freq);
-                        fprintf(pjl_file, "YP%03d;", vector_power);
-                        fprintf(pjl_file, "ZS%03d;", vector_speed);
-
-
-                    }
-                    switch (*buf) {
-                    case 'M': // move
-                        if (sscanf((char *) buf + 1, "%d,%d", &y, &x)
-                            == 2) {
-                            sx = x;
-                            sy = y;
-                            newline = 1;
-                        }
-                        break;
-                    case 'C': // close - only makes sense after an "L"
-                        if (newline == 0 && up == 0 && (lx != sx || ly
-                                                        != sy)) {
-                            fprintf(pjl_file, ",%d,%d", basex + offx + sx +
-                                    HPGLX, basey + offy + sy + HPGLY);
-                        }
-                        break;
-                    case 'P': // power
-                        if (sscanf((char *)buf + 1, "%d", &x) == 1
-                            && x != power) {
-                            int epower;
-                            power = x;
-                            if (!started) {
-                                started = 1;
-                                /* XXX disabled as current code path inserts
-                                 *  this statement AFTER the IN; statement.
-                                 */
-                                /* start HPGL */
-/*                                 fprintf(pjl_file, "\e%%1B");     */
-                            }
-                            if (!up) {
-                                fprintf(pjl_file, ";PU");
-                            }
-                            up = 1;
-                            epower = (power * vector_power + 50) / 100;
-                            if (vector_speed && vector_speed < 100) {
-                                int espeed = vector_speed;
-                                int efreq = vector_freq;
-                                if (epower && x < 100) {
-                                    int r;
-                                    int q;
-                                    r = 10000 / x; // power, up to set power level (i.e. x=100)
-                                    q = 10000 / espeed;
-                                    if (q < r)
-                                        r = q;
-                                    q = 500000 / efreq;
-                                    if (q < r)
-                                        r = q;
-                                    epower = (50 + epower * r) / 100;
-                                    espeed = (50 + espeed * r) / 100;
-                                    efreq = (50 + espeed * r) / 100;
-                                }
-                                fprintf(pjl_file, ";ZS%03d;XR%04d;", espeed, efreq);
-                            }
-                            fprintf(pjl_file, ";YP%03d;", epower);
-                        }
-                        break;
-                    case 'L': // line
-                        if (!started) {
-                            started = 1;
-                            //fprintf(pjl_file, "\e%%1B;");      // start HPGL
-                        }
-                        if (newline) {
-                            if (!up)
-                                fprintf(pjl_file, ";");
-                            fprintf(pjl_file, "PU%d,%d",
-                                    basex + offx + sx + HPGLX,
-                                    basey + offy + sy + HPGLY);
-                            up = 1;
-                            newline = 0;
-                        }
-                        if (up) {
-                            fprintf(pjl_file, ";PD");
-                        } else {
-                            fprintf(pjl_file, ",");
-                        }
-                        up = 0;
-                        if (sscanf ((char *) buf + 1, "%d,%d", &y, &x)
-                            == 2) {
-                            fprintf (pjl_file, "%d,%d", basex + offx + x +
-                                     HPGLX, basey + offy + y + HPGLY);
-                        }
-                        lx = x;
-                        ly = y;
-                        break;
-                    }
-                    if (*buf == 'X')
-                        break;
-                }
-            }
-        }
-    }
-    if (started) {
-        if (up == 0)
-            fprintf(pjl_file, ";");
-        fprintf(pjl_file, "\e%%0B");      // end HLGL
-    }
-    fprintf(pjl_file, "\e%%1BPU");  // start HLGL, and pen up, end
-#endif
-
-    return true;
 }