- /* For each frame and map i in framesheet + mapsheet */
- /* output frame data */
- /* output op space for frames */
- /* determine ops in map */
- /* check if ops are acceptable */
- /* output ops */
+ /* Output framesheet header */
+ header.width = framesheet_info.fwidth;
+ header.height = framesheet_info.fheight;
+ header.frames = framesheet_info.width / framesheet_info.fwidth; //TODO: division is bad
+ header.op_start = ftell(binaryout);
+ fseek(binaryout, facing_start, SEEK_SET);
+ fwrite(&header, sizeof(header), 1, binaryout);
+ fseek(binaryout, 0, SEEK_END);
+
+
+ /* Assuming that fheight = image height */
+ /* For each mapframe in mapsheet */
+ for ( x = 0; x < header.frames; x++)
+ { map_pixel_list = bin_map_to_pixel_list(mapsheet_info, 0, x * mapsheet_info.fwidth, data);
+ if(!bin_process_map_pixel_list(default_pixel_list, map_pixel_list))
+ eprintf("error processing map pixel list\n");
+ bin_output_pixel_list(map_pixel_list);
+ data += mapsheet_info.fwidth;
+
+ }
+ /* Determine pixel_list */
+
+ /* Output pixel_list */