Free Hero Mesh

Check-in [72f318849b]
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.
Overview
Comment:Implement the spare page in the picture editor.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 72f318849b9d2a1aff56487d7852921596f10116
User & Date: user on 2021-12-03 20:32:12
Other Links: manifest | tags
Context
2021-12-03
23:44
Implement possibility of user-defined macros in picture editor. check-in: 9dce768c07 user: user tags: trunk
20:32
Implement the spare page in the picture editor. check-in: 72f318849b user: user tags: trunk
2021-11-30
04:36
Display descriptions of inventory items when clicking them. check-in: 4ff3818394 user: user tags: trunk
Changes

Modified TODO from [10a2af48e5] to [8cd629c2b8].

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  * Level index editor
* Table of contents for levels
  * 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
* Bugs
  * Figure out why the $SeekerCloser class doesn't seem to work properly







<







18
19
20
21
22
23
24

25
26
27
28
29
30
31
  * Level index editor
* Table of contents for levels
  * 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

  * 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
* Bugs
  * Figure out why the $SeekerCloser class doesn't seem to work properly

Modified picedit.c from [be4069b047] to [fdf7a1a60f].

61
62
63
64
65
66
67

68
69
70
71
72
73
74
  sqlite3_vtab_cursor super;
  int pos;
} Cursor;

static Uint8 cur_type;
static Uint8 gsizes[16];
static Picture*cur_pic;


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);
    return;
  }







>







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
  sqlite3_vtab_cursor super;
  int pos;
} 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);
    return;
  }
1037
1038
1039
1040
1041
1042
1043














1044
1045
1046
1047
1048
1049
1050
          case SDLK_RIGHT: case SDLK_KP6: ++cc; goto redraw;
          case SDLK_UP: case SDLK_KP8: cc-=16; goto redraw;
          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("<SQL>");
            if(p) sqlite3_exec(userdb,p,response_cb,0,0);














            goto redraw;
        }
        break;
      case SDL_VIDEOEXPOSE:
        goto redraw;
    }
  }







>
>
>
>
>
>
>
>
>
>
>
>
>
>







1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
          case SDLK_RIGHT: case SDLK_KP6: ++cc; goto redraw;
          case SDLK_UP: case SDLK_KP8: cc-=16; goto redraw;
          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("<SQL>");
            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;
    }
  }

Modified picedit.doc from [4b94bea7ec] to [fe0ca8910f].

130
131
132
133
134
135
136




137
138
139
140
141
142
143
  Enter a SQL statement to edit the current picture. This should be a
  UPDATE statement which updates the column called "C" of the table called
  "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).





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
block will be affected.








>
>
>
>







130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
  Enter a SQL statement to edit the current picture. This should be a
  UPDATE statement which updates the column called "C" of the table called
  "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
block will be affected.