diff --git a/common/texture/texture_slots.cpp b/common/texture/texture_slots.cpp index d92d5513cf..27847a85bc 100644 --- a/common/texture/texture_slots.cpp +++ b/common/texture/texture_slots.cpp @@ -42,7 +42,9 @@ std::vector jak2_slots = { "cas-toxic-slime-scroll-dest", }; -std::vector jak3_slots = {}; +std::vector jak3_slots = { + "skull-gem-dest", "jakc-arm", "jakc-eyebrow", "jakc-face", "jakc-finger", "jakc-hair", +}; } // namespace diff --git a/decompiler/config/jak3/all-types.gc b/decompiler/config/jak3/all-types.gc index f5c8a0e8d8..815e6af79d 100644 --- a/decompiler/config/jak3/all-types.gc +++ b/decompiler/config/jak3/all-types.gc @@ -6754,7 +6754,12 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (deftype texture-anim-layer (structure) - ((extra vector :inline :offset 240) + ((interpolated-color vector :inline) ;; added + (interpolated-scale-offset vector :inline) + (interpolated-st-scale-offset vector :inline) + (interpolated-qs vector :inline) + (interpolated-rot vector :inline) + (extra vector :inline :offset 240) (func (function dma-buffer uint int int texture-anim-layer float int) :offset-assert 256) ;; guessed by decompiler (func-id symbol :offset-assert 256 :overlay-at func) ;; guessed by decompiler (init-func (function texture-anim-layer int) :offset-assert 260) ;; guessed by decompiler @@ -6766,6 +6771,8 @@ (test gs-test :offset-assert 280) ;; gs-test (alpha gs-alpha :offset-assert 288) ;; gs-alpha (clamp gs-clamp :offset-assert 296) ;; gs-clamp + (start-vectors vector 5 :inline :offset 80 :score -10) ;; added + (start-color vector :inline :offset 80) (start-scale vector2 :inline :offset 96) (start-offset vector2 :inline :offset 104) @@ -6774,6 +6781,8 @@ (start-qs vector :inline :offset 128) (start-rot degrees :offset 144) ;; degrees (start-st-rot degrees :offset 148) ;; degrees + (end-vectors vector 5 :inline :offset 160 :score -10) ;; added + (end-color vector :inline :offset 160) (end-scale vector2 :inline :offset 176) (end-offset vector2 :inline :offset 184) @@ -30975,57 +30984,57 @@ ;; texture-anim ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *texture-anim-work* object) ;; texture-anim-work -;; (define-extern texture-anim-layer-interp function) ;; (function texture-anim-layer float none) -;; (define-extern texture-anim-layer-add-shader function) ;; (function dma-buffer texture-anim-layer int none) -;; (define-extern texture-anim-layer-add-clut-shader function) ;; (function dma-buffer texture-anim-layer int none) -;; (define-extern texture-anim-layer-draw function) ;; (function dma-buffer int int texture-anim-layer none) -;; (define-extern default-texture-anim-layer-func function) ;; (function dma-buffer uint int int texture-anim-layer float int) -;; (define-extern blend-clut-texture-anim-layer-func function) ;; (function dma-buffer uint int int texture-anim-layer float int) -;; (define-extern add-clut-texture-anim-layer-func function) -;; (define-extern dest-blend-clut-texture-anim-layer-func function) -;; (define-extern move-rg-to-ba-texture-anim-layer-func function) ;; (function dma-buffer uint int int texture-anim-layer float int) -;; (define-extern fill-rgb-texture-anim-layer-func function) ;; (function dma-buffer uint int int texture-anim-layer float int) -;; (define-extern texture-anim-draw-mip-shader function) -;; (define-extern clear-texture-ids function) -;; (define-extern texture-anim-draw-mips function) +(define-extern *texture-anim-work* texture-anim-work) +(define-extern texture-anim-layer-interp (function texture-anim-layer float none)) +(define-extern texture-anim-layer-add-shader (function dma-buffer texture-anim-layer int none)) +(define-extern texture-anim-layer-add-clut-shader (function dma-buffer texture-anim-layer int none)) +(define-extern texture-anim-layer-draw (function dma-buffer int int texture-anim-layer none)) +(define-extern default-texture-anim-layer-func (function dma-buffer uint int int texture-anim-layer float int)) +(define-extern blend-clut-texture-anim-layer-func (function dma-buffer uint int int texture-anim-layer float int)) +(define-extern add-clut-texture-anim-layer-func (function dma-buffer uint int int texture-anim-layer float int)) +(define-extern dest-blend-clut-texture-anim-layer-func (function dma-buffer uint int int texture-anim-layer float int)) +(define-extern move-rg-to-ba-texture-anim-layer-func (function dma-buffer uint int int texture-anim-layer float int)) +(define-extern fill-rgb-texture-anim-layer-func (function dma-buffer uint int int texture-anim-layer float int)) +(define-extern texture-anim-draw-mip-shader (function dma-buffer texture int none)) +(define-extern clear-texture-ids (function texture none)) +(define-extern texture-anim-draw-mips (function dma-buffer texture none)) (define-extern update-texture-anim (function bucket-id texture-anim-array none)) -;; (define-extern no-alpha-texture-anim-layer-func function) ;; (function dma-buffer uint int int texture-anim-layer float int) -;; (define-extern copy-alpha-texture-anim-layer-func function) ;; (function dma-buffer uint int int texture-anim-layer float int) -;; (define-extern copy-clut-alpha-texture-anim-layer-func function) ;; (function dma-buffer uint int int texture-anim-layer float int) -;; (define-extern set-alpha-texture-anim-layer-func function) ;; (function dma-buffer uint int int texture-anim-layer float int) -;; (define-extern set-clut-alpha-texture-anim-layer-func function) ;; (function dma-buffer uint int int texture-anim-layer float int) -;; (define-extern dest-texture-init function) ;; (function texture-anim none) -;; (define-extern src-texture-init function) ;; (function texture-anim-layer none) -;; (define-extern src-texture-init-mt8 function) ;; (function texture-anim-layer none) -;; (define-extern make-noise-texture function) ;; (function pointer int int int none) -;; (define-extern make-cloud-clut function) ;; (function (pointer uint32) float float none) -;; (define-extern texture-anim-cloud-clut-upload function) ;; (function dma-buffer texture-anim none) -;; (define-extern texture-anim-cloud-clut-init function) ;; (function texture-anim none) -;; (define-extern make-slime-clut function) ;; (function (pointer uint32) none) -;; (define-extern texture-anim-slime-clut-upload function) ;; (function dma-buffer texture-anim none) -;; (define-extern texture-anim-slime-clut-init function) ;; (function texture-anim none) -;; (define-extern make-ramp-clut function) ;; (function (pointer uint32) pointer object none) -;; (define-extern make-alpha-ramp-clut function) ;; (function (pointer uint32) none) -;; (define-extern noise-texture-init function) ;; (function texture-anim-layer none) -;; (define-extern texture-anim-alpha-ramp-clut-upload function) ;; (function dma-buffer texture-anim none) -;; (define-extern texture-anim-alpha-ramp-clut-init function) ;; (function texture-anim none) -;; (define-extern texture-anim-overide-size-init function) ;; (function texture-anim none) -;; (define-extern texture-anim-change-mt8h-init function) ;; (function texture-anim none) -;; (define-extern *texture-anim-pages-table* object) -;; (define-extern *texture-anim-mip-array* object) +(define-extern no-alpha-texture-anim-layer-func (function dma-buffer uint int int texture-anim-layer float int)) +(define-extern copy-alpha-texture-anim-layer-func (function dma-buffer uint int int texture-anim-layer float int)) +(define-extern copy-clut-alpha-texture-anim-layer-func (function dma-buffer uint int int texture-anim-layer float int)) +(define-extern set-alpha-texture-anim-layer-func (function dma-buffer uint int int texture-anim-layer float int)) +(define-extern set-clut-alpha-texture-anim-layer-func (function dma-buffer uint int int texture-anim-layer float int)) +(define-extern dest-texture-init (function texture-anim none)) +(define-extern src-texture-init (function texture-anim-layer none)) +(define-extern src-texture-init-mt8 (function texture-anim-layer none)) +(define-extern make-noise-texture (function pointer int int int none)) +(define-extern make-cloud-clut (function (pointer uint32) float float none)) +(define-extern texture-anim-cloud-clut-upload (function dma-buffer texture-anim none)) +(define-extern texture-anim-cloud-clut-init (function texture-anim none)) +(define-extern make-slime-clut (function (pointer uint32) none)) +(define-extern texture-anim-slime-clut-upload (function dma-buffer texture-anim none)) +(define-extern texture-anim-slime-clut-init (function texture-anim none)) +(define-extern make-ramp-clut (function (pointer uint32) pointer object none)) +(define-extern make-alpha-ramp-clut (function (pointer uint32) none)) +(define-extern noise-texture-init (function texture-anim-layer none)) +(define-extern texture-anim-alpha-ramp-clut-upload (function dma-buffer texture-anim none)) +(define-extern texture-anim-alpha-ramp-clut-init (function texture-anim none)) +(define-extern texture-anim-overide-size-init (function texture-anim none)) +(define-extern texture-anim-change-mt8h-init (function texture-anim none)) +(define-extern *texture-anim-pages-table* (pointer uint8)) +(define-extern *texture-anim-mip-array* (pointer uint16)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; texture-anim-funcs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern noise-texture-anim-layer-func function) ;; (function dma-buffer uint int int texture-anim-layer float int) -;; (define-extern cloud-texture-anim-layer-func function) ;; (function dma-buffer uint int int texture-anim-layer float int) -;; (define-extern cloud-texture-anim-func function) ;; (function dma-buffer texture-anim int) -;; (define-extern fog-texture-anim-init function) ;; (function texture-anim int) +(define-extern noise-texture-anim-layer-func (function dma-buffer uint int int texture-anim-layer float int)) +(define-extern cloud-texture-anim-layer-func (function dma-buffer uint int int texture-anim-layer float int)) +(define-extern cloud-texture-anim-func (function dma-buffer texture-anim int)) +(define-extern fog-texture-anim-init (function texture-anim int)) (define-extern *fog-texture-work* fog-texture-work) -;; (define-extern real-fog-texture-anim-func function) ;; (function dma-buffer texture-anim int) -;; (define-extern fog-texture-anim-func function) ;; (function dma-buffer texture-anim int) +(define-extern real-fog-texture-anim-func (function dma-buffer texture-anim int)) +(define-extern fog-texture-anim-func (function dma-buffer texture-anim int)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; texture-anim-tables ;; diff --git a/decompiler/config/jak3/ntsc_v1/inputs.jsonc b/decompiler/config/jak3/ntsc_v1/inputs.jsonc index 724ca576be..bcd9083872 100644 --- a/decompiler/config/jak3/ntsc_v1/inputs.jsonc +++ b/decompiler/config/jak3/ntsc_v1/inputs.jsonc @@ -347,6 +347,19 @@ "VAGWAD.INT" ], + "animated_textures": [ + // dark jak + "jakc-arm", "jakc-eyebrow", "jakc-face", "jakc-finger", "jakc-hair", + "jakc-arm-norm", "jakc-eyebrow-norm", "jakc-face-norm", "jakc-finger-norm", "jakc-hair-norm", + "jakc-arm-dark", "jakc-eyebrow-dark", "jakc-face-dark", "jakc-finger-dark", "jakc-hair-dark", + + // Skull Gem + "skull-gem-dest", + "skull-gem-alpha-00", + "skull-gem-alpha-01", + "skull-gem-alpha-02" + ], + "levels_to_extract": [ // wascity "WASALL.DGO", diff --git a/decompiler/config/jak3/ntsc_v1/label_types.jsonc b/decompiler/config/jak3/ntsc_v1/label_types.jsonc index db383fcf1b..98dacdfe8c 100644 --- a/decompiler/config/jak3/ntsc_v1/label_types.jsonc +++ b/decompiler/config/jak3/ntsc_v1/label_types.jsonc @@ -2460,5 +2460,9 @@ ["L575", "vector4w"], ["L576", "vector4w"], ["L577", "vector4w"] + ], + "texture-anim": [ + ["L198", "(pointer uint8)", 16], + ["L197", "(pointer uint16)", 48] ] } diff --git a/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc b/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc index 87c44469e2..af6026b5b1 100644 --- a/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc +++ b/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc @@ -2507,5 +2507,6 @@ "(post idle precur-bridge-blocks-break)": [ [16, "vector"], [32, "vector"] - ] + ], + "texture-anim-layer-draw": [[16, "matrix"], [80, "matrix"], [144, "matrix"], [208, "matrix"]] } diff --git a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc index d7d583a6e5..937dbecca1 100644 --- a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc +++ b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc @@ -10851,6 +10851,9 @@ ["_stack_", 76, "float"], ["_stack_", 100, "float"] ], + "real-wang-texture-anim-func": [ + [[3, 31], "v1", "mood-context"] + ], "(method 24 sky-work)": [ [256, "s4", "(pointer int32)"], [261, "s4", "(pointer int32)"] @@ -11102,5 +11105,40 @@ ], "(method 10 neon-baron)": [[11, "s5", "uint"]], "(method 15 neon-baron)": [[29, "s5", "int"]], - "(method 16 neon-baron)": [[5, "a1", "int"]] + "(method 16 neon-baron)": [[5, "a1", "int"]], + "texture-anim-layer-add-clut-shader": [ + [[23, 30], "a3", "dma-packet"], + [[32, 39], "a3", "gs-gif-tag"], + [49, "a1", "(pointer gs-tex0)"], + [51, "a1", "(pointer gs-reg64)"], + [52, "a1", "(pointer gs-tex1)"], + [54, "a1", "(pointer gs-reg64)"], + [56, "a1", "(pointer gs-test)"], + [58, "a1", "(pointer gs-reg64)"], + [60, "a1", "(pointer gs-clamp)"], + [62, "a1", "(pointer gs-reg64)"], + [64, "a1", "(pointer gs-alpha)"], + [66, "a1", "(pointer gs-reg64)"] + ], + "texture-anim-layer-draw": [ + [[24, 182], "s4", "(pointer uint128)"] + ], + "update-texture-anim": [ + [213, "v1", "(pointer uint128)"], + [[214, 230], "t0", "vector4w"], + [[230, 238], "t0", "vector4w"], + [[239, 247], "v1", "vector4w"] + ], + "(method 9 texture-anim-layer)": [ + [5, "v1", "symbol"], + [11, "v1", "symbol"] + ], + "(method 9 texture-anim)": [ + [5, "v1", "symbol"], + [11, "v1", "symbol"], + ["_stack_", 16, "texture-page"] + ], + "real-fog-texture-anim-func": [ + [[6, 160], "s2", "(pointer uint32)"] + ] } diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt index 6e1308a8a9..f1e5725591 100644 --- a/game/CMakeLists.txt +++ b/game/CMakeLists.txt @@ -80,6 +80,7 @@ set(RUNTIME_SOURCE graphics/opengl_renderer/sprite/Sprite3_Glow.cpp graphics/opengl_renderer/sprite/Sprite3.cpp graphics/opengl_renderer/TextureAnimator.cpp + graphics/opengl_renderer/TextureAnimatorDefs.cpp graphics/opengl_renderer/TextureUploadHandler.cpp graphics/opengl_renderer/VisDataHandler.cpp graphics/opengl_renderer/Warp.cpp diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.cpp b/game/graphics/opengl_renderer/OpenGLRenderer.cpp index 00e7c087fb..2d82e8b098 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.cpp +++ b/game/graphics/opengl_renderer/OpenGLRenderer.cpp @@ -97,10 +97,9 @@ OpenGLRenderer::OpenGLRenderer(std::shared_ptr texture_pool, case GameVersion::Jak1: break; case GameVersion::Jak2: - m_texture_animator = std::make_shared(m_render_state.shaders, common_level); - break; case GameVersion::Jak3: - // for now, no texture animation for jak3... + m_texture_animator = + std::make_shared(m_render_state.shaders, common_level, m_version); break; default: ASSERT(false); @@ -130,7 +129,6 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { using namespace jak3; m_bucket_renderers.resize((int)BucketId::MAX_BUCKETS); m_bucket_categories.resize((int)BucketId::MAX_BUCKETS, BucketCategory::OTHER); - std::shared_ptr texture_animator = nullptr; // todo tex anim { auto p = scoped_prof("render-inits"); @@ -140,7 +138,7 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { // 4 init_bucket_renderer("tex-lcom-sky-pre", BucketCategory::TEX, - BucketId::TEX_LCOM_SKY_PRE, texture_animator); + BucketId::TEX_LCOM_SKY_PRE, m_texture_animator); init_bucket_renderer("sky", BucketCategory::OTHER, BucketId::SKY, 1024 * 8); init_bucket_renderer("ocean-mid-far", BucketCategory::OCEAN, @@ -156,7 +154,7 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { init_bucket_renderer( fmt::format("tex-l{}-tfrag", i), BucketCategory::TEX, GET_BUCKET_ID_FOR_LIST(BucketId::TEX_L0_TFRAG, BucketId::TEX_L1_TFRAG, i), - texture_animator); + m_texture_animator); // 11 init_bucket_renderer( fmt::format("tfrag-l{}-tfrag", i), BucketCategory::TFRAG, @@ -230,7 +228,7 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { // 340 init_bucket_renderer("tex-lcom-tfrag", BucketCategory::TEX, - BucketId::TEX_LCOM_TFRAG, texture_animator); + BucketId::TEX_LCOM_TFRAG, m_texture_animator); init_bucket_renderer("merc-lcom-tfrag", BucketCategory::MERC, BucketId::MERC_LCOM_TFRAG, m_merc2); init_bucket_renderer("gmerc-lcom-tfrag", BucketCategory::GENERIC, @@ -238,7 +236,7 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { Generic2::Mode::NORMAL); // 345 init_bucket_renderer("tex-lcom-shrub", BucketCategory::TEX, - BucketId::TEX_LCOM_SHRUB, texture_animator); + BucketId::TEX_LCOM_SHRUB, m_texture_animator); init_bucket_renderer("merc-lcom-shrub", BucketCategory::MERC, BucketId::MERC_LCOM_SHRUB, m_merc2); // 351 @@ -247,11 +245,11 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { init_bucket_renderer( fmt::format("tex-l{}-pris", i), BucketCategory::TEX, GET_BUCKET_ID_FOR_LIST(BucketId::TEX_L0_PRIS, BucketId::TEX_L1_PRIS, i), - texture_animator); + m_texture_animator); init_bucket_renderer( fmt::format("tex-l{}-pris2", i), BucketCategory::TEX, GET_BUCKET_ID_FOR_LIST(BucketId::TEX_L0_PRIS2, BucketId::TEX_L1_PRIS2, i), - texture_animator); + m_texture_animator); init_bucket_renderer( fmt::format("merc-l{}-pris", i), BucketCategory::MERC, @@ -272,7 +270,7 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { // 401 init_bucket_renderer("tex-lcom-pris", BucketCategory::TEX, - BucketId::TEX_LCOM_PRIS, texture_animator); + BucketId::TEX_LCOM_PRIS, m_texture_animator); init_bucket_renderer("merc-lcom-pris", BucketCategory::MERC, BucketId::MERC_LCOM_PRIS, m_merc2); init_bucket_renderer("gmerc-lcom-pris", BucketCategory::GENERIC, @@ -281,7 +279,7 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { // 461 init_bucket_renderer("tex-lcom-sky-post", BucketCategory::TEX, - BucketId::TEX_LCOM_SKY_POST, texture_animator); + BucketId::TEX_LCOM_SKY_POST, m_texture_animator); init_bucket_renderer("ocean-near", BucketCategory::OCEAN, BucketId::OCEAN_NEAR); // 463 @@ -291,7 +289,7 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { init_bucket_renderer( fmt::format("tex-l{}-water", i), BucketCategory::TEX, GET_BUCKET_ID_FOR_LIST(BucketId::TEX_L0_WATER, BucketId::TEX_L1_WATER, i), - texture_animator); + m_texture_animator); init_bucket_renderer( fmt::format("merc-l{}-water", i), BucketCategory::MERC, GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_WATER, BucketId::MERC_L1_WATER, i), m_merc2); @@ -308,20 +306,20 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { // 563 init_bucket_renderer("tex-lcom-water", BucketCategory::TEX, - BucketId::TEX_LCOM_WATER, texture_animator); + BucketId::TEX_LCOM_WATER, m_texture_animator); init_bucket_renderer("merc-lcom-water", BucketCategory::MERC, BucketId::MERC_LCOM_WATER, m_merc2); // 568 init_bucket_renderer("tex-sprite", BucketCategory::TEX, - BucketId::TEX_SPRITE, texture_animator); + BucketId::TEX_SPRITE, m_texture_animator); init_bucket_renderer("particles", BucketCategory::SPRITE, BucketId::PARTICLES); init_bucket_renderer("generic-sprite-3", BucketCategory::OTHER, BucketId::GENERIC_SPRITE_3, m_generic2, Generic2::Mode::LIGHTNING); // 575 init_bucket_renderer("tex-warp", BucketCategory::TEX, BucketId::TEX_WARP, - texture_animator); + m_texture_animator); init_bucket_renderer("generic-warp", BucketCategory::GENERIC, BucketId::GENERIC_WARP, m_generic2); @@ -329,16 +327,16 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { BucketId::DEBUG_NO_ZBUF1, m_texture_animator, true); // 578 init_bucket_renderer("tex-hud-hud-alpha", BucketCategory::TEX, - BucketId::TEX_HUD_HUD_ALPHA, texture_animator); + BucketId::TEX_HUD_HUD_ALPHA, m_texture_animator); init_bucket_renderer("tex-hud-hud-alpha", BucketCategory::TEX, - BucketId::TEX_HUD_HUD_ALPHA, texture_animator); + BucketId::TEX_HUD_HUD_ALPHA, m_texture_animator); init_bucket_renderer("hud-draw-hud-alpha", BucketCategory::OTHER, BucketId::HUD_DRAW_HUD_ALPHA, 0x8000); init_bucket_renderer("tex-hud-pris2", BucketCategory::TEX, - BucketId::TEX_HUD_PRIS2, texture_animator); + BucketId::TEX_HUD_PRIS2, m_texture_animator); init_bucket_renderer("hud-draw-pris2", BucketCategory::TEX, - BucketId::HUD_DRAW_PRIS2, texture_animator); + BucketId::HUD_DRAW_PRIS2, m_texture_animator); init_bucket_renderer("progress", BucketCategory::OTHER, BucketId::BUCKET582, 0x8000); diff --git a/game/graphics/opengl_renderer/TextureAnimator.cpp b/game/graphics/opengl_renderer/TextureAnimator.cpp index af6ce6c679..4022b2cce7 100644 --- a/game/graphics/opengl_renderer/TextureAnimator.cpp +++ b/game/graphics/opengl_renderer/TextureAnimator.cpp @@ -208,6 +208,9 @@ int output_slot_by_idx(GameVersion version, const std::string& name) { case GameVersion::Jak2: v = &jak2_animated_texture_slots(); break; + case GameVersion::Jak3: + v = &jak3_animated_texture_slots(); + break; default: case GameVersion::Jak1: ASSERT_NOT_REACHED(); @@ -352,12 +355,26 @@ Psm32ToPsm8Scrambler::Psm32ToPsm8Scrambler(int w, int h, int write_tex_width, in } } -TextureAnimator::TextureAnimator(ShaderLibrary& shaders, const tfrag3::Level* common_level) +const std::vector& animated_texture_slots(GameVersion version) { + switch (version) { + case GameVersion::Jak2: + return jak2_animated_texture_slots(); + case GameVersion::Jak3: + return jak3_animated_texture_slots(); + default: + ASSERT_NOT_REACHED(); + } +} + +TextureAnimator::TextureAnimator(ShaderLibrary& shaders, + const tfrag3::Level* common_level, + GameVersion version) : m_common_level(common_level), m_psm32_to_psm8_8_8(8, 8, 8, 64), m_psm32_to_psm8_16_16(16, 16, 16, 64), m_psm32_to_psm8_32_32(32, 32, 16, 64), m_psm32_to_psm8_64_64(64, 64, 64, 64), + m_version(version), m_sky_blend_texture(kFinalSkyTextureSize, kFinalSkyTextureSize, GL_UNSIGNED_INT_8_8_8_8_REV), m_sky_final_texture(kFinalSkyTextureSize, kFinalSkyTextureSize, GL_UNSIGNED_INT_8_8_8_8_REV), m_sky_hires_blend_texture(kFinalSkyHiresTextureSize, @@ -462,12 +479,22 @@ TextureAnimator::TextureAnimator(ShaderLibrary& shaders, const tfrag3::Level* co m_index_to_clut_addr[i] = clx + cly * 16; } - m_public_output_slots.resize(jak2_animated_texture_slots().size(), m_dummy_texture); + m_public_output_slots.resize(animated_texture_slots(m_version).size(), m_dummy_texture); m_private_output_slots = m_public_output_slots; - m_output_debug_flags.resize(jak2_animated_texture_slots().size()); + m_output_debug_flags.resize(animated_texture_slots(m_version).size()); // animation-specific stuff - setup_texture_anims(); + setup_texture_anims_common(); + switch (m_version) { + case GameVersion::Jak2: + setup_texture_anims_jak2(); + break; + case GameVersion::Jak3: + setup_texture_anims_jak3(); + break; + default: + ASSERT_NOT_REACHED(); + } setup_sky(); } @@ -485,7 +512,7 @@ int TextureAnimator::create_fixed_anim_array(const std::vector& de anim.def = def; // set up the destination texture. - anim.dest_slot = output_slot_by_idx(GameVersion::Jak2, anim.def.tex_name); + anim.dest_slot = output_slot_by_idx(m_version, anim.def.tex_name); auto* dtex = tex_by_name(m_common_level, anim.def.tex_name); if (anim.def.override_size) { anim.fbt.emplace(anim.def.override_size->x(), anim.def.override_size->y(), @@ -552,7 +579,7 @@ void TextureAnimator::draw_debug_window() { imgui_show_tex(m_sky_hires_noise_textures[i].new_tex); } - auto& slots = jak2_animated_texture_slots(); + auto& slots = animated_texture_slots(m_version); for (size_t i = 0; i < slots.size(); i++) { ImGui::Text("Slot %d %s (%d)", (int)i, slots[i].c_str(), (int)m_private_output_slots[i]); imgui_show_tex(m_private_output_slots[i]); @@ -562,7 +589,7 @@ void TextureAnimator::draw_debug_window() { } void TextureAnimator::copy_private_to_public() { - auto& slots = jak2_animated_texture_slots(); + auto& slots = animated_texture_slots(m_version); for (size_t i = 0; i < slots.size(); i++) { if (m_output_debug_flags[i].b) { m_public_output_slots[i] = m_dummy_texture; @@ -598,7 +625,7 @@ void TextureAnimator::add_to_clut_blender_group(int idx, grp.blenders.emplace_back(prefix, std::array{prefix + suffix0, prefix + suffix1}, dgo, m_common_level, &m_opengl_texture_pool); - grp.outputs.push_back(output_slot_by_idx(GameVersion::Jak2, prefix)); + grp.outputs.push_back(output_slot_by_idx(m_version, prefix)); m_private_output_slots.at(grp.outputs.back()) = grp.blenders.back().texture(); } } @@ -984,7 +1011,7 @@ void TextureAnimator::force_to_gpu(int tbp) { PcTextureId TextureAnimator::get_id_for_tbp(TexturePool* pool, u64 tbp, u64 other_id) { const auto& it = m_ids_by_vram.find(tbp | (other_id << 32)); if (it == m_ids_by_vram.end()) { - auto ret = pool->allocate_pc_port_texture(GameVersion::Jak2); + auto ret = pool->allocate_pc_port_texture(m_version); m_ids_by_vram[tbp] = ret; return ret; } else { @@ -2047,471 +2074,6 @@ void TextureAnimator::run_fixed_animation(FixedAnim& anim, float time) { glBindTexture(GL_TEXTURE_2D, 0); } -void TextureAnimator::setup_texture_anims() { - // DARKJAK - m_darkjak_clut_blender_idx = create_clut_blender_group( - {"jakbsmall-eyebrow", "jakbsmall-face", "jakbsmall-finger", "jakbsmall-hair"}, "-norm", - "-dark", {}); - - // PRISON - // MISSING EYELID - m_jakb_prison_clut_blender_idx = create_clut_blender_group( - {"jak-orig-arm-formorph", "jak-orig-eyebrow-formorph", "jak-orig-finger-formorph"}, "-start", - "-end", "LDJAKBRN.DGO"); - add_to_clut_blender_group(m_jakb_prison_clut_blender_idx, - {"jakb-facelft", "jakb-facert", "jakb-hairtrans"}, "-norm", "-dark", - "LDJAKBRN.DGO"); - - // ORACLE - // MISSING FINGER - m_jakb_oracle_clut_blender_idx = create_clut_blender_group( - {"jakb-eyebrow", "jakb-eyelid", "jakb-facelft", "jakb-facert", "jakb-hairtrans"}, "-norm", - "-dark", "ORACLE.DGO"); - - // NEST - // MISSING FINGER - m_jakb_nest_clut_blender_idx = create_clut_blender_group( - {"jakb-eyebrow", "jakb-eyelid", "jakb-facelft", "jakb-facert", "jakb-hairtrans"}, "-norm", - "-dark", "NEB.DGO"); - - // KOR (doesn't work??) - m_kor_transform_clut_blender_idx = create_clut_blender_group( - { - // "kor-eyeeffect-formorph", - // "kor-hair-formorph", - // "kor-head-formorph", - // "kor-head-formorph-noreflect", - // "kor-lowercaps-formorph", - // "kor-uppercaps-formorph", - }, - "-start", "-end", {}); - - // Skull Gem - { - FixedAnimDef skull_gem; - skull_gem.move_to_pool = true; - skull_gem.tex_name = "skull-gem-dest"; - skull_gem.color = math::Vector4{0, 0, 0, 0x80}; - // overriden in texture-finish.gc - skull_gem.override_size = math::Vector2(32, 32); - - auto& skull_gem_0 = skull_gem.layers.emplace_back(); - skull_gem_0.end_time = 300.; - skull_gem_0.tex_name = "skull-gem-alpha-00"; - skull_gem_0.set_blend_b2_d1(); - skull_gem_0.set_no_z_write_no_z_test(); - - auto& skull_gem_1 = skull_gem.layers.emplace_back(); - skull_gem_1.end_time = 300.; - skull_gem_1.tex_name = "skull-gem-alpha-01"; - skull_gem_1.set_blend_b2_d1(); - skull_gem_1.set_no_z_write_no_z_test(); - - auto& skull_gem_2 = skull_gem.layers.emplace_back(); - skull_gem_2.end_time = 300.; - skull_gem_2.tex_name = "skull-gem-alpha-02"; - skull_gem_2.set_blend_b2_d1(); - skull_gem_2.set_no_z_write_no_z_test(); - - m_skull_gem_fixed_anim_array_idx = create_fixed_anim_array({skull_gem}); - } - - // Bomb - { - FixedAnimDef bomb; - bomb.tex_name = "bomb-gradient"; - bomb.color = math::Vector4{0, 0, 0, 0x80}; - - auto& bomb_0 = bomb.layers.emplace_back(); - bomb_0.end_time = 300.; - bomb_0.tex_name = "bomb-gradient-rim"; - bomb_0.set_blend_b2_d1(); - bomb_0.set_no_z_write_no_z_test(); - // :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) - bomb_0.channel_masks[3] = false; // no alpha writes. - - auto& bomb_1 = bomb.layers.emplace_back(); - bomb_1.end_time = 300.; - bomb_1.tex_name = "bomb-gradient-flames"; - bomb_1.set_blend_b2_d1(); - bomb_1.set_no_z_write_no_z_test(); - // :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) - bomb_1.channel_masks[3] = false; // no alpha writes. - - m_bomb_fixed_anim_array_idx = create_fixed_anim_array({bomb}); - } - - // CAS conveyor - { - FixedAnimDef conveyor_0; - conveyor_0.tex_name = "cas-conveyor-dest"; - conveyor_0.color = math::Vector4(0, 0, 0, 0x80); - conveyor_0.override_size = math::Vector2(64, 32); - auto& c0 = conveyor_0.layers.emplace_back(); - c0.set_blend_b2_d1(); - c0.set_no_z_write_no_z_test(); - // :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) - c0.channel_masks[3] = false; // no alpha writes. - c0.end_time = 300.; - c0.tex_name = "cas-conveyor"; - - FixedAnimDef conveyor_1; - conveyor_1.tex_name = "cas-conveyor-dest-01"; - conveyor_1.color = math::Vector4(0, 0, 0, 0x80); - conveyor_1.override_size = math::Vector2(64, 32); - auto& c1 = conveyor_1.layers.emplace_back(); - c1.set_blend_b2_d1(); - c1.set_no_z_write_no_z_test(); - // :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) - c1.channel_masks[3] = false; // no alpha writes. - c1.end_time = 300.; - c1.tex_name = "cas-conveyor"; - - FixedAnimDef conveyor_2; - conveyor_2.tex_name = "cas-conveyor-dest-02"; - conveyor_2.color = math::Vector4(0, 0, 0, 0x80); - conveyor_2.override_size = math::Vector2(64, 32); - auto& c2 = conveyor_2.layers.emplace_back(); - c2.set_blend_b2_d1(); - c2.set_no_z_write_no_z_test(); - // :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) - c2.channel_masks[3] = false; // no alpha writes. - c2.end_time = 300.; - c2.tex_name = "cas-conveyor"; - - FixedAnimDef conveyor_3; - conveyor_3.tex_name = "cas-conveyor-dest-03"; - conveyor_3.color = math::Vector4(0, 0, 0, 0x80); - conveyor_3.override_size = math::Vector2(64, 32); - auto& c3 = conveyor_3.layers.emplace_back(); - c3.set_blend_b2_d1(); - c3.set_no_z_write_no_z_test(); - // :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) - c3.channel_masks[3] = false; // no alpha writes. - c3.end_time = 300.; - c3.tex_name = "cas-conveyor"; - - m_cas_conveyor_anim_array_idx = - create_fixed_anim_array({conveyor_0, conveyor_1, conveyor_2, conveyor_3}); - } - - // SECURITY - { - FixedAnimDef env; - env.color = math::Vector4(0, 0, 0, 0x80); - env.tex_name = "security-env-dest"; - for (int i = 0; i < 2; i++) { - auto& env1 = env.layers.emplace_back(); - env1.tex_name = "security-env-uscroll"; - // :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) - env1.set_no_z_write_no_z_test(); - env1.channel_masks[3] = false; // no alpha writes. - // :alpha (new 'static 'gs-alpha :b #x2 :d #x1) - env1.set_blend_b2_d1(); - env1.end_time = 4800.f; - } - - FixedAnimDef dot; - dot.color = math::Vector4(0, 0, 0, 0x80); - dot.tex_name = "security-dot-dest"; - - auto& cwhite = dot.layers.emplace_back(); - cwhite.set_blend_b2_d1(); - cwhite.set_no_z_write_no_z_test(); - cwhite.tex_name = "common-white"; - cwhite.end_time = 4800.f; - - for (int i = 0; i < 2; i++) { - auto& dsrc = dot.layers.emplace_back(); - dsrc.set_blend_b2_d1(); - dsrc.set_no_z_write_no_z_test(); - dsrc.end_time = 600.f; - dsrc.tex_name = "security-dot-src"; - } - - m_security_anim_array_idx = create_fixed_anim_array({env, dot}); - } - - // WATERFALL - { - FixedAnimDef waterfall; - waterfall.color = math::Vector4(0, 0, 0, 0x80); - waterfall.tex_name = "waterfall-dest"; - for (int i = 0; i < 4; i++) { - auto& src = waterfall.layers.emplace_back(); - src.set_blend_b1_d1(); - src.set_no_z_write_no_z_test(); - src.end_time = 450.f; - src.tex_name = "waterfall"; - } - m_waterfall_anim_array_idx = create_fixed_anim_array({waterfall}); - } - - { - FixedAnimDef waterfall; - waterfall.color = math::Vector4(0, 0, 0, 0x80); - waterfall.tex_name = "waterfall-dest"; - for (int i = 0; i < 4; i++) { - auto& src = waterfall.layers.emplace_back(); - src.set_blend_b1_d1(); - src.set_no_z_write_no_z_test(); - src.end_time = 450.f; - src.tex_name = "waterfall"; - } - m_waterfall_b_anim_array_idx = create_fixed_anim_array({waterfall}); - } - - // LAVA - { - FixedAnimDef lava; - lava.color = math::Vector4(0, 0, 0, 0x80); - lava.tex_name = "dig-lava-01-dest"; - for (int i = 0; i < 2; i++) { - auto& src = lava.layers.emplace_back(); - src.set_blend_b1_d1(); - src.set_no_z_write_no_z_test(); - src.end_time = 3600.f; - src.tex_name = "dig-lava-01"; - } - m_lava_anim_array_idx = create_fixed_anim_array({lava}); - } - - { - FixedAnimDef lava; - lava.color = math::Vector4(0, 0, 0, 0x80); - lava.tex_name = "dig-lava-01-dest"; - for (int i = 0; i < 2; i++) { - auto& src = lava.layers.emplace_back(); - src.set_blend_b1_d1(); - src.set_no_z_write_no_z_test(); - src.end_time = 3600.f; - src.tex_name = "dig-lava-01"; - } - m_lava_b_anim_array_idx = create_fixed_anim_array({lava}); - } - - // Stadiumb - { - FixedAnimDef def; - def.color = math::Vector4(0, 0, 0, 0x80); - def.tex_name = "stdmb-energy-wall-01-dest"; - for (int i = 0; i < 2; i++) { - auto& src = def.layers.emplace_back(); - src.set_blend_b1_d1(); - src.set_no_z_write_no_z_test(); - src.end_time = 300.f; - src.tex_name = "stdmb-energy-wall-01"; - } - m_stadiumb_anim_array_idx = create_fixed_anim_array({def}); - } - - // Fortress pris - { - FixedAnimDef l_tread; - l_tread.color = math::Vector4(0, 0, 0, 0x80); - l_tread.tex_name = "robotank-tread-l-dest"; - auto& l_src = l_tread.layers.emplace_back(); - l_src.set_blend_b1_d1(); - l_src.set_no_z_write_no_z_test(); - l_src.channel_masks[3] = false; // no alpha writes. - l_src.end_time = 1.f; - l_src.tex_name = "robotank-tread"; - - FixedAnimDef r_tread; - r_tread.color = math::Vector4(0, 0, 0, 0x80); - r_tread.tex_name = "robotank-tread-r-dest"; - auto& r_src = r_tread.layers.emplace_back(); - r_src.set_blend_b1_d1(); - r_src.set_no_z_write_no_z_test(); - r_src.channel_masks[3] = false; // no alpha writes. - r_src.end_time = 1.f; - r_src.tex_name = "robotank-tread"; - - m_fortress_pris_anim_array_idx = create_fixed_anim_array({l_tread, r_tread}); - } - - // Fortress Warp - { - FixedAnimDef def; - def.color = math::Vector4(0, 0, 0, 0x80); - def.move_to_pool = true; - def.tex_name = "fort-roboscreen-dest"; - auto& src = def.layers.emplace_back(); - src.set_blend_b2_d1(); - src.channel_masks[3] = false; // no alpha writes. - src.set_no_z_write_no_z_test(); - src.end_time = 300.f; - src.tex_name = "fort-roboscreen-env"; - m_fortress_warp_anim_array_idx = create_fixed_anim_array({def}); - } - - // metkor - { - FixedAnimDef def; - def.color = math::Vector4(0, 0, 0, 0x80); - def.tex_name = "squid-env-rim-dest"; - def.move_to_pool = true; - { - auto& src = def.layers.emplace_back(); - src.set_blend_b2_d1(); - src.channel_masks[3] = false; // no alpha writes. - src.set_no_z_write_no_z_test(); - src.set_clamp(); - src.end_time = 1200.f; - src.tex_name = "metkor-head-env-noise"; - } - { - auto& src = def.layers.emplace_back(); - src.set_blend_b2_d1(); - src.channel_masks[3] = false; // no alpha writes. - src.set_no_z_write_no_z_test(); - src.set_clamp(); - src.end_time = 1200.f; - src.tex_name = "metkor-head-env-scan"; - } - { - auto& src = def.layers.emplace_back(); - src.set_blend_b2_d1(); - src.channel_masks[3] = false; // no alpha writes. - src.set_no_z_write_no_z_test(); - src.set_clamp(); - src.end_time = 1200.f; - src.tex_name = "metkor-head-env-rim"; - } - { - auto& src = def.layers.emplace_back(); - src.set_blend_b2_d1(); - src.channel_masks[3] = false; // no alpha writes. - src.set_no_z_write_no_z_test(); - src.set_clamp(); - src.end_time = 1200.f; - src.tex_name = "metkor-head-env-rim"; - } - { - auto& src = def.layers.emplace_back(); - src.set_blend_b2_d1(); - src.channel_masks[3] = false; // no alpha writes. - src.set_no_z_write_no_z_test(); - src.set_clamp(); - src.end_time = 1200.f; - src.tex_name = "environment-phong-rim"; - } - m_metkor_anim_array_idx = create_fixed_anim_array({def}); - } - - // shield - { - FixedAnimDef def; - def.color = math::Vector4(0, 0, 0, 0x80); - def.tex_name = "squid-env-rim-dest"; - def.move_to_pool = true; - - { - auto& src = def.layers.emplace_back(); - src.set_blend_b2_d1(); - src.set_no_z_write_no_z_test(); - src.set_clamp(); - src.end_time = 1200.f; - src.tex_name = "common-white"; - } - - { - auto& src = def.layers.emplace_back(); - src.set_blend_b2_d1(); - src.channel_masks[3] = false; // no alpha writes. - src.set_no_z_write_no_z_test(); - src.set_clamp(); - src.end_time = 1200.f; - src.tex_name = "squid-env-uscroll"; - } - - { - auto& src = def.layers.emplace_back(); - src.set_blend_b2_d1(); - src.channel_masks[3] = false; // no alpha writes. - src.set_no_z_write_no_z_test(); - src.set_clamp(); - src.end_time = 1200.f; - src.tex_name = "squid-env-uscroll"; - } - - { - auto& src = def.layers.emplace_back(); - src.set_blend_b2_d1(); - src.channel_masks[3] = false; // no alpha writes. - src.set_no_z_write_no_z_test(); - src.set_clamp(); - src.end_time = 1200.f; - src.tex_name = "squid-env-rim-src"; - } - - { - auto& src = def.layers.emplace_back(); - src.set_blend_b2_d1(); - src.channel_masks[3] = false; // no alpha writes. - src.set_no_z_write_no_z_test(); - src.set_clamp(); - src.end_time = 1200.f; - src.tex_name = "squid-env-rim-src"; - } - m_shield_anim_array_idx = create_fixed_anim_array({def}); - } - - // krew - { - FixedAnimDef def; - def.color = math::Vector4(0, 0, 0, 0x80); - def.tex_name = "krew-holo-dest"; - def.move_to_pool = true; - { - auto& src = def.layers.emplace_back(); - src.set_blend_b2_d1(); - src.channel_masks[3] = false; // no alpha writes. - src.set_no_z_write_no_z_test(); - src.set_clamp(); - src.end_time = 1200.f; - src.tex_name = "metkor-head-env-noise"; - } - { - auto& src = def.layers.emplace_back(); - src.set_blend_b2_d1(); - src.channel_masks[3] = false; // no alpha writes. - src.set_no_z_write_no_z_test(); - src.set_clamp(); - src.end_time = 1200.f; - src.tex_name = "metkor-head-env-scan"; - } - { - auto& src = def.layers.emplace_back(); - src.set_blend_b2_d1(); - src.channel_masks[3] = false; // no alpha writes. - src.set_no_z_write_no_z_test(); - src.set_clamp(); - src.end_time = 1200.f; - src.tex_name = "metkor-head-env-rim"; - } - { - auto& src = def.layers.emplace_back(); - src.set_blend_b2_d1(); - src.channel_masks[3] = false; // no alpha writes. - src.set_no_z_write_no_z_test(); - src.set_clamp(); - src.end_time = 1200.f; - src.tex_name = "metkor-head-env-rim"; - } - { - auto& src = def.layers.emplace_back(); - src.set_blend_b2_d1(); - src.channel_masks[3] = false; // no alpha writes. - src.set_no_z_write_no_z_test(); - src.set_clamp(); - src.end_time = 1200.f; - src.tex_name = "metkor-phong-env"; - } - m_krew_holo_anim_array_idx = create_fixed_anim_array({def}); - } -} - // initial values of the random table for cloud texture generation. constexpr Vector16ub kInitialRandomTable[TextureAnimator::kRandomTableSize] = { {0x20, 0x19, 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 0x89, 0x67, 0x45, 0x23, 0x1}, @@ -2614,28 +2176,6 @@ void TextureAnimator::setup_sky() { m_random_table, dim, m_random_index); } } - - { - m_slime_output_slot = output_slot_by_idx(GameVersion::Jak2, "cas-toxic-slime-dest"); - m_slime_scroll_output_slot = - output_slot_by_idx(GameVersion::Jak2, "cas-toxic-slime-scroll-dest"); - const float max_times[4] = {600.f, 300.f, 150.f, 75.f}; - const float scales[4] = {0.55, 0.6, 0.3, 0.1f}; - for (int i = 0, dim = kFinalSlimeTextureSize >> (kNumSlimeNoiseLayers - 1); - i < kNumSlimeNoiseLayers; i++, dim *= 2) { - auto& tex = m_slime_noise_textures[i]; - tex.temp_data.resize(dim * dim); - tex.max_time = max_times[i]; - tex.scale = scales[i]; - tex.dim = dim; - glGenTextures(1, &tex.new_tex); - m_random_index = update_opengl_noise_texture(tex.new_tex, tex.temp_data.data(), - m_random_table, dim, m_random_index); - glGenTextures(1, &tex.old_tex); - m_random_index = update_opengl_noise_texture(tex.old_tex, tex.temp_data.data(), - m_random_table, dim, m_random_index); - } - } } GLint TextureAnimator::run_clouds(const SkyInput& input, bool hires) { diff --git a/game/graphics/opengl_renderer/TextureAnimator.h b/game/graphics/opengl_renderer/TextureAnimator.h index 35f7ff0f77..6d91b1db96 100644 --- a/game/graphics/opengl_renderer/TextureAnimator.h +++ b/game/graphics/opengl_renderer/TextureAnimator.h @@ -246,7 +246,7 @@ class TexturePool; class TextureAnimator { public: - TextureAnimator(ShaderLibrary& shaders, const tfrag3::Level* common_level); + TextureAnimator(ShaderLibrary& shaders, const tfrag3::Level* common_level, GameVersion version); ~TextureAnimator(); void handle_texture_anim_data(DmaFollower& dma, const u8* ee_mem, @@ -259,7 +259,10 @@ class TextureAnimator { private: void copy_private_to_public(); - void setup_texture_anims(); + void setup_texture_anims_common(); + void setup_texture_anims_jak2(); + void setup_texture_anims_jak3(); + void setup_sky(); void handle_upload_clut_16_16(const DmaTransfer& tf, const u8* ee_mem); void handle_generic_upload(const DmaTransfer& tf, const u8* ee_mem); @@ -429,6 +432,7 @@ class TextureAnimator { static constexpr int kNumSlimeNoiseLayers = 4; private: + GameVersion m_version; Vector16ub m_random_table[kRandomTableSize]; int m_random_index = 0; @@ -451,3 +455,10 @@ class TextureAnimator { int m_slime_output_slot = -1; int m_slime_scroll_output_slot = -1; }; + +int output_slot_by_idx(GameVersion version, const std::string& name); +int update_opengl_noise_texture(GLuint texture, + u8* temp, + Vector16ub* random_table, + int dim, + int random_index_in); \ No newline at end of file diff --git a/game/graphics/opengl_renderer/TextureAnimatorDefs.cpp b/game/graphics/opengl_renderer/TextureAnimatorDefs.cpp new file mode 100644 index 0000000000..4928a19e14 --- /dev/null +++ b/game/graphics/opengl_renderer/TextureAnimatorDefs.cpp @@ -0,0 +1,494 @@ +#include "game/graphics/opengl_renderer/TextureAnimator.h" + +void TextureAnimator::setup_texture_anims_jak3() { + m_darkjak_clut_blender_idx = create_clut_blender_group( + {"jakc-arm", "jakc-eyebrow", "jakc-face", "jakc-finger", "jakc-hair"}, "-norm", "-dark", {}); +} + +void TextureAnimator::setup_texture_anims_common() { + // Skull Gem + { + FixedAnimDef skull_gem; + skull_gem.move_to_pool = true; + skull_gem.tex_name = "skull-gem-dest"; + skull_gem.color = math::Vector4{0, 0, 0, 0x80}; + // overriden in texture-finish.gc + skull_gem.override_size = math::Vector2(32, 32); + + auto& skull_gem_0 = skull_gem.layers.emplace_back(); + skull_gem_0.end_time = 300.; + skull_gem_0.tex_name = "skull-gem-alpha-00"; + skull_gem_0.set_blend_b2_d1(); + skull_gem_0.set_no_z_write_no_z_test(); + + auto& skull_gem_1 = skull_gem.layers.emplace_back(); + skull_gem_1.end_time = 300.; + skull_gem_1.tex_name = "skull-gem-alpha-01"; + skull_gem_1.set_blend_b2_d1(); + skull_gem_1.set_no_z_write_no_z_test(); + + auto& skull_gem_2 = skull_gem.layers.emplace_back(); + skull_gem_2.end_time = 300.; + skull_gem_2.tex_name = "skull-gem-alpha-02"; + skull_gem_2.set_blend_b2_d1(); + skull_gem_2.set_no_z_write_no_z_test(); + + m_skull_gem_fixed_anim_array_idx = create_fixed_anim_array({skull_gem}); + } +} + +void TextureAnimator::setup_texture_anims_jak2() { + // DARKJAK + m_darkjak_clut_blender_idx = create_clut_blender_group( + {"jakbsmall-eyebrow", "jakbsmall-face", "jakbsmall-finger", "jakbsmall-hair"}, "-norm", + "-dark", {}); + + // PRISON + // MISSING EYELID + m_jakb_prison_clut_blender_idx = create_clut_blender_group( + {"jak-orig-arm-formorph", "jak-orig-eyebrow-formorph", "jak-orig-finger-formorph"}, "-start", + "-end", "LDJAKBRN.DGO"); + add_to_clut_blender_group(m_jakb_prison_clut_blender_idx, + {"jakb-facelft", "jakb-facert", "jakb-hairtrans"}, "-norm", "-dark", + "LDJAKBRN.DGO"); + + // ORACLE + // MISSING FINGER + m_jakb_oracle_clut_blender_idx = create_clut_blender_group( + {"jakb-eyebrow", "jakb-eyelid", "jakb-facelft", "jakb-facert", "jakb-hairtrans"}, "-norm", + "-dark", "ORACLE.DGO"); + + // NEST + // MISSING FINGER + m_jakb_nest_clut_blender_idx = create_clut_blender_group( + {"jakb-eyebrow", "jakb-eyelid", "jakb-facelft", "jakb-facert", "jakb-hairtrans"}, "-norm", + "-dark", "NEB.DGO"); + + // KOR (doesn't work??) + m_kor_transform_clut_blender_idx = create_clut_blender_group( + { + // "kor-eyeeffect-formorph", + // "kor-hair-formorph", + // "kor-head-formorph", + // "kor-head-formorph-noreflect", + // "kor-lowercaps-formorph", + // "kor-uppercaps-formorph", + }, + "-start", "-end", {}); + + // Bomb + { + FixedAnimDef bomb; + bomb.tex_name = "bomb-gradient"; + bomb.color = math::Vector4{0, 0, 0, 0x80}; + + auto& bomb_0 = bomb.layers.emplace_back(); + bomb_0.end_time = 300.; + bomb_0.tex_name = "bomb-gradient-rim"; + bomb_0.set_blend_b2_d1(); + bomb_0.set_no_z_write_no_z_test(); + // :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + bomb_0.channel_masks[3] = false; // no alpha writes. + + auto& bomb_1 = bomb.layers.emplace_back(); + bomb_1.end_time = 300.; + bomb_1.tex_name = "bomb-gradient-flames"; + bomb_1.set_blend_b2_d1(); + bomb_1.set_no_z_write_no_z_test(); + // :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + bomb_1.channel_masks[3] = false; // no alpha writes. + + m_bomb_fixed_anim_array_idx = create_fixed_anim_array({bomb}); + } + + // CAS conveyor + { + FixedAnimDef conveyor_0; + conveyor_0.tex_name = "cas-conveyor-dest"; + conveyor_0.color = math::Vector4(0, 0, 0, 0x80); + conveyor_0.override_size = math::Vector2(64, 32); + auto& c0 = conveyor_0.layers.emplace_back(); + c0.set_blend_b2_d1(); + c0.set_no_z_write_no_z_test(); + // :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + c0.channel_masks[3] = false; // no alpha writes. + c0.end_time = 300.; + c0.tex_name = "cas-conveyor"; + + FixedAnimDef conveyor_1; + conveyor_1.tex_name = "cas-conveyor-dest-01"; + conveyor_1.color = math::Vector4(0, 0, 0, 0x80); + conveyor_1.override_size = math::Vector2(64, 32); + auto& c1 = conveyor_1.layers.emplace_back(); + c1.set_blend_b2_d1(); + c1.set_no_z_write_no_z_test(); + // :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + c1.channel_masks[3] = false; // no alpha writes. + c1.end_time = 300.; + c1.tex_name = "cas-conveyor"; + + FixedAnimDef conveyor_2; + conveyor_2.tex_name = "cas-conveyor-dest-02"; + conveyor_2.color = math::Vector4(0, 0, 0, 0x80); + conveyor_2.override_size = math::Vector2(64, 32); + auto& c2 = conveyor_2.layers.emplace_back(); + c2.set_blend_b2_d1(); + c2.set_no_z_write_no_z_test(); + // :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + c2.channel_masks[3] = false; // no alpha writes. + c2.end_time = 300.; + c2.tex_name = "cas-conveyor"; + + FixedAnimDef conveyor_3; + conveyor_3.tex_name = "cas-conveyor-dest-03"; + conveyor_3.color = math::Vector4(0, 0, 0, 0x80); + conveyor_3.override_size = math::Vector2(64, 32); + auto& c3 = conveyor_3.layers.emplace_back(); + c3.set_blend_b2_d1(); + c3.set_no_z_write_no_z_test(); + // :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + c3.channel_masks[3] = false; // no alpha writes. + c3.end_time = 300.; + c3.tex_name = "cas-conveyor"; + + m_cas_conveyor_anim_array_idx = + create_fixed_anim_array({conveyor_0, conveyor_1, conveyor_2, conveyor_3}); + } + + // SECURITY + { + FixedAnimDef env; + env.color = math::Vector4(0, 0, 0, 0x80); + env.tex_name = "security-env-dest"; + for (int i = 0; i < 2; i++) { + auto& env1 = env.layers.emplace_back(); + env1.tex_name = "security-env-uscroll"; + // :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + env1.set_no_z_write_no_z_test(); + env1.channel_masks[3] = false; // no alpha writes. + // :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + env1.set_blend_b2_d1(); + env1.end_time = 4800.f; + } + + FixedAnimDef dot; + dot.color = math::Vector4(0, 0, 0, 0x80); + dot.tex_name = "security-dot-dest"; + + auto& cwhite = dot.layers.emplace_back(); + cwhite.set_blend_b2_d1(); + cwhite.set_no_z_write_no_z_test(); + cwhite.tex_name = "common-white"; + cwhite.end_time = 4800.f; + + for (int i = 0; i < 2; i++) { + auto& dsrc = dot.layers.emplace_back(); + dsrc.set_blend_b2_d1(); + dsrc.set_no_z_write_no_z_test(); + dsrc.end_time = 600.f; + dsrc.tex_name = "security-dot-src"; + } + + m_security_anim_array_idx = create_fixed_anim_array({env, dot}); + } + + // WATERFALL + { + FixedAnimDef waterfall; + waterfall.color = math::Vector4(0, 0, 0, 0x80); + waterfall.tex_name = "waterfall-dest"; + for (int i = 0; i < 4; i++) { + auto& src = waterfall.layers.emplace_back(); + src.set_blend_b1_d1(); + src.set_no_z_write_no_z_test(); + src.end_time = 450.f; + src.tex_name = "waterfall"; + } + m_waterfall_anim_array_idx = create_fixed_anim_array({waterfall}); + } + + { + FixedAnimDef waterfall; + waterfall.color = math::Vector4(0, 0, 0, 0x80); + waterfall.tex_name = "waterfall-dest"; + for (int i = 0; i < 4; i++) { + auto& src = waterfall.layers.emplace_back(); + src.set_blend_b1_d1(); + src.set_no_z_write_no_z_test(); + src.end_time = 450.f; + src.tex_name = "waterfall"; + } + m_waterfall_b_anim_array_idx = create_fixed_anim_array({waterfall}); + } + + // LAVA + { + FixedAnimDef lava; + lava.color = math::Vector4(0, 0, 0, 0x80); + lava.tex_name = "dig-lava-01-dest"; + for (int i = 0; i < 2; i++) { + auto& src = lava.layers.emplace_back(); + src.set_blend_b1_d1(); + src.set_no_z_write_no_z_test(); + src.end_time = 3600.f; + src.tex_name = "dig-lava-01"; + } + m_lava_anim_array_idx = create_fixed_anim_array({lava}); + } + + { + FixedAnimDef lava; + lava.color = math::Vector4(0, 0, 0, 0x80); + lava.tex_name = "dig-lava-01-dest"; + for (int i = 0; i < 2; i++) { + auto& src = lava.layers.emplace_back(); + src.set_blend_b1_d1(); + src.set_no_z_write_no_z_test(); + src.end_time = 3600.f; + src.tex_name = "dig-lava-01"; + } + m_lava_b_anim_array_idx = create_fixed_anim_array({lava}); + } + + // Stadiumb + { + FixedAnimDef def; + def.color = math::Vector4(0, 0, 0, 0x80); + def.tex_name = "stdmb-energy-wall-01-dest"; + for (int i = 0; i < 2; i++) { + auto& src = def.layers.emplace_back(); + src.set_blend_b1_d1(); + src.set_no_z_write_no_z_test(); + src.end_time = 300.f; + src.tex_name = "stdmb-energy-wall-01"; + } + m_stadiumb_anim_array_idx = create_fixed_anim_array({def}); + } + + // Fortress pris + { + FixedAnimDef l_tread; + l_tread.color = math::Vector4(0, 0, 0, 0x80); + l_tread.tex_name = "robotank-tread-l-dest"; + auto& l_src = l_tread.layers.emplace_back(); + l_src.set_blend_b1_d1(); + l_src.set_no_z_write_no_z_test(); + l_src.channel_masks[3] = false; // no alpha writes. + l_src.end_time = 1.f; + l_src.tex_name = "robotank-tread"; + + FixedAnimDef r_tread; + r_tread.color = math::Vector4(0, 0, 0, 0x80); + r_tread.tex_name = "robotank-tread-r-dest"; + auto& r_src = r_tread.layers.emplace_back(); + r_src.set_blend_b1_d1(); + r_src.set_no_z_write_no_z_test(); + r_src.channel_masks[3] = false; // no alpha writes. + r_src.end_time = 1.f; + r_src.tex_name = "robotank-tread"; + + m_fortress_pris_anim_array_idx = create_fixed_anim_array({l_tread, r_tread}); + } + + // Fortress Warp + { + FixedAnimDef def; + def.color = math::Vector4(0, 0, 0, 0x80); + def.move_to_pool = true; + def.tex_name = "fort-roboscreen-dest"; + auto& src = def.layers.emplace_back(); + src.set_blend_b2_d1(); + src.channel_masks[3] = false; // no alpha writes. + src.set_no_z_write_no_z_test(); + src.end_time = 300.f; + src.tex_name = "fort-roboscreen-env"; + m_fortress_warp_anim_array_idx = create_fixed_anim_array({def}); + } + + // metkor + { + FixedAnimDef def; + def.color = math::Vector4(0, 0, 0, 0x80); + def.tex_name = "squid-env-rim-dest"; + def.move_to_pool = true; + { + auto& src = def.layers.emplace_back(); + src.set_blend_b2_d1(); + src.channel_masks[3] = false; // no alpha writes. + src.set_no_z_write_no_z_test(); + src.set_clamp(); + src.end_time = 1200.f; + src.tex_name = "metkor-head-env-noise"; + } + { + auto& src = def.layers.emplace_back(); + src.set_blend_b2_d1(); + src.channel_masks[3] = false; // no alpha writes. + src.set_no_z_write_no_z_test(); + src.set_clamp(); + src.end_time = 1200.f; + src.tex_name = "metkor-head-env-scan"; + } + { + auto& src = def.layers.emplace_back(); + src.set_blend_b2_d1(); + src.channel_masks[3] = false; // no alpha writes. + src.set_no_z_write_no_z_test(); + src.set_clamp(); + src.end_time = 1200.f; + src.tex_name = "metkor-head-env-rim"; + } + { + auto& src = def.layers.emplace_back(); + src.set_blend_b2_d1(); + src.channel_masks[3] = false; // no alpha writes. + src.set_no_z_write_no_z_test(); + src.set_clamp(); + src.end_time = 1200.f; + src.tex_name = "metkor-head-env-rim"; + } + { + auto& src = def.layers.emplace_back(); + src.set_blend_b2_d1(); + src.channel_masks[3] = false; // no alpha writes. + src.set_no_z_write_no_z_test(); + src.set_clamp(); + src.end_time = 1200.f; + src.tex_name = "environment-phong-rim"; + } + m_metkor_anim_array_idx = create_fixed_anim_array({def}); + } + + // shield + { + FixedAnimDef def; + def.color = math::Vector4(0, 0, 0, 0x80); + def.tex_name = "squid-env-rim-dest"; + def.move_to_pool = true; + + { + auto& src = def.layers.emplace_back(); + src.set_blend_b2_d1(); + src.set_no_z_write_no_z_test(); + src.set_clamp(); + src.end_time = 1200.f; + src.tex_name = "common-white"; + } + + { + auto& src = def.layers.emplace_back(); + src.set_blend_b2_d1(); + src.channel_masks[3] = false; // no alpha writes. + src.set_no_z_write_no_z_test(); + src.set_clamp(); + src.end_time = 1200.f; + src.tex_name = "squid-env-uscroll"; + } + + { + auto& src = def.layers.emplace_back(); + src.set_blend_b2_d1(); + src.channel_masks[3] = false; // no alpha writes. + src.set_no_z_write_no_z_test(); + src.set_clamp(); + src.end_time = 1200.f; + src.tex_name = "squid-env-uscroll"; + } + + { + auto& src = def.layers.emplace_back(); + src.set_blend_b2_d1(); + src.channel_masks[3] = false; // no alpha writes. + src.set_no_z_write_no_z_test(); + src.set_clamp(); + src.end_time = 1200.f; + src.tex_name = "squid-env-rim-src"; + } + + { + auto& src = def.layers.emplace_back(); + src.set_blend_b2_d1(); + src.channel_masks[3] = false; // no alpha writes. + src.set_no_z_write_no_z_test(); + src.set_clamp(); + src.end_time = 1200.f; + src.tex_name = "squid-env-rim-src"; + } + m_shield_anim_array_idx = create_fixed_anim_array({def}); + } + + // krew + { + FixedAnimDef def; + def.color = math::Vector4(0, 0, 0, 0x80); + def.tex_name = "krew-holo-dest"; + def.move_to_pool = true; + { + auto& src = def.layers.emplace_back(); + src.set_blend_b2_d1(); + src.channel_masks[3] = false; // no alpha writes. + src.set_no_z_write_no_z_test(); + src.set_clamp(); + src.end_time = 1200.f; + src.tex_name = "metkor-head-env-noise"; + } + { + auto& src = def.layers.emplace_back(); + src.set_blend_b2_d1(); + src.channel_masks[3] = false; // no alpha writes. + src.set_no_z_write_no_z_test(); + src.set_clamp(); + src.end_time = 1200.f; + src.tex_name = "metkor-head-env-scan"; + } + { + auto& src = def.layers.emplace_back(); + src.set_blend_b2_d1(); + src.channel_masks[3] = false; // no alpha writes. + src.set_no_z_write_no_z_test(); + src.set_clamp(); + src.end_time = 1200.f; + src.tex_name = "metkor-head-env-rim"; + } + { + auto& src = def.layers.emplace_back(); + src.set_blend_b2_d1(); + src.channel_masks[3] = false; // no alpha writes. + src.set_no_z_write_no_z_test(); + src.set_clamp(); + src.end_time = 1200.f; + src.tex_name = "metkor-head-env-rim"; + } + { + auto& src = def.layers.emplace_back(); + src.set_blend_b2_d1(); + src.channel_masks[3] = false; // no alpha writes. + src.set_no_z_write_no_z_test(); + src.set_clamp(); + src.end_time = 1200.f; + src.tex_name = "metkor-phong-env"; + } + m_krew_holo_anim_array_idx = create_fixed_anim_array({def}); + } + + { + m_slime_output_slot = output_slot_by_idx(m_version, "cas-toxic-slime-dest"); + m_slime_scroll_output_slot = output_slot_by_idx(m_version, "cas-toxic-slime-scroll-dest"); + const float max_times[4] = {600.f, 300.f, 150.f, 75.f}; + const float scales[4] = {0.55, 0.6, 0.3, 0.1f}; + for (int i = 0, dim = kFinalSlimeTextureSize >> (kNumSlimeNoiseLayers - 1); + i < kNumSlimeNoiseLayers; i++, dim *= 2) { + auto& tex = m_slime_noise_textures[i]; + tex.temp_data.resize(dim * dim); + tex.max_time = max_times[i]; + tex.scale = scales[i]; + tex.dim = dim; + glGenTextures(1, &tex.new_tex); + m_random_index = update_opengl_noise_texture(tex.new_tex, tex.temp_data.data(), + m_random_table, dim, m_random_index); + glGenTextures(1, &tex.old_tex); + m_random_index = update_opengl_noise_texture(tex.old_tex, tex.temp_data.data(), + m_random_table, dim, m_random_index); + } + } +} \ No newline at end of file diff --git a/game/graphics/opengl_renderer/background/Hfrag.cpp b/game/graphics/opengl_renderer/background/Hfrag.cpp index bd620b4b52..cd3cc68625 100644 --- a/game/graphics/opengl_renderer/background/Hfrag.cpp +++ b/game/graphics/opengl_renderer/background/Hfrag.cpp @@ -349,7 +349,9 @@ void Hfrag::render_hfrag_level(Hfrag::HfragLevel* lev, b = false; } lev->stats = {}; - for (u32 bucket_idx = 0; bucket_idx < lev->hfrag->buckets.size(); bucket_idx++) { + + // bucket 0 is not drawn, although there is data there. + for (u32 bucket_idx = 1; bucket_idx < lev->hfrag->buckets.size(); bucket_idx++) { const auto& bucket = lev->hfrag->buckets[bucket_idx]; for (u32 corner_idx : bucket.corners) { const auto& corner = lev->hfrag->corners[corner_idx]; diff --git a/goal_src/jak3/engine/gfx/sky/sky-tng.gc b/goal_src/jak3/engine/gfx/sky/sky-tng.gc index 6af35cf552..682c507601 100644 --- a/goal_src/jak3/engine/gfx/sky/sky-tng.gc +++ b/goal_src/jak3/engine/gfx/sky/sky-tng.gc @@ -678,8 +678,6 @@ (mem-copy! (the-as pointer s4-1) (the-as pointer this) #x2814) (setup-stars s4-1 (-> s4-1 star-mat) (-> this upload-data)) (when (nonzero? (-> s4-1 star-colors 0 x)) - (format *stdcon* "doing stars asm!~%") - (format *stdcon* "~`matrix`I~%" (-> s4-1 star-mat)) (stars-transform-asm s4-1) ) (cond diff --git a/goal_src/jak3/engine/gfx/texture/texture-anim-funcs.gc b/goal_src/jak3/engine/gfx/texture/texture-anim-funcs.gc index b6ee17969e..e4099401f3 100644 --- a/goal_src/jak3/engine/gfx/texture/texture-anim-funcs.gc +++ b/goal_src/jak3/engine/gfx/texture/texture-anim-funcs.gc @@ -9,3 +9,234 @@ ;; DECOMP BEGINS +(defun noise-texture-anim-layer-func ((arg0 dma-buffer) (arg1 uint) (arg2 int) (arg3 int) (arg4 texture-anim-layer) (arg5 float)) + (format 0 "unsupported noise-texture-anim-layer-func~%") + (break!) + 0 + ) + +(defun cloud-texture-anim-layer-func ((arg0 dma-buffer) (arg1 uint) (arg2 int) (arg3 int) (arg4 texture-anim-layer) (arg5 float)) + (format 0 "unsupported cloud-texture-anim-layer-func~%") + (break!) + 0 + ) + +(defun cloud-texture-anim-func ((arg0 dma-buffer) (arg1 texture-anim)) + (format 0 "unsupported cloud-texture-anim-func~%") + (break!) + 0 + ) + +(defun fog-texture-anim-init ((arg0 texture-anim)) + (let ((gp-0 (new 'loading-level 'fog8x256)) + (s4-0 (new 'loading-level 'clut16x16)) + ) + (when (and gp-0 s4-0) + (let ((v1-5 (new 'loading-level 'texture))) + (let ((a0-4 (the int (-> arg0 extra x))) + (a1-3 (the int (-> arg0 extra y))) + ) + (set! (-> arg0 tex) v1-5) + (set! (-> v1-5 pad 0) (the-as uint gp-0)) + (set! (-> v1-5 pad 1) (the-as uint s4-0)) + (set! (-> v1-5 w) 256) + (set! (-> v1-5 h) 1) + (set! (-> v1-5 num-mips) (the-as uint 1)) + (set! (-> v1-5 psm) (gs-psm mt8)) + (set! (-> v1-5 clutpsm) (the-as uint 0)) + (set! (-> v1-5 dest 0) (the-as uint (* a0-4 32))) + (set! (-> v1-5 clutdest) (the-as uint (* a1-3 32))) + ) + (set! (-> v1-5 width 0) (the-as uint 4)) + (set! (-> v1-5 masks data 0 mask quad) (the-as uint128 0)) + (set! (-> v1-5 masks data 1 mask quad) (the-as uint128 0)) + (set! (-> v1-5 masks data 2 mask quad) (the-as uint128 0)) + ) + 0 + (dotimes (v1-7 256) + (nop!) + (nop!) + (nop!) + (nop!) + (set! (-> gp-0 image v1-7) (the-as uint v1-7)) + ) + ) + ) + 0 + ) + +(define *fog-texture-work* (new 'static 'fog-texture-work :const (new 'static 'vector :x 0.00390625))) + + +(defun real-fog-texture-anim-func ((arg0 dma-buffer) (arg1 texture-anim)) + (local-vars (v1-11 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (s1-0 *fog-texture-work*) + (s2-0 (the-as (pointer uint32) (-> arg1 tex pad 1))) + ) + (let ((v1-1 (-> s1-0 color))) + (dotimes (a0-1 256) + (set! (-> s2-0 a0-1) (the-as uint v1-1)) + ) + ) + (vector+! (-> s1-0 max-corner) (the-as vector (-> s1-0 corner)) (-> s1-0 corner 1)) + (vector-float*! (-> s1-0 max-corner) (-> s1-0 max-corner) 0.5) + (vector+! (-> s1-0 min-corner) (-> s1-0 corner 2) (-> s1-0 corner 3)) + (vector-float*! (-> s1-0 min-corner) (-> s1-0 min-corner) 0.5) + (when (< (-> s1-0 max-corner y) (-> s1-0 min-corner y)) + (.lvf vf1 (&-> s1-0 min-corner quad)) + (.lvf vf2 (&-> s1-0 max-corner quad)) + (.svf (&-> s1-0 max-corner quad) vf1) + (.svf (&-> s1-0 min-corner quad) vf2) + (.mov v1-11 vf2) + ) + (let* ((f0-3 (-> s1-0 corner 0 y)) + (f2-0 (-> s1-0 corner 1 y)) + (f1-1 (fmin f0-3 f2-0)) + (f2-1 (fmax f0-3 f2-0)) + (f3-0 (-> s1-0 corner 2 y)) + (f0-4 (-> s1-0 corner 3 y)) + (f1-3 (fmin (fmin f1-1 f3-0) f0-4)) + (f0-5 (fmax (fmax f2-1 f3-0) f0-4)) + ) + (set! (-> s1-0 min-corner y) f1-3) + (set! (-> s1-0 max-corner y) f0-5) + ) + (set! (-> s4-0 quad) (-> s1-0 min-corner quad)) + (vector-! s3-0 (-> s1-0 max-corner) (-> s1-0 min-corner)) + (vector-float/! s3-0 s3-0 256.0) + 0.0 + 0.0 + (let ((f0-9 (fmax 4096.0 (-> *math-camera* trans y))) + (f1-5 (-> arg1 extra z)) + (f2-3 (-> s1-0 alpha-near)) + (f3-1 (-> s1-0 alpha-far)) + (f4-0 (-> s1-0 alpha-delta)) + (f5-0 (-> s1-0 fog-near)) + (f6-0 (-> s1-0 fog-far)) + (f7-0 (-> s1-0 fog-delta)) + ) + (dotimes (v1-17 256) + (let* ((f8-0 (-> s4-0 y)) + (f8-1 (cond + ((= f8-0 0.0) + f3-1 + ) + ((< f8-0 0.0) + (let ((f9-4 (fmin f6-0 (/ (* f0-9 (vector-length s4-0)) (- f8-0))))) + (+ f2-3 (* f4-0 (/ (fmax 0.0 (- f9-4 f5-0)) f7-0))) + ) + ) + (else + (let ((f9-8 (fmin f6-0 (/ (* f1-5 (vector-length s4-0)) f8-0)))) + (+ f2-3 (* f4-0 (/ (fmax 0.0 (- f9-8 f5-0)) f7-0))) + ) + ) + ) + ) + ) + (set! (-> s2-0 (-> *clut-translate* v1-17)) + (logior (logand (-> s2-0 (-> *clut-translate* v1-17)) (the-as uint #xffffffff00ffffff)) + (shr (shl (the int (* 128.0 f8-1)) 56) 32) + ) + ) + ) + (vector+! s4-0 s4-0 s3-0) + ) + ) + ) + (let ((s5-1 (-> arg1 tex)) + (v1-20 *display*) + (a0-26 144) + ) + (+! (-> v1-20 mem-reserve-size) a0-26) + (the-as + int + (when (not (-> v1-20 dma-buffer-overflow)) + (let ((a2-3 (-> v1-20 frames (-> v1-20 on-screen) global-buf))) + (if (< (-> a2-3 real-buffer-end) (the-as int (&+ (-> a2-3 base) a0-26))) + (set! (-> v1-20 dma-buffer-overflow) #t) + ) + ) + (when (not (-> v1-20 dma-buffer-overflow)) + ;; PC port of texture upload: + (pc-texture-anim-flag upload-generic-vram arg0 :qwc 1) + (let ((upload-record (the texture-anim-pc-upload (-> arg0 base)))) + (set! (-> upload-record data) (the-as pointer (-> s5-1 pad 0))) ;; the texture data + (set! (-> upload-record width) (-> s5-1 w)) ;; see fog-texture-anim-init, there's not cropping. + (set! (-> upload-record height) (-> s5-1 h)) + (set! (-> upload-record dest) (-> s5-1 dest 0)) + (set! (-> upload-record format) (-> s5-1 psm)) + (set! (-> upload-record force-to-gpu) 1) + ) + (&+! (-> arg0 base) 16) + ;; original upload + ; (dma-buffer-add-gs-set arg0 + ; (bitbltbuf + ; (new 'static 'gs-bitbltbuf :dpsm (the-as int (-> s5-1 psm)) :dbp (-> s5-1 dest 0) :dbw (-> s5-1 width 0)) + ; ) + ; (trxpos (new 'static 'gs-trxpos)) + ; (trxreg (new 'static 'gs-trxreg :rrw (-> s5-1 w) :rrh (-> s5-1 h))) + ; (trxdir (new 'static 'gs-trxdir)) + ; ) + ; (dma-buffer-add-ref-texture arg0 (the-as pointer (-> s5-1 pad 0)) (-> s5-1 w) (-> s5-1 h) (-> s5-1 psm)) + + + ;; PC port of clut upload + ;;(upload-vram-data arg0 (the-as int (-> s5-1 clutdest)) (the-as pointer (-> s5-1 pad 1)) 16 16) + (pc-texture-anim-flag upload-clut-16-16 arg0 :qwc 1) + (let ((upload-record (the texture-anim-pc-upload (-> arg0 base)))) + (set! (-> upload-record data) (the-as pointer (-> s5-1 pad 1))) ;; the clut16x16 object + (set! (-> upload-record width) 16) + (set! (-> upload-record height) 16) + (set! (-> upload-record dest) (-> s5-1 clutdest)) + (set! (-> upload-record format) (gs-psm ct32)) + ) + (&+! (-> arg0 base) 16) + (set! (-> *texture-pool* ids (shr (-> s5-1 clutdest) 6)) (the-as uint 0)) + ; (let* ((v1-29 arg0) + ; (a0-39 (-> v1-29 base)) + ; ) + ; (set! (-> (the-as (pointer int64) a0-39)) #x10000002) + ; (s.w! (+ a0-39 8) 0) + ; (let ((a1-52 #x50000002)) + ; (s.w! (+ a0-39 12) a1-52) + ; ) + ; (set! (-> v1-29 base) (&+ a0-39 16)) + ; ) + ; (let* ((v1-30 arg0) + ; (a0-41 (-> v1-30 base)) + ; ) + ; (set! (-> (the-as (pointer uint64) a0-41)) (make-u128 0 (the-as uint #x1000000000008001))) + ; (let ((a1-55 (the-as uint #xeeeeeeeeeeeeeeee))) + ; (s.d! (+ a0-41 8) a1-55) + ; ) + ; (set! (-> v1-30 base) (&+ a0-41 16)) + ; ) + ; (let ((v1-31 (-> arg0 base))) + ; (set! (-> (the-as (pointer int64) v1-31)) 0) + ; (let ((a0-43 63)) + ; (s.d! (+ v1-31 8) a0-43) + ; ) + ; (set! (-> arg0 base) (&+ v1-31 16)) + ; ) + (let ((v1-34 (shr (-> s5-1 dest 0) 6))) + (dotimes (a0-44 3) + (set! (-> *texture-pool* ids (+ v1-34 a0-44)) (the-as uint 0)) + ) + ) + #f + ) + ) + ) + ) + ) + ) + +(defun fog-texture-anim-func ((arg0 dma-buffer) (arg1 texture-anim)) + (real-fog-texture-anim-func arg0 arg1) + ) diff --git a/goal_src/jak3/engine/gfx/texture/texture-anim-h.gc b/goal_src/jak3/engine/gfx/texture/texture-anim-h.gc index 3f40cc925e..65011366e6 100644 --- a/goal_src/jak3/engine/gfx/texture/texture-anim-h.gc +++ b/goal_src/jak3/engine/gfx/texture/texture-anim-h.gc @@ -11,34 +11,41 @@ ;; DECOMP BEGINS (deftype texture-anim-layer (structure) - ((extra vector :inline :offset 240) - (func (function dma-buffer uint int int texture-anim-layer float int)) - (func-id symbol :overlay-at func) - (init-func (function texture-anim-layer int)) - (init-func-id symbol :overlay-at init-func) - (tex texture) - (start-time float) - (end-time float) - (tex-name string) - (test gs-test) - (alpha gs-alpha) - (clamp gs-clamp) - (start-color vector :inline :offset 80) - (start-scale vector2 :inline :offset 96) - (start-offset vector2 :inline :offset 104) - (start-st-scale vector2 :inline :offset 112) - (start-st-offset vector2 :inline :offset 120) - (start-qs vector :inline :offset 128) - (start-rot degrees :offset 144) - (start-st-rot degrees :offset 148) - (end-color vector :inline :offset 160) - (end-scale vector2 :inline :offset 176) - (end-offset vector2 :inline :offset 184) - (end-st-scale vector2 :inline :offset 192) - (end-st-offset vector2 :inline :offset 200) - (end-qs vector :inline :offset 208) - (end-rot degrees :offset 224) - (end-st-rot degrees :offset 228) + ((interpolated-color vector :inline) + (interpolated-scale-offset vector :inline) + (interpolated-st-scale-offset vector :inline) + (interpolated-qs vector :inline) + (interpolated-rot vector :inline) + (extra vector :inline :offset 240) + (func (function dma-buffer uint int int texture-anim-layer float int)) + (func-id symbol :overlay-at func) + (init-func (function texture-anim-layer int)) + (init-func-id symbol :overlay-at init-func) + (tex texture) + (start-time float) + (end-time float) + (tex-name string) + (test gs-test) + (alpha gs-alpha) + (clamp gs-clamp) + (start-vectors vector 5 :inline :offset 80) ;; added + (start-color vector :inline :offset 80) + (start-scale vector2 :inline :offset 96) + (start-offset vector2 :inline :offset 104) + (start-st-scale vector2 :inline :offset 112) + (start-st-offset vector2 :inline :offset 120) + (start-qs vector :inline :offset 128) + (start-rot degrees :offset 144) + (start-st-rot degrees :offset 148) + (end-vectors vector 5 :inline :offset 160) ;; added + (end-color vector :inline :offset 160) + (end-scale vector2 :inline :offset 176) + (end-offset vector2 :inline :offset 184) + (end-st-scale vector2 :inline :offset 192) + (end-st-offset vector2 :inline :offset 200) + (end-qs vector :inline :offset 208) + (end-rot degrees :offset 224) + (end-st-rot degrees :offset 228) ) (:methods (initialize-texture! (_type_) _type_) diff --git a/goal_src/jak3/engine/gfx/texture/texture-anim-tables.gc b/goal_src/jak3/engine/gfx/texture/texture-anim-tables.gc index 90ddd50802..db9d40f854 100644 --- a/goal_src/jak3/engine/gfx/texture/texture-anim-tables.gc +++ b/goal_src/jak3/engine/gfx/texture/texture-anim-tables.gc @@ -15,14 +15,1824 @@ ;; DECOMP BEGINS -(defun set-darkjak-texture-morph! ((arg0 float)) - (none) +(define *sky-texture-anim-array* + (the-as (texture-anim-array texture-anim) + (new 'static 'texture-anim-array :type texture-anim + (new 'static 'texture-anim + :func-id 'texture-anim-alpha-ramp-clut-upload + :init-func-id 'texture-anim-alpha-ramp-clut-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 24.0) + :color (new 'static 'rgba :a #x80) + :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 0) + ) + (new 'static 'texture-anim + :num-layers #x2 + :func-id 'cloud-texture-anim-func + :init-func-id 'dest-texture-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 16.0 :y 4.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 300.0 + :frame-mod 4800.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 + :extra (new 'static 'vector :x 16.0 :y 16.0 :z 24.0) + :func-id 'cloud-texture-anim-layer-func + :init-func-id 'noise-texture-init + :tex #f + :end-time 4800.0 + :tex-name #f + :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) + :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 + :extra (new 'static 'vector :x 16.0 :y 16.0 :z 24.0) + :func-id 'cloud-texture-anim-layer-func + :init-func-id 'noise-texture-init + :tex #f + :end-time 4800.0 + :tex-name #f + :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) + :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) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x2 + :func-id 'cloud-texture-anim-func + :init-func-id 'dest-texture-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 32.0 :y 5.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 300.0 + :frame-mod 2400.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 + :extra (new 'static 'vector :x 32.0 :y 16.0 :z 24.0) + :func-id 'cloud-texture-anim-layer-func + :init-func-id 'noise-texture-init + :tex #f + :end-time 2400.0 + :tex-name #f + :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) + :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 + :extra (new 'static 'vector :x 32.0 :y 16.0 :z 24.0) + :func-id 'cloud-texture-anim-layer-func + :init-func-id 'noise-texture-init + :tex #f + :end-time 2400.0 + :tex-name #f + :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) + :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) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x2 + :func-id 'cloud-texture-anim-func + :init-func-id 'dest-texture-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 64.0 :y 6.0) + :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) + :data (new 'static 'array texture-anim-layer 2 + (new 'static 'texture-anim-layer + :extra (new 'static 'vector :x 64.0 :y 16.0 :z 24.0) + :func-id 'cloud-texture-anim-layer-func + :init-func-id 'noise-texture-init + :tex #f + :end-time 1200.0 + :tex-name #f + :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) + :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 + :extra (new 'static 'vector :x 64.0 :y 16.0 :z 24.0) + :func-id 'cloud-texture-anim-layer-func + :init-func-id 'noise-texture-init + :tex #f + :end-time 1200.0 + :tex-name #f + :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) + :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) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x2 + :func-id 'cloud-texture-anim-func + :init-func-id 'dest-texture-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 128.0 :y 8.0) + :color (new 'static 'rgba :a #x80) + :frame-delta 300.0 + :frame-mod 600.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 + :extra (new 'static 'vector :x 128.0 :y 16.0 :z 24.0) + :func-id 'cloud-texture-anim-layer-func + :init-func-id 'noise-texture-init + :tex #f + :end-time 600.0 + :tex-name #f + :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) + :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 + :extra (new 'static 'vector :x 128.0 :y 16.0 :z 24.0) + :func-id 'cloud-texture-anim-layer-func + :init-func-id 'noise-texture-init + :tex #f + :end-time 600.0 + :tex-name #f + :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) + :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) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x4 + :func #f + :init-func-id 'dest-texture-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 128.0 :y 16.0) + :color (new 'static 'rgba :a #x80) + :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 6 + (new 'static 'texture-anim-layer + :extra (new 'static 'vector :x 16.0 :y 4.0) + :func-id 'default-texture-anim-layer-func + :init-func-id 'src-texture-init + :tex #f + :end-time 300.0 + :tex-name #f + :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 0.5) + :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) + ) + (new 'static 'texture-anim-layer + :extra (new 'static 'vector :x 32.0 :y 5.0) + :func-id 'default-texture-anim-layer-func + :init-func-id 'src-texture-init + :tex #f + :end-time 300.0 + :tex-name #f + :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 0.2) + :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) + ) + (new 'static 'texture-anim-layer + :extra (new 'static 'vector :x 64.0 :y 6.0) + :func-id 'default-texture-anim-layer-func + :init-func-id 'src-texture-init + :tex #f + :end-time 300.0 + :tex-name #f + :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 0.15) + :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) + ) + (new 'static 'texture-anim-layer + :extra (new 'static 'vector :x 128.0 :y 8.0) + :func-id 'default-texture-anim-layer-func + :init-func-id 'src-texture-init + :tex #f + :end-time 300.0 + :tex-name #f + :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 0.0075) + :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) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x1 + :func #f + :init-func-id 'dest-texture-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 128.0 :y 8.0) + :color (new 'static 'rgba :a #x80) + :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 + :extra (new 'static 'vector :x 128.0 :y 16.0) + :func-id 'move-rg-to-ba-texture-anim-layer-func + :init-func-id 'src-texture-init + :tex #f + :end-time 300.0 + :tex-name #f + :test (new 'static 'gs-test :ate #x1 :afail #x1 :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.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) + ) + ) + ) + (new 'static 'texture-anim + :func-id 'texture-anim-cloud-clut-upload + :init-func-id 'texture-anim-cloud-clut-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 24.0 :y 0.5 :z 1.0) + :color (new 'static 'rgba :a #x80) + :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 + :func-id 'fog-texture-anim-func + :init-func-id 'fog-texture-anim-init + :tex #f + :tex-name #f + :extra (new 'static 'vector :x 4.0 :y 6.0 :z 122880.0) + :color (new 'static 'rgba :a #x80) + :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) + ) + ) + ) ) +;; WARN: Return type mismatch float vs none. (defun set-fog-height! ((arg0 float)) + (set! (-> *sky-texture-anim-array* array-data 8 extra z) arg0) (none) ) +;; WARN: Return type mismatch float vs none. (defun set-cloud-minmax! ((arg0 float) (arg1 float)) + (set! (-> *sky-texture-anim-array* array-data 7 extra y) arg0) + (set! (-> *sky-texture-anim-array* array-data 7 extra z) arg1) (none) - ) \ No newline at end of file + ) + +(define *darkjak-texture-anim-array* + (the-as (texture-anim-array texture-anim) + (new 'static 'texture-anim-array :type texture-anim + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func #f + :tex #f + :tex-name "jakc-arm" + :color (new 'static 'rgba :a #x80) + :frame-mod 2.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 6 + (new 'static 'texture-anim-layer + :func-id 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakc-arm-norm" + :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.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) + :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 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakc-arm-dark" + :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) + :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) + ) + (new 'static 'texture-anim-layer + :func-id 'set-clut-alpha-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 300.0 + :tex-name #f + :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.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) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func #f + :tex #f + :tex-name "jakc-eyebrow" + :color (new 'static 'rgba :a #x80) + :frame-mod 2.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 6 + (new 'static 'texture-anim-layer + :func-id 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakc-eyebrow-norm" + :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.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) + :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 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakc-eyebrow-dark" + :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) + :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) + ) + (new 'static 'texture-anim-layer + :func-id 'set-clut-alpha-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 300.0 + :tex-name #f + :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.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) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func #f + :tex #f + :tex-name "jakc-face" + :color (new 'static 'rgba :a #x80) + :frame-mod 2.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 6 + (new 'static 'texture-anim-layer + :func-id 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakc-face-norm" + :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.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) + :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 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakc-face-dark" + :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) + :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) + ) + (new 'static 'texture-anim-layer + :func-id 'set-clut-alpha-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 300.0 + :tex-name #f + :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.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) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func #f + :tex #f + :tex-name "jakc-finger" + :color (new 'static 'rgba :a #x80) + :frame-mod 2.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 6 + (new 'static 'texture-anim-layer + :func-id 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakc-finger-norm" + :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.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) + :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 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakc-finger-dark" + :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) + :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) + ) + (new 'static 'texture-anim-layer + :func-id 'set-clut-alpha-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 300.0 + :tex-name #f + :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.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) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func #f + :tex #f + :tex-name "jakc-hair" + :color (new 'static 'rgba :a #x80) + :frame-mod 2.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 6 + (new 'static 'texture-anim-layer + :func-id 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakc-hair-norm" + :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.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) + :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 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakc-hair-dark" + :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) + :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) + ) + (new 'static 'texture-anim-layer + :func-id 'copy-clut-alpha-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakc-hair-norm" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :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.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) + ) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun set-darkjak-texture-morph! ((arg0 float)) + (let ((v1-0 *darkjak-texture-anim-array*)) + (dotimes (a1-0 (-> v1-0 length)) + (set! (-> v1-0 array-data a1-0 frame-time) arg0) + ) + ) + (none) + ) + +(define *darkjak-highres-texture-anim-array* + (the-as (texture-anim-array texture-anim) + (new 'static 'texture-anim-array :type texture-anim + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func #f + :tex #f + :tex-name "jakchires-arm" + :color (new 'static 'rgba :a #x80) + :frame-mod 2.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 6 + (new 'static 'texture-anim-layer + :func-id 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakchires-arm-norm" + :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.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) + :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 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakchires-arm-dark" + :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) + :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) + ) + (new 'static 'texture-anim-layer + :func-id 'set-clut-alpha-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 300.0 + :tex-name #f + :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.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) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func #f + :tex #f + :tex-name "jakchires-eye" + :color (new 'static 'rgba :a #x80) + :frame-mod 2.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 6 + (new 'static 'texture-anim-layer + :func-id 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakchires-eye-norm" + :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.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) + :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 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakchires-eye-dark" + :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) + :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) + ) + (new 'static 'texture-anim-layer + :func-id 'set-clut-alpha-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 300.0 + :tex-name #f + :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.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) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func #f + :tex #f + :tex-name "jakchires-eyebrow" + :color (new 'static 'rgba :a #x80) + :frame-mod 2.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 6 + (new 'static 'texture-anim-layer + :func-id 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakchires-eyebrow-norm" + :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.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) + :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 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakchires-eyebrow-dark" + :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) + :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) + ) + (new 'static 'texture-anim-layer + :func-id 'set-clut-alpha-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 300.0 + :tex-name #f + :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.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) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func #f + :tex #f + :tex-name "jakchires-eyelid" + :color (new 'static 'rgba :a #x80) + :frame-mod 2.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 6 + (new 'static 'texture-anim-layer + :func-id 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakchires-eyelid-norm" + :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.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) + :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 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakchires-eyelid-dark" + :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) + :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) + ) + (new 'static 'texture-anim-layer + :func-id 'set-clut-alpha-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 300.0 + :tex-name #f + :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.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) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func #f + :tex #f + :tex-name "jakchires-facelft" + :color (new 'static 'rgba :a #x80) + :frame-mod 2.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 6 + (new 'static 'texture-anim-layer + :func-id 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakchires-facelft-norm" + :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.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) + :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 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakchires-facelft-dark" + :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) + :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) + ) + (new 'static 'texture-anim-layer + :func-id 'set-clut-alpha-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 300.0 + :tex-name #f + :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.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) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func #f + :tex #f + :tex-name "jakchires-facert" + :color (new 'static 'rgba :a #x80) + :frame-mod 2.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 6 + (new 'static 'texture-anim-layer + :func-id 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakchires-facert-norm" + :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.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) + :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 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakchires-facert-dark" + :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) + :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) + ) + (new 'static 'texture-anim-layer + :func-id 'set-clut-alpha-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 300.0 + :tex-name #f + :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.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) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func #f + :tex #f + :tex-name "jakchires-hair" + :color (new 'static 'rgba :a #x80) + :frame-mod 2.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 6 + (new 'static 'texture-anim-layer + :func-id 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakchires-hair-norm" + :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.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) + :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 'blend-clut-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakchires-hair-dark" + :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) + :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) + ) + (new 'static 'texture-anim-layer + :func-id 'copy-clut-alpha-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1.0 + :tex-name "jakchires-hair-norm" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :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.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-darkjak-highres-texture-morph! ((arg0 float)) + (let ((v1-0 *darkjak-highres-texture-anim-array*)) + (dotimes (a1-0 (-> v1-0 length)) + (set! (-> v1-0 array-data a1-0 frame-time) arg0) + ) + ) + #f + ) + +(define *skull-gem-texture-anim-array* + (the-as (texture-anim-array texture-anim) + (new 'static 'texture-anim-array :type texture-anim + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func #f + :tex #f + :tex-name "skull-gem-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 6 + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 300.0 + :tex-name "skull-gem-alpha-00" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :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.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-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 300.0 + :tex-name "skull-gem-alpha-01" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 0.6 :y 0.6 :z 0.6 :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 2.0 1.0)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 0.6 :y 0.5 :z 0.6 :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-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 300.0 + :tex-name "skull-gem-alpha-02" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 0.6 :y 0.6 :z 0.6 :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-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 0.6 :y 0.6 :z 0.6 :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 2.0 2.0)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + ) + ) + ) + +(define *default-water-texture-anim-array* + (the-as (texture-anim-array texture-anim) + (new 'static 'texture-anim-array :type texture-anim + (new 'static 'texture-anim + :num-layers #x2 + :func #f + :init-func-id 'texture-anim-overide-size-init + :tex #f + :tex-name "bomb-gradient" + :extra (new 'static 'vector :x 64.0 :y 64.0 :z 1.0) + :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) + :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + :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 "bomb-gradient-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 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 4.0)) + :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 300.0 + :tex-name "bomb-gradient-flames" + :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.0 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 -6.0 0.5)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x2 + :func #f + :init-func-id 'texture-anim-overide-size-init + :tex #f + :tex-name "blue-beam-dest" + :extra (new 'static 'vector :x 128.0 :y 128.0 :z 1.0) + :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 "lightning-beam-01" + :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.0 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 -4.0 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 300.0 + :tex-name "lightning-beam-02" + :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 0.6)) + :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.0 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 0.6)) + :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 -6.0 0.5)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x2 + :func #f + :init-func-id 'texture-anim-overide-size-init + :tex #f + :tex-name "lightjak-wings" + :extra (new 'static 'vector :x 64.0 :y 16.0 :z 1.0) + :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) + :clamp (new 'static 'gs-clamp :wmt (gs-tex-wrap-mode clamp)) + :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 "lightjak-wings-u-src" + :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :clamp (new 'static 'gs-clamp :wmt (gs-tex-wrap-mode clamp)) + :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.0 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 -1.0 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 300.0 + :tex-name "lightjak-wings-v-src" + :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp)) + :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 #x2 + :func #f + :init-func-id 'texture-anim-overide-size-init + :tex #f + :tex-name "mushroom-dest" + :extra (new 'static 'vector :x 128.0 :y 64.0 :z 1.0) + :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) + :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 1200.0 + :tex-name "mushroom-src" + :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)) + :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) + ) + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1200.0 + :tex-name "mushroom-src" + :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :c #x2 :d #x2 :fix #x80) + :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp)) + :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 *default-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 #x5 + :func #f + :init-func-id 'texture-anim-overide-size-init + :tex #f + :tex-name "shield-env-rim-dest" + :extra (new 'static 'vector :x 64.0 :y 64.0 :z 1.0) + :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 "common-white" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :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) + :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) + :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 "shield-env-uscroll" + :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.0 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 4.0 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 "shield-env-uvscroll" + :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-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 8.0 4.0)) + :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 "shield-env-rim-src" + :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 65536) + ) + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 1200.0 + :tex-name "shield-env-rim-src" + :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 65536) + ) + ) + ) + ) + ) + ) diff --git a/goal_src/jak3/engine/gfx/texture/texture-anim.gc b/goal_src/jak3/engine/gfx/texture/texture-anim.gc index cf0c774098..8abd5be83c 100644 --- a/goal_src/jak3/engine/gfx/texture/texture-anim.gc +++ b/goal_src/jak3/engine/gfx/texture/texture-anim.gc @@ -7,3 +7,1438 @@ ;; DECOMP BEGINS +(define *texture-anim-work* + (new 'static 'texture-anim-work + :erase-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x3003400000008001 #x551) + ) + :draw-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x902a400000008001 #x525252521) + ) + :draw2-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x500b400000008001 #x52521) + ) + :fill-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x3003400000008001 #x551) + ) + :adgif-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x1000000000008005 #xe) + ) + :corner0 (new 'static 'vector :x -0.5 :y -0.5 :w 1.0) + :corner1 (new 'static 'vector :x 0.5 :y -0.5 :w 1.0) + :corner2 (new 'static 'vector :x -0.5 :y 0.5 :w 1.0) + :corner3 (new 'static 'vector :x 0.5 :y 0.5 :w 1.0) + :const (new 'static 'vector :x 128.0 :z 1.9921 :w 1.0) + :color (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) + :random (new 'static 'inline-array vector4w 8 + (new 'static 'vector4w :x #x17181920 :y #x13141516 :z -1995435758 :w #x1234567) + (new 'static 'vector4w :x #x23878237 :y #x32048778 :z -1740074601 :w -2021050320) + (new 'static 'vector4w :x #x62024762 :y -1876389256 :z #x28724781 :w #x68712983) + (new 'static 'vector4w :x #x62176128 :y #x12387487 :z #x12780983 :w -2139999882) + (new 'static 'vector4w :x #x34987239 :y #x78699872 :z -2087161499 :w #x1982397) + (new 'static 'vector4w :x -1737344873 :y -1742502109 :z #x20987293 :w #x62102981) + (new 'static 'vector4w :x -2110229208 :y -2022559591 :z -1743517309 :w #x29874310) + (new 'static 'vector4w :x -2030034041 :y -1743611880 :z -2094950384 :w #x71623790) + ) + ) + ) + +(defun texture-anim-layer-interp ((arg0 texture-anim-layer) (arg1 float)) + (format 0 "unsupported texture-anim-layer-interp~%") + (break!) + (none) + ) + +;; og:preserve-this +(defenum texture-anim-pc + (start-anim-array 12) + (finish-anim-array 13) + (erase-and-init 14) + (upload-clut-16-16 15) ;; needed for fog clut upload + (upload-generic-vram 16) ;; needed for fog texture upload + ; (set-shader 17) + ; (draw 18) + ; (move-rg-to-ba 19) + ; (set-clut-alpha 20) + ; (copy-clut-alpha 21) + (darkjak 22) + ; (prison-jak 23) + ; (oracle-jak 24) + ; (nest-jak 25) + ; (kor-transform 26) + (skull-gem 27) ;; same as jak 2 + ; (bomb 28) + ; (cas-conveyor 29) + ; (security 30) + ; (waterfall 31) + ; (waterfall-b 32) + ; (lava 33) + ; (lava-b 34) + ; (stadiumb 35) + ; (fortress-pris 36) + ; (fortress-warp 37) + ; (metkor 38) + ; (shield 39) + ; (krew-holo 40) + (clouds-and-fog 41) ;; same as jak 2 + ; (slime 42) + ; (clouds-hires 43) + ) + +(deftype texture-anim-pc-upload (structure) + ((data pointer) + (width uint16) + (height uint16) + (dest uint32) + (format gs-psm) + (force-to-gpu uint8) + (pad uint8 2) + ) + :size-assert 16 + ) + +(deftype texture-anim-pc-texture-transform (structure) + ((src-tbp uint32) + (dest-tbp uint32) + (pad0 uint32) + (pad1 uint32) + ) + ) + +(defmacro pc-texture-anim-flag (kind buf &key (qwc 0)) + `(dma-buffer-add-cnt-vif2 + ,buf + ,qwc + (new 'static 'vif-tag :cmd (vif-cmd pc-port) :imm (texture-anim-pc ,kind)) + (new 'static 'vif-tag) + ) + ) + +(defmacro pc-texture-anim-flag-id (kind buf &key (qwc 0)) + `(dma-buffer-add-cnt-vif2 + ,buf + ,qwc + (new 'static 'vif-tag :cmd (vif-cmd pc-port) :imm ,kind) + (new 'static 'vif-tag) + ) + ) + +(defun texture-anim-layer-add-shader ((arg0 dma-buffer) (arg1 texture-anim-layer) (arg2 int)) + (format 0 "call to texture-anim-layer-add-shader~%") + (break!) + (none) + ) + +;; WARN: Return type mismatch pointer vs none. +(defun texture-anim-layer-add-clut-shader ((arg0 dma-buffer) (arg1 texture-anim-layer) (arg2 int)) + (format 0 "call to texture-anim-layer-add-clut-shader~%") + (break!) + (none) + ) + +;; WARN: Return type mismatch pointer vs none. +(defun texture-anim-layer-draw ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 texture-anim-layer)) + (format 0 "call to texture-anim-layer-draw~%") + (break!) + (none) + ) + +(defun default-texture-anim-layer-func ((arg0 dma-buffer) (arg1 uint) (arg2 int) (arg3 int) (arg4 texture-anim-layer) (arg5 float)) + (format 0 "call to default-texture-anim-layer-func~%") + (break!) + 0 + ) + +(defun blend-clut-texture-anim-layer-func ((arg0 dma-buffer) (arg1 uint) (arg2 int) (arg3 int) (arg4 texture-anim-layer) (arg5 float)) + (format 0 "call to blend-clut-texture-anim-layer-func~%") + (break!) + 0 + ) + +(defun add-clut-texture-anim-layer-func ((arg0 dma-buffer) (arg1 uint) (arg2 int) (arg3 int) (arg4 texture-anim-layer) (arg5 float)) + (format 0 "call to add-clut-texture-anim-layer-func~%") + (break!) + 0 + ) + +(defun dest-blend-clut-texture-anim-layer-func ((arg0 dma-buffer) (arg1 uint) (arg2 int) (arg3 int) (arg4 texture-anim-layer) (arg5 float)) + (format 0 "call to dest-blend-clut-texture-anim-layer-func~%") + (break!) + 0 + ) + +(defun move-rg-to-ba-texture-anim-layer-func ((arg0 dma-buffer) (arg1 uint) (arg2 int) (arg3 int) (arg4 texture-anim-layer) (arg5 float)) + (format 0 "call to move-rg-to-ba-texture-anim-layer-func~%") + (break!) + 0 + ) + +(defun fill-rgb-texture-anim-layer-func ((arg0 dma-buffer) (arg1 uint) (arg2 int) (arg3 int) (arg4 texture-anim-layer) (arg5 float)) + (format 0 "call to fill-rgb-texture-anim-layer-func~%") + (break!) + 0 + ) + +;; WARN: Return type mismatch pointer vs none. +(defun texture-anim-draw-mip-shader ((arg0 dma-buffer) (arg1 texture) (arg2 int)) + (format 0 "call to texture-anim-draw-mip-shader~%") + (break!) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun clear-texture-ids ((arg0 texture)) + (let ((v1-0 (-> arg0 w)) + (a1-0 (-> arg0 h)) + ) + (dotimes (a2-0 (the-as int (-> arg0 num-mips))) + (let* ((a3-0 (- a2-0)) + (t0-1 (ash v1-0 a3-0)) + (t1-2 (ash a1-0 a3-0)) + (t2-0 (shr (-> arg0 dest a2-0) 5)) + (a3-6 (min 128 (the-as int (shr t2-0 1)))) + (t0-4 (* (/ (+ t0-1 63) 64) (/ (+ t1-2 63) 64))) + ) + (if (and (logtest? t2-0 1) (< 32 v1-0)) + (+! t0-4 1) + ) + (let ((t1-10 a3-6) + (t2-2 (min 128 (+ t0-4 -1 a3-6))) + ) + (while (>= (the-as uint t2-2) (the-as uint t1-10)) + (set! (-> *texture-pool* ids t1-10) (the-as uint 0)) + (+! t1-10 1) + ) + ) + ) + ) + ) + (none) + ) + + +(defun texture-anim-draw-mips ((arg0 dma-buffer) (arg1 texture)) + (none) + ) + +(defun pc-update-anim-frame-time ((anim texture-anim)) + (when (not (paused?)) + (with-pp + (let ((f0-2 (+ (-> anim frame-time) (* (-> anim frame-delta) (seconds-per-frame)))) + (f1-2 (-> anim frame-mod)) + ) + (set! (-> anim frame-time) (- f0-2 (* (the float (the int (/ f0-2 f1-2))) f1-2))) + ) + (if (< (-> anim frame-time) 0.0) + (+! (-> anim frame-time) (-> anim frame-mod)) + ) + ) + ) + ) + +;; og:preserve-this +(defun pc-update-fixed-anim ((bucket bucket-id) (anim-id texture-anim-pc) (anim-array texture-anim-array)) + "Run a 'fixed' texture-anim, which should run entirely in C++." + (with-dma-buffer-add-bucket ((dma-buf (-> *display* frames (-> *display* on-screen) global-buf)) + bucket + ) + ;; determine how many texture we have: + (let ((num-anims 0) + (num-qwc-floats 0)) + (dotimes (i (-> anim-array length)) + (when (-> anim-array array-data i tex) + (+! num-anims 1) + (+! num-qwc-floats 1) ;; for times + (+! num-qwc-floats (* 10 (-> anim-array array-data i num-layers))) + ) + ) + + ;; (format 0 "pc-update-fixed-anim: ~d layers~%" num) + (pc-texture-anim-flag start-anim-array dma-buf) + (pc-texture-anim-flag-id anim-id dma-buf :qwc num-qwc-floats) + + (let ((out-ptr (the (inline-array vector) (-> dma-buf base))) + ) + (dotimes (i num-anims) + (let ((anim (-> anim-array array-data i)) + (out-slot (the (pointer float) (&+ (-> dma-buf base) (* 11 16 i)))) + ) + + (set! (-> out-ptr 0 x) (-> anim frame-time)) + (set! (-> out-ptr 0 y) (the-as float (if (-> anim tex) + (-> anim tex dest 0) + -1 + ) + ) + ) + (&+! out-ptr 16) + + (dotimes (j (-> anim num-layers)) + (quad-copy! (the pointer out-ptr) (the pointer (-> anim data j start-vectors)) 5) + (&+! out-ptr 80) + (quad-copy! (the pointer out-ptr) (the pointer (-> anim data j end-vectors)) 5) + (&+! out-ptr 80) + ) + + (when (-> anim func) + ((-> anim func) dma-buf anim) + ) + (pc-update-anim-frame-time anim) + ) + ) + ) + + (&+! (-> dma-buf base) (* 16 num-qwc-floats)) + (pc-texture-anim-flag finish-anim-array dma-buf) + ) + ) + + (none) + ) + +(deftype sky-input (structure) + ((fog-height float) + (cloud-min float) + (cloud-max float) + (times float 11) + (max-times float 6) + (scales float 6) + (cloud-dest int32) + ) + ) + +(define-extern *sky-texture-anim-array* (texture-anim-array texture-anim)) +(define-extern *darkjak-texture-anim-array* (texture-anim-array texture-anim)) +(define-extern *darkjak-highres-texture-anim-array* (texture-anim-array texture-anim)) +(define-extern *skull-gem-texture-anim-array* (texture-anim-array texture-anim)) +(define-extern *default-water-texture-anim-array* (texture-anim-array texture-anim)) +(define-extern *default-warp-texture-anim-array* (texture-anim-array texture-anim)) +(define-extern *templea-water-texture-anim-array* texture-anim-array) +(define-extern *templea-warp-texture-anim-array* texture-anim-array) +(define-extern *templeb-warp-texture-anim-array* texture-anim-array) +(define-extern *templec-water-texture-anim-array* texture-anim-array) +(define-extern *sewc-water-texture-anim-array* texture-anim-array) +(define-extern *sewd-water-texture-anim-array* texture-anim-array) +(define-extern *sewe-water-texture-anim-array* texture-anim-array) +(define-extern *sewg-water-texture-anim-array* texture-anim-array) +(define-extern *sewh-water-texture-anim-array* texture-anim-array) +(define-extern *sewi-water-texture-anim-array* texture-anim-array) +(define-extern *sewj-water-texture-anim-array* texture-anim-array) +(define-extern *sewl-water-texture-anim-array* texture-anim-array) +(define-extern *sewm-water-texture-anim-array* texture-anim-array) +(define-extern *sewn-water-texture-anim-array* texture-anim-array) +(define-extern *desresc-warp-texture-anim-array* texture-anim-array) +(define-extern *ctyslumb-water-texture-anim-array* texture-anim-array) +(define-extern *nstb-quicksand-anim-array* texture-anim-array) +(define-extern *ctyslumc-water-texture-anim-array* texture-anim-array) +(define-extern *factoryc-alpha-texture-anim-array* texture-anim-array) +(define-extern *hfrag-texture-anim-array* (texture-anim-array texture-anim)) +(define-extern *hanga-sprite-texture-anim-array* texture-anim-array) +(define-extern *hanga-water-texture-anim-array* texture-anim-array) +(define-extern *desertd-water-texture-anim-array* texture-anim-array) +(define-extern *lmhcityb-tfrag-texture-anim-array* texture-anim-array) +(define-extern *towerb-water-texture-anim-array* texture-anim-array) +(define-extern *comb-field-texture-anim-array* (texture-anim-array texture-anim)) +(define-extern *wasstada-alpha-texture-anim-array* texture-anim-array) +(define-extern *factoryb-water-texture-anim-array* texture-anim-array) +(define-extern *lmhcitya-tfrag-texture-anim-array* texture-anim-array) +(define-extern *mhcitya-pris-texture-anim-array* texture-anim-array) +(define-extern *rubblea-water-texture-anim-array* texture-anim-array) +(define-extern *rubblea2-water-texture-anim-array* texture-anim-array) +(define-extern *rubbleb-water-texture-anim-array* texture-anim-array) +(define-extern *rubblec-water-texture-anim-array* texture-anim-array) +(define-extern *foresta-water-texture-anim-array* texture-anim-array) +(define-extern *forestb-water-texture-anim-array* texture-anim-array) +(define-extern *lforplnt-pris-texture-anim-array* texture-anim-array) +(define-extern *ltnfxhip-texture-anim-array* texture-anim-array) +(define-extern *lgunnorm-water-texture-anim-array* texture-anim-array) +(define-extern *ljkdxvin-texture-anim-array* texture-anim-array) +(define-extern *security-texture-anim-array* (texture-anim-array texture-anim)) +(define-extern *waspal-water-texture-anim-array* texture-anim-array) +(define-extern *mined-tfrag-texture-anim-array* texture-anim-array) +(define-extern *volcanox-warp-texture-anim-array* texture-anim-array) +(define-extern *templex-water-texture-anim-array* texture-anim-array) +(define-extern *volcanoa-alpha-texture-anim-array* texture-anim-array) +(define-extern *deshover-texture-anim-array* texture-anim-array) + +(defun make-sky-input ((si sky-input)) + (set! (-> si fog-height) (-> (the-as (array texture-anim) *sky-texture-anim-array*) 8 extra z)) + (set! (-> si cloud-min) (-> *sky-texture-anim-array* array-data 7 extra y)) + (set! (-> si cloud-max) (-> *sky-texture-anim-array* array-data 7 extra z)) + (set! (-> si cloud-dest) (the int (-> *sky-texture-anim-array* array-data 6 tex dest 0))) + (dotimes (i (-> *sky-texture-anim-array* array-data 5 num-layers)) + (set! (-> si scales i) (-> *sky-texture-anim-array* array-data 5 data i start-color w)) + (set! (-> si max-times i) (-> *sky-texture-anim-array* array-data (1+ i) frame-mod)) + ) + (dotimes (i 9) + (set! (-> si times i) + (-> *sky-texture-anim-array* array-data i frame-time) + ) + ) + ) + +(defmacro print-anim (&rest args) + ;`(format 0 ,@args) + 0 + ) + +;; WARN: Function update-texture-anim has a return type of none, but the expression builder found a return statement. +(defun update-texture-anim ((bucket bucket-id) (anim-array texture-anim-array)) + (let ((anim-idx 0)) + (local-vars (sv-16 int) (sv-32 int) (sv-48 uint) (sv-64 int)) + + ;; first, try PC ported animations. + (case anim-array + ((0) + (format 0 "ZERO texture-anim-array - is there an animation array missing?~%") + (return #f) + ) + ((*sky-texture-anim-array*) + (when (= bucket (bucket-id tex-lcom-sky-post)) + ;; og:preserve-this + ;; skip. I believe this is only used to generate the envmap texture for the ocean. + ;; it generates the exact same thing, so if we want this on PC one day, we can just + ;; steal if from the beginning of the frame. + (return #f) + ) + (with-dma-buffer-add-bucket ((dma-buf (-> *display* frames (-> *display* on-screen) global-buf)) + bucket + ) + (pc-texture-anim-flag start-anim-array dma-buf) + (pc-texture-anim-flag clouds-and-fog dma-buf :qwc (/ (psize-of sky-input) 16)) + (make-sky-input (the sky-input (-> dma-buf base))) + (&+! (-> dma-buf base) (psize-of sky-input)) + (pc-texture-anim-flag finish-anim-array dma-buf) + (dotimes (i 8) ;; intentially skipping fog here!! + (pc-update-anim-frame-time (-> *sky-texture-anim-array* array-data i)) + ) + ) + ;; falling through on purpose (TODO) + (set! anim-idx 8) ;; fog + ;; (return #f) + ) + ((*darkjak-texture-anim-array*) + (with-dma-buffer-add-bucket ((dma-buf (-> *display* frames (-> *display* on-screen) global-buf)) + bucket + ) + (pc-texture-anim-flag start-anim-array dma-buf) + (pc-texture-anim-flag darkjak dma-buf :qwc 1) + (let ((morph (-> anim-array array-data 0 frame-time)) + (vec (the vector (-> dma-buf base))) + ) + (set! (-> vec x) morph) + ) + (&+! (-> dma-buf base) 16) + (pc-texture-anim-flag finish-anim-array dma-buf) + ) + (return #f) + ) + ((*darkjak-highres-texture-anim-array*) + (print-anim "*darkjak-highres-texture-anim-array*~%") + (return #f) + ) + ((*skull-gem-texture-anim-array*) + (pc-update-fixed-anim bucket (texture-anim-pc skull-gem) anim-array) + (return #f) + ) + ((*default-water-texture-anim-array*) + (print-anim "*default-water-texture-anim-array*~%") + (return #f) + ) + ((*default-warp-texture-anim-array*) + (print-anim "*default-warp-texture-anim-array*~%") + (return #f) + ) + ((*templea-water-texture-anim-array*) + (print-anim "*templea-water-texture-anim-array*~%") + (return #f) + ) + ((*templea-warp-texture-anim-array*) + (print-anim "*templea-warp-texture-anim-array*~%") + (return #f) + ) + ((*templeb-warp-texture-anim-array*) + (print-anim "*templeb-warp-texture-anim-array*~%") + (return #f) + ) + ((*templec-water-texture-anim-array*) + (print-anim "*templec-water-texture-anim-array*~%") + (return #f) + ) + ((*sewc-water-texture-anim-array*) + (print-anim "*sewc-water-texture-anim-array*~%") + (return #f) + ) + ((*sewd-water-texture-anim-array*) + (print-anim "*sewd-water-texture-anim-array*~%") + (return #f) + ) + ((*sewe-water-texture-anim-array*) + (print-anim "*sewe-water-texture-anim-array*~%") + (return #f) + ) + ((*sewg-water-texture-anim-array*) + (print-anim "*sewg-water-texture-anim-array*~%") + (return #f) + ) + ((*sewh-water-texture-anim-array*) + (print-anim "*sewh-water-texture-anim-array*~%") + (return #f) + ) + ((*sewi-water-texture-anim-array*) + (print-anim "*sewi-water-texture-anim-array*~%") + (return #f) + ) + ((*sewj-water-texture-anim-array*) + (print-anim "*sewj-water-texture-anim-array*~%") + (return #f) + ) + ((*sewl-water-texture-anim-array*) + (print-anim "*sewl-water-texture-anim-array*~%") + (return #f) + ) + ((*sewm-water-texture-anim-array*) + (print-anim "*sewm-water-texture-anim-array*~%") + (return #f) + ) + ((*sewn-water-texture-anim-array*) + (print-anim "*sewn-water-texture-anim-array*~%") + (return #f) + ) + ((*desresc-warp-texture-anim-array*) + (print-anim "*desresc-warp-texture-anim-array*~%") + (return #f) + ) + ((*ctyslumb-water-texture-anim-array*) + (print-anim "*ctyslumb-water-texture-anim-array*~%") + (return #f) + ) + ((*nstb-quicksand-anim-array*) + (print-anim "*nstb-quicksand-anim-array*~%") + (return #f) + ) + ((*ctyslumc-water-texture-anim-array*) + (print-anim "*ctyslumc-water-texture-anim-array*~%") + (return #f) + ) + ((*factoryc-alpha-texture-anim-array*) + (print-anim "*factoryc-alpha-texture-anim-array*~%") + (return #f) + ) + ((*hfrag-texture-anim-array*) + (print-anim "*hfrag-texture-anim-array*~%") + (return #f) + ) + ((*hanga-sprite-texture-anim-array*) + (print-anim "*hanga-sprite-texture-anim-array*~%") + (return #f) + ) + ((*hanga-water-texture-anim-array*) + (print-anim "*hanga-water-texture-anim-array*~%") + (return #f) + ) + ((*desertd-water-texture-anim-array*) + (print-anim "*desertd-water-texture-anim-array*~%") + (return #f) + ) + ((*lmhcityb-tfrag-texture-anim-array*) + (print-anim "*lmhcityb-tfrag-texture-anim-array*~%") + (return #f) + ) + ((*towerb-water-texture-anim-array*) + (print-anim "*towerb-water-texture-anim-array*~%") + (return #f) + ) + ((*comb-field-texture-anim-array*) + (print-anim "*comb-field-texture-anim-array*~%") + (return #f) + ) + ((*wasstada-alpha-texture-anim-array*) + (print-anim "*wasstada-alpha-texture-anim-array*~%") + (return #f) + ) + ((*factoryb-water-texture-anim-array*) + (print-anim "*factoryb-water-texture-anim-array*~%") + (return #f) + ) + ((*lmhcitya-tfrag-texture-anim-array*) + (print-anim "*lmhcitya-tfrag-texture-anim-array*~%") + (return #f) + ) + ((*mhcitya-pris-texture-anim-array*) + (print-anim "*mhcitya-pris-texture-anim-array*~%") + (return #f) + ) + ((*rubblea-water-texture-anim-array*) + (print-anim "*rubblea-water-texture-anim-array*~%") + (return #f) + ) + ((*rubblea2-water-texture-anim-array*) + (print-anim "*rubblea2-water-texture-anim-array*~%") + (return #f) + ) + ((*rubbleb-water-texture-anim-array*) + (print-anim "*rubbleb-water-texture-anim-array*~%") + (return #f) + ) + ((*rubblec-water-texture-anim-array*) + (print-anim "*rubblec-water-texture-anim-array*~%") + (return #f) + ) + ((*foresta-water-texture-anim-array*) + (print-anim "*foresta-water-texture-anim-array*~%") + (return #f) + ) + ((*forestb-water-texture-anim-array*) + (print-anim "*forestb-water-texture-anim-array*~%") + (return #f) + ) + ((*lforplnt-pris-texture-anim-array*) + (print-anim "*lforplnt-pris-texture-anim-array*~%") + (return #f) + ) + ((*ltnfxhip-texture-anim-array*) + (print-anim "*ltnfxhip-texture-anim-array*~%") + (return #f) + ) + ((*lgunnorm-water-texture-anim-array*) + (print-anim "*lgunnorm-water-texture-anim-array*~%") + (return #f) + ) + ((*ljkdxvin-texture-anim-array*) + (print-anim "*ljkdxvin-texture-anim-array*~%") + (return #f) + ) + ((*security-texture-anim-array*) + (print-anim "*security-texture-anim-array*~%") + (return #f) + ) + ((*waspal-water-texture-anim-array*) + (print-anim "*waspal-water-texture-anim-array*~%") + (return #f) + ) + ((*mined-tfrag-texture-anim-array*) + (print-anim "*mined-tfrag-texture-anim-array*~%") + (return #f) + ) + ((*volcanox-warp-texture-anim-array*) + (print-anim "*volcanox-warp-texture-anim-array*~%") + (return #f) + ) + ((*templex-water-texture-anim-array*) + (print-anim "*templex-water-texture-anim-array*~%") + (return #f) + ) + ((*volcanoa-alpha-texture-anim-array*) + (print-anim "*volcanoa-alpha-texture-anim-array*~%") + (return #f) + ) + ((*deshover-texture-anim-array*) + (print-anim "*deshover-texture-anim-array*~%") + (return #f) + ) + (else + (format 0 "Unhandled texture animation!~%") + (break!) + (return #f) + ) + ) + + (if (get-menu-mode *blit-displays-work*) + (return #f) + ) + (let ((v1-3 *display*) + (a0-2 16) + ) + (+! (-> v1-3 mem-reserve-size) a0-2) + (when (not (-> v1-3 dma-buffer-overflow)) + (let ((a2-0 (-> v1-3 frames (-> v1-3 on-screen) global-buf))) + (if (< (-> a2-0 real-buffer-end) (the-as int (&+ (-> a2-0 base) a0-2))) + (set! (-> v1-3 dma-buffer-overflow) #t) + ) + ) + (when (not (-> v1-3 dma-buffer-overflow)) + (with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf)) + bucket + ) + + ;; start of "emulated" texture anim data + (pc-texture-anim-flag start-anim-array s3-0) + + ;;(dotimes (anim-idx (-> arg1 length)) + (while (< anim-idx (-> anim-array length)) + (let* ((s1-0 (-> anim-array array-data anim-idx)) + (s0-0 (-> s1-0 tex)) + ) + (when s0-0 + 0 + (set! sv-16 (-> s0-0 w)) + (set! sv-32 (-> s0-0 h)) + (cond + ((or (= (-> s0-0 psm) (gs-psm ct32)) (= (-> s0-0 psm) (gs-psm mt8h))) + (set! sv-48 (shr (-> s0-0 dest 0) 5)) + (clear-texture-ids s0-0) + ) + (else + (set! sv-48 (shr (-> s0-0 clutdest) 5)) + (set! sv-16 16) + (set! sv-32 16) + (set! (-> *texture-pool* ids (min 128 (the-as int (/ (the-as int sv-48) 2)))) (the-as uint 0)) + 0 + ) + ) + (when (and (nonzero? sv-16) (nonzero? sv-32)) + (pc-texture-anim-flag erase-and-init s3-0) + (let ((v1-34 *display*) + (a0-13 176) + ) + (+! (-> v1-34 mem-reserve-size) a0-13) + (when (not (-> v1-34 dma-buffer-overflow)) + (let ((a2-2 (-> v1-34 frames (-> v1-34 on-screen) global-buf))) + (if (< (-> a2-2 real-buffer-end) (the-as int (&+ (-> a2-2 base) a0-13))) + (set! (-> v1-34 dma-buffer-overflow) #t) + ) + ) + (if (not (-> v1-34 dma-buffer-overflow)) + (dma-buffer-add-gs-set-flusha s3-0 + (scissor-1 (new 'static 'gs-scissor :scax1 (+ sv-16 -1) :scay1 (+ sv-32 -1))) + (xyoffset-1 (new 'static 'gs-xy-offset :ofx #x8000 :ofy #x8000)) + (frame-1 (new 'static 'gs-frame :fbw (/ (+ sv-16 63) 64) :fbp sv-48)) + (test-1 (-> s1-0 test)) + (alpha-1 (-> s1-0 alpha)) + (clamp-1 (-> s1-0 clamp)) + (texa (new 'static 'gs-texa :ta0 #x80 :ta1 #x80)) + (zbuf-1 (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24) :zmsk #x1)) + (texflush 0) + ) + ) + ) + ) + (let ((v1-39 *display*) + (a0-22 80) + ) + (+! (-> v1-39 mem-reserve-size) a0-22) + (when (not (-> v1-39 dma-buffer-overflow)) + (let ((a2-13 (-> v1-39 frames (-> v1-39 on-screen) global-buf))) + (if (< (-> a2-13 real-buffer-end) (the-as int (&+ (-> a2-13 base) a0-22))) + (set! (-> v1-39 dma-buffer-overflow) #t) + ) + ) + (when (not (-> v1-39 dma-buffer-overflow)) + (let ((v1-41 (-> s3-0 base)) + (a3-0 2048) + (a2-15 2048) + (a0-27 (+ sv-16 2048)) + (a1-63 (+ sv-32 2048)) + ) + (set! (-> (the-as (pointer uint128) v1-41)) (-> *texture-anim-work* erase-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-41) 1) (-> *texture-anim-work* erase-tmpl quad 1)) + (set-vector! + (the-as vector4w (&+ v1-41 32)) + (the-as int (-> s1-0 color r)) + (the-as int (-> s1-0 color g)) + (the-as int (-> s1-0 color b)) + (the-as int (-> s1-0 color a)) + ) + (set-vector! (the-as vector4w (&+ v1-41 48)) (* a3-0 16) (* a2-15 16) #xffffff 0) + (set-vector! (the-as vector4w (&+ v1-41 64)) (* a0-27 16) (* a1-63 16) #xffffff 0) + ) + (&+! (-> s3-0 base) 80) + ) + ) + ) + ) + (set! sv-64 0) + (while (< sv-64 (the-as int (-> s1-0 num-layers))) + (let ((t0-6 (-> s1-0 data sv-64))) + ((-> t0-6 func) s3-0 sv-48 sv-16 sv-32 t0-6 (-> s1-0 frame-time)) + ) + (set! sv-64 (+ sv-64 1)) + ) + (if (-> s1-0 func) + ((-> s1-0 func) s3-0 s1-0) + ) + (if (and (= (-> s0-0 psm) (gs-psm ct32)) (< (the-as uint 1) (-> s0-0 num-mips))) + (texture-anim-draw-mips s3-0 s0-0) + ) + (when (not (paused?)) + (let ((f0-2 (+ (-> s1-0 frame-time) (* (-> s1-0 frame-delta) (seconds-per-frame)))) + (f1-2 (-> s1-0 frame-mod)) + ) + (set! (-> s1-0 frame-time) (- f0-2 (* (the float (the int (/ f0-2 f1-2))) f1-2))) + ) + (if (< (-> s1-0 frame-time) 0.0) + (+! (-> s1-0 frame-time) (-> s1-0 frame-mod)) + ) + ) + ) + ) + (+! anim-idx 1) + + ) + ;;(reset-display-gs-state *display* s3-0) + + (dma-buffer-add-cnt-vif2 + s3-0 + 0 + (new 'static 'vif-tag :cmd (vif-cmd pc-port) :imm (texture-anim-pc finish-anim-array)) + (new 'static 'vif-tag :cmd (vif-cmd pc-port)) + ) + ) + ) + ) + ) + ) + (none) + ) + +(defun no-alpha-texture-anim-layer-func ((arg0 dma-buffer) (arg1 uint) (arg2 int) (arg3 int) (arg4 texture-anim-layer) (arg5 float)) + (format 0 "unsupported no-alpha-texture-anim-layer-func~%") + (break!) + 0 + ) + + +(defun copy-alpha-texture-anim-layer-func ((arg0 dma-buffer) (arg1 uint) (arg2 int) (arg3 int) (arg4 texture-anim-layer) (arg5 float)) + (format 0 "unsupported copy-alpha-texture-anim-layer-func~%") + (break!) + 0 + ) + +(defun copy-clut-alpha-texture-anim-layer-func ((arg0 dma-buffer) (arg1 uint) (arg2 int) (arg3 int) (arg4 texture-anim-layer) (arg5 float)) + (format 0 "unsupported copy-clut-alpha-texture-anim-layer-func~%") + (break!) + 0 + ) + +(defun set-alpha-texture-anim-layer-func ((arg0 dma-buffer) (arg1 uint) (arg2 int) (arg3 int) (arg4 texture-anim-layer) (arg5 float)) + (format 0 "unsupported set-alpha-texture-anim-layer-func~%") + (break!) + 0 + ) + +(defun set-clut-alpha-texture-anim-layer-func ((arg0 dma-buffer) (arg1 uint) (arg2 int) (arg3 int) (arg4 texture-anim-layer) (arg5 float)) + (format 0 "unsupported set-clut-alpha-texture-anim-layer-func~%") + (break!) + 0 + ) + +(defun dest-texture-init ((arg0 texture-anim)) + (let ((v1-1 (new 'loading-level 'texture))) + (let ((a0-2 (the int (-> arg0 extra x)))) + (let ((a1-1 (the int (-> arg0 extra y)))) + (set! (-> arg0 tex) v1-1) + (set! (-> v1-1 w) a0-2) + (set! (-> v1-1 h) a0-2) + (set! (-> v1-1 num-mips) (the-as uint 1)) + (set! (-> v1-1 psm) (gs-psm ct32)) + (set! (-> v1-1 dest 0) (the-as uint (* a1-1 32))) + ) + (set! (-> v1-1 width 0) (the-as uint (/ (+ a0-2 63) 64))) + ) + (set! (-> v1-1 masks data 0 mask quad) (the-as uint128 0)) + (set! (-> v1-1 masks data 1 mask quad) (the-as uint128 0)) + (set! (-> v1-1 masks data 2 mask quad) (the-as uint128 0)) + ) + 0 + 0 + (none) + ) + +(defun src-texture-init ((arg0 texture-anim-layer)) + (let ((v1-1 (new 'loading-level 'texture))) + (let ((a0-2 (the int (-> arg0 extra x)))) + (let ((a1-1 (the int (-> arg0 extra y)))) + (set! (-> arg0 tex) v1-1) + (set! (-> v1-1 w) a0-2) + (set! (-> v1-1 h) a0-2) + (set! (-> v1-1 num-mips) (the-as uint 1)) + (set! (-> v1-1 psm) (gs-psm ct32)) + (set! (-> v1-1 dest 0) (the-as uint (* a1-1 32))) + ) + (set! (-> v1-1 width 0) (the-as uint (/ (+ a0-2 63) 64))) + ) + (set! (-> v1-1 masks data 0 mask quad) (the-as uint128 0)) + (set! (-> v1-1 masks data 1 mask quad) (the-as uint128 0)) + (set! (-> v1-1 masks data 2 mask quad) (the-as uint128 0)) + ) + 0 + 0 + (none) + ) + +(defun src-texture-init-mt8 ((arg0 texture-anim-layer)) + (let ((v1-1 (new 'loading-level 'texture))) + (let ((a0-2 (the int (-> arg0 extra x)))) + (let ((a1-1 (the int (-> arg0 extra y))) + (a2-0 (the int (-> arg0 extra z))) + (a3-0 (the int (-> arg0 extra w))) + ) + (set! (-> arg0 tex) v1-1) + (set! (-> v1-1 w) a0-2) + (set! (-> v1-1 h) a1-1) + (set! (-> v1-1 num-mips) (the-as uint 1)) + (set! (-> v1-1 psm) (gs-psm mt8)) + (set! (-> v1-1 dest 0) (the-as uint (* a2-0 32))) + (set! (-> v1-1 clutpsm) (the-as uint 0)) + (set! (-> v1-1 clutdest) (the-as uint (* a3-0 32))) + ) + (set! (-> v1-1 width 0) (the-as uint (/ (+ a0-2 63) 64))) + ) + (set! (-> v1-1 masks data 0 mask quad) (the-as uint128 0)) + (set! (-> v1-1 masks data 1 mask quad) (the-as uint128 0)) + (set! (-> v1-1 masks data 2 mask quad) (the-as uint128 0)) + ) + 0 + 0 + (none) + ) + +;; I copied this from jak 2- I don't think we need the data! +(defun make-noise-texture ((arg0 pointer) (arg1 int) (arg2 int) (arg3 int)) + "Generate 'random' noise texture." + (local-vars (t4-5 uint128) (t5-3 uint128)) + (let ((v1-0 (/ arg1 16)) + (a3-1 (/ arg3 16)) + ) + (when (< arg1 16) + (set! a3-1 1) + (set! v1-0 1) + (set! arg2 (/ (* arg2 arg1) 16)) + ) + (let* ((a1-5 *texture-anim-work*) + (v0-0 (-> a1-5 random-index)) + ) + (dotimes (t0-1 arg2) + (let ((t1-0 0)) + (goto cfg-6) + (until (>= t1-0 v1-0) + (let* ((t2-0 (* t0-1 a3-1)) + (t3-0 (+ v0-0 3)) + (t4-0 (+ v0-0 5)) + (t5-0 (+ v0-0 7)) + (t3-1 (logand t3-0 7)) + (t4-1 (logand t4-0 7)) + (t7-0 (logand t5-0 7)) + (t6-0 (* v0-0 16)) + (t5-1 (* t3-1 16)) + (t4-2 (* t4-1 16)) + (t3-2 (* t7-0 16)) + (t2-1 (+ t2-0 t1-0)) + (t6-1 (the-as object (+ t6-0 (the-as uint a1-5)))) + (t2-2 (* t2-1 16)) + (t7-1 (the-as object (+ t5-1 (the-as uint a1-5)))) + (t5-2 (-> (the-as (pointer uint128) t6-1) 15)) + (t4-3 (the-as object (+ t4-2 (the-as uint a1-5)))) + (t6-2 (-> (the-as (pointer uint128) t7-1) 15)) + (t3-3 (the-as object (+ t3-2 (the-as uint a1-5)))) + ) + (let ((t4-4 (-> (the-as (pointer uint128) t4-3) 15))) + (.paddb t5-3 t5-2 t6-2) + (nop!) + (.paddb t4-5 t5-3 t4-4) + ) + (nop!) + (let ((t2-3 (+ t2-2 (the-as int arg0)))) + (set! (-> (the-as (pointer uint128) t3-3) 15) t4-5) + (let ((t3-4 (+ v0-0 1))) + (set! (-> (the-as (pointer uint128) t2-3) 0) t4-5) + (set! v0-0 (logand t3-4 7)) + ) + ) + ) + (nop!) + (+! t1-0 1) + (label cfg-6) + ) + ) + ) + (set! (-> a1-5 random-index) v0-0) + ) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun make-cloud-clut ((arg0 (pointer uint32)) (arg1 float) (arg2 float)) + (local-vars (v1-10 int)) + 0 + (let* ((s5-0 (the int (* 255.0 arg1))) + (s4-1 (max (the int (* 255.0 arg2)) s5-0)) + (f30-0 (/ 128.0 (the float (- s4-1 s5-0)))) + ) + (dotimes (s3-0 256) + (let ((s2-0 (-> *clut-translate* s3-0))) + (cond + ((and (>= s5-0 s3-0) (nonzero? s4-1)) + (set! v1-10 0) + ) + ((>= s3-0 s4-1) + (set! v1-10 128) + ) + (else + (let* ((f0-9 (sin (* 128.0 (fmin 128.0 (* (the float (- s3-0 s5-0)) f30-0))))) + (f0-11 (* f0-9 f0-9)) + ) + (set! v1-10 (the int (* 128.0 f0-11))) + ) + ) + ) + (set! (-> arg0 s2-0) (logior (logand (-> arg0 s2-0) -256) 128)) + (set! (-> arg0 s2-0) (logior (logand (-> arg0 s2-0) -65281) #x8000)) + (set! (-> arg0 s2-0) (logior (logand (-> arg0 s2-0) -16711681) #x800000)) + (set! (-> arg0 s2-0) + (logior (logand (-> arg0 s2-0) (the-as uint #xffffffff00ffffff)) (shr (shl v1-10 56) 32)) + ) + ) + ) + ) + (none) + ) + +(defun texture-anim-cloud-clut-upload ((arg0 dma-buffer) (arg1 texture-anim)) + (format 0 "unsupported texture-anim-cloud-clut-upload~%") + (break!) + (none) + ) + +(defun texture-anim-cloud-clut-init ((arg0 texture-anim)) + (let ((s5-0 (new 'loading-level 'texture)) + (s4-0 (the int (-> arg0 extra x))) + (v1-2 (new 'loading-level 'clut16x16)) + ) + (set! (-> arg0 tex) s5-0) + (set! (-> s5-0 clutdest) (the-as uint (* s4-0 32))) + (set! (-> s5-0 pad 0) (the-as uint v1-2)) + ) + 0 + (none) + ) + +;; copied from jak 2- I don't think we need the data. +(define-extern *slime-clut* clut16x16) +(defun make-slime-clut ((arg0 (pointer uint32))) + (dotimes (v1-0 256) + (let ((a1-2 (-> *clut-translate* v1-0)) + (a2-2 (-> *slime-clut* clut v1-0)) + ) + (set! (-> arg0 a1-2) (logior (logand (-> arg0 a1-2) -256) (shr (shl (-> a2-2 r) 56) 56))) + (set! (-> arg0 a1-2) (logior (logand (-> arg0 a1-2) -65281) (shr (shl (-> a2-2 g) 56) 48))) + (set! (-> arg0 a1-2) (logior (logand (-> arg0 a1-2) -16711681) (shr (shl (-> a2-2 b) 56) 40))) + (set! (-> arg0 a1-2) + (logior (logand (-> arg0 a1-2) (the-as uint #xffffffff00ffffff)) (shr (shl (-> a2-2 a) 56) 32)) + ) + ) + ) + (none) + ) + +(defun texture-anim-slime-clut-upload ((arg0 dma-buffer) (arg1 texture-anim)) + (format 0 "unsupported texture-anim-slime-clut-upload~%") + (break!) + (none) + ) + +(defun texture-anim-slime-clut-init ((arg0 texture-anim)) + (let ((s5-0 (new 'loading-level 'texture)) + (s4-0 (the int (-> arg0 extra x))) + (v1-2 (new 'loading-level 'clut16x16)) + ) + (set! (-> arg0 tex) s5-0) + (set! (-> s5-0 clutdest) (the-as uint (* s4-0 32))) + (set! (-> s5-0 pad 0) (the-as uint v1-2)) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun make-ramp-clut ((arg0 (pointer uint32)) (arg1 pointer) (arg2 object)) + (dotimes (v1-0 256) + (let ((a1-3 (-> *clut-translate* v1-0))) + (set! (-> arg0 a1-3) (logior (logand (-> arg0 a1-3) -256) (shr (shl v1-0 56) 56))) + (set! (-> arg0 a1-3) (logior (logand (-> arg0 a1-3) -65281) (shr (shl v1-0 56) 48))) + (set! (-> arg0 a1-3) (logior (logand (-> arg0 a1-3) -16711681) (shr (shl v1-0 56) 40))) + (set! (-> arg0 a1-3) (logior (logand (-> arg0 a1-3) (the-as uint #xffffffff00ffffff)) (shr (shl v1-0 56) 32))) + ) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun make-alpha-ramp-clut ((arg0 (pointer uint32))) + (dotimes (v1-0 256) + (let ((a1-2 (-> *clut-translate* v1-0))) + (set! (-> arg0 a1-2) (logior (logand (-> arg0 a1-2) -256) 128)) + (set! (-> arg0 a1-2) (logior (logand (-> arg0 a1-2) -65281) #x8000)) + (set! (-> arg0 a1-2) (logior (logand (-> arg0 a1-2) -16711681) #x800000)) + (set! (-> arg0 a1-2) (logior (logand (-> arg0 a1-2) (the-as uint #xffffffff00ffffff)) (shr (shl v1-0 56) 32))) + ) + ) + (none) + ) + +(defun noise-texture-init ((arg0 texture-anim-layer)) + (let ((gp-0 (the int (-> arg0 extra x))) + (s4-0 (the-as structure #f)) + ) + (case gp-0 + ((8) + (set! s4-0 (new 'loading-level 'noise8x8)) + ) + ((16) + (set! s4-0 (new 'loading-level 'noise16x16)) + ) + ((32) + (set! s4-0 (new 'loading-level 'noise32x32)) + ) + ((64) + (set! s4-0 (new 'loading-level 'noise64x64)) + ) + ((128) + (set! s4-0 (new 'loading-level 'noise128x128)) + ) + ) + (when s4-0 + (let ((v1-14 (new 'loading-level 'texture))) + (let ((a0-16 (the int (-> arg0 extra y))) + (a1-6 (the int (-> arg0 extra z))) + ) + (set! (-> arg0 tex) v1-14) + (set! (-> v1-14 pad 0) (the-as uint s4-0)) + (set! (-> v1-14 w) gp-0) + (set! (-> v1-14 h) gp-0) + (set! (-> v1-14 num-mips) (the-as uint 1)) + (set! (-> v1-14 psm) (gs-psm mt8)) + (set! (-> v1-14 clutpsm) (the-as uint 0)) + (set! (-> v1-14 dest 0) (the-as uint (* a0-16 32))) + (set! (-> v1-14 clutdest) (the-as uint (* a1-6 32))) + ) + (set! (-> v1-14 width 0) (the-as uint 1)) + (set! (-> v1-14 masks data 0 mask quad) (the-as uint128 0)) + (set! (-> v1-14 masks data 1 mask quad) (the-as uint128 0)) + (set! (-> v1-14 masks data 2 mask quad) (the-as uint128 0)) + (make-noise-texture (the-as pointer (-> v1-14 pad 0)) gp-0 gp-0 gp-0) + ) + ) + ) + 0 + (none) + ) + +(defun texture-anim-alpha-ramp-clut-upload ((arg0 dma-buffer) (arg1 texture-anim)) + (format 0 "unsupported texture-anim-alpha-ramp-clut-upload~%") + (break!) + (none) + ) + +(defun texture-anim-alpha-ramp-clut-init ((arg0 texture-anim)) + (let ((s5-0 (new 'loading-level 'texture)) + (s4-0 (the int (-> arg0 extra x))) + (a0-3 (new 'loading-level 'clut16x16)) + ) + (set! (-> arg0 tex) s5-0) + (set! (-> s5-0 clutdest) (the-as uint (* s4-0 32))) + (set! (-> s5-0 pad 0) (the-as uint a0-3)) + (make-alpha-ramp-clut (the-as (pointer uint32) a0-3)) + ) + 0 + (none) + ) + +(defun texture-anim-overide-size-init ((arg0 texture-anim)) + (when (-> arg0 tex-name) + (let ((v1-2 (lookup-level-texture-by-name + (-> arg0 tex-name) + (-> *level* loading-level) + (the-as (pointer texture-page) #f) + ) + ) + ) + (when v1-2 + (let ((a0-2 (the int (-> arg0 extra x)))) + (let ((a1-1 (the int (-> arg0 extra y))) + (a2-1 (the int (-> arg0 extra z))) + ) + (set! (-> v1-2 w) a0-2) + (set! (-> v1-2 h) a1-1) + (set! (-> v1-2 num-mips) (the-as uint a2-1)) + ) + (set! (-> v1-2 dest 0) (the-as uint #xffff)) + (set! (-> v1-2 width 0) (the-as uint (/ a0-2 64))) + ) + (set! (-> v1-2 masks data 0 mask quad) (the-as uint128 0)) + (set! (-> v1-2 masks data 1 mask quad) (the-as uint128 0)) + (set! (-> v1-2 masks data 2 mask quad) (the-as uint128 0)) + 0 + ) + ) + ) + (none) + ) + +(defun texture-anim-change-mt8h-init ((arg0 texture-anim)) + (when (-> arg0 tex-name) + (let ((v1-2 (lookup-level-texture-by-name + (-> arg0 tex-name) + (-> *level* loading-level) + (the-as (pointer texture-page) #f) + ) + ) + ) + (when v1-2 + (let ((a0-2 (the int (-> arg0 extra x))) + (a1-1 (the int (-> arg0 extra y))) + (a2-1 (the int (-> arg0 extra z))) + ) + (let ((a3-0 (the int (-> arg0 extra w)))) + (set! (-> v1-2 clutdest) (the-as uint (* a0-2 32))) + (set! (-> v1-2 clutpsm) (the-as uint 0)) + (set! (-> v1-2 dest 0) (the-as uint (* a1-1 32))) + (set! (-> v1-2 psm) (gs-psm mt8h)) + (set! (-> v1-2 w) a2-1) + (set! (-> v1-2 h) a3-0) + ) + (set! (-> v1-2 width 0) (the-as uint (/ a2-1 64))) + ) + (set! (-> v1-2 masks data 0 mask quad) (the-as uint128 0)) + (set! (-> v1-2 masks data 1 mask quad) (the-as uint128 0)) + (set! (-> v1-2 masks data 2 mask quad) (the-as uint128 0)) + 0 + ) + ) + ) + (none) + ) + +(defmethod init! ((this texture-anim-array)) + (dotimes (s5-0 (-> this length)) + (init-textures! (-> this array-data s5-0)) + ) + this + ) + +(defmethod clear! ((this texture-anim-array)) + (dotimes (s5-0 (-> this length)) + (clear-textures! (-> this array-data s5-0)) + ) + this + ) + +(define *texture-anim-pages-table* + (new 'static 'array uint8 16 #x2 #x3 #x3 #x3 #x3 #x8 #xc #xd #xd #xd #x20 #x28 #x2a #x2b #x2b #x0) + ) + +(define *texture-anim-mip-array* (new 'static 'array uint16 48 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x1 + #x0 + #x0 + #x0 + #x0 + #x1 + #x2 + #x0 + #x0 + #x0 + #x1 + #x2 + #x3 + #x0 + #x0 + #x4 + #x5 + #x6 + #x7 + #x0 + #x10 + #x14 + #x15 + #x16 + #x0 + #x40 + #x50 + #x54 + #x55 + #x0 + #x100 + #x140 + #x150 + #x154 + #x0 + #x400 + #x500 + #x540 + #x550 + #x0 + #x0 + #x0 + ) + ) + +(defmethod init-textures! ((this texture-anim)) + (local-vars (a3-6 uint128) (sv-16 texture-page)) + (if (logtest? (the-as int (-> this func)) 1) + (set! (-> this func) + (the-as (function dma-buffer texture-anim int) (-> (the-as symbol (-> this func)) value)) + ) + ) + (if (logtest? (the-as int (-> this init-func)) 1) + (set! (-> this init-func) (the-as (function texture-anim int) (-> (the-as symbol (-> this init-func)) value))) + ) + (if (-> this init-func) + ((-> this init-func) this) + ) + (when (-> this tex-name) + (set! sv-16 (the-as texture-page #f)) + (let ((s5-0 (lookup-level-texture-by-name (-> this tex-name) (-> *level* loading-level) (& sv-16)))) + (set! (-> this tex) s5-0) + (when (and s5-0 sv-16) + 0 + (cond + ((= (-> s5-0 psm) (gs-psm mt8)) + (let ((v1-21 (-> s5-0 clutdest))) + (when (!= v1-21 (* (/ (the-as int v1-21) 32) 32)) + (let ((a0-8 (+ (-> sv-16 segment 2 dest) (-> sv-16 vram-size))) + (v1-26 2048) + ) + (set! (-> this tex clutdest) (* (shr (+ a0-8 2047) 11) 32)) + (+! (-> sv-16 vram-size) v1-26) + ) + ) + ) + ) + ((= (-> s5-0 psm) (gs-psm ct32)) + (cond + ((= (-> s5-0 dest 0) #xffff) + (let ((s4-0 (-> sv-16 segment 2)) + (a1-2 (log2 (max (-> s5-0 w) (-> s5-0 h)))) + (a0-19 (min 4 (the-as int (-> s5-0 num-mips)))) + (v1-35 2048) + ) + (let ((a2-6 (* (shr (+ (-> sv-16 vram-size) 2047 (-> s4-0 dest)) 11) 32)) + (a3-2 (* 5 a1-2)) + ) + (dotimes (t0-0 a0-19) + (set! (-> s5-0 dest t0-0) (+ a2-6 (-> *texture-anim-mip-array* (+ a3-2 t0-0)))) + (set! (-> s5-0 width t0-0) (the-as uint (/ (ash (-> s5-0 w) (- t0-0)) 64))) + ) + ) + (when (>= a1-2 6) + (let ((a0-20 (+ (* 5 (+ a1-2 -6)) a0-19))) + (set! v1-35 (the-as int (* (the-as uint v1-35) (-> *texture-anim-pages-table* a0-20)))) + ) + ) + (+! (-> sv-16 vram-size) v1-35) + ) + ) + (else + (let ((v1-37 (-> s5-0 dest 0))) + (set! (-> s5-0 num-mips) (the-as uint 1)) + (when (!= v1-37 (* (/ (the-as int v1-37) 32) 32)) + (let ((v1-42 (+ (-> sv-16 segment 2 dest) (-> sv-16 vram-size))) + (a0-36 (shl (sar (+ (* (-> s5-0 w) (-> s5-0 h)) 2047) 11) 11)) + ) + (set! (-> this tex dest 0) (* (shr (+ v1-42 2047) 11) 32)) + (+! (-> sv-16 vram-size) a0-36) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (dotimes (s5-1 (the-as int (-> this num-layers))) + (initialize-texture! (-> this data s5-1)) + ) + (let ((v1-56 (-> this tex))) + (when v1-56 + (dotimes (a0-40 3) + (set! (-> v1-56 masks data a0-40 mask quad) (the-as uint128 0)) + ) + (dotimes (a0-43 (the-as int (-> this num-layers))) + (let ((a1-13 (-> this data a0-43 tex))) + (when a1-13 + (dotimes (a2-12 3) + (let ((a3-5 (-> v1-56 masks data a2-12 mask quad)) + (t0-3 (-> a1-13 masks data a2-12 mask quad)) + ) + (.por a3-6 a3-5 t0-3) + ) + (set! (-> v1-56 masks data a2-12 mask quad) a3-6) + ) + ) + ) + ) + ) + ) + this + ) + +(defmethod clear-textures! ((this texture-anim)) + (set! (-> this tex) #f) + (dotimes (s5-0 (the-as int (-> this num-layers))) + (clear-texture! (-> this data s5-0)) + ) + this + ) + +(defmethod initialize-texture! ((this texture-anim-layer)) + (if (logtest? (the-as int (-> this func)) 1) + (set! (-> this func) (the-as + (function dma-buffer uint int int texture-anim-layer float int) + (-> (the-as symbol (-> this func)) value) + ) + ) + ) + (when (logtest? (the-as int (-> this init-func)) 1) + (set! (-> this init-func) + (the-as (function texture-anim-layer int) (-> (the-as symbol (-> this init-func)) value)) + ) + (if (-> this init-func) + ((-> this init-func) this) + ) + ) + (if (-> this tex-name) + (set! (-> this tex) (lookup-level-texture-by-name + (-> this tex-name) + (-> *level* loading-level) + (the-as (pointer texture-page) #f) + ) + ) + ) + this + ) + +(defmethod clear-texture! ((this texture-anim-layer)) + (set! (-> this tex) #f) + this + ) diff --git a/goal_src/jak3/engine/gfx/texture/texture-finish.gc b/goal_src/jak3/engine/gfx/texture/texture-finish.gc index 2fc7199f1f..bd7c3c2fa9 100644 --- a/goal_src/jak3/engine/gfx/texture/texture-finish.gc +++ b/goal_src/jak3/engine/gfx/texture/texture-finish.gc @@ -18,11 +18,11 @@ ) (format #t "skipping init in texture-finish.~%") -; (init! *sky-texture-anim-array*) -; (init! *darkjak-texture-anim-array*) -; (init! *skull-gem-texture-anim-array*) -; (init! *default-water-texture-anim-array*) -; (init! *default-warp-texture-anim-array*) +(init! *sky-texture-anim-array*) +(init! *darkjak-texture-anim-array*) +(init! *skull-gem-texture-anim-array*) +(init! *default-water-texture-anim-array*) +(init! *default-warp-texture-anim-array*) (kmemclose) diff --git a/goal_src/jak3/engine/physics/cloth.gc b/goal_src/jak3/engine/physics/cloth.gc index 5e15d1af31..6346724781 100644 --- a/goal_src/jak3/engine/physics/cloth.gc +++ b/goal_src/jak3/engine/physics/cloth.gc @@ -16,6 +16,10 @@ (none) ) +(defmethod cloth-system-cmd-handler ((this cloth-system) (cmds pair)) + (format 0 "unimplemented cloth-system-cmd-handler~%") + (none) + ) (defmethod init! ((this cloth-base)) ;; this looks more like run! than init to me. diff --git a/test/decompiler/reference/jak3/engine/gfx/texture/texture-anim-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/texture/texture-anim-h_REF.gc index 3398f1b227..0a9d5147b6 100644 --- a/test/decompiler/reference/jak3/engine/gfx/texture/texture-anim-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/texture/texture-anim-h_REF.gc @@ -3,34 +3,41 @@ ;; definition of type texture-anim-layer (deftype texture-anim-layer (structure) - ((extra vector :inline :offset 240) - (func (function dma-buffer uint int int texture-anim-layer float int)) - (func-id symbol :overlay-at func) - (init-func (function texture-anim-layer int)) - (init-func-id symbol :overlay-at init-func) - (tex texture) - (start-time float) - (end-time float) - (tex-name string) - (test gs-test) - (alpha gs-alpha) - (clamp gs-clamp) - (start-color vector :inline :offset 80) - (start-scale vector2 :inline :offset 96) - (start-offset vector2 :inline :offset 104) - (start-st-scale vector2 :inline :offset 112) - (start-st-offset vector2 :inline :offset 120) - (start-qs vector :inline :offset 128) - (start-rot degrees :offset 144) - (start-st-rot degrees :offset 148) - (end-color vector :inline :offset 160) - (end-scale vector2 :inline :offset 176) - (end-offset vector2 :inline :offset 184) - (end-st-scale vector2 :inline :offset 192) - (end-st-offset vector2 :inline :offset 200) - (end-qs vector :inline :offset 208) - (end-rot degrees :offset 224) - (end-st-rot degrees :offset 228) + ((interpolated-color vector :inline) + (interpolated-scale-offset vector :inline) + (interpolated-st-scale-offset vector :inline) + (interpolated-qs vector :inline) + (interpolated-rot vector :inline) + (extra vector :inline :offset 240) + (func (function dma-buffer uint int int texture-anim-layer float int)) + (func-id symbol :overlay-at func) + (init-func (function texture-anim-layer int)) + (init-func-id symbol :overlay-at init-func) + (tex texture) + (start-time float) + (end-time float) + (tex-name string) + (test gs-test) + (alpha gs-alpha) + (clamp gs-clamp) + (start-vectors vector 5 :inline :offset 80) + (start-color vector :inline :overlay-at (-> start-vectors 0)) + (start-scale vector2 :inline :offset 96) + (start-offset vector2 :inline :offset 104) + (start-st-scale vector2 :inline :offset 112) + (start-st-offset vector2 :inline :offset 120) + (start-qs vector :inline :overlay-at (-> start-vectors 3)) + (start-rot degrees :offset 144) + (start-st-rot degrees :offset 148) + (end-vectors vector 5 :inline :offset 160) + (end-color vector :inline :overlay-at (-> end-vectors 0)) + (end-scale vector2 :inline :offset 176) + (end-offset vector2 :inline :offset 184) + (end-st-scale vector2 :inline :offset 192) + (end-st-offset vector2 :inline :offset 200) + (end-qs vector :inline :overlay-at (-> end-vectors 3)) + (end-rot degrees :offset 224) + (end-st-rot degrees :offset 228) ) (:methods (initialize-texture! (_type_) _type_)