name the colour function type
A typedef of a function pointer type compiles now (sex#53). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,13 +12,13 @@
|
|||||||
(fn climate-colour ((v i32)) u32 (return (& (cast v u32) 0xFFFFFF)))
|
(fn climate-colour ((v i32)) u32 (return (& (cast v u32) 0xFFFFFF)))
|
||||||
(fn byte-colour ((v i32)) u32 (return (grey v)))
|
(fn byte-colour ((v i32)) u32 (return (grey v)))
|
||||||
|
|
||||||
|
(typedef colour-fn (fn ((i32)) u32))
|
||||||
|
|
||||||
;;; The inner square of one region's map, placed at (ox, oz) and
|
;;; The inner square of one region's map, placed at (ox, oz) and
|
||||||
;;; stretched to CELL pixels a side, so maps of different resolutions
|
;;; stretched to CELL pixels a side, so maps of different resolutions
|
||||||
;;; line up pixel for pixel across mosaics.
|
;;; line up pixel for pixel across mosaics.
|
||||||
;; TODO sex#53: name the colour function type with a typedef once that
|
|
||||||
;; no longer crashes sexc.
|
|
||||||
(fn paint-map ((im (* image)) (m (* const int-map)) (ox int) (oz int) (cell int)
|
(fn paint-map ((im (* image)) (m (* const int-map)) (ox int) (oz int) (cell int)
|
||||||
(colour (fn ((i32)) u32))) void
|
(colour colour-fn)) void
|
||||||
(var inner int (- (. m size) (. m pad-tl) (. m pad-br)))
|
(var inner int (- (. m size) (. m pad-tl) (. m pad-br)))
|
||||||
(if (<= inner 0)
|
(if (<= inner 0)
|
||||||
(return))
|
(return))
|
||||||
|
|||||||
Reference in New Issue
Block a user