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

;; name: prototype.gc
;; name in dgo: prototype
;; dgos: GAME

;; DECOMP BEGINS

(defmethod login ((this prototype-inline-array-shrub))
  "Initialize the object after it is loaded."
  (let ((s5-0 (-> *level* level *level-index* bsp)))
    (dotimes (s4-0 (-> this length))
      (let ((s3-0 (-> this data s4-0)))
        (when (and *debug-segment* (-> *screen-shot-work* highres-enable))
          (dotimes (v1-9 4)
            (+! (-> s3-0 dists data v1-9) 40960000.0)
            (set! (-> s3-0 rdists data v1-9) (/ 1.0 (-> s3-0 dists data v1-9)))
            )
          )
        (set! *texture-masks* (-> s5-0 shrub-masks data (-> s3-0 texture-masks-index)))
        (dotimes (s2-0 4)
          (let ((a0-15 (-> s3-0 geometry s2-0)))
            (if (nonzero? a0-15)
                (login a0-15)
                )
            )
          )
        )
      )
    )
  this
  )

(defmethod mem-usage ((this prototype-array-tie) (usage memory-usage-block) (flags int))
  (set! (-> usage length) (max 1 (-> usage length)))
  (set! (-> usage data 0 name) "drawable-group")
  (+! (-> usage data 0 count) 1)
  (let ((v1-6 (asize-of this)))
    (+! (-> usage data 0 used) v1-6)
    (+! (-> usage data 0 total) (logand -16 (+ v1-6 15)))
    )
  (dotimes (s3-0 (-> this length))
    (mem-usage (-> this array-data s3-0) usage flags)
    )
  this
  )

(defmethod mem-usage ((this prototype-bucket-tie) (usage memory-usage-block) (flags int))
  (dotimes (s3-0 4)
    (let ((a0-1 (-> this tie-geom s3-0)))
      (if (nonzero? a0-1)
          (mem-usage a0-1 usage (logior flags 1))
          )
      )
    )
  (set! (-> usage length) (max 85 (-> usage length)))
  (set! (-> usage data 84 name) "string")
  (+! (-> usage data 84 count) 1)
  (let ((v1-13 (asize-of (-> this name))))
    (+! (-> usage data 84 used) v1-13)
    (+! (-> usage data 84 total) (logand -16 (+ v1-13 15)))
    )
  (when (nonzero? (-> this tie-colors))
    (set! (-> usage length) (max 17 (-> usage length)))
    (set! (-> usage data 16 name) "tie-pal")
    (+! (-> usage data 16 count) 1)
    (let ((v1-25 (asize-of (-> this tie-colors))))
      (+! (-> usage data 16 used) v1-25)
      (+! (-> usage data 16 total) (logand -16 (+ v1-25 15)))
      )
    )
  (if (nonzero? (-> this collide-hash-fragment-array))
      (mem-usage (-> this collide-hash-fragment-array) usage (logior flags 1))
      )
  this
  )

(defmethod mem-usage ((this prototype-inline-array-shrub) (usage memory-usage-block) (flags int))
  (set! (-> usage length) (max 1 (-> usage length)))
  (set! (-> usage data 0 name) "drawable-group")
  (+! (-> usage data 0 count) 1)
  (let ((v1-6 (asize-of this)))
    (+! (-> usage data 0 used) v1-6)
    (+! (-> usage data 0 total) (logand -16 (+ v1-6 15)))
    )
  (dotimes (s3-0 (-> this length))
    (mem-usage (-> this data s3-0) usage flags)
    )
  this
  )

(defmethod mem-usage ((this prototype-bucket-shrub) (usage memory-usage-block) (flags int))
  (set! (-> usage length) (max 25 (-> usage length)))
  (set! (-> usage data 24 name) "prototype-bucket-shrub")
  (+! (-> usage data 24 count) 1)
  (let ((v1-5 112))
    (+! (-> usage data 24 used) v1-5)
    (+! (-> usage data 24 total) (logand -16 (+ v1-5 15)))
    )
  (dotimes (s3-0 4)
    (let ((a0-5 (-> this geometry s3-0)))
      (if (nonzero? a0-5)
          (mem-usage a0-5 usage (logior flags 1))
          )
      )
    )
  (set! (-> usage length) (max 85 (-> usage length)))
  (set! (-> usage data 84 name) "string")
  (+! (-> usage data 84 count) 1)
  (let ((v1-22 (asize-of (-> this name))))
    (+! (-> usage data 84 used) v1-22)
    (+! (-> usage data 84 total) (logand -16 (+ v1-22 15)))
    )
  this
  )
