Free Hero Mesh

Check-in [bb9043ee13]
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:Add a "S" column to the "GRAPH" SQL table in the picture editor. The example ALT+M macro uses this to automatically apply horizontal mirror symmetry to a picture.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bb9043ee137277f5579b6829380a22f4f5036ffc
User & Date: user on 2022-08-30 22:12:45
Other Links: manifest | tags
Context
2022-08-31
23:24
Implement the conditional blocks in (PopUp) texts. check-in: 88913b5804 user: user tags: trunk
2022-08-30
22:12
Add a "S" column to the "GRAPH" SQL table in the picture editor. The example ALT+M macro uses this to automatically apply horizontal mirror symmetry to a picture. check-in: bb9043ee13 user: user tags: trunk
2022-08-19
06:05
Fix the implementation of ranges in (DefaultImage) block check-in: ffe428f969 user: user tags: trunk
Changes

Modified class.doc from [a02242cdfb] to [6ae95e1473].

1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
FlushClass  ( class -- ) **
  Resets the Arrived, Busy, Departed, Inertia, Moved, and UserSignal flags
  of all objects of the specified class to zero. If the class is -1, then
  all objects are flushed in this way, and during the input phase, it also
  skips the beginning and ending phases if the class is -1.

FlushObj  ( -- ) **
  Resets this object's Arrived, Departed, Inertia, Moved, and UserSignal.

,FlushObj  ( obj -- ) **
  Resets the Arrived, Busy, Departed, Inertia, Moved, and UserSignal flags
  of the specified object only.

From  ( -- obj )
  The object which send the message to this object. In some cases, this







|







1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
FlushClass  ( class -- ) **
  Resets the Arrived, Busy, Departed, Inertia, Moved, and UserSignal flags
  of all objects of the specified class to zero. If the class is -1, then
  all objects are flushed in this way, and during the input phase, it also
  skips the beginning and ending phases if the class is -1.

FlushObj  ( -- ) **
  Resets this object's Arrived, Busy, Departed, Inertia, Moved, UserSignal.

,FlushObj  ( obj -- ) **
  Resets the Arrived, Busy, Departed, Inertia, Moved, and UserSignal flags
  of the specified object only.

From  ( -- obj )
  The object which send the message to this object. In some cases, this

Modified default.heromeshrc from [f6f6f8f1b2] to [8adb826c84].

190
191
192
193
194
195
196



?.?.ctrl.Q: ^Q
?.?.ctrl.S: ^S
?.?.ctrl.T: ^T
?.?.ctrl.Y: ^Y
?.?.shift.ctrl.M: select ':s';
?.?.f10: select ':x';











>
>
>
190
191
192
193
194
195
196
197
198
199
?.?.ctrl.Q: ^Q
?.?.ctrl.S: ^S
?.?.ctrl.T: ^T
?.?.ctrl.Y: ^Y
?.?.shift.ctrl.M: select ':s';
?.?.f10: select ':x';

! Picture editor macros
?.picedit.macro.M: insert into graph(x,y,c) select s-x-1,y,c from graph where x<s/2;

Modified picedit.c from [f746d76413] to [e11269f40c].

121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148



149


150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
  *cur=sqlite3_malloc(sizeof(Cursor));
  return *cur?SQLITE_OK:SQLITE_NOMEM;
}

static int vt_graph_connect(sqlite3*db,void*aux,int argc,const char*const*argv,sqlite3_vtab**vt,char**ex) {
  *vt=sqlite3_malloc(sizeof(sqlite3_vtab));
  if(!*vt) return SQLITE_NOMEM;
  sqlite3_declare_vtab(db,"CREATE TABLE `GRAPH`(`X` INT, `Y` INT, `C` INT);");
  return SQLITE_OK;
}

static int vt_graph_disconnect(sqlite3_vtab*vt) {
  sqlite3_free(vt);
  return SQLITE_OK;
}

static int vt_graph_filter(sqlite3_vtab_cursor*cc,int n,const char*s,int c,sqlite3_value**v) {
  Cursor*cur=(void*)cc;
  cur->pos=0;
  return SQLITE_OK;
}

static int vt_graph_index(sqlite3_vtab*vt,sqlite3_index_info*inf) {
  return SQLITE_OK;
}

static int vt_graph_column(sqlite3_vtab_cursor*cc,sqlite3_context*cxt,int n) {
  Cursor*cur=(void*)cc;



  sqlite3_result_int(cxt,n==0?cur->pos%cur_pic->size:n==1?cur->pos/cur_pic->size:cur_pic->data[cur->pos+cur_pic->size]);


  return SQLITE_OK;
}

static int vt_graph_next(sqlite3_vtab_cursor*cc) {
  Cursor*cur=(void*)cc;
  cur->pos++;
  return SQLITE_OK;
}

static int vt_graph_rowid(sqlite3_vtab_cursor*cc,sqlite3_int64*p) {
  Cursor*cur=(void*)cc;
  *p=cur->pos;
  return SQLITE_OK;
}

static int vt_graph_update(sqlite3_vtab*vt,int argc,sqlite3_value**argv,sqlite3_int64*rowid) {
  int x,y;
  if(argc!=5) return SQLITE_CONSTRAINT_VTAB;
  if(sqlite3_value_type(argv[0])==SQLITE_NULL) {
    x=sqlite3_value_int(argv[2]);
    y=sqlite3_value_int(argv[3]);
    if(x<0 || x>=cur_pic->size || y<0 || y>=cur_pic->size) return SQLITE_CONSTRAINT_VTAB;
    x+=y*cur_pic->size;
  } else {
    x=sqlite3_value_int(argv[0]);







|




















>
>
>
|
>
>

















|







121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
  *cur=sqlite3_malloc(sizeof(Cursor));
  return *cur?SQLITE_OK:SQLITE_NOMEM;
}

static int vt_graph_connect(sqlite3*db,void*aux,int argc,const char*const*argv,sqlite3_vtab**vt,char**ex) {
  *vt=sqlite3_malloc(sizeof(sqlite3_vtab));
  if(!*vt) return SQLITE_NOMEM;
  sqlite3_declare_vtab(db,"CREATE TABLE `GRAPH`(`X` INT, `Y` INT, `C` INT, `S` INT);");
  return SQLITE_OK;
}

static int vt_graph_disconnect(sqlite3_vtab*vt) {
  sqlite3_free(vt);
  return SQLITE_OK;
}

static int vt_graph_filter(sqlite3_vtab_cursor*cc,int n,const char*s,int c,sqlite3_value**v) {
  Cursor*cur=(void*)cc;
  cur->pos=0;
  return SQLITE_OK;
}

static int vt_graph_index(sqlite3_vtab*vt,sqlite3_index_info*inf) {
  return SQLITE_OK;
}

static int vt_graph_column(sqlite3_vtab_cursor*cc,sqlite3_context*cxt,int n) {
  Cursor*cur=(void*)cc;
  switch(n) {
    case 0: sqlite3_result_int(cxt,cur->pos%cur_pic->size); break;
    case 1: sqlite3_result_int(cxt,cur->pos/cur_pic->size); break;
    case 2: sqlite3_result_int(cxt,cur_pic->data[cur->pos+cur_pic->size]); break;
    case 3: sqlite3_result_int(cxt,cur_pic->size); break;
  }
  return SQLITE_OK;
}

static int vt_graph_next(sqlite3_vtab_cursor*cc) {
  Cursor*cur=(void*)cc;
  cur->pos++;
  return SQLITE_OK;
}

static int vt_graph_rowid(sqlite3_vtab_cursor*cc,sqlite3_int64*p) {
  Cursor*cur=(void*)cc;
  *p=cur->pos;
  return SQLITE_OK;
}

static int vt_graph_update(sqlite3_vtab*vt,int argc,sqlite3_value**argv,sqlite3_int64*rowid) {
  int x,y;
  if(argc!=6) return SQLITE_CONSTRAINT_VTAB;
  if(sqlite3_value_type(argv[0])==SQLITE_NULL) {
    x=sqlite3_value_int(argv[2]);
    y=sqlite3_value_int(argv[3]);
    if(x<0 || x>=cur_pic->size || y<0 || y>=cur_pic->size) return SQLITE_CONSTRAINT_VTAB;
    x+=y*cur_pic->size;
  } else {
    x=sqlite3_value_int(argv[0]);

Modified picedit.doc from [db75a2ce84] to [181395115a].

133
134
135
136
137
138
139
140


141
142
143
144
145
146
147

F12
  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







|
>
>







133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149

F12
  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). This table also has
  a column "S" which is the same for all rows, and is the size of the
  picture, which can be used in macros (see config.doc).

` 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