Free Hero Mesh

Check-in [3c35f09e50]
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 possibility for SQL codes in picture editor to use REPLACE INTO or INSERT INTO to replace some or all pixels according to the result of a SELECT query.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3c35f09e5041b86ed3325c02d9c70931efb0510b
User & Date: user on 2021-05-09 01:21:42
Other Links: manifest | tags
Context
2021-05-11
19:16
Add the -f switch as a shortcut to only flush the user cache check-in: 09a2d2f5c8 user: user tags: trunk
2021-05-09
01:21
Implement possibility for SQL codes in picture editor to use REPLACE INTO or INSERT INTO to replace some or all pixels according to the result of a SELECT query. check-in: 3c35f09e50 user: user tags: trunk
2021-05-05
20:03
Add the possibility to edit Misc/Dir of existing objects. check-in: acca5b95d3 user: user tags: trunk
Changes

Modified picedit.c from [8c2ed17c26] to [d414016cc6].

127
128
129
130
131
132
133


134
135









136
137
138
139
140
141
142
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







+
+
-
-
+
+
+
+
+
+
+
+
+







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(argc!=5 || sqlite3_value_type(argv[0])==SQLITE_NULL) return SQLITE_ERROR;
  cur_pic->data[cur_pic->size+sqlite3_value_int(argv[0])]=sqlite3_value_int(argv[4]);
  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]);
  }
  cur_pic->data[cur_pic->size+x]=sqlite3_value_int(argv[4]);
  return SQLITE_OK;
}

static const sqlite3_module vt_graph={
  .iVersion=1,
  .xBestIndex=vt_graph_index,
  .xClose=vt_graph_close,