diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2011-12-30 02:06:31 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-12-30 02:06:31 (GMT) |
| commit | 86369670aaa11b8cd2ddcbd46413fb9482e4e58f (patch) | |
| tree | 07be282e1e08003153ee5c000f3e50336cfa2eb0 /src/interface.c | |
| parent | ad2b000a8af84f299e7c7c43a6a272a60ffcd36d (diff) | |
| download | powder-86369670aaa11b8cd2ddcbd46413fb9482e4e58f.zip powder-86369670aaa11b8cd2ddcbd46413fb9482e4e58f.tar.gz | |
Add checks for prerender_save in save_filename_ui, pass vx, vy and pv air data into parse and build save methods. New save format: OPS, basic reading and writing complete, uses BSON, BSON.c/h (Binary JSON) implementation from MongoDB. (Is License OK?)
Diffstat (limited to 'src/interface.c')
| -rw-r--r-- | src/interface.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/interface.c b/src/interface.c index 472fd9b..bb34c15 100644 --- a/src/interface.c +++ b/src/interface.c @@ -26,6 +26,7 @@ #include <pythonconsole.h> #endif #include <powdergraphics.h> +#include "save.h" SDLMod sdl_mod; int sdl_key, sdl_rkey, sdl_wheel, sdl_caps=0, sdl_ascii, sdl_zoom_trig=0; @@ -4265,7 +4266,7 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) if (queue_open) { if (info_ready && data_ready) { // Do Open! - status = parse_save(data, data_size, 1, 0, 0, bmap, fvx, fvy, signs, parts, pmap); + status = parse_save(data, data_size, 1, 0, 0, bmap, vx, vy, pv, fvx, fvy, signs, parts, pmap); if (!status) { if(svf_last) free(svf_last); @@ -4827,7 +4828,7 @@ void execute_save(pixel *vid_buf) plens[0] = strlen(svf_name); uploadparts[1] = svf_description; plens[1] = strlen(svf_description); - uploadparts[2] = build_save(plens+2, 0, 0, XRES, YRES, bmap, fvx, fvy, signs, parts); + uploadparts[2] = build_save(plens+2, 0, 0, XRES, YRES, bmap, vx, vy, pv, fvx, fvy, signs, parts); uploadparts[3] = build_thumb(plens+3, 1); uploadparts[4] = (svf_publish==1)?"Public":"Private"; plens[4] = strlen((svf_publish==1)?"Public":"Private"); @@ -5945,9 +5946,12 @@ int save_filename_ui(pixel *vid_buf) pixel *save = NULL;//calloc((XRES/3)*(YRES/3), PIXELSIZE); ui_edit ed; - save_data = build_save(&save_size, 0, 0, XRES, YRES, bmap, fvx, fvy, signs, parts); + save_data = build_save(&save_size, 0, 0, XRES, YRES, bmap, vx, vy, pv, fvx, fvy, signs, parts); save_data_image = prerender_save(save_data, save_size, &imgw, &imgh); - save = resample_img(save_data_image, imgw, imgh, XRES/3, YRES/3); + if(save_data_image!=NULL) + { + save = resample_img(save_data_image, imgw, imgh, XRES/3, YRES/3); + } ed.x = x0+11; ed.y = y0+25; @@ -5993,7 +5997,10 @@ int save_filename_ui(pixel *vid_buf) drawrect(vid_buf, x0, y0, xsize, ysize, 192, 192, 192, 255); drawtext(vid_buf, x0+8, y0+8, "Filename:", 255, 255, 255, 255); drawrect(vid_buf, x0+8, y0+20, xsize-16, 16, 255, 255, 255, 180); - draw_image(vid_buf, save, x0+8, y0+40, XRES/3, YRES/3, 255); + if(save!=NULL) + { + draw_image(vid_buf, save, x0+8, y0+40, XRES/3, YRES/3, 255); + } drawrect(vid_buf, x0+8, y0+40, XRES/3, YRES/3, 192, 192, 192, 255); drawrect(vid_buf, x0, y0+ysize-16, xsize, 16, 192, 192, 192, 255); @@ -6204,7 +6211,7 @@ void catalogue_ui(pixel * vid_buf) void *data; data = file_load(csave->filename, &size); if(data){ - status = parse_save(data, size, 1, 0, 0, bmap, fvx, fvy, signs, parts, pmap); + status = parse_save(data, size, 1, 0, 0, bmap, vx, vy, pv, fvx, fvy, signs, parts, pmap); if(!status) { //svf_filename[0] = 0; |
