ref: a3477b9d29227db6e78cede76fdd9d6b83f5ea76
parent: 3b862725591bc312572a3e35aab3007712c8b9bf
author: sirjofri <[email protected]>
date: Wed Aug 14 05:15:06 EDT 2024
moves layers a level down, in preparation for brushes and other folders
--- a/layer.c
+++ b/layer.c
@@ -98,7 +98,7 @@
if (!name || !name[0])
return;
- file = smprint("%s/meta", name);
+ file = smprint("l/%s/meta", name);
b = Bopen(file, OREAD);
free(file);
if (!b)
@@ -192,7 +192,7 @@
Biobuf *b;
char *file;
- file = smprint("%s.meta", layer->name);
+ file = smprint("l/%s/meta", layer->name);
b = Bopen(file, OWRITE|OTRUNC);
free(file);
if (!b)
--- a/p9image.c
+++ b/p9image.c
@@ -130,7 +130,7 @@
l->data = d;
/* image file */
- s = smprint("%s/img", l->name);
+ s = smprint("l/%s/img", l->name);
fd = open(s, OREAD);
if (fd < 0) {
free(s);
@@ -147,7 +147,7 @@
close(fd);
/* mask file */
- s = smprint("%s/mask", l->name);
+ s = smprint("l/%s/mask", l->name);
fd = open(s, OREAD);
if (fd < 0) {
free(s);
binary files /dev/null b/test/img/l/layerA/img differ
binary files /dev/null b/test/img/l/layerA/mask differ
--- /dev/null
+++ b/test/img/l/layerA/meta
@@ -1,0 +1,3 @@
+p9img
+Layer A
+SoverD
binary files /dev/null b/test/img/l/layerB/img differ
binary files /dev/null b/test/img/l/layerB/mask differ
--- /dev/null
+++ b/test/img/l/layerB/meta
@@ -1,0 +1,3 @@
+p9img
+Layer B
+SoverD
binary files a/test/img/layerA/img /dev/null differ
binary files a/test/img/layerA/mask /dev/null differ
--- a/test/img/layerA/meta
+++ /dev/null
@@ -1,3 +1,0 @@
-p9img
-Layer A
-SoverD
binary files a/test/img/layerB/img /dev/null differ
binary files a/test/img/layerB/mask /dev/null differ
--- a/test/img/layerB/meta
+++ /dev/null
@@ -1,3 +1,0 @@
-p9img
-Layer B
-SoverD
--- a/words
+++ b/words
@@ -7,8 +7,8 @@
this folder needs at least a single file "layers", which lists all
the layers in order.
-Each layer has its own subdirectory named as the layer, with at
-least a file named "meta". The meta files looks like this:
+Each layer has its own subdirectory within "l", named as the layer,
+with at least a file named "meta". The meta files looks like this:
editor-type
Label
@@ -20,7 +20,8 @@
Label is a user label which should be displayed in the editor.
Drawop is the drawing operation of that layer. It uses the names
-from draw(2), for example SatopD.
+from draw(2), for example SatopD (see
+https://en.wikipedia.org/wiki/Alpha_compositing and draw(2)).
All remaining lines are ignored.
@@ -35,11 +36,11 @@
In total, a sample structure could look like this:
- /layers
-- /layerA/meta
-- /layerA/img
-- /layerB/meta
-- /layerB/img
-- /layerB/mask
+- /l/layerA/meta
+- /l/layerA/img
+- /l/layerB/meta
+- /l/layerB/img
+- /l/layerB/mask
In this case, "layers" would look like this: