Index: TODO ================================================================== --- TODO +++ TODO @@ -20,11 +20,10 @@ * Can define your own columns * User can write SQL queries on them * Deal better with allowing to skip past corrupted levels * Picture editor/loading * Allowing more altimages - * Spare page (for temporary use while editing) * Batch insert multiple dependent image lumps * Puzzle set catalog format (using with internet; a separate program) * Inventory/replay hybrid view * Bookmarks * Message trace menu to enable/disable Index: picedit.c ================================================================== --- picedit.c +++ picedit.c @@ -63,10 +63,11 @@ } Cursor; static Uint8 cur_type; static Uint8 gsizes[16]; static Picture*cur_pic; +static Picture*spare_page; static void fn_valid_name(sqlite3_context*cxt,int argc,sqlite3_value**argv) { const char*s=sqlite3_value_text(*argv); if(!s || !*s || s[strspn(s,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-0123456789")]) { sqlite3_result_error(cxt,"Invalid name",-1); @@ -1039,10 +1040,24 @@ case SDLK_DOWN: case SDLK_KP2: cc+=16; goto redraw; case SDLK_HOME: case SDLK_KP7: cc=0; goto redraw; case SDLK_F12: p=(Uint8*)screen_prompt(""); if(p) sqlite3_exec(userdb,p,response_cb,0,0); + goto redraw; + case SDLK_EQUALS: case SDLK_BACKQUOTE: + if(!spare_page) { + spare_page=malloc(sizeof(Picture)+(picture_size+1)*picture_size); + if(!spare_page) fatal("Allocation failed\n"); + spare_page->size=picture_size; + memset(spare_page->data,0,(picture_size+1)*picture_size); + } + if(spare_page->size!=cur_pic->size) { + m.x=m.y=m.w=m.h=0; + xx=yy=-1; + } + pict[sel]=spare_page; + spare_page=cur_pic; goto redraw; } break; case SDL_VIDEOEXPOSE: goto redraw; Index: picedit.doc ================================================================== --- picedit.doc +++ picedit.doc @@ -132,10 +132,14 @@ "GRAPH". It has columns "X" and "Y" which are the coordinates of the pixel, and "C" which is the colour of the pixel. It may also be a SELECT statement in order to query it, and the response is then displayed (which must be a single row and single column only). +` or = + Exchange the current picture with the spare page. (The spare page is not + stored in the puzzle set; it is lost when Free Hero Mesh is terminated.) + Click in the colour palette on the right to select a colour. With the left button, that colour is selected as the current colour. The middle button will replace everything of the current colour with the clicked colour, and the right button will exchange pixels between the current colour and the clicked colour; in either case, if any block is marked, only the marked