ref: cafa36b0e3121efb83b9b02f60ea2f35194b98b0
parent: cd9c544230a46ada5fe93cf368f15338f9b75b68
author: Jacob Nevins <jacobn@chiark.greenend.org.uk>
date: Sun Sep 23 12:36:24 EDT 2018
Net: rename 'loop' to 'err' in UI code. In preparation for highlighting other kinds of errors. No intended functional change.
--- a/net.c
+++ b/net.c
@@ -34,11 +34,11 @@
#define D 0x08
#define LOCKED 0x10
#define ACTIVE 0x20
-#define RLOOP (R << 6)
-#define ULOOP (U << 6)
-#define LLOOP (L << 6)
-#define DLOOP (D << 6)
-#define LOOP(dir) ((dir) << 6)
+#define RERR (R << 6)
+#define UERR (U << 6)
+#define LERR (L << 6)
+#define DERR (D << 6)
+#define ERR(dir) ((dir) << 6)
/* Rotations: Anticlockwise, Clockwise, Flip, general rotate */
#define A(x) ( (((x) & 0x07) << 1) | (((x) & 0x08) >> 3) )
@@ -76,7 +76,7 @@
COL_ENDPOINT,
COL_POWERED,
COL_BARRIER,
- COL_LOOP,
+ COL_ERR,
NCOLOURS
};
@@ -1979,7 +1979,7 @@
OFFSETWH(x1, y1, x, y, dir, w, h);
if ((tiles[y1*w+x1] & F(dir)) &&
findloop_is_loop_edge(fls, y*w+x, y1*w+x1))
- flags |= LOOP(dir);
+ flags |= ERR(dir);
}
}
loops[y*w+x] = flags;
@@ -2513,11 +2513,11 @@
ret[COL_BARRIER * 3 + 2] = 0.0F;
/*
- * Highlighted loops are red as well.
+ * Highlighted errors are red as well.
*/
- ret[COL_LOOP * 3 + 0] = 1.0F;
- ret[COL_LOOP * 3 + 1] = 0.0F;
- ret[COL_LOOP * 3 + 2] = 0.0F;
+ ret[COL_ERR * 3 + 0] = 1.0F;
+ ret[COL_ERR * 3 + 1] = 0.0F;
+ ret[COL_ERR * 3 + 2] = 0.0F;
/*
* Unpowered endpoints are blue.
@@ -2556,7 +2556,7 @@
#define TILE_KEYBOARD_CURSOR (1<<8) /* 1 bit if cursor is here */
#define TILE_WIRE_SHIFT 9 /* 8 bits: RR UU LL DD
* Each pair: 0=no wire, 1=unpowered,
- * 2=powered, 3=loop err highlight */
+ * 2=powered, 3=error highlight */
#define TILE_ENDPOINT_SHIFT 17 /* 2 bits: 0=no endpoint, 1=unpowered,
* 2=powered, 3=power-source square */
#define TILE_WIRE_ON_EDGE_SHIFT 19 /* 8 bits: RR UU LL DD,
@@ -2705,7 +2705,7 @@
for (pass = 0; pass < 2; pass++) {
int x, y, w, h;
int col = (pass == 0 || edgetype == 1 ? COL_WIRE :
- edgetype == 2 ? COL_POWERED : COL_LOOP);
+ edgetype == 2 ? COL_POWERED : COL_ERR);
int halfwidth = pass == 0 ? 2*LINE_THICK-1 : LINE_THICK-1;
if (X(d) < 0) {
@@ -2757,7 +2757,7 @@
draw_wires(dr, cx, cy, radius, tile,
0x4, COL_POWERED, LINE_THICK-1, matrix);
draw_wires(dr, cx, cy, radius, tile,
- 0x8, COL_LOOP, LINE_THICK-1, matrix);
+ 0x8, COL_ERR, LINE_THICK-1, matrix);
/*
* Draw the central box.
@@ -2915,7 +2915,7 @@
}
if (t & d) {
- int edgeval = (t & LOOP(d) ? 3 : t & ACTIVE ? 2 : 1);
+ int edgeval = (t & ERR(d) ? 3 : t & ACTIVE ? 2 : 1);
todraw(ds, dx, dy) |= edgeval << (TILE_WIRE_SHIFT + dsh*2);
if (!(gx == tx && gy == ty)) {
todraw(ds, dx + X(d), dy + Y(d)) |=