~mdw
/
sgt
/
puzzles
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Lee Dowling points out that duplicating the entire grid data
[sgt/puzzles]
/
net.c
diff --git
a/net.c
b/net.c
index
ab16b1a
..
3c8a660
100644
(file)
--- a/
net.c
+++ b/
net.c
@@
-232,7
+232,7
@@
static void decode_params(game_params *ret, char const *string)
ret->wrapping = TRUE;
} else if (*p == 'b') {
p++;
ret->wrapping = TRUE;
} else if (*p == 'b') {
p++;
- ret->barrier_probability = atof(p);
+ ret->barrier_probability =
(float)
atof(p);
while (*p && (*p == '.' || isdigit((unsigned char)*p))) p++;
} else if (*p == 'a') {
p++;
while (*p && (*p == '.' || isdigit((unsigned char)*p))) p++;
} else if (*p == 'a') {
p++;
@@
-1978,7
+1978,11
@@
static char *interpret_move(game_state *state, game_ui *ui,
* Middle button never drags: it only toggles the lock.
*/
action = TOGGLE_LOCK;
* Middle button never drags: it only toggles the lock.
*/
action = TOGGLE_LOCK;
- } else if (button == LEFT_BUTTON || button == RIGHT_BUTTON) {
+ } else if (button == LEFT_BUTTON
+#ifndef STYLUS_BASED
+ || button == RIGHT_BUTTON /* (see above) */
+#endif
+ ) {
/*
* Otherwise, we note down the start point for a drag.
*/
/*
* Otherwise, we note down the start point for a drag.
*/
@@
-1988,7
+1992,11
@@
static char *interpret_move(game_state *state, game_ui *ui,
ui->dragstarty = y % TILE_SIZE;
ui->dragged = FALSE;
return nullret; /* no actual action */
ui->dragstarty = y % TILE_SIZE;
ui->dragged = FALSE;
return nullret; /* no actual action */
- } else if (button == LEFT_DRAG || button == RIGHT_DRAG) {
+ } else if (button == LEFT_DRAG
+#ifndef STYLUS_BASED
+ || button == RIGHT_DRAG
+#endif
+ ) {
/*
* Find the new drag point and see if it necessitates a
* rotation.
/*
* Find the new drag point and see if it necessitates a
* rotation.
@@
-2037,7
+2045,11
@@
static char *interpret_move(game_state *state, game_ui *ui,
ui->dragstarty = yC;
ui->dragged = TRUE;
}
ui->dragstarty = yC;
ui->dragged = TRUE;
}
- } else if (button == LEFT_RELEASE || button == RIGHT_RELEASE) {
+ } else if (button == LEFT_RELEASE
+#ifndef STYLUS_BASED
+ || button == RIGHT_RELEASE
+#endif
+ ) {
if (!ui->dragged) {
/*
* There was a click but no perceptible drag:
if (!ui->dragged) {
/*
* There was a click but no perceptible drag:
@@
-2061,8
+2073,7
@@
static char *interpret_move(game_state *state, game_ui *ui,
#endif /* USE_DRAGGING */
#endif /* USE_DRAGGING */
- } else if (button == CURSOR_UP || button == CURSOR_DOWN ||
- button == CURSOR_RIGHT || button == CURSOR_LEFT) {
+ } else if (IS_CURSOR_MOVE(button)) {
switch (button) {
case CURSOR_UP: dir = U; break;
case CURSOR_DOWN: dir = D; break;
switch (button) {
case CURSOR_UP: dir = U; break;
case CURSOR_DOWN: dir = D; break;
@@
-2077,12
+2088,12
@@
static char *interpret_move(game_state *state, game_ui *ui,
} else if (button == 'a' || button == 's' || button == 'd' ||
button == 'A' || button == 'S' || button == 'D' ||
button == 'f' || button == 'F' ||
} else if (button == 'a' || button == 's' || button == 'd' ||
button == 'A' || button == 'S' || button == 'D' ||
button == 'f' || button == 'F' ||
-
button == CURSOR_SELECT
) {
+
IS_CURSOR_SELECT(button)
) {
tx = ui->cur_x;
ty = ui->cur_y;
if (button == 'a' || button == 'A' || button == CURSOR_SELECT)
action = ROTATE_LEFT;
tx = ui->cur_x;
ty = ui->cur_y;
if (button == 'a' || button == 'A' || button == CURSOR_SELECT)
action = ROTATE_LEFT;
- else if (button == 's' || button == 'S')
+ else if (button == 's' || button == 'S'
|| button == CURSOR_SELECT2
)
action = TOGGLE_LOCK;
else if (button == 'd' || button == 'D')
action = ROTATE_RIGHT;
action = TOGGLE_LOCK;
else if (button == 'd' || button == 'D')
action = ROTATE_RIGHT;
@@
-2863,8
+2874,8
@@
static void game_print_size(game_params *params, float *x, float *y)
* I'll use 8mm squares by default.
*/
game_compute_size(params, 800, &pw, &ph);
* I'll use 8mm squares by default.
*/
game_compute_size(params, 800, &pw, &ph);
- *x = pw / 100.0;
- *y = ph / 100.0;
+ *x = pw / 100.0
F
;
+ *y = ph / 100.0
F
;
}
static void draw_diagram(drawing *dr, game_drawstate *ds, int x, int y,
}
static void draw_diagram(drawing *dr, game_drawstate *ds, int x, int y,