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

;; name: ltnfxhip-texture.gc
;; name in dgo: ltnfxhip-texture
;; dgos: HHG

;; DECOMP BEGINS

(define *ltnfxhip-texture-anim-array*
  (the-as (texture-anim-array texture-anim)
    (new 'static 'texture-anim-array :type texture-anim
      (new 'static 'texture-anim
        :num-layers #x5
        :func-id 'ltnfxhip-texture-anim-func
        :init-func #f
        :tex #f
        :tex-name "holograph-env-rim-dest"
        :color (new 'static 'rgba :a #x80)
        :frame-delta 300.0
        :frame-mod 1200.0
        :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))
        :alpha (new 'static 'gs-alpha :b #x1 :d #x1)
        :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp))
        :data (new 'static 'array texture-anim-layer 6
          (new 'static 'texture-anim-layer
            :func-id 'default-texture-anim-layer-func
            :init-func #f
            :tex #f
            :end-time 1200.0
            :tex-name "holograph-env-noise"
            :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always))
            :alpha (new 'static 'gs-alpha :b #x2 :d #x1)
            :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
            :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
            :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
            :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
            :end-st-rot (degrees 21600)
            )
          (new 'static 'texture-anim-layer
            :func-id 'default-texture-anim-layer-func
            :init-func #f
            :tex #f
            :end-time 1200.0
            :tex-name "holograph-env-scan"
            :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always))
            :alpha (new 'static 'gs-alpha :b #x2 :d #x1)
            :start-color (new 'static 'vector :x 0.25 :y 0.35 :z 0.5 :w 1.0)
            :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
            :end-color (new 'static 'vector :x 0.25 :y 0.35 :z 0.5 :w 1.0)
            :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
            )
          (new 'static 'texture-anim-layer
            :func-id 'default-texture-anim-layer-func
            :init-func #f
            :tex #f
            :end-time 1200.0
            :tex-name "holograph-env-rim"
            :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always))
            :alpha (new 'static 'gs-alpha :b #x2 :d #x1)
            :start-color (new 'static 'vector :x 0.5 :y 0.5 :z 0.5 :w 1.0)
            :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
            :end-color (new 'static 'vector :x 0.5 :y 0.5 :z 0.5 :w 1.0)
            :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
            :end-st-rot (degrees 360)
            )
          (new 'static 'texture-anim-layer
            :func-id 'default-texture-anim-layer-func
            :init-func #f
            :tex #f
            :end-time 1200.0
            :tex-name "holograph-env-rim"
            :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always))
            :alpha (new 'static 'gs-alpha :b #x2 :d #x1)
            :start-color (new 'static 'vector :x 0.5 :y 0.5 :z 0.5 :w 1.0)
            :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 -1.0 1.0))
            :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
            :end-color (new 'static 'vector :x 0.5 :y 0.5 :z 0.5 :w 1.0)
            :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 -1.0 1.0))
            :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
            :end-st-rot (degrees 360)
            )
          (new 'static 'texture-anim-layer
            :func-id 'default-texture-anim-layer-func
            :init-func #f
            :tex #f
            :end-time 1200.0
            :tex-name "environment-phong-rim"
            :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always))
            :alpha (new 'static 'gs-alpha :b #x2 :d #x1)
            :start-color (new 'static 'vector :x 0.125 :y 0.175 :z 0.25 :w 1.0)
            :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
            :end-color (new 'static 'vector :x 0.125 :y 0.175 :z 0.25 :w 1.0)
            :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0))
            :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5))
            :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
            )
          )
        )
      )
    )
  )

(defun ltnfxhip-texture-anim-func ()
  (let ((gp-0 *ltnfxhip-texture-anim-array*))
    (when (not (paused?))
      (let ((s5-0 (-> gp-0 array-data 0 data 0)))
        (cond
          ((= (-> s5-0 extra x) 0.0)
           (cond
             ((>= 0.0 (-> s5-0 extra y))
              (set! (-> s5-0 extra y) (rand-vu-float-range 150.0 300.0))
              (set! (-> s5-0 extra z) (-> s5-0 extra y))
              (set! (-> s5-0 extra w) (rand-vu-float-range 0.1 0.5))
              (set! (-> s5-0 extra x) 1.0)
              )
             (else
               (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame))))
               )
             )
           )
          ((= (-> s5-0 extra x) 1.0)
           (cond
             ((>= 0.0 (-> s5-0 extra y))
              (set! (-> s5-0 extra y) (rand-vu-float-range 300.0 600.0))
              (set! (-> s5-0 extra x) 0.0)
              )
             (else
               (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z))))))))
                 (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0)
                 (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0)
                 )
               (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame))))
               )
             )
           )
          )
        )
      (let ((gp-1 (-> gp-0 array-data 0 data 1)))
        (cond
          ((= (-> gp-1 extra x) 0.0)
           (cond
             ((>= 0.0 (-> gp-1 extra y))
              (set! (-> gp-1 extra y) (rand-vu-float-range 75.0 150.0))
              (set! (-> gp-1 extra z) (-> gp-1 extra y))
              (set! (-> gp-1 extra x) 1.0)
              )
             (else
               (set! (-> gp-1 start-st-offset y) 0.0)
               (set! (-> gp-1 end-st-offset y) 0.0)
               (set! (-> gp-1 extra y) (- (-> gp-1 extra y) (* 300.0 (seconds-per-frame))))
               )
             )
           )
          ((= (-> gp-1 extra x) 1.0)
           (cond
             ((>= 0.0 (-> gp-1 extra y))
              (set! (-> gp-1 extra y) (rand-vu-float-range 300.0 600.0))
              (set! (-> gp-1 extra x) 0.0)
              )
             (else
               (let ((f0-34 (- 1.0 (/ (-> gp-1 extra y) (-> gp-1 extra z)))))
                 (set! (-> gp-1 start-st-offset y) f0-34)
                 (set! (-> gp-1 end-st-offset y) f0-34)
                 )
               (set! (-> gp-1 extra y) (- (-> gp-1 extra y) (* 300.0 (seconds-per-frame))))
               )
             )
           )
          )
        )
      )
    )
  0
  (none)
  )
