;;-*-Lisp-*-
(in-package goal)

;; name: sky-data.gc
;; name in dgo: sky-data
;; dgos: GAME

;; DECOMP BEGINS

(define *sky-work*
  (new 'static 'sky-work
    :adgif-tmpl (new 'static 'dma-gif-packet
      :dma-vif (new 'static 'dma-packet
        :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))
        :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)
        )
      :gif0 (new 'static 'gif-tag64 :nloop #x5 :eop #x1 :nreg #x1)
      :gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))
      )
    :draw-tmpl (new 'static 'dma-gif-packet
      :dma-vif (new 'static 'dma-packet
        :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))
        :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)
        )
      :gif0 (new 'static 'gif-tag64
        :nloop #x1
        :eop #x1
        :pre #x1
        :prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1)
        :nreg #x5
        )
      :gif1 (new 'static 'gif-tag-regs
        :regs0 (gif-reg-id rgbaq)
        :regs1 (gif-reg-id st)
        :regs2 (gif-reg-id xyzf2)
        :regs3 (gif-reg-id st)
        :regs4 (gif-reg-id xyzf2)
        )
      )
    :draw-tmpl2 (new 'static 'dma-gif-packet
      :dma-vif (new 'static 'dma-packet
        :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))
        :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)
        )
      :gif0 (new 'static 'gif-tag64
        :nloop #x1
        :eop #x1
        :pre #x1
        :prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1 :fst #x1)
        :nreg #x5
        )
      :gif1 (new 'static 'gif-tag-regs
        :regs0 (gif-reg-id rgbaq)
        :regs1 (gif-reg-id uv)
        :regs2 (gif-reg-id xyzf2)
        :regs3 (gif-reg-id uv)
        :regs4 (gif-reg-id xyzf2)
        )
      )
    :fog-tmpl (new 'static 'dma-gif-packet
      :dma-vif (new 'static 'dma-packet
        :dma (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt))
        :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1)
        )
      :gif0 (new 'static 'gif-tag64
        :nloop #x1
        :eop #x1
        :pre #x1
        :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :tme #x1 :abe #x1)
        :nreg #x9
        )
      :gif1 (new 'static 'gif-tag-regs
        :regs0 (gif-reg-id rgbaq)
        :regs1 (gif-reg-id st)
        :regs2 (gif-reg-id xyzf2)
        :regs3 (gif-reg-id st)
        :regs4 (gif-reg-id xyzf2)
        :regs5 (gif-reg-id st)
        :regs6 (gif-reg-id xyzf2)
        :regs7 (gif-reg-id st)
        :regs8 (gif-reg-id xyzf2)
        )
      )
    :blend-tmpl (new 'static 'dma-gif-packet
      :dma-vif (new 'static 'dma-packet
        :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))
        :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)
        )
      :gif0 (new 'static 'gif-tag64
        :nloop #x1
        :eop #x1
        :pre #x1
        :prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1 :fst #x1)
        :nreg #x5
        )
      :gif1 (new 'static 'gif-tag-regs
        :regs0 (gif-reg-id rgbaq)
        :regs1 (gif-reg-id uv)
        :regs2 (gif-reg-id xyzf2)
        :regs3 (gif-reg-id uv)
        :regs4 (gif-reg-id xyzf2)
        )
      )
    :sprite-tmpl (new 'static 'dma-gif-packet
      :dma-vif (new 'static 'dma-packet
        :dma (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))
        :vif1 (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1)
        )
      :gif0 (new 'static 'gif-tag64
        :nloop #x1
        :eop #x1
        :pre #x1
        :prim (new 'static 'gs-prim :prim (gs-prim-type sprite))
        :nreg #x2
        )
      :gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id xyz2) :regs1 (gif-reg-id xyz2))
      )
    :sprite-tmpl2 (new 'static 'dma-gif-packet
      :dma-vif (new 'static 'dma-packet
        :dma (new 'static 'dma-tag :qwc #x21 :id (dma-tag-id cnt))
        :vif1 (new 'static 'vif-tag :imm #x21 :cmd (vif-cmd direct) :msk #x1)
        )
      :gif0 (new 'static 'gif-tag64
        :nloop #x10
        :eop #x1
        :pre #x1
        :prim (new 'static 'gs-prim :prim (gs-prim-type sprite))
        :nreg #x2
        )
      :gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id xyz2) :regs1 (gif-reg-id xyz2))
      )
    :sun-coords (new 'static 'inline-array vector 2
      (new 'static 'vector :x -267.0 :y -267.0 :w 1.0)
      (new 'static 'vector :x 267.0 :y 267.0)
      )
    :green-coords (new 'static 'inline-array vector 2
      (new 'static 'vector :x -126.0 :y -126.0 :w 1.0)
      (new 'static 'vector :x 126.0 :y 126.0)
      )
    :moon0-coords (new 'static 'inline-array vector 2
      (new 'static 'vector :x -357.0 :y -357.0)
      (new 'static 'vector :x 357.0 :y 357.0)
      )
    :moon1-coords (new 'static 'inline-array vector 2
      (new 'static 'vector :x -1207.0 :y -1207.0 :w 1.0)
      (new 'static 'vector :x 1207.0 :y 1207.0)
      )
    :moon2-coords (new 'static 'inline-array vector 2
      (new 'static 'vector :x -232.0 :y -232.0)
      (new 'static 'vector :x 232.0 :y 232.0)
      )
    :day-star-coords (new 'static 'inline-array vector 2
      (new 'static 'vector :x -126.0 :y -126.0 :w 1.0)
      (new 'static 'vector :x 126.0 :y 126.0)
      )
    :star-coords (new 'static 'inline-array vector 2 (new 'static 'vector :x -1.5 :y -1.5) (new 'static 'vector :x 1.5 :y 1.5))
    :sun-colors (new 'static 'inline-array vector4w 2
      (new 'static 'vector4w :x #xff :y 64 :w 64)
      (new 'static 'vector4w :x #xff :y #xff :z #x80 :w 64)
      )
    :green-colors (new 'static 'inline-array vector4w 2
      (new 'static 'vector4w :y #xc4 :w #x80)
      (new 'static 'vector4w :x #xc4 :y #xff :z #xff :w #x80)
      )
    :moon-colors (new 'static 'inline-array vector4w 3
      (new 'static 'vector4w :x 16 :y 32 :z 64 :w 96)
      (new 'static 'vector4w :x 16 :y 32 :z 64 :w 64)
      (new 'static 'vector4w :x 80 :y 80 :z 80 :w #x80)
      )
    :day-star-colors (new 'static 'inline-array vector4w 3
      (new 'static 'vector4w :z #xc4 :w #x80)
      (new 'static 'vector4w :x #xc4 :y #xff :z #xff :w #x80)
      (new 'static 'vector4w)
      )
    :st-coords (new 'static 'inline-array vector 2 (new 'static 'vector :z 1.0) (new 'static 'vector :x 1.0 :y 1.0 :z 1.0))
    :random (new 'static 'inline-array vector4w 8
      (new 'static 'vector4w :x #x181920 :y #x141516 :z #x101112 :w #x234567)
      (new 'static 'vector4w :x #x878237 :y #x48778 :z #x489197 :w #x893830)
      (new 'static 'vector4w :x #x24762 :y #x289278 :z #x724781 :w #x712983)
      (new 'static 'vector4w :x #x176128 :y #x387487 :z #x780983 :w #x723176)
      (new 'static 'vector4w :x #x987239 :y #x699872 :z #x987165 :w #x982397)
      (new 'static 'vector4w :x #x723897 :y #x238723 :z #x987293 :w #x102981)
      (new 'static 'vector4w :x #x387528 :y #x723099 :z #x140983 :w #x874310)
      (new 'static 'vector4w :x #x2387 :y #x129818 :z #x219810 :w #x623790)
      )
    :giftag-base (new 'static 'dma-gif
      :gif0 (new 'static 'gif-tag64
        :nloop #x1
        :eop #x1
        :pre #x1
        :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan))
        :nreg #x3
        )
      :gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
      )
    :giftag-haze (new 'static 'dma-gif
      :gif0 (new 'static 'gif-tag64
        :nloop #x1
        :eop #x1
        :pre #x1
        :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :abe #x1)
        :nreg #x3
        )
      :gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
      )
    :giftag-roof (new 'static 'dma-gif
      :gif0 (new 'static 'gif-tag64
        :nloop #x1
        :eop #x1
        :pre #x1
        :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1)
        :nreg #x3
        )
      :gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
      )
    :giftag-ocean (new 'static 'dma-gif
      :gif0 (new 'static 'gif-tag64
        :nloop #x1
        :eop #x1
        :pre #x1
        :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1)
        :nreg #x3
        )
      :gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
      )
    :draw-vortex #f
    :day-star-scale 1.0
    :disable-day-star #f
    )
  )

(define sky-base-polygons (new 'static 'inline-array sky-vertex 12
                            (new 'static 'sky-vertex :pos (new 'static 'vector :z -40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :x 40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :y -40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :x 40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :z 40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :y -40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :z 40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :x -40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :y -40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :x -40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :z -40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :y -40960000.0))
                            )
        )

(define sky-roof-polygons (new 'static 'inline-array sky-vertex 12
                            (new 'static 'sky-vertex :pos (new 'static 'vector :z -40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :x 40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :y 10240000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :x 40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :z 40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :y 10240000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :z 40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :x -40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :y 10240000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :x -40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :z -40960000.0))
                            (new 'static 'sky-vertex :pos (new 'static 'vector :y 10240000.0))
                            )
        )

(define *cloud-vert-array* (new 'static 'cloud-vert-array))

(define *cloud-poly* (new 'static 'inline-array sky-vertex 648
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       (new 'static 'sky-vertex)
                       )
        )

(defun init-cloud-vert-array ()
  (let ((gp-0 *cloud-vert-array*))
    (dotimes (s5-0 10)
      (dotimes (s4-0 10)
        (let ((s3-0 (-> gp-0 data (+ (* 10 s5-0) s4-0))))
          (set! (-> s3-0 pos x) (* 2.0 (+ -4.5 (the float s4-0))))
          (set! (-> s3-0 pos z) (* 2.0 (+ -4.5 (the float s5-0))))
          (set! (-> s3-0 pos y)
                (fmin (cos (* 182.04445 (* 10.0 (-> s3-0 pos x)))) (cos (* 182.04445 (* 10.0 (-> s3-0 pos z)))))
                )
          (set-vector! (-> s3-0 stq) (* 0.25 (the float (+ s4-0 -4))) (* 0.25 (the float (+ s5-0 -4))) 1.0 1.0)
          (vector-copy! (-> s3-0 nrm) (-> s3-0 pos))
          (+! (-> s3-0 nrm y) 1.0)
          (vector-normalize! (-> s3-0 nrm) 1.0)
          (vector-negate! (-> s3-0 nrm2) (-> s3-0 nrm))
          (cond
            ((or (zero? s5-0) (= s5-0 9) (zero? s4-0) (= s4-0 9))
             (set! (-> s3-0 col w) 0.0)
             (set! (-> s3-0 col2 w) 0.0)
             )
            ((or (= s5-0 1) (= s5-0 8) (= s4-0 1) (= s4-0 8))
             (set! (-> s3-0 col w) 48.0)
             (set! (-> s3-0 col2 w) 48.0)
             )
            (else
              (set! (-> s3-0 col w) 128.0)
              (set! (-> s3-0 col2 w) 128.0)
              )
            )
          )
        )
      )
    )
  #f
  )

(init-cloud-vert-array)

(define *haze-vert-array* (new 'static 'haze-vert-array))

(define *haze-poly* (new 'static 'inline-array sky-vertex 144
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      (new 'static 'sky-vertex)
                      )
        )

(defun init-haze-vert-array ()
  (let ((gp-0 *haze-vert-array*))
    (dotimes (s5-0 36)
      (let ((s4-0 (-> gp-0 data s5-0)))
        (set! (-> s4-0 pos x) (* 9.0 (sin (* 182.04445 (* 10.0 (the float s5-0))))))
        (set! (-> s4-0 pos z) (* 9.0 (cos (* 182.04445 (* 10.0 (the float s5-0))))))
        (set! (-> s4-0 pos y) 0.0)
        (vector-copy! (-> s4-0 nrm) (-> s4-0 pos))
        (+! (-> s4-0 nrm y) 1.0)
        (vector-normalize! (-> s4-0 nrm) 1.0)
        )
      )
    )
  #f
  )

(init-haze-vert-array)

(defmethod init-sun-data! ((this sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float))
  (let ((v1-0 (logand arg0 1)))
    (set! (-> this upload-data sun v1-0 r-sun) arg1)
    (set! (-> this upload-data sun v1-0 r-halo) arg2)
    (set! (-> this upload-data sun v1-0 r-aurora) arg3)
    )
  0
  (none)
  )

(defmethod init-orbit-settings! ((this sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float) (arg4 float) (arg5 float) (arg6 float))
  (set! (-> this orbit arg0 high-noon) arg1)
  (set! (-> this orbit arg0 tilt) (* 0.017453292 arg2))
  (set! (-> this orbit arg0 rise) (* 0.017453292 arg3))
  (set! (-> this orbit arg0 dist) arg4)
  (set! (-> this orbit arg0 min-halo) arg5)
  (set! (-> this orbit arg0 max-halo) arg6)
  0
  (none)
  )

(defun sky-make-sun-data ((arg0 sky-work) (arg1 int) (arg2 float))
  (let* ((s4-0 (-> arg0 orbit arg1))
         (s3-0 (the-as sky-sun-data (+ (the-as uint (-> arg0 upload-data)) (* arg1 64))))
         (f0-1 (- arg2 (-> s4-0 high-noon)))
         (f30-0 (* 2730.6667 f0-1))
         (f28-0 (* (sin f30-0) (-> s4-0 dist)))
         (f30-1 (cos f30-0))
         )
    (let* ((f24-0 (* f30-1 (-> s4-0 dist)))
           (f26-0 (* f24-0 (cos-rad (-> s4-0 tilt))))
           (f24-1 (* f24-0 (sin-rad (-> s4-0 tilt))))
           (f22-0 (sin-rad (-> s4-0 rise)))
           (f0-10 (cos-rad (-> s4-0 rise)))
           )
      (set! (-> s3-0 pos z) (- (+ (* f28-0 f0-10) (* f24-1 f22-0))))
      (set! (-> s3-0 pos y) f26-0)
      (set! (-> s3-0 pos x) (- (* f24-1 f0-10) (* f28-0 f22-0)))
      )
    (let ((f0-14 (if (< f30-1 0.0)
                     0.0
                     f30-1
                     )
                 )
          )
      (set! (-> arg0 upload-data sun arg1 r-aurora)
            (+ (* (-> s4-0 min-halo) (- 1.0 f0-14)) (* (-> s4-0 max-halo) f0-14))
            )
      )
    )
  0
  (none)
  )

(defun sky-make-moon-data ((arg0 sky-work) (arg1 float))
  (let* ((s5-0 (-> arg0 orbit 2))
         (gp-0 (-> arg0 upload-data moon))
         (f0-1 (- arg1 (-> s5-0 high-noon)))
         (f28-0 (* 2730.6667 f0-1))
         (f30-0 (* (sin f28-0) (-> s5-0 dist)))
         (f26-0 (* (cos f28-0) (-> s5-0 dist)))
         (f28-1 (* f26-0 (cos-rad (-> s5-0 tilt))))
         (f26-1 (* f26-0 (sin-rad (-> s5-0 tilt))))
         (f24-0 (sin-rad (-> s5-0 rise)))
         (f0-10 (cos-rad (-> s5-0 rise)))
         )
    (set! (-> gp-0 pos z) (- (+ (* f30-0 f0-10) (* f26-1 f24-0))))
    (set! (-> gp-0 pos y) f28-1)
    (set! (-> gp-0 pos x) (- (* f26-1 f0-10) (* f30-0 f24-0)))
    )
  0
  (none)
  )

(init-sun-data! *sky-work* 0 60.0 200.0 300.0)

(init-sun-data! *sky-work* 1 15.0 20.0 300.0)

(init-orbit-settings! *sky-work* 0 12.5 -20.0 90.0 9950.0 300.0 300.0)

(init-orbit-settings! *sky-work* 1 4.0 0.0 90.0 9950.0 300.0 300.0)

(init-orbit-settings! *sky-work* 2 0.5 -40.0 90.0 9950.0 300.0 300.0)

(let ((v0-9 (-> *sky-work* upload-data day-star)))
  (set! (-> v0-9 pos x) 0.0)
  (set! (-> v0-9 pos y) 2000.0)
  (set! (-> v0-9 pos z) -9000.0)
  (set! (-> v0-9 pos w) 1.0)
  )
