summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flam3.c11
-rw-r--r--flam3.h10
-rw-r--r--main.c4
-rw-r--r--parser.c136
4 files changed, 5 insertions, 156 deletions
diff --git a/flam3.c b/flam3.c
index 641801d..bf0b124 100644
--- a/flam3.c
+++ b/flam3.c
@@ -1207,7 +1207,7 @@ char *flam3_print_to_string(flam3_genome *cp) {
return (NULL);
}
}
- flam3_print(tmpflame,cp,NULL,flam3_dont_print_edits);
+ flam3_print(tmpflame,cp,NULL);
stringbytes = ftell(tmpflame);
fseek(tmpflame,0L, SEEK_SET);
genome_string = (char *)calloc(stringbytes+1,1);
@@ -1223,7 +1223,7 @@ char *flam3_print_to_string(flam3_genome *cp) {
}
-void flam3_print(FILE *f, flam3_genome *cp, char *extra_attributes, int print_edits) {
+void flam3_print(FILE *f, flam3_genome *cp, char *extra_attributes) {
int i,numstd;
// force use of "C" locale when writing reals.
@@ -1322,13 +1322,6 @@ void flam3_print(FILE *f, flam3_genome *cp, char *extra_attributes, int print_ed
}
- if (cp->edits != NULL && print_edits==flam3_print_edits) {
-
- /* We need a custom script for printing these */
- /* and it needs to be recursive */
- xmlNodePtr elem_node = xmlDocGetRootElement(cp->edits);
- flam3_edit_print(f,elem_node, 1, 1);
- }
fprintf(f, "</flame>\n");
if (locale != NULL) {
diff --git a/flam3.h b/flam3.h
index e780533..58b6343 100644
--- a/flam3.h
+++ b/flam3.h
@@ -30,9 +30,6 @@
#define flam3_name_len 64
-#define flam3_print_edits (1)
-#define flam3_dont_print_edits (0)
-
#include "vector.h"
#include "random.h"
@@ -461,9 +458,6 @@ typedef struct {
double zoom; /* effects ppu, sample density, scale */
double pixels_per_unit; /* vertically */
- /* XML Edit structure */
- xmlDocPtr edits;
-
/* Small-gamma linearization threshold */
double gam_lin_thresh;
@@ -475,8 +469,6 @@ typedef struct {
double palette_blend;
int palette_mode;
-
-
} flam3_genome;
typedef struct {
@@ -515,7 +507,7 @@ void apply_motion_parameters(flam3_xform *xf, flam3_xform *addto, double blend);
void flam3_interpolate(flam3_genome *genomes, int ngenomes, double time, double stagger, flam3_genome *result);
/* print genome to given file with extra_attributes if not NULL */
-void flam3_print(FILE *f, flam3_genome *g, char *extra_attributes, int print_edits);
+void flam3_print(FILE *f, flam3_genome *g, char *extra_attributes);
void flam3_print_xform(FILE *f, flam3_xform *x, int final_flag, int numstd, double *chaos_row, int motion_flag);
char *flam3_print_to_string(flam3_genome *cp);
diff --git a/main.c b/main.c
index 1b3fba6..ecd487a 100644
--- a/main.c
+++ b/main.c
@@ -136,7 +136,7 @@ static void do_render (const render_arguments * const arguments) {
static void print_genome (flam3_genome * const genome) {
printf("<pick version=\"" PACKAGE "-" VERSION "\">\n");
- flam3_print (stdout, genome, NULL, flam3_dont_print_edits);
+ flam3_print (stdout, genome, NULL);
printf("</pick>\n");
}
@@ -228,7 +228,7 @@ static void do_random (const random_arguments * const arguments) {
bool bret = palette_read_collection ("flam3-palettes.xml", &pc);
assert (bret);
- flam3_genome genome = { .edits = NULL };
+ flam3_genome genome;
int ivars = flam3_variation_random;
flam3_random (&genome, &ivars, 1, arguments->symmetry, 0, &pc, &rc);
diff --git a/parser.c b/parser.c
index 46198f9..f28bad8 100644
--- a/parser.c
+++ b/parser.c
@@ -276,7 +276,6 @@ int parse_flame_element(xmlNode *flame_node, flam3_genome *loc_current_cp,
randctx * const rc) {
flam3_genome *cp = loc_current_cp;
xmlNode *chld_node, *motion_node;
- xmlNodePtr edit_node;
xmlAttrPtr att_ptr, cur_att;
int solo_xform=-1;
char *att_str;
@@ -674,14 +673,6 @@ int parse_flame_element(xmlNode *flame_node, flam3_genome *loc_current_cp,
}
}
-
- } else if (!xmlStrcmp(chld_node->name, (const xmlChar *)"edit")) {
-
- /* Create a new XML document with this edit node as the root node */
- cp->edits = xmlNewDoc( (const xmlChar *)"1.0");
- edit_node = xmlCopyNode( chld_node, 1 );
- xmlDocSetRootElement(cp->edits, edit_node);
-
}
} /* Done parsing flame element. */
@@ -1151,130 +1142,3 @@ int parse_xform_xml(xmlNode *chld_node,flam3_xform *this_xform, int *num_xaos,
return(0);
}
-void flam3_edit_print(FILE *f, xmlNodePtr editNode, int tabs, int formatting) {
-
- char *tab_string = " ";
- int ti,strl;
- xmlAttrPtr att_ptr=NULL,cur_att=NULL;
- xmlNodePtr chld_ptr=NULL, cur_chld=NULL;
- int indent_printed = 0;
-
- char *att_str,*cont_str,*cpy_string;
-
- /* If this node is an XML_ELEMENT_NODE, print it and it's attributes */
- if (editNode->type==XML_ELEMENT_NODE) {
-
- /* Print the node at the tab specified */
- if (formatting) {
- for (ti=0;ti<tabs;ti++)
- fprintf(f,"%s",tab_string);
- }
-
- fprintf(f,"<%s",editNode->name);
-
- /* This can either be an edit node or a sheep node */
- /* If it's an edit node, add one to the tab */
- if (!xmlStrcmp(editNode->name, (const xmlChar *)"edit")) {
- tabs ++;
- }
-
- /* Print the attributes */
- att_ptr = editNode->properties;
-
- for (cur_att = att_ptr; cur_att; cur_att = cur_att->next) {
-
- att_str = (char *) xmlGetProp(editNode,cur_att->name);
- fprintf(f," %s=\"%s\"",cur_att->name,att_str);
- xmlFree(att_str);
- }
-
- /* Does this node have children? */
- if (!editNode->children) {
- /* Close the tag and subtract the tab */
- fprintf(f,"/>");
- if (formatting)
- fprintf(f,"\n");
- tabs--;
- } else {
-
- /* Close the tag */
- fprintf(f,">");
-
- if (formatting)
- fprintf(f,"\n");
-
- /* Loop through the children and print them */
- chld_ptr = editNode->children;
-
- indent_printed = 0;
-
- for (cur_chld=chld_ptr; cur_chld; cur_chld = cur_chld->next) {
-
- /* If child is an element, indent first and then print it. */
- if (cur_chld->type==XML_ELEMENT_NODE &&
- (!xmlStrcmp(cur_chld->name, (const xmlChar *)"edit") ||
- (!xmlStrcmp(cur_chld->name, (const xmlChar *)"sheep")))) {
-
- if (indent_printed) {
- indent_printed = 0;
- fprintf(f,"\n");
- }
-
- flam3_edit_print(f, cur_chld, tabs, 1);
-
- } else {
-
- /* Child is a text node. We don't want to indent more than once. */
- if (xmlIsBlankNode(cur_chld))
- continue;
-
- if (indent_printed==0 && formatting==1) {
- for (ti=0;ti<tabs;ti++)
- fprintf(f,"%s",tab_string);
- indent_printed = 1;
- }
-
- /* Print nodes without formatting. */
- flam3_edit_print(f, cur_chld, tabs, 0);
-
- }
- }
-
- if (indent_printed && formatting)
- fprintf(f,"\n");
-
- /* Tab out. */
- tabs --;
- if (formatting) {
- for (ti=0;ti<tabs;ti++)
- fprintf(f,"%s",tab_string);
- }
-
- /* Close the tag */
- fprintf(f,"</%s>",editNode->name);
-
- if (formatting) {
- fprintf(f,"\n");
- }
- }
-
- } else if (editNode->type==XML_TEXT_NODE) {
-
- /* Print text node */
- cont_str = (char *) xmlNodeGetContent(editNode);
- cpy_string = &(cont_str[0]);
- while (isspace(*cpy_string))
- cpy_string++;
-
- strl = (int)strlen(cont_str)-1;
-
- while (isspace(cont_str[strl]))
- strl--;
-
- cont_str[strl+1] = 0;
-
- fprintf(f,"%s",cpy_string);
-
- }
-}
-