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

;; name: fordumpa-texture.gc
;; name in dgo: fordumpa-texture
;; dgos: FORDUMPC, FDA

;; DECOMP BEGINS

(define *fortress-pris-texture-anim-array*
  (the-as (texture-anim-array texture-anim)
    (new 'static 'texture-anim-array :type texture-anim
      (new 'static 'texture-anim
        :num-layers #x1
        :func #f
        :init-func #f
        :tex #f
        :tex-name "robotank-tread-l-dest"
        :color (new 'static 'rgba :a #x80)
        :frame-mod 1.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)
        :data (new 'static 'array texture-anim-layer 2
          (new 'static 'texture-anim-layer
            :func-id 'default-texture-anim-layer-func
            :init-func #f
            :tex #f
            :end-time 1.0
            :tex-name "robotank-tread"
            :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always))
            :alpha (new 'static 'gs-alpha :b #x1 :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.0))
            :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 1.0))
            :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
            )
          )
        )
      (new 'static 'texture-anim
        :num-layers #x1
        :func #f
        :init-func #f
        :tex #f
        :tex-name "robotank-tread-r-dest"
        :color (new 'static 'rgba :a #x80)
        :frame-mod 1.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)
        :data (new 'static 'array texture-anim-layer 2
          (new 'static 'texture-anim-layer
            :func-id 'default-texture-anim-layer-func
            :init-func #f
            :tex #f
            :end-time 1.0
            :tex-name "robotank-tread"
            :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always))
            :alpha (new 'static 'gs-alpha :b #x1 :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.0))
            :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 1.0))
            :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
            )
          )
        )
      )
    )
  )

(define *fortress-warp-texture-anim-array*
  (the-as (texture-anim-array texture-anim)
    (new 'static 'texture-anim-array :type texture-anim
      (new 'static 'texture-anim
        :num-layers #x1
        :func #f
        :init-func #f
        :tex #f
        :tex-name "fort-roboscreen-dest"
        :color (new 'static 'rgba :a #x80)
        :frame-delta 300.0
        :frame-mod 300.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)
        :data (new 'static 'array texture-anim-layer 2
          (new 'static 'texture-anim-layer
            :func-id 'default-texture-anim-layer-func
            :init-func #f
            :tex #f
            :end-time 300.0
            :tex-name "fort-roboscreen-env"
            :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)
            )
          )
        )
      )
    )
  )

(defun set-roboscreen-alpha! ((arg0 float))
  (set! (-> *blit-displays-work* line-color)
        (logior (logand (-> *blit-displays-work* line-color) (the-as uint #xffffffff00ffffff))
                (shr (shl (the int (* 16.0 arg0)) 56) 32)
                )
        )
  (let ((v1-5 (the int (* 128.0 arg0))))
    (dotimes (a1-6 15)
      (set! (-> *blit-displays-work* scan-colors a1-6 w) v1-5)
      )
    )
  (let ((v1-9 (-> *fortress-warp-texture-anim-array* array-data 0)))
    (dotimes (a1-7 (the-as int (-> v1-9 num-layers)))
      (set! (-> v1-9 data a1-7 start-color w) arg0)
      (set! (-> v1-9 data a1-7 end-color w) arg0)
      )
    )
  (let ((a1-8 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0))
        (a2-9 (new 'static 'vector :x 0.666 :y 1.25 :z 0.666 :w 1.0))
        (v1-13 (-> *time-of-day-context* filter-color))
        )
    (vector4-lerp! v1-13 a1-8 a2-9 arg0)
    )
  0
  (none)
  )
