pass the river colour as a conditional, with #line on every statement
A #line no longer lands inside a ?: (sex#54), so the build goes back to statement-level directives, which is what lands a debugger on the right line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
6
Makefile
6
Makefile
@@ -20,12 +20,8 @@ all: $(B)/vsmv $(B)/vs-map-viewer
|
||||
# dependency files.
|
||||
SEX_SRC := $(wildcard src/*.sex)
|
||||
|
||||
# Statement-level #line directives can land inside a ?: and break the
|
||||
# C (see Sex-field-notes.org), so they are kept to toplevel forms.
|
||||
# TODO sex#54: drop --line-directives=toplevel once #line no longer
|
||||
# lands inside a ?:.
|
||||
$(B)/%.o: src/%.sex $(SEX_SRC) | $(B)
|
||||
$(SEXC) --line-directives=toplevel $< -c -o $@ -- $(CFLAGS) $(SEX_CFLAGS) $(CPPFLAGS)
|
||||
$(SEXC) $< -c -o $@ -- $(CFLAGS) $(SEX_CFLAGS) $(CPPFLAGS)
|
||||
|
||||
$(B)/nk.o: src/nk.c src/nk.h | $(B)
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
|
||||
|
||||
@@ -128,11 +128,7 @@
|
||||
(if (. m has-river-distance)
|
||||
(do
|
||||
(var d int [(. m river-distance) i])
|
||||
;; TODO sex#54: pass the colour as an (if ...) argument to
|
||||
;; .set once #line no longer splits it.
|
||||
(var c u32 (grey (- 255 d)))
|
||||
(if (== d 0) (= c 0x4060BF))
|
||||
(.set (& river) x y c))
|
||||
(.set (& river) x y (if (== d 0) 0x4060BF (grey (- 255 d)))))
|
||||
(.set (& river) x y 0x202020)))))
|
||||
|
||||
(write-image (& height) dir "height")
|
||||
|
||||
Reference in New Issue
Block a user