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

;; definition of type mood-fog
(deftype mood-fog (structure)
  ((fog-color   vector :inline :offset-assert   0)
   (fog-dists   vector :inline :offset-assert  16)
   (fog-start   meters         :offset         16)
   (fog-end     meters         :offset         20)
   (fog-max     float          :offset         24)
   (fog-min     float          :offset         28)
   (erase-color vector :inline :offset-assert  32)
   )
  :method-count-assert 9
  :size-assert         #x30
  :flag-assert         #x900000030
  )

;; definition for method 3 of type mood-fog
(defmethod inspect mood-fog ((obj mood-fog))
  (format #t "[~8x] ~A~%" obj 'mood-fog)
  (format #t "~Tfog-color: #<vector @ #x~X>~%" (-> obj fog-color))
  (format #t "~Tfog-dists: #<vector @ #x~X>~%" (-> obj fog-dists))
  (format #t "~Tfog-start: (meters ~m)~%" (-> obj fog-dists x))
  (format #t "~Tfog-end: (meters ~m)~%" (-> obj fog-dists y))
  (format #t "~Tfog-max: ~f~%" (-> obj fog-dists z))
  (format #t "~Tfog-min: ~f~%" (-> obj fog-dists w))
  (format #t "~Terase-color: #<vector @ #x~X>~%" (-> obj erase-color))
  obj
  )

;; definition of type mood-fog-table
(deftype mood-fog-table (structure)
  ((data mood-fog 8 :inline :offset-assert   0)
   )
  :method-count-assert 9
  :size-assert         #x180
  :flag-assert         #x900000180
  )

;; definition for method 3 of type mood-fog-table
(defmethod inspect mood-fog-table ((obj mood-fog-table))
  (format #t "[~8x] ~A~%" obj 'mood-fog-table)
  (format #t "~Tdata[8] @ #x~X~%" (-> obj data))
  obj
  )

;; definition of type mood-lights
(deftype mood-lights (structure)
  ((direction vector :inline :offset-assert   0)
   (lgt-color vector :inline :offset-assert  16)
   (prt-color vector :inline :offset-assert  32)
   (amb-color vector :inline :offset-assert  48)
   (shadow    vector :inline :offset-assert  64)
   )
  :method-count-assert 9
  :size-assert         #x50
  :flag-assert         #x900000050
  )

;; definition for method 3 of type mood-lights
(defmethod inspect mood-lights ((obj mood-lights))
  (format #t "[~8x] ~A~%" obj 'mood-lights)
  (format #t "~Tdirection: #<vector @ #x~X>~%" (-> obj direction))
  (format #t "~Tlgt-color: #<vector @ #x~X>~%" (-> obj lgt-color))
  (format #t "~Tprt-color: #<vector @ #x~X>~%" (-> obj prt-color))
  (format #t "~Tamb-color: #<vector @ #x~X>~%" (-> obj amb-color))
  (format #t "~Tshadow: #<vector @ #x~X>~%" (-> obj shadow))
  obj
  )

;; definition of type mood-lights-table
(deftype mood-lights-table (structure)
  ((data mood-lights 8 :inline :offset-assert   0)
   )
  :method-count-assert 9
  :size-assert         #x280
  :flag-assert         #x900000280
  )

;; definition for method 3 of type mood-lights-table
(defmethod inspect mood-lights-table ((obj mood-lights-table))
  (format #t "[~8x] ~A~%" obj 'mood-lights-table)
  (format #t "~Tdata[8] @ #x~X~%" (-> obj data))
  obj
  )

;; definition of type mood-sun
(deftype mood-sun (structure)
  ((sun-color vector :inline :offset-assert   0)
   (env-color vector :inline :offset-assert  16)
   )
  :method-count-assert 9
  :size-assert         #x20
  :flag-assert         #x900000020
  )

;; definition for method 3 of type mood-sun
(defmethod inspect mood-sun ((obj mood-sun))
  (format #t "[~8x] ~A~%" obj 'mood-sun)
  (format #t "~Tsun-color: #<vector @ #x~X>~%" (-> obj sun-color))
  (format #t "~Tenv-color: #<vector @ #x~X>~%" (-> obj env-color))
  obj
  )

;; definition of type mood-sun-table
(deftype mood-sun-table (structure)
  ((data mood-sun 8 :inline :offset-assert   0)
   )
  :method-count-assert 9
  :size-assert         #x100
  :flag-assert         #x900000100
  )

;; definition for method 3 of type mood-sun-table
(defmethod inspect mood-sun-table ((obj mood-sun-table))
  (format #t "[~8x] ~A~%" obj 'mood-sun-table)
  (format #t "~Tdata[8] @ #x~X~%" (-> obj data))
  obj
  )

;; definition of type mood-context
(deftype mood-context (basic)
  ((mood-fog-table       mood-fog-table              :offset-assert   4)
   (mood-lights-table    mood-lights-table           :offset-assert   8)
   (mood-sun-table       mood-sun-table              :offset-assert  12)
   (fog-interp           sky-color-day               :offset-assert  16)
   (palette-interp       sky-color-day               :offset-assert  20)
   (sky-texture-interp   sky-color-day               :offset-assert  24)
   (current-fog          mood-fog          :inline   :offset-assert  32)
   (current-sun          mood-sun          :inline   :offset-assert  80)
   (current-prt-color    vector            :inline   :offset-assert 112)
   (current-shadow       vector            :inline   :offset-assert 128)
   (current-shadow-color vector            :inline   :offset-assert 144)
   (light-group          light-group       8 :inline :offset-assert 160)
   (times                vector            8 :inline :offset-assert 1696)
   (sky-times            float             8         :offset-assert 1824)
   (itimes               vector4w          4 :inline :offset-assert 1856)
   (state                uint8             16        :offset-assert 1920)
   (num-stars            float                       :offset-assert 1936)
   (some-byte            uint8                       :offset        1939)
   )
  :method-count-assert 9
  :size-assert         #x794
  :flag-assert         #x900000794
  (:methods
    (new (symbol type) _type_ 0)
    )
  )

;; definition for method 3 of type mood-context
(defmethod inspect mood-context ((obj mood-context))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tmood-fog-table: #<mood-fog-table @ #x~X>~%" (-> obj mood-fog-table))
  (format #t "~Tmood-lights-table: #<mood-lights-table @ #x~X>~%" (-> obj mood-lights-table))
  (format #t "~Tmood-sun-table: #<mood-sun-table @ #x~X>~%" (-> obj mood-sun-table))
  (format #t "~Tfog-interp: #<sky-color-day @ #x~X>~%" (-> obj fog-interp))
  (format #t "~Tpalette-interp: #<sky-color-day @ #x~X>~%" (-> obj palette-interp))
  (format #t "~Tsky-texture-interp: #<sky-color-day @ #x~X>~%" (-> obj sky-texture-interp))
  (format #t "~Tcurrent-fog: #<mood-fog @ #x~X>~%" (-> obj current-fog))
  (format #t "~Tcurrent-sun: #<mood-sun @ #x~X>~%" (-> obj current-sun))
  (format #t "~Tcurrent-prt-color: #<vector @ #x~X>~%" (-> obj current-prt-color))
  (format #t "~Tcurrent-shadow: #<vector @ #x~X>~%" (-> obj current-shadow))
  (format #t "~Tcurrent-shadow-color: #<vector @ #x~X>~%" (-> obj current-shadow-color))
  (format #t "~Tlight-group[8] @ #x~X~%" (-> obj light-group))
  (format #t "~Ttimes[8] @ #x~X~%" (-> obj times))
  (format #t "~Tsky-times[8] @ #x~X~%" (-> obj sky-times))
  (format #t "~Titimes[4] @ #x~X~%" (-> obj itimes))
  (format #t "~Tstate[16] @ #x~X~%" (-> obj state))
  (format #t "~Tnum-stars: ~f~%" (-> obj num-stars))
  obj
  )

;; definition for method 0 of type mood-context
(defmethod new mood-context ((allocation symbol) (type-to-make type))
  (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
    (set-vector! (-> v0-0 times 0) 1.0 1.0 1.0 0.0)
    (set-vector! (-> v0-0 times 1) 1.0 1.0 1.0 0.0)
    (set-vector! (-> v0-0 times 2) 1.0 1.0 1.0 0.0)
    (set-vector! (-> v0-0 times 3) 1.0 1.0 1.0 0.0)
    (set-vector! (-> v0-0 times 4) 1.0 1.0 1.0 0.0)
    (set-vector! (-> v0-0 times 5) 1.0 1.0 1.0 0.0)
    (set-vector! (-> v0-0 times 6) 1.0 1.0 1.0 0.0)
    (set-vector! (-> v0-0 times 7) 1.0 1.0 1.0 0.0)
    v0-0
    )
  )

;; failed to figure out what this is:
0
