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

;; definition of type subdivide-settings
(deftype subdivide-settings (basic)
  ((dist   float 5 :offset-assert   4)
   (meters float 5 :offset-assert  24)
   (close  float 4 :offset-assert  44)
   (far    float 4 :offset-assert  60)
   )
  :method-count-assert 9
  :size-assert         #x4c
  :flag-assert         #x90000004c
  (:methods
    (new (symbol type meters meters) _type_ 0)
    )
  )

;; definition for method 3 of type subdivide-settings
(defmethod inspect subdivide-settings ((obj subdivide-settings))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tdist[5] @ #x~X~%" (-> obj dist))
  (format #t "~Tmeters[5] @ #x~X~%" (-> obj meters))
  (format #t "~Tclose[4] @ #x~X~%" (-> obj close))
  (format #t "~Tfar[4] @ #x~X~%" (-> obj far))
  obj
  )

;; definition for method 0 of type subdivide-settings
(defmethod new subdivide-settings ((allocation symbol) (type-to-make type) (arg0 meters) (arg1 meters))
  (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
    (dotimes (v1-2 3)
      (set! (-> v0-0 close v1-2) arg0)
      (set! (-> v0-0 far v1-2) arg1)
      )
    v0-0
    )
  )

;; definition of type subdivide-dists
(deftype subdivide-dists (structure)
  ((data   uint32  32        :offset   0)
   (vector vector  8 :inline :offset   0)
   (k0s    uint128 4         :offset   0)
   (k1s    uint128 4         :offset  64)
   )
  :method-count-assert 9
  :size-assert         #x80
  :flag-assert         #x900000080
  )

;; definition for method 3 of type subdivide-dists
(defmethod inspect subdivide-dists ((obj subdivide-dists))
  (format #t "[~8x] ~A~%" obj 'subdivide-dists)
  (format #t "~Tdata[32] @ #x~X~%" (-> obj data))
  (format #t "~Tvector[8] @ #x~X~%" (-> obj data))
  (format #t "~Tk0s[4] @ #x~X~%" (-> obj data))
  (format #t "~Tk1s[4] @ #x~X~%" (-> obj k1s))
  obj
  )

;; definition of type gs-packed-rgba
(deftype gs-packed-rgba (structure)
  ((data  int32 4 :offset-assert   0)
   (red   int32   :offset          0)
   (green int32   :offset          4)
   (blue  int32   :offset          8)
   (alpha int32   :offset         12)
   )
  :method-count-assert 9
  :size-assert         #x10
  :flag-assert         #x900000010
  )

;; definition for method 3 of type gs-packed-rgba
(defmethod inspect gs-packed-rgba ((obj gs-packed-rgba))
  (format #t "[~8x] ~A~%" obj 'gs-packed-rgba)
  (format #t "~Tdata[4] @ #x~X~%" (-> obj data))
  (format #t "~Tred: ~D~%" (-> obj red))
  (format #t "~Tgreen: ~D~%" (-> obj green))
  (format #t "~Tblue: ~D~%" (-> obj blue))
  (format #t "~Talpha: ~D~%" (-> obj alpha))
  obj
  )

;; definition of type gs-packed-xyzw
(deftype gs-packed-xyzw (structure)
  ((data int32   4 :offset-assert   0)
   (x    int32     :offset          0)
   (y    int32     :offset          4)
   (z    int32     :offset          8)
   (w    int32     :offset         12)
   (quad uint128   :offset          0)
   )
  :method-count-assert 9
  :size-assert         #x10
  :flag-assert         #x900000010
  )

;; definition for method 3 of type gs-packed-xyzw
;; Used lq/sq
(defmethod inspect gs-packed-xyzw ((obj gs-packed-xyzw))
  (format #t "[~8x] ~A~%" obj 'gs-packed-xyzw)
  (format #t "~Tdata[4] @ #x~X~%" (-> obj data))
  (format #t "~Tx: ~D~%" (-> obj x))
  (format #t "~Ty: ~D~%" (-> obj y))
  (format #t "~Tz: ~D~%" (-> obj z))
  (format #t "~Tw: ~D~%" (-> obj w))
  (format #t "~Tquad: ~D~%" (-> obj quad))
  obj
  )

;; definition of type gs-packed-stq
(deftype gs-packed-stq (structure)
  ((data  float   4 :offset-assert   0)
   (tex-s float     :offset          0)
   (tex-t float     :offset          4)
   (tex-q float     :offset          8)
   (quad  uint128   :offset          0)
   )
  :method-count-assert 9
  :size-assert         #x10
  :flag-assert         #x900000010
  )

;; definition for method 3 of type gs-packed-stq
;; Used lq/sq
(defmethod inspect gs-packed-stq ((obj gs-packed-stq))
  (format #t "[~8x] ~A~%" obj 'gs-packed-stq)
  (format #t "~Tdata[4] @ #x~X~%" (-> obj data))
  (format #t "~Ttex-s: ~f~%" (-> obj tex-s))
  (format #t "~Ttex-t: ~f~%" (-> obj tex-t))
  (format #t "~Ttex-q: ~f~%" (-> obj tex-q))
  (format #t "~Tquad: ~D~%" (-> obj quad))
  obj
  )

;; definition of type gs-packed-gt
(deftype gs-packed-gt (structure)
  ((stq  gs-packed-stq  :inline :offset-assert   0)
   (rgba gs-packed-rgba :inline :offset-assert  16)
   (xyzw gs-packed-xyzw :inline :offset-assert  32)
   )
  :method-count-assert 9
  :size-assert         #x30
  :flag-assert         #x900000030
  )

;; definition for method 3 of type gs-packed-gt
(defmethod inspect gs-packed-gt ((obj gs-packed-gt))
  (format #t "[~8x] ~A~%" obj 'gs-packed-gt)
  (format #t "~Tstq: #<gs-packed-stq @ #x~X>~%" (-> obj stq))
  (format #t "~Trgba: #<gs-packed-rgba @ #x~X>~%" (-> obj rgba))
  (format #t "~Txyzw: #<gs-packed-xyzw @ #x~X>~%" (-> obj xyzw))
  obj
  )

;; definition of type gs-packed-gt4
(deftype gs-packed-gt4 (structure)
  ((data gs-packed-gt 4 :inline :offset-assert   0)
   )
  :method-count-assert 9
  :size-assert         #xc0
  :flag-assert         #x9000000c0
  )

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

;; definition of type terrain-bsp
(deftype terrain-bsp (structure)
  ((lev-index int32  :offset-assert   0)
   (mood      basic  :offset-assert   4)
   )
  :method-count-assert 9
  :size-assert         #x8
  :flag-assert         #x900000008
  )

;; definition for method 3 of type terrain-bsp
(defmethod inspect terrain-bsp ((obj terrain-bsp))
  (format #t "[~8x] ~A~%" obj 'terrain-bsp)
  (format #t "~Tlev-index: ~D~%" (-> obj lev-index))
  (format #t "~Tmood: ~A~%" (-> obj mood))
  obj
  )

;; definition of type terrain-stats
(deftype terrain-stats (structure)
  ((pris             tr-stat :inline :offset-assert   0)
   (tie-generic      tr-stat :inline :offset-assert  16)
   (tie              tr-stat :inline :offset-assert  32)
   (tie-near         tr-stat :inline :offset-assert  48)
   (shrub-near       tr-stat :inline :offset-assert  64)
   (shrub            tr-stat :inline :offset-assert  80)
   (tfrag-near       tr-stat :inline :offset-assert  96)
   (tfrag            tr-stat :inline :offset-assert 112)
   (billboard        tr-stat :inline :offset-assert 128)
   (trans-tfrag      tr-stat :inline :offset-assert 144)
   (trans-tfrag-near tr-stat :inline :offset-assert 160)
   (trans-pris       tr-stat :inline :offset-assert 176)
   (trans-shrub      tr-stat :inline :offset-assert 192)
   (ocean-mid        tr-stat :inline :offset-assert 208)
   (ocean-near       tr-stat :inline :offset-assert 224)
   (total            tr-stat :inline :offset-assert 240)
   )
  :method-count-assert 9
  :size-assert         #x100
  :flag-assert         #x900000100
  )

;; definition for method 3 of type terrain-stats
(defmethod inspect terrain-stats ((obj terrain-stats))
  (format #t "[~8x] ~A~%" obj 'terrain-stats)
  (format #t "~Tpris: #<tr-stat @ #x~X>~%" (-> obj pris))
  (format #t "~Ttie-generic: #<tr-stat @ #x~X>~%" (-> obj tie-generic))
  (format #t "~Ttie: #<tr-stat @ #x~X>~%" (-> obj tie))
  (format #t "~Ttie-near: #<tr-stat @ #x~X>~%" (-> obj tie-near))
  (format #t "~Tshrub-near: #<tr-stat @ #x~X>~%" (-> obj shrub-near))
  (format #t "~Tshrub: #<tr-stat @ #x~X>~%" (-> obj shrub))
  (format #t "~Ttfrag-near: #<tr-stat @ #x~X>~%" (-> obj tfrag-near))
  (format #t "~Ttfrag: #<tr-stat @ #x~X>~%" (-> obj tfrag))
  (format #t "~Tbillboard: #<tr-stat @ #x~X>~%" (-> obj billboard))
  (format #t "~Ttrans-tfrag: #<tr-stat @ #x~X>~%" (-> obj trans-tfrag))
  (format #t "~Ttrans-tfrag-near: #<tr-stat @ #x~X>~%" (-> obj trans-tfrag-near))
  (format #t "~Ttrans-pris: #<tr-stat @ #x~X>~%" (-> obj trans-pris))
  (format #t "~Ttrans-shrub: #<tr-stat @ #x~X>~%" (-> obj trans-shrub))
  (format #t "~Tocean-mid: #<tr-stat @ #x~X>~%" (-> obj ocean-mid))
  (format #t "~Tocean-near: #<tr-stat @ #x~X>~%" (-> obj ocean-near))
  (format #t "~Ttotal: #<tr-stat @ #x~X>~%" (-> obj total))
  obj
  )

;; definition of type dma-area
(deftype dma-area (structure)
  ((draw-node-dma      draw-node-dma      :inline   :offset   0)
   (tfrag-dma          tfrag-dma          :inline   :offset   0)
   (instance-shrub-dma instance-shrub-dma :inline   :offset   0)
   (instance-tie-dma   instance-tie-dma   :inline   :offset   0)
   (prototype-tie-dma  prototype-tie-dma  :inline   :offset   0)
   (time-of-day-dma    time-of-day-dma    :inline   :offset   0)
   (decomp-work        decomp-work        :inline   :offset   0)
   (ocean-vertex       ocean-vertex       4 :inline :offset   0)
   )
  :method-count-assert 9
  :size-assert         #x38a0
  :flag-assert         #x9000038a0
  )

;; definition for method 3 of type dma-area
(defmethod inspect dma-area ((obj dma-area))
  (format #t "[~8x] ~A~%" obj 'dma-area)
  (format #t "~Tdraw-node-dma: #<draw-node-dma @ #x~X>~%" (-> obj draw-node-dma))
  (format #t "~Ttfrag-dma: #<tfrag-dma @ #x~X>~%" (-> obj draw-node-dma))
  (format #t "~Tinstance-shrub-dma: #<instance-shrub-dma @ #x~X>~%" (-> obj draw-node-dma))
  (format #t "~Tinstance-tie-dma: #<instance-tie-dma @ #x~X>~%" (-> obj draw-node-dma))
  (format #t "~Tprototype-tie-dma: #<prototype-tie-dma @ #x~X>~%" (-> obj draw-node-dma))
  (format #t "~Ttime-of-day-dma: #<time-of-day-dma @ #x~X>~%" (-> obj draw-node-dma))
  (format #t "~Tdecomp-work: #<decomp-work @ #x~X>~%" (-> obj draw-node-dma))
  (format #t "~Tocean-vertex[4] @ #x~X~%" (-> obj draw-node-dma))
  obj
  )

;; definition of type background-area
(deftype background-area (structure)
  ((dma-area dma-area :inline :offset-assert   0)
   (vis-list uint8    2048    :offset-assert 14496)
   )
  :method-count-assert 9
  :size-assert         #x40a0
  :flag-assert         #x9000040a0
  )

;; definition for method 3 of type background-area
(defmethod inspect background-area ((obj background-area))
  (format #t "[~8x] ~A~%" obj 'background-area)
  (format #t "~Tdma-area: #<dma-area @ #x~X>~%" (-> obj dma-area))
  (format #t "~Tvis-list[2048] @ #x~X~%" (-> obj vis-list))
  obj
  )

;; definition of type foreground-area
(deftype foreground-area (structure)
  ((joint-work   joint-work   :inline :offset-assert   0)
   (generic-work generic-work :inline :offset          0)
   (bone-mem     bone-memory  :inline :offset          0)
   (shadow-work  shadow-work  :inline :offset          0)
   )
  :method-count-assert 9
  :size-assert         #x3fd0
  :flag-assert         #x900003fd0
  )

;; definition for method 3 of type foreground-area
(defmethod inspect foreground-area ((obj foreground-area))
  (format #t "[~8x] ~A~%" obj 'foreground-area)
  (format #t "~Tjoint-work: #<joint-work @ #x~X>~%" (-> obj joint-work))
  (format #t "~Tgeneric-work: #<generic-work @ #x~X>~%" (-> obj joint-work))
  (format #t "~Tbone-mem: #<bone-memory @ #x~X>~%" (-> obj joint-work))
  (format #t "~Tshadow-work: #<shadow-work @ #x~X>~%" (-> obj joint-work))
  obj
  )

;; definition of type ambient-area
(deftype ambient-area (structure)
  ((ambient-list ambient-list :inline :offset-assert   0)
   )
  :method-count-assert 9
  :size-assert         #x2004
  :flag-assert         #x900002004
  )

;; definition for method 3 of type ambient-area
(defmethod inspect ambient-area ((obj ambient-area))
  (format #t "[~8x] ~A~%" obj 'ambient-area)
  (format #t "~Tambient-list: #<ambient-list @ #x~X>~%" (-> obj ambient-list))
  obj
  )

;; definition of type work-area
(deftype work-area (structure)
  ((background background-area :inline :offset-assert   0)
   (foreground foreground-area :inline :offset          0)
   (ambient    ambient-area    :inline :offset          0)
   )
  :method-count-assert 9
  :size-assert         #x40a0
  :flag-assert         #x9000040a0
  )

;; definition for method 3 of type work-area
(defmethod inspect work-area ((obj work-area))
  (format #t "[~8x] ~A~%" obj 'work-area)
  (format #t "~Tbackground: #<background-area @ #x~X>~%" (-> obj background))
  (format #t "~Tforeground: #<foreground-area @ #x~X>~%" (-> obj background))
  (format #t "~Tambient: #<ambient-area @ #x~X>~%" (-> obj background))
  obj
  )

;; definition of type terrain-context
(deftype terrain-context (structure)
  ((bsp  terrain-bsp :inline :offset-assert   0)
   (work work-area   :inline :offset-assert  16)
   )
  :method-count-assert 9
  :size-assert         #x40b0
  :flag-assert         #x9000040b0
  )

;; definition for method 3 of type terrain-context
(defmethod inspect terrain-context ((obj terrain-context))
  (format #t "[~8x] ~A~%" obj 'terrain-context)
  (format #t "~Tbsp: #<terrain-bsp @ #x~X>~%" (-> obj bsp))
  (format #t "~Twork: #<work-area @ #x~X>~%" (-> obj work))
  obj
  )

;; definition for symbol *terrain-stats*, type terrain-stats
(define *terrain-stats* (new 'global 'terrain-stats))

;; definition for symbol *collide-stats*, type collide-stats
(define *collide-stats* (new 'global 'collide-stats))

;; failed to figure out what this is:
0
