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

;; definition of type hud-icon
(deftype hud-icon (basic)
  ((icon    (pointer manipy)  :offset-assert   4)
   (icon-y  int32             :offset-assert   8)
   (icon-x  int32             :offset-assert  12)
   (icon-z  int32             :offset-assert  16)
   (scale-x float             :offset-assert  20)
   (scale-y float             :offset-assert  24)
   )
  :method-count-assert 9
  :size-assert         #x1c
  :flag-assert         #x90000001c
  )

;; definition for method 3 of type hud-icon
(defmethod inspect hud-icon ((obj hud-icon))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Ticon: #x~X~%" (-> obj icon))
  (format #t "~Ticon-y: ~D~%" (-> obj icon-y))
  (format #t "~Ticon-x: ~D~%" (-> obj icon-x))
  (format #t "~Ticon-z: ~D~%" (-> obj icon-z))
  (format #t "~Tscale-x: ~f~%" (-> obj scale-x))
  (format #t "~Tscale-y: ~f~%" (-> obj scale-y))
  obj
  )

;; definition of type hud-particle
(deftype hud-particle (basic)
  ((part     sparticle-launch-control         :offset-assert   4)
   (init-pos vector                   :inline :offset-assert  16)
   (pos      vector                   :inline :offset-assert  32)
   (prev-pos vector                   :inline :offset-assert  48)
   )
  :method-count-assert 9
  :size-assert         #x40
  :flag-assert         #x900000040
  )

;; definition for method 3 of type hud-particle
(defmethod inspect hud-particle ((obj hud-particle))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tpart: ~A~%" (-> obj part))
  (format #t "~Tinit-pos: #<vector @ #x~X>~%" (-> obj init-pos))
  (format #t "~Tpos: #<vector @ #x~X>~%" (-> obj pos))
  (format #t "~Tprev-pos: #<vector @ #x~X>~%" (-> obj prev-pos))
  obj
  )

;; definition of type hud
(deftype hud (process)
  ((value                  int32          :offset-assert 112)
   (value2                 int32          :offset-assert 116)
   (target-value           int32          :offset-assert 120)
   (last-increment-time    time-frame     :offset-assert 128)
   (last-target-equal-time time-frame     :offset-assert 136)
   (offset                 int32          :offset-assert 144)
   (y-offset               int32          :offset-assert 148)
   (next-y-offset          int32          :offset-assert 152)
   (x-sgn                  int32          :offset-assert 156)
   (y-sgn                  int32          :offset-assert 160)
   (text-x                 int32          :offset-assert 164)
   (text-y                 int32          :offset-assert 168)
   (friend                 int32          :offset-assert 172)
   (first-init             symbol         :offset-assert 176)
   (increment-on-event     symbol         :offset-assert 180)
   (skip-particle          int32          :offset-assert 184)
   (disable                symbol         :offset-assert 188)
   (force-on-screen        symbol         :offset-assert 192)
   (deactivate-when-hidden symbol         :offset-assert 196)
   (trigger-time           time-frame     :offset-assert 200)
   (last-hide-time         time-frame     :offset-assert 208)
   (nb-of-icons            int32          :offset-assert 216)
   (icons                  hud-icon     6 :offset-assert 220)
   (max-nb-of-particles    int32          :offset-assert 244)
   (nb-of-particles        int32          :offset-assert 248)
   (particles              hud-particle 7 :offset-assert 252)
   )
  :heap-base #xb0
  :method-count-assert 27
  :size-assert         #x118
  :flag-assert         #x1b00b00118
  (:methods
    (hidden? (_type_) symbol 14)
    (draw-hud (_type_) none 15)
    (tally-value (_type_ int int) none 16)
    (draw-icons (_type_) none 17)
    (draw-particles (_type_) none 18)
    (hud-update (_type_) none 19)
    (init-particles! (_type_ int) none 20)
    (get-icon-pos-x (_type_) int 21)
    (get-icon-pos-y (_type_) int 22)
    (dummy-23 (_type_) none 23)
    (set-pos-and-scale (_type_ symbol symbol) none 24)
    (get-icon-scale-x (_type_) float 25)
    (get-icon-scale-y (_type_) float 26)
    )
  (:states
    hud-arriving
    hud-hidden
    hud-in
    (hud-leaving int)
    )
  )

;; definition for method 3 of type hud
(defmethod inspect hud ((obj hud))
  (let ((t9-0 (method-of-type process inspect)))
    (t9-0 obj)
    )
  (format #t "~T~Tvalue: ~D~%" (-> obj value))
  (format #t "~T~Tvalue2: ~D~%" (-> obj value2))
  (format #t "~T~Ttarget-value: ~D~%" (-> obj target-value))
  (format #t "~T~Tlast-increment-time: ~D~%" (-> obj last-increment-time))
  (format #t "~T~Tlast-target-equal-time: ~D~%" (-> obj last-target-equal-time))
  (format #t "~T~Toffset: ~D~%" (-> obj offset))
  (format #t "~T~Ty-offset: ~D~%" (-> obj y-offset))
  (format #t "~T~Tnext-y-offset: ~D~%" (-> obj next-y-offset))
  (format #t "~T~Tx-sgn: ~D~%" (-> obj x-sgn))
  (format #t "~T~Ty-sgn: ~D~%" (-> obj y-sgn))
  (format #t "~T~Ttext-x: ~D~%" (-> obj text-x))
  (format #t "~T~Ttext-y: ~D~%" (-> obj text-y))
  (format #t "~T~Tfriend: ~D~%" (-> obj friend))
  (format #t "~T~Tfirst-init: ~A~%" (-> obj first-init))
  (format #t "~T~Tincrement-on-event: ~A~%" (-> obj increment-on-event))
  (format #t "~T~Tskip-particle: ~D~%" (-> obj skip-particle))
  (format #t "~T~Tdisable: ~A~%" (-> obj disable))
  (format #t "~T~Tforce-on-screen: ~A~%" (-> obj force-on-screen))
  (format #t "~T~Tdeactivate-when-hidden: ~A~%" (-> obj deactivate-when-hidden))
  (format #t "~T~Ttrigger-time: ~D~%" (-> obj trigger-time))
  (format #t "~T~Tlast-hide-time: ~D~%" (-> obj last-hide-time))
  (format #t "~T~Tnb-of-icons: ~D~%" (-> obj nb-of-icons))
  (format #t "~T~Ticons[6] @ #x~X~%" (-> obj icons))
  (format #t "~T~Tmax-nb-of-particles: ~D~%" (-> obj max-nb-of-particles))
  (format #t "~T~Tnb-of-particles: ~D~%" (-> obj nb-of-particles))
  (format #t "~T~Tparticles[7] @ #x~X~%" (-> obj particles))
  obj
  )

;; definition of type hud-parts
(deftype hud-parts (structure)
  ((pickups    (pointer hud-pickups)      :offset-assert   0)
   (money      (pointer hud-money)        :offset-assert   4)
   (fuel-cell  (pointer hud-fuel-cell)    :offset-assert   8)
   (health     (pointer hud-health)       :offset-assert  12)
   (buzzers    (pointer hud-buzzers)      :offset-assert  16)
   (power      (pointer hud-power)        :offset-assert  20)
   (bike-speed (pointer hud-bike-speed)   :offset-assert  24)
   (bike-heat  (pointer hud-bike-heat)    :offset-assert  28)
   (money-all  (pointer hud-money-all)    :offset-assert  32)
   (parts      (pointer hud)            9 :offset          0)
   )
  :method-count-assert 9
  :size-assert         #x24
  :flag-assert         #x900000024
  )

;; definition for method 3 of type hud-parts
(defmethod inspect hud-parts ((obj hud-parts))
  (format #t "[~8x] ~A~%" obj 'hud-parts)
  (format #t "~Tdata[9] @ #x~X~%" (&-> obj pickups))
  (format #t "~Tpickups: #x~X~%" (-> obj pickups))
  (format #t "~Tmoney: #x~X~%" (-> obj money))
  (format #t "~Tfuel-cell: #x~X~%" (-> obj fuel-cell))
  (format #t "~Thealth: #x~X~%" (-> obj health))
  (format #t "~Tbuzzers: #x~X~%" (-> obj buzzers))
  (format #t "~Tpower: #x~X~%" (-> obj power))
  (format #t "~Tbike-speed: #x~X~%" (-> obj bike-speed))
  (format #t "~Tbike-heat: #x~X~%" (-> obj bike-heat))
  (format #t "~Tmoney-all: #x~X~%" (-> obj money-all))
  obj
  )

;; definition for symbol *hud-parts*, type hud-parts
(define *hud-parts* (new 'static 'hud-parts
                      :pickups #f
                      :money #f
                      :fuel-cell #f
                      :health #f
                      :buzzers #f
                      :power #f
                      :bike-speed #f
                      :bike-heat #f
                      :money-all #f
                      )
        )

;; failed to figure out what this is:
0
