Overview
Comment: | More work in picture editor |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
fcb6460dfe7a8a519c617741681a0832 |
User & Date: | user on 2021-01-16 03:28:33 |
Other Links: | manifest | tags |
Context
2021-01-16
| ||
23:19 | Another more work in picture editor check-in: 776f8eb358 user: user tags: trunk | |
03:28 | More work in picture editor check-in: fcb6460dfe user: user tags: trunk | |
2021-01-14
| ||
05:15 | More implementation of picture editor (still incomplete) check-in: 1a77804796 user: user tags: trunk | |
Changes
Modified config.doc from [f70dddc30c] to [1678db96f2].
︙ | |||
63 64 65 66 67 68 69 | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | - + + - + + | .screenFlags SDL flags: d = double buffer, f = full screen, h = use hardware surface, n = no window frame, p = hardware palette, r = allow the window to be resized, y = asynchronous blit, z = no parachute. Some flags might not work if the window manager does not support them. .screenHeight |
︙ |
Modified picedit.c from [d35764e246] to [e208362902].
︙ | |||
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 | + + + + + + + + + + + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | } n--; if(t==2) c=fgetc(fp); if(t==3) c=p[-pic->size]; *p++=c; } } static inline void load_rotate(Picture*pic) { int x,y; int m=pic->meth; int s=pic->size; Uint8*d=pic->data+s; static Uint8*buf; Uint8*p; if(!buf) { buf=malloc(255*255); if(!buf) fatal("Allocation failed\n"); } p=buf; for(y=0;y<s;y++) for(x=0;x<s;x++) { if(m&1) x=s-x-1; if(m&2) y=s-y-1; *p++=d[m&4?x*s+y:y*s+x]; if(m&1) x=s-x-1; if(m&2) y=s-y-1; } memcpy(d,buf,s*s); } static void load_picture_lump(const unsigned char*data,int len,Picture**pict) { Uint8 buf[32]; FILE*fp; int i,j,n; if(!len) return; fp=fmemopen((unsigned char*)data,len,"r"); if(!fp) fatal("Failed to open in-memory stream of size %d\n",len); *buf=fgetc(fp); n=*buf&15; fread(buf+1,1,n+(n>>1),fp); for(i=0;i<n;i++) { j=buf[i+1]; pict[i]=malloc(sizeof(Picture)+(j+1)*j); if(!pict[i]) fatal("Allocation failed\n"); memset(pict[i]->data,0,pict[i]->size=j); |
︙ | |||
291 292 293 294 295 296 297 | 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 | - + | set_caption(); i=sqlite3_prepare_v3(userdb,"SELECT `ID`,SUBSTR(`NAME`,1,LENGTH(`NAME`)-4),`TYPE` FROM `PICEDIT` WHERE `TYPE` ORDER BY `NAME` LIMIT ?1 OFFSET ?2;",-1,SQLITE_PREPARE_PERSISTENT,&st,0); if(i) fatal("SQL error (%d): %s\n",i,sqlite3_errmsg(userdb)); ids=calloc(screen->h/8,sizeof(sqlite3_int64)); if(!ids) fatal("Allocation failed\n"); redraw: sqlite3_reset(st); |
︙ | |||
324 325 326 327 328 329 330 | 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 | - - - - - - + + + + + + | case SDLK_ESCAPE: if(!(ev.key.keysym.mod&(KMOD_SHIFT|KMOD_CTRL))) save_picture_file(); return; case SDLK_q: if(!(ev.key.keysym.mod&KMOD_CTRL)) break; if(!(ev.key.keysym.mod&KMOD_SHIFT)) save_picture_file(); return; |
︙ |